Registers client script
5853
public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /* @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $cs->registerCssFile($assetsUrl . '/css/bootstrap-formhelpers.css');
        $cs->registerScriptFile($assetsUrl . '/js/bootstrap-formhelpers-timepicker.js');

        /* initialize plugin */
        // $selector = '#' . TbArray::getValue('id', $this->htmlOptions, $this->getId());
        // $this->getApi()->registerPlugin('bfhdatepicker', $selector, $this->pluginOptions);

    }
782546
protected function registerClientScript()
    {

        $path      = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /* @var $cs CClientScript */
        $cs = Yii::app()->clientScript;

        $cs->registerCoreScript('jquery');

        $cs->registerCssFile($assetsUrl . '/css/bootstrap-toggle-buttons.css');
        $cs->registerScriptFile($assetsUrl . '/js/jquery.toggle.buttons.js');

        /* initialize plugin */
        $selector = '#wrapper-' . TbArray::getValue('id', $this->htmlOptions, $this->getId());

        $this->getApi()->registerPlugin(
            'toggleButtons',
            $selector,
            $this->getConfiguration(),
            CClientScript::POS_READY
        );

    }
366510
public function registerCustomClientScript()
    {
        /* publish assets dir */
        $path = __DIR__ . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /** @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $fixedHeaderJs = '';
        if ($this->fixedHeader) {
            $cs->registerScriptFile(
                $assetsUrl . '/js/jquery.stickytableheaders' . (!YII_DEBUG ? '.min' : '') . '.js',
                CClientScript::POS_END
            );
            $fixedHeaderJs = "$('#{$this->id} table.items').stickyTableHeaders({fixedOffset:{$this->headerOffset}});";
            $this->componentsAfterAjaxUpdate[] = $fixedHeaderJs;
        }

        $cs->registerScript(
            __CLASS__ . '#Wh' . $this->id,
            '$grid = $("#' . $this->id . '");' .
            $fixedHeaderJs . '
			if ($(".' . $this->extendedSummaryCssClass . '", $grid).length)
			{
				$(".' . $this->extendedSummaryCssClass . '", $grid).html($("#' . $this->id . '-extended-summary", $grid).html());
			}
			' . (count($this->componentsReadyScripts) ? implode("\n", $this->componentsReadyScripts) : '') . '
			$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
				var qs = $.deparam.querystring(options.url);
				if (qs.hasOwnProperty("ajax") && qs.ajax == "' . $this->id . '")
				{
					options.realsuccess = options.success;
					options.success = function(data)
					{
						if (options.realsuccess) {
							options.realsuccess(data);
							var $data = $("<div>" + data + "</div>");
							// we need to get the grid again... as it has been updated
							if ($(".' . $this->extendedSummaryCssClass . '", $("#' . $this->id . '")))
							{
								$(".' .
            $this->extendedSummaryCssClass .
            '", $("#' . $this->id .
            '")).html($("#' . $this->id .
            '-extended-summary", $data).html());
        }
        ' .
            (count($this->componentsAfterAjaxUpdate)
                ? implode("\n", $this->componentsAfterAjaxUpdate)
                : '') .
            '
        }
    }
}
});'
        );
    }
202838
public function registerClientScript()
    {
        $this->clientOptions = array_merge([
            'refreshUrl' => Url::toRoute($this->captchaAction),
            'hashKey'=> 'yiiSmsCaptcha/' . trim($this->captchaAction, '/'),
            'mobileField' => $this->mobileField,
            'buttonTime' => Yii::t('yuncms', 'Resend after @second@ seconds'),
            'buttonGet'=>Yii::t('yuncms', 'Get Verify Code'),
        ], $this->clientOptions);
        $options = empty ($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions);
        $id = $this->buttonOptions['id'];
        $view = $this->getView();
        CaptchaAsset::register($view);
        $view->registerJs("\r\njQuery('#$id').yiiSmsCaptcha($options);\r\n");
    }
583817
public function registerClientScript()
    {
        if (!empty($this->pluginOptions)) {
            $options = \CJavaScript::encode($this->pluginOptions);
            \Yii::app()->clientScript
                ->registerScript('Tooltip#' . $this->getId(), "$(document).foundation('tooltip', {$options});");
        }
    }
738994
public function registerClientScript()
	{
		$id=$this->htmlOptions['id'];

		$acOptions=$this->getClientOptions();
		$options=$acOptions===array()?'{}' : CJavaScript::encode($acOptions);

		$cs=Yii::app()->getClientScript();
		$cs->registerCoreScript('autocomplete');
		if($this->data!==null)
			$data=CJavaScript::encode($this->data);
		else
		{
			$url=CHtml::normalizeUrl($this->url);
			$data='"'.$url.'"';
		}
		$cs->registerScript('Yii.CAutoComplete#'.$id,"jQuery(\"#{$id}\").legacyautocomplete($data,{$options}){$this->methodChain};");

		if($this->cssFile!==false)
			self::registerCssFile($this->cssFile);
	}
1304983
public function registerClientScript()
	{
		$view = $this->getView();
		TwbsMaxlengthAsset::register($view);

		$options = empty($this->clientOptions) ? "{}" : Json::encode($this->clientOptions);
		if( isset($this->selector)) {
			$js = "jQuery(\"{$this->selector}\").maxlength(" . $options . ")";
		} else {
			$js = "jQuery(\"#{$this->options['id']}\").maxlength(" . $options . ")";
		}
		$view->registerJs($js);
	}
895646
public function registerClientScript()
	{
		$id=$this->htmlOptions['id'];
		$miOptions=$this->getClientOptions();
		$options=$miOptions!==array() ? ','.CJavaScript::encode($miOptions) : '';
		$js='';
		if(is_array($this->charMap))
			$js.='jQuery.mask.definitions='.CJavaScript::encode($this->charMap).";\n";
		$js.="jQuery(\"#{$id}\").mask(\"{$this->mask}\"{$options});";

		$cs=Yii::app()->getClientScript();
		$cs->registerCoreScript('maskedinput');
		$cs->registerScript('Yii.CMaskedTextField#'.$id,$js);
	}
735986
public function registerClientScript()
	{
		$id=$this->htmlOptions['id'];

		$options=$this->getClientOptions();
		$options=$options===array()? '' : CJavaScript::encode($options);

		$cs=Yii::app()->getClientScript();
		$cs->registerCoreScript('multifile');
		$cs->registerScript('Yii.CMultiFileUpload#'.$id,"jQuery(\"#{$id}\").MultiFile({$options});");
	}
336270
private function registerWidgetScripts()
    {
        $view = $this->getView();
        $asset = Yii::$container->get(Asset::className());
        $asset::register($view);
        $this->widgetSettings = Json::encode($this->widgetSettings);
        $view->registerJs("var audioWidget = new AudioWidget(" . $this->widgetSettings . "); audioWidget.init();", $view::POS_READY);
    }
1164869
public function registerClientScript()
    {
        $view = $this->getView();
        // Register jQuery image cropping js and css files
        CropperAsset::register($view);
        // Additional plugin options
        $options = Json::encode($this->pluginOptions);

        $selector = "#$this->id .crop-image-container > img";

        if ($this->modal) {
            $ajaxOptions = Json::encode($this->ajaxOptions);
            $view->registerJs(<<<JS
(function() {

    var modalBox = $("#$this->id"),
        image = $("$selector"),
        cropBoxData,
        canvasData,
        cropUrl;

    modalBox.on("shown.bs.modal", function (event) {
        var button = $(event.relatedTarget); // Button that triggered the modal
        cropUrl = button.data('crop-url'); // Extract info from data-* attributes

        image.cropper($.extend({
            built: function () {
                // Strict mode: set crop box data first
                image.cropper('setCropBoxData', cropBoxData);
                image.cropper('setCanvasData', canvasData);
            },
            dragend: function() {
                cropBoxData = image.cropper('getCropBoxData');
                canvasData = image.cropper('getCanvasData');
            }
        }, $options));
    }).on('hidden.bs.modal', function () {
        cropBoxData = image.cropper('getCropBoxData');
        canvasData = image.cropper('getCanvasData');
        image.cropper('destroy');
    });

    $(document).on("click", "#$this->id .crop-submit", function(e) {
        e.preventDefault();

        $.ajax($.extend({
            method: "POST",
            url: cropUrl,
            data: image.cropper("getData"),
            dataType: "JSON",
            error: function() {
                alert("Error while cropping");
            }
        }, $ajaxOptions));

        modalBox.modal("hide");
    });

})();
JS
            );
        } else {
            $view->registerJs(";$(\"$selector\").cropper($options);");
        }
    }
1273445
public function registerClientScript()
    {
        if (!empty($this->pluginOptions)) {
            $options = \CJavaScript::encode($this->pluginOptions);
            \Yii::app()->clientScript
                ->registerScript('Orbit#' . $this->getId(), "$(document).foundation('orbit', {$options});");
        }

        if (!empty($this->events)) {
            $this->registerEvents("#{$this->getId()}", $this->events);
        }
    }
298514
public function registerScripts()
    {
        $view = $this->getView();

        Asset::register($view);
        if ($this->crop === true) {
            CropAsset::register($view);
        }

        $view->registerJs(
            'jQuery(\'#' . $this->getSelector() . '\').fileapi(' . Json::encode($this->settings) .');'
        );

        $this->registerCallbacks();
    }
802405
public function registerClientScript()
    {
        Html::addCssClass($this->wrapperOptions, "upload-kit");
        UploadAsset::register($this->getView());
        if ($this->sortable) {
            JuiAsset::register($this->getView());
        }
        $options = Json::encode($this->clientOptions);
        $this->getView()->registerJs("jQuery('#{$this->fileInputName}').attachmentUpload({$options});");
    }
263575
public function registerClientScript()
    {
        $view = $this->view;
        CodeMirrorAsset::register($view);
        $js = 'var CodeMirrorLabels = {
    bold: "' . Yii::t('podium/view', 'Bold') . '",
    italic: "' . Yii::t('podium/view', 'Italic') . '",
    header: "' . Yii::t('podium/view', 'Header') . '",
    inlinecode: "' . Yii::t('podium/view', 'Inline code') . '",
    blockcode: "' . Yii::t('podium/view', 'Block code') . '",
    quote: "' . Yii::t('podium/view', 'Quote') . '",
    bulletedlist: "' . Yii::t('podium/view', 'Bulleted list') . '",
    orderedlist: "' . Yii::t('podium/view', 'Ordered list') . '",
    link: "' . Yii::t('podium/view', 'Link') . '",
    image: "' . Yii::t('podium/view', 'Image') . '",
    help: "' . Yii::t('podium/view', 'Help') . '",
};var CodeMirrorSet = "' . $this->type . '";';
        $view->registerJs($js, View::POS_BEGIN);
    }
200858
public function registerClientScript()
    {
        parent::registerClientScript();

        $errorMessage = \Yii::t('skeeks/admin', 'An unexpected error occurred. Refer to the developers.');

        $errorNotify = '';
        if ($this->isShowError) {
            $errorNotify = "sx.notify.error('{$errorMessage}');";
        }

        if ($this->isBlock === true) {
            $this->getView()->registerJs(<<<JS
                (function(sx, $, _)
                {
                    var blockerPanel = new sx.classes.Blocker('#{$this->id}');

                    $(document).on('pjax:send', function(e)
                    {
                        if ('{$this->id}' == e.target.id) {
                            blockerPanel = new sx.classes.Blocker($(e.target));
                            blockerPanel.block();
                        }
                        
                    });

                    $(document).on('pjax:complete', function(e) {
                        if ('{$this->id}' == e.target.id) {
                            blockerPanel.unblock();
                        }
                    });

                    $(document).on('pjax:error', function(e, data) {
                        if ('{$this->id}' == e.target.id) {
                            {$errorNotify}
                            blockerPanel.unblock();
                            e.preventDefault();
                        }
                    });

                })(sx, sx.$, sx._);
JS
            );
        }

        if ($this->blockContainer) {
            $this->getView()->registerJs(<<<JS
                (function(sx, $, _)
                {
                    var blockerPanel = new sx.classes.Blocker($("{$this->blockContainer}"));

                    $(document).on('pjax:send', function(e)
                    {
                        if ('{$this->id}' == e.target.id) {
                            var blockerPanel = new sx.classes.Blocker($("{$this->blockContainer}"));
                            blockerPanel.block();
                        }
                        
                    });

                    $(document).on('pjax:complete', function(e) {
                        if ('{$this->id}' == e.target.id) {
                            blockerPanel.unblock();
                        }  
                        
                    });

                    $(document).on('pjax:error', function(e, data) {
                        if ('{$this->id}' == e.target.id) {
                            {$errorNotify}
                            blockerPanel.unblock();
                            e.preventDefault();
                        }
                        
                    });

                })(sx, sx.$, sx._);
JS
            );
        }

    }
464966
protected function registerClientScript()
    {
        $view = $this->getView();
        switch ($this->type) {
            case 'address':
                EditableAddressAsset::register($view);
                break;
            case 'combodate':
                EditableComboDateAsset::register($view);
                break;
            case 'date':
                EditableDatePickerAsset::register($view);
                break;
            case 'datetime':
                EditableDateTimePickerAsset::register($view);
                break;
            default:
                EditableBootstrapAsset::register($view);
        }
        $id = ArrayHelper::remove($this->pluginOptions, 'selector', '#' . $this->options['id']);
        $id = preg_replace('/([.])/', '\\\\\\\$1', $id);

        $pluginOptions = $this->getPluginOptions();
        $js = "jQuery('$id').editable($pluginOptions);";
        $view->registerJs($js);
        if (!empty($this->clientEvents)) {
            $this->registerClientEvents($id);
        }
    }