Registers the needed client script and options.
358925
public function registerClientScript()
    {
        $view = $this->getView();
        TagsinputAsset::register($view);
        $clientOptions = Json::encode($this->clientOptions);
        $view->registerJs("jQuery(\"#{$this->options['id']}\").tagsinput({$clientOptions});");
    }
631673
public function registerClientScript()
    {
        $view = $this->getView();
        $selector = Json::encode($this->selector);
        $asset = TrumbowygAsset::register($view);

        if (isset($this->settings['lang'])) {
            $asset->language = $this->settings['lang'];
        }

        if (isset($this->settings['plugins'])) {
            $asset->plugins = $this->settings['plugins'];
        }

        $settings = !empty($this->settings) ? Json::encode($this->settings) : '';

        $view->registerJs("jQuery($selector).trumbowyg($settings);");
    }
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);
        }
    }
302415
public function registerCustomClientScript()
	{
		/** @var $cs CClientScript */
		$cs = Yii::app()->getClientScript();

		$fixedHeaderJs = '';
		if ($this->fixedHeader) {
            Booster::getBooster()->registerAssetJs('jquery.stickytableheaders' . (!YII_DEBUG ? '.min' : '') . '.js');
			$fixedHeaderJs = "$('#{$this->id} table.items').stickyTableHeaders({fixedOffset:{$this->headerOffset}});";
			$this->componentsAfterAjaxUpdate[] = $fixedHeaderJs;
		}

		if ($this->sortableRows) {
			$afterSortableUpdate = '';
			if ($this->afterSortableUpdate !== null) {
				if (!($this->afterSortableUpdate instanceof CJavaScriptExpression) && strpos(
					$this->afterSortableUpdate,
					'js:'
				) !== 0
				) {
					$afterSortableUpdate = new CJavaScriptExpression($this->afterSortableUpdate);
				} else {
					$afterSortableUpdate = $this->afterSortableUpdate;
				}
			}

			$this->selectableRows = 1;
			$cs->registerCoreScript('jquery.ui');
            Booster::getBooster()->registerAssetJs('jquery.sortable.gridview.js');

			if ($this->sortableAjaxSave && $this->sortableAction !== null) {
				$sortableAction = Yii::app()->createUrl(
					$this->sortableAction,
					array('sortableAttribute' => $this->sortableAttribute)
				);
			} else {
				$sortableAction = '';
			}

			$afterSortableUpdate = CJavaScript::encode($afterSortableUpdate);
			if (Yii::app()->request->enableCsrfValidation)
			{
				$csrfTokenName = Yii::app()->request->csrfTokenName;
				$csrfToken = Yii::app()->request->csrfToken;
				$csrf = "{'$csrfTokenName':'$csrfToken' }";
			} else
				$csrf = '{}';

			$this->componentsReadyScripts[] = "$.fn.yiiGridView.sortable('{$this->id}', '{$sortableAction}', {$afterSortableUpdate}, $csrf);";
			$this->componentsAfterAjaxUpdate[] = "$.fn.yiiGridView.sortable('{$this->id}', '{$sortableAction}', {$afterSortableUpdate}, $csrf);";
		}

		if ($this->selectableCells) {
			$afterSelectableCells = '';
			if ($this->afterSelectableCells !== null) {
				if (!($this->afterSelectableCells instanceof CJavaScriptExpression) && strpos($this->afterSelectableCells,'js:') !== 0) {
					$afterSelectableCells = new CJavaScriptExpression($this->afterSelectableCells);
				} else {
					$afterSelectableCells = $this->afterSelectableCells;
				}
			}
			$cs->registerCoreScript('jquery.ui');
            Booster::getBooster()->registerAssetJs('jquery.selectable.gridview.js');
			$afterSelectableCells = CJavaScript::encode($afterSelectableCells);
			$this->componentsReadyScripts[] = "$.fn.yiiGridView.selectable('{$this->id}','{$this->selectableCellsFilter}',{$afterSelectableCells});";
			$this->componentsAfterAjaxUpdate[] = "$.fn.yiiGridView.selectable('{$this->id}','{$this->selectableCellsFilter}', {$afterSelectableCells});";
		}

		$cs->registerScript(
			__CLASS__ . '#' . $this->id . 'Ex',
			'
			var $grid = $("#' . $this->id . '");
			' . $fixedHeaderJs . '
			if ($(".' . $this->extendedSummaryCssClass . '", $grid).length)
			{
				$(".' . $this->extendedSummaryCssClass . '", $grid).html($("#' . $this->id . '-extended-summary", $grid).html());
			}
			' . (count($this->componentsReadyScripts) ? implode(PHP_EOL, $this->componentsReadyScripts) : '') . '
			$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
				var qs = $.deparam.querystring(options.url);
				if (qs.hasOwnProperty("ajax") && qs.ajax == "' . $this->id . '")
				{
				    if (typeof (options.realsuccess) == "undefined" || options.realsuccess !== options.success)
				    {
                        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(
                    PHP_EOL,
                    $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");
    }
1059282
public function registerClientScript()
    {
        $view = $this->getView();
        
        if ($this->gallery) {
            GalleryAsset::register($view);
        }
        switch ($this->appearance) {
            case 'ui':
                JQueryFileUploadPlusUIAsset::register($view);
                break;    
            
            case 'plus':
                JQueryFileUploadPlusAsset::register($view);
                break;
            
            default:
                JQueryFileUploadAsset::register($view);
        }

        $id = $this->formId ? : $this->options['id'];
        $this->registerClientOptions('fileupload', $id);
        $this->registerClientEvents('fileupload', $id);
    }
1347113
public function registerClientScript()
	{
		$id=$this->getId();

		if($this->ajaxUpdate===false)
			$ajaxUpdate=array();
		else
			$ajaxUpdate=array_unique(preg_split('/\s*,\s*/',$this->ajaxUpdate.','.$id,-1,PREG_SPLIT_NO_EMPTY));
		$options=array(
			'ajaxUpdate'=>$ajaxUpdate,
			'ajaxVar'=>$this->ajaxVar,
			'pagerClass'=>$this->pagerCssClass,
			'loadingClass'=>$this->loadingCssClass,
			'sorterClass'=>$this->sorterCssClass,
			'enableHistory'=>$this->enableHistory
		);
		if($this->ajaxUrl!==null)
			$options['url']=CHtml::normalizeUrl($this->ajaxUrl);
		if($this->ajaxType!==null)
			$options['ajaxType']=strtoupper($this->ajaxType);
		if($this->updateSelector!==null)
			$options['updateSelector']=$this->updateSelector;
		foreach(array('beforeAjaxUpdate', 'afterAjaxUpdate', 'ajaxUpdateError') as $event)
		{
			if($this->$event!==null)
			{
				if($this->$event instanceof CJavaScriptExpression)
					$options[$event]=$this->$event;
				else
					$options[$event]=new CJavaScriptExpression($this->$event);
			}
		}

		$options=CJavaScript::encode($options);
		$cs=Yii::app()->getClientScript();
		$cs->registerCoreScript('jquery');
		$cs->registerCoreScript('bbq');
		if($this->enableHistory)
			$cs->registerCoreScript('history');
		$cs->registerScriptFile($this->baseScriptUrl.'/jquery.yiilistview.js',CClientScript::POS_END);
		$cs->registerScript(__CLASS__.'#'.$id,"jQuery('#$id').yiiListView($options);");
	}
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
            );
        }

    }
1017513
public void register(Client client) {
        Exceptions.checkNotClosed(this.closed.get(), this);
        Preconditions.checkNotNull(client, "client");
        synchronized (this.clients) {
            if (!this.clients.contains(client)) {
                this.clients.add(client);
                client.updateGenerations(this.currentGeneration.get(), this.oldestGeneration.get());
            }
        }

        log.info("{} Registered {}.", TRACE_OBJECT_ID, client);
    }
715353
protected function registerClientScript()
	{
		$assets = Booster::getBooster()->cs;

		$assets->registerPackage('highcharts');

		$baseUrl = $assets->packages['highcharts']['baseUrl'];

		$this->options = CMap::mergeArray(array('exporting' => array('enabled' => true)), $this->options);

		if (isset($this->options['exporting']) && @$this->options['exporting']['enabled']) {
			$assets->registerScriptFile($baseUrl . '/modules/exporting.js');
		}
		if (isset($this->options['theme'])) {
			$assets->registerScriptFile($baseUrl . '/themes/' . $this->options['theme'] . '.js');
		}

		$options = CJavaScript::encode($this->options);

		$assets->registerScript(
			__CLASS__ . '#' . $this->getId(),
			"var highchart{$this->getId()} = new Highcharts.Chart({$options});"
		);
	}
1169762
public function registerClientScript() {
		
        $booster = Booster::getBooster();
        $booster->registerAssetCss('bootstrap-daterangepicker.css');
        $booster->registerAssetJs('bootstrap.daterangepicker.js');
        $booster->registerPackage('moment');
	}
426937
protected function registerClientScript()
    {
        $id = $this->options['id'];
        $view = $this->getView();
        $option = !empty($this->pluginOptions['option']) ? Json::encode($this->pluginOptions['option']) : '{}';

        if ($this->theme) {
            $js = "var {$this->clientId} = echarts.init(document.getElementById('{$id}'), " . $this->quote($this->theme) . ");";
        } else {
            $js = "var {$this->clientId} = echarts.init(document.getElementById('{$id}'));";
        }
        $js .= "{$this->clientId}.setOption({$option});";
        if (isset($this->pluginOptions['group'])) {
            $js .= "{$this->clientId}.group = " . $this->quote($this->pluginOptions['group']) . ";";
        }
        if ($this->responsive) {
            $js .= "$(window).resize(function () {{$this->clientId}.resize()});";
        }
        foreach ($this->pluginEvents as $name => $handlers) {
            $handlers = (array) $handlers;
            foreach ($handlers as $handler) {
                $js .= "{$this->clientId}.on(" . $this->quote($name) . ", $handler);";
            }
        }

        EChartsAsset::register($view);
        $view->registerJs($js);
    }
680072
private function registerScripts() {
        $view = $this->getView();

        $view->registerJsFile($this->stripeJs, ['position' => \yii\web\View::POS_END]);

        if (!self::$handlerRegistered) {
            $js = "var handler = StripeCheckout.configure({
                key: '" . Yii::$app->stripe->publicKey . "'
            });";
            $view->registerJs($js);
            $js = 'jQuery("window").on("popstate", function(e) {
                handler.close();
            });';
            $view->registerJs($js);

            self::$handlerRegistered = true;
        }

        $js = 'jQuery("#' . $this->buttonOptions['id'] . '").on("click", function(e) {
                    handler.open({
                        name: "' . $this->name . '",
                        description: "' . $this->description . '",
                        amount: ' . $this->amount . ',
                        image: "' . $this->image . '",
                        currency: "' . $this->currency . '",
                        panelLabel: "' . $this->panelLabel . '",
                        zipCode: "' . $this->validateZipCode . '",
                        email: "' . $this->userEmail . '",
                        allowRememberMe: "' . $this->allowRemember . '",
                        token: ' . $this->tokenFunction . ',
                        opened: ' . $this->openedFunction . ',
                        closed: ' . $this->closedFunction . '
                    });
                    e.preventDefault();
         });';
        $view->registerJs($js);

    }
