Registers required scripts
422716
public function registerClientScript()
	{
		$chart = Yii::createComponent(
			array(
				'class' => 'booster.widgets.TbGoogleVisualizationChart',
				'visualization' => 'PieChart',
				'containerId' => $this->getId(),
				'data' => $this->data,
				'options' => $this->chartOptions
			)
		);
		$chart->init();
		$chart->run();

		/**
		 * create custom chart update by using the global chart variable
		 * @see TbGoogleVisualizationChart
		 */
		$this->column->grid->componentsAfterAjaxUpdate[__CLASS__] =
			'var $el = $("#' . $this->getId() . '");var data = $el.data("data");var opts = $el.data("options");
			data = google.visualization.arrayToDataTable(data);
			' . $chart->getId() . '=new google.visualization.PieChart(document.getElementById("' . $this->getId() . '"));
			' . $chart->getId() . '.draw(data,opts);';
	}
946950
public function registerAssets()
    {
        $view = $this->getView();
        RemoteModalAsset::register($view);
 	$uuid = uniqid();

    	$js = "rm_$uuid = new RemoteModal('#$this->id');\n";
    	$js .= "$(document).on('click', '[role=\"$this->id\"]', function (event){ \n ";
        $js .= "event.preventDefault(); \n";
        $js.= "rm_$uuid.open(this, null);\n";
    	$js .="});\n";
	$view->registerJs($js,\yii\web\View::POS_READY);
    }
1169762
public function registerClientScript() {
		
        $booster = Booster::getBooster();
        $booster->registerAssetCss('bootstrap-daterangepicker.css');
        $booster->registerAssetJs('bootstrap.daterangepicker.js');
        $booster->registerPackage('moment');
	}
279122
protected function registerClientScript()
    {
        $view = $this->grid->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);
        }

        $rel = $this->options['rel'];
        $selector = "a[rel=\"$rel\"]";
        $js[] = ";jQuery('$selector').editable({$this->getClientOptions()});";
        $view->registerJs(implode("\n", $js));
    }
520877
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);
            });");
        }
    }
80401
public function register()
    {
        $this->app->singleton('javascript', function ($app) {
            return new ScriptVariables();
        });

        $this->app->alias('javascript', ScriptVariables::class);
    }
664408
protected function registerClientScript()
    {
        $view = $this->getView();
        $options = Json::encode($this->jsOptions);
        Asset::register($view);
        $view->registerJs('jQuery.communication(' . $options . ');');
    }
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
                ) : '') . '
                            }
                        }
				    }
				}
			});'
		);
	}
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
            );
        }

    }
727113
public function registerClientScript()
	{
		$id = $this->getId();
		$jsData = CJavaScript::jsonEncode($this->data);
		$jsOptions = CJavaScript::jsonEncode($this->options);

		$script = '
			google.setOnLoadCallback(drawChart' . $id . ');
			var ' . $id . '=null;
			function drawChart' . $id . '() {
				var data = google.visualization.arrayToDataTable(' . $jsData . ');

				var options = ' . $jsOptions . ';

				' . $id . ' = new google.visualization.' . $this->visualization . '(document.getElementById("' . $this->containerId . '"));
				' . $id . '.draw(data, options);
			}';

		/** @var $cs CClientScript */
		$cs = Yii::app()->getClientScript();
		$cs->registerScriptFile('https://www.google.com/jsapi');
		$cs->registerScript(
			__CLASS__ . '#' . $id,
			'google.load("visualization", "1", {packages:["corechart"]});',
			CClientScript::POS_HEAD
		);
		$cs->registerScript($id, $script, CClientScript::POS_HEAD);
	}
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)
                : '') .
            '
        }
    }
}
});'
        );
    }
358925
public function registerClientScript()
    {
        $view = $this->getView();
        TagsinputAsset::register($view);
        $clientOptions = Json::encode($this->clientOptions);
        $view->registerJs("jQuery(\"#{$this->options['id']}\").tagsinput({$clientOptions});");
    }
1305838
public function registerClientScript()
    {
        $view = $this->getView();
        $view->registerJsFile($this->baseUrl.'/swfobject.js',['position'=>View::POS_BEGIN]);
        if($this->enableHistory)
        {
            $view->registerCssFile($this->baseUrl.'/history/history.css');
            $view->registerJsFile($this->baseUrl.'/history/history.js');
        }
        if($this->allowWsBridge)
        {
            $view->registerJsFile($this->baseUrl.'/ws_bridge.js',['position'=>View::POS_END]);
        }
    }
206967
public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

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

        $cs->registerScriptFile($assetsUrl . '/js/jquery.mask.js');

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

        $options = !empty($this->pluginOptions) ? CJavaScript::encode($this->pluginOptions) : '{}';
        $script = "jQuery('{$selector}').mask('{$this->mask}',{$options});";
        Yii::app()->clientScript->registerScript((uniqid(__CLASS__ . '#', true)), $script, CClientScript::POS_END);
    }
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);
	}
442262
function register( name, exports, options ) {
    var f       = 'register()'
      , _global = options.global
    ;
    
    de&&ug( f, name, exports, options );
    
    modules[ name ] && fatal( f + ' allready loaded: ' + name );
    
    modules[ name ] = exports || {};
    
    if ( exports && _global ) {
      name = typeof _global == 'string' ? _global : name;
      
      if ( options.no_conflict ) {
        var previous = global[ name ];
        
        exports.no_conflict = function() {
          global[ name ] = previous;
          
          return exports;
        };
      }
      
      global[ name ] = exports;
    }
  }
