private function registerScript()
    {
        ZeroClipboardAsset::register($this->getView());

        $clipboardVar = 'client' . preg_replace('/[^0-9a-zA-Z_$]/', '_', $this->id);
        $this->getView()->registerJs('var ' . $clipboardVar . ';', View::POS_HEAD);
        $this->getView()->registerJs(
            $clipboardVar . " = new ZeroClipboard($('#" . $this->id . "'));

            " . $clipboardVar . ".on('copy', function (event) {
                var clipboard = event.clipboardData;

                clipboard.setData('text/plain', " . $this->text . ');
            });'
        );

        if ($this->enableAftercopy) {
            $this->getView()->registerJs($clipboardVar . ".on('aftercopy', function(event) {
                var oldLabel = $('#" . $this->id . "').html();

                $('#" . $this->id . "').html('" . $this->afterCopyLabel . "');

                setTimeout(function() {
                    $('#" . $this->id . "').html(oldLabel);
                }, 1000);
            });");
        }
    }