297160
public function registerClientScript() {
        $view = $this->getView();

        FancyBoxAsset::register($view);

        if ($this->mouse) {
            MousewheelAsset::register($view);
        }

        if ($this->helpers) {
            FancyBoxHelpersAsset::register($view);
        }
    }
563454
public function registerClientScript()
	{
		$id=$this->getId();

		if($this->ajaxUpdate===false)
			$ajaxUpdate=false;
		else
			$ajaxUpdate=array_unique(preg_split('/\s*,\s*/',$this->ajaxUpdate.','.$id,-1,PREG_SPLIT_NO_EMPTY));
		$options=array(
			'ajaxUpdate'=>$ajaxUpdate,
			'ajaxVar'=>$this->ajaxVar,
			'pagerClass'=>$this->pagerCssClass,
			'loadingClass'=>$this->loadingCssClass,
			'filterClass'=>$this->filterCssClass,
			'tableClass'=>$this->itemsCssClass,
			'selectableRows'=>$this->selectableRows,
			'enableHistory'=>$this->enableHistory,
			'updateSelector'=>$this->updateSelector,
			'filterSelector'=>$this->filterSelector
		);
		if($this->ajaxUrl!==null)
			$options['url']=CHtml::normalizeUrl($this->ajaxUrl);
		if($this->ajaxType!==null) {
			$options['ajaxType']=strtoupper($this->ajaxType);
			$request=Yii::app()->getRequest();
			if ($options['ajaxType']=='POST' && $request->enableCsrfValidation) {
				$options['csrfTokenName']=$request->csrfTokenName;
				$options['csrfToken']=$request->getCsrfToken();
			}
		}
		if($this->enablePagination)
			$options['pageVar']=$this->dataProvider->getPagination()->pageVar;
		foreach(array('beforeAjaxUpdate', 'afterAjaxUpdate', 'ajaxUpdateError', 'selectionChanged') as $event)
		{
			if($this->$event!==null)
			{
				if($this->$event instanceof CJavaScriptExpression)
					$options[$event]=$this->$event;
				else
					$options[$event]=new CJavaScriptExpression($this->$event);
			}
		}

		$options=CJavaScript::encode($options);
		$cs=Yii::app()->getClientScript();
		$cs->registerCoreScript('jquery');
		$cs->registerCoreScript('bbq');
		if($this->enableHistory)
			$cs->registerCoreScript('history');
		$cs->registerScriptFile($this->baseScriptUrl.'/jquery.yiigridview.js',CClientScript::POS_END);
		$cs->registerScript(__CLASS__.'#'.$id,"jQuery('#$id').yiiGridView($options);");
	}
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);

    }
1359852
protected function registerScript()
    {
        $id = $this->options['id'];
        $clientOptions = (count($this->clientOptions)) ? Json::encode($this->clientOptions) : '{}';

        $this->getView()->registerJs("CKEDITOR.replace('$id', $clientOptions);", View::POS_END);
    }