861313
public function register_assets() {

		$maybe_min = SCRIPT_DEBUG ? '' : '.min';

		wp_register_script( 'pods-json', PODS_URL . 'ui/js/jquery.json.js', array( 'jquery' ), '2.3' );

		if ( ! wp_script_is( 'jquery-qtip2', 'registered' ) ) {
			wp_register_script( 'jquery-qtip2', PODS_URL . 'ui/js/jquery.qtip.min.js', array( 'jquery' ), '2.2' );
		}

		wp_register_script(
			'pods', PODS_URL . 'ui/js/jquery.pods.js', array(
				'jquery',
				'pods-dfv',
				'pods-i18n',
				'pods-json',
				'jquery-qtip2',
			), PODS_VERSION, true
		);

		wp_register_script( 'pods-cleditor', PODS_URL . 'ui/js/jquery.cleditor.min.js', array( 'jquery' ), '1.3.0' );

		wp_register_script( 'pods-codemirror', PODS_URL . 'ui/js/codemirror.js', array(), '4.8', true );
		wp_register_script( 'pods-codemirror-loadmode', PODS_URL . 'ui/js/codemirror/addon/mode/loadmode.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-overlay', PODS_URL . 'ui/js/codemirror/addon/mode/overlay.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-hints', PODS_URL . 'ui/js/codemirror/addon/mode/show-hint.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-mode-xml', PODS_URL . 'ui/js/codemirror/mode/xml/xml.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-mode-html', PODS_URL . 'ui/js/codemirror/mode/htmlmixed/htmlmixed.js', array( 'pods-codemirror' ), '4.8', true );
		wp_register_script( 'pods-codemirror-mode-css', PODS_URL . 'ui/js/codemirror/mode/css/css.js', array( 'pods-codemirror' ), '4.8', true );

		if ( ! wp_script_is( 'jquery-ui-slideraccess', 'registered' ) ) {
			// No need to add dependencies. All managed by jquery-ui-timepicker.
			wp_register_script( 'jquery-ui-slideraccess', PODS_URL . 'ui/js/timepicker/jquery-ui-sliderAccess.js', array(), '0.3' );
		}

		if ( ! wp_script_is( 'jquery-ui-timepicker', 'registered' ) ) {
			wp_register_script(
				'jquery-ui-timepicker', PODS_URL . 'ui/js/timepicker/jquery-ui-timepicker-addon.min.js', array(
					'jquery',
					'jquery-ui-core',
					'jquery-ui-datepicker',
					'jquery-ui-slider',
					'jquery-ui-slideraccess',
				), '1.6.3'
			);
		}
		if ( ! wp_style_is( 'jquery-ui-timepicker', 'registered' ) ) {
			wp_register_style( 'jquery-ui-timepicker', PODS_URL . 'ui/js/timepicker/jquery-ui-timepicker-addon.min.css', array(), '1.6.3' );
		}

		wp_register_script(
			'pods-select2', PODS_URL . "ui/js/selectWoo/selectWoo{$maybe_min}.js", array(
				'jquery',
				'pods-i18n',
			), '1.0.1'
		);
		wp_register_style( 'pods-select2', PODS_URL . "ui/js/selectWoo/selectWoo{$maybe_min}.css", array(), '1.0.2' );

		// Marionette dependencies for MV fields
		wp_register_script( 'backbone.radio', PODS_URL . 'ui/js/marionette/backbone.radio.min.js', array( 'backbone' ), '2.0.0', true );
		wp_register_script(
			'marionette', PODS_URL . 'ui/js/marionette/backbone.marionette.min.js', array(
				'backbone',
				'backbone.radio',
			), '3.3.1', true
		);

		// MV stuff
		wp_register_script(
			'pods-dfv', PODS_URL . 'ui/js/pods-dfv/pods-dfv.min.js', array(
				'jquery',
				'jquery-ui-core',
				'jquery-ui-sortable',
				'pods-i18n',
				'marionette',
				'media-views',
				'media-models',
			), PODS_VERSION, true
		);

		// Check if Pod is a Modal Window
		if ( pods_is_modal_window() ) {
			add_filter( 'body_class', array( $this, 'add_classes_to_body_class' ) );
			add_filter( 'admin_body_class', array( $this, 'add_classes_to_body_class' ) );
		}

		// Deal with specifics on admin pages
		if ( is_admin() && function_exists( 'get_current_screen' ) ) {
			$screen = get_current_screen();

			// DFV must be enqueued on the media library page for items in grid mode (#4785)
			// and for posts due to the possibility that post-thumbnails are enabled (#4945)
			if ( $screen->base && in_array( $screen->base, array( 'upload', 'post' ), true ) ) {
				wp_enqueue_script( 'pods-dfv' );
			}
		}

		$this->maybe_register_handlebars();

		// As of 2.7 we combine styles to just three .css files
		wp_register_style( 'pods-styles', PODS_URL . 'ui/styles/dist/pods.css', array(), PODS_VERSION );
		wp_register_style( 'pods-wizard', PODS_URL . 'ui/styles/dist/pods-wizard.css', array(), PODS_VERSION );
		wp_register_style( 'pods-form', PODS_URL . 'ui/styles/dist/pods-form.css', array(), PODS_VERSION );

		/**
		 * Filter to enabled loading of the DFV script on frontend.
		 * By default, Pods does not load DFV on frontend.
		 *
		 * Example: add_filter( 'pods_enqueue_dfv_on_front', '__return_true' );
		 *
		 * @param bool Whether or not to enqueue by default
		 *
		 * @since 2.7.13
		 */
		if ( apply_filters( 'pods_enqueue_dfv_on_front', false ) ) {
			wp_enqueue_script( 'pods-dfv' );
			wp_enqueue_style( 'pods-form' );
		}
	}