Register widget asset
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);
    }
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)
                : '') .
            '
        }
    }
}
});'
        );
    }
914825
def register_plugin(self):
        """"""
        self.main.restore_scrollbar_position.connect(
                                               self.restore_scrollbar_position)
        self.main.add_dockwidget(self)
910370
public function registerAssets()
    {
        $view = $this->getView();

        $asset = NotificationsAsset::register($view);

        // Register the theme assets
        if (!is_null($this->theme)) {
            if (!in_array($this->theme, self::$_builtinThemes)) {
                throw new Exception("Unknown theme: " . $this->theme, 501);
            }
            foreach (['js' => 'registerJsFile', 'css' => 'registerCssFile'] as $type => $method) {
                $filename = NotificationsAsset::getFilename($this->theme, $type);
                if ($filename) {
                    $view->$method($asset->baseUrl . '/' . $filename, [
                        'depends' => NotificationsAsset::className()
                    ]);
                }
            }
        }

        // Register timeago i18n file
        if ($filename = NotificationsAsset::getTimeAgoI18n($this->timeAgoLocale)) {
            $view->registerJsFile($asset->baseUrl . '/' . $filename, [
                'depends' => NotificationsAsset::className()
            ]);
        }

        $params = [
            'url' => Url::to(['/notifications/notifications/poll']),
            'xhrTimeout' => Html::encode($this->xhrTimeout),
            'delay' => Html::encode($this->delay),
            'options' => $this->clientOptions,
            'pollSeen' => !!$this->pollSeen,
            'pollInterval' => Html::encode($this->pollInterval),
            'counters' => $this->counters,
        ];

        if ($this->theme) {
            $params['theme'] = Html::encode($this->theme);
        }

        if ($this->markAllSeenSelector) {
            $params['markAllSeenSelector'] = $this->markAllSeenSelector;
            $params['seenAllUrl'] = Url::to(['/notifications/notifications/read-all']);
        }

        if ($this->deleteAllSelector) {
            $params['deleteAllSelector'] = $this->deleteAllSelector;
            $params['deleteAllUrl'] = Url::to(['/notifications/notifications/delete-all']);
        }

        if ($this->listSelector) {
            $params['seenUrl'] = Url::to(['/notifications/notifications/read']);
            $params['deleteUrl'] = Url::to(['/notifications/notifications/delete']);
            $params['flashUrl'] = Url::to(['/notifications/notifications/flash']);
            $params['listSelector'] = $this->listSelector;
            if ($this->listItemTemplate) {
                $params['listItemTemplate'] = $this->listItemTemplate;
            }
            if ($this->listItemBeforeRender instanceof JsExpression) {
                $params['listItemBeforeRender'] = $this->listItemBeforeRender;
            }
        }

        $js = 'Notifications(' . Json::encode($params) . ');';

        $view->registerJs($js);
    }
445260
protected function registerAssets()
    {
        $view = $this->getView();
        SelectizeAsset::register($view);
        $js = '$("#' . $this->getInputId() . '").selectize(' . $this->getPluginOptions() . ');';
        $view->registerJs($js, $view::POS_END);
    }
807682
protected function registerWidget()
    {
        $totalUserWidget = new TotalUserWidget();
        WidgetFacade::make($totalUserWidget->identifier(), $totalUserWidget);

        $monthlyRevenueWidget = new MonthlyRevenueWidget();
        WidgetFacade::make($monthlyRevenueWidget->identifier(), $monthlyRevenueWidget);

        $totalOrderWidget = new TotalOrderWidget();
        WidgetFacade::make($totalOrderWidget->identifier(), $totalOrderWidget);

        $recentOrderWidget = new RecentOrderWidget();
        WidgetFacade::make($recentOrderWidget->identifier(), $recentOrderWidget);
    }
801478
public function registerGalleryScriptFiles()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

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

        $cs->registerScriptFile($assetsUrl . '/js/blueimp-gallery.min.js', CClientScript::POS_END);
        $cs->registerScriptFile($assetsUrl . '/js/blueimp-gallery-indicator.js', CClientScript::POS_END);
        $cs->registerCssFile($assetsUrl . '/css/blueimp-gallery.min.css');
    }
1124708
protected function registerAssets()
    {
        $view = $this->getView();
        PieAsset::register($view);

        $js = 'var pie' . ucfirst($this->getId()) . ' = new d3pie(' . $this->getId() . ', ' . Json::encode($this->pieOptions) . ');';
        $view->registerJs($js);

    }
765655
public function register()
    {
        $this->app['actions']->listen(
            'widgets_init',
            function ()
            {
                foreach ($this->widgets as $widget)
                {
                    if (class_exists($widget))
                    {
                        register_widget($widget);
                    }
                }
            }
        );
    }
65547
private static function register_widget( $widget_class ) {
		register_widget( $widget_class );

		$callback = [ $widget_class, 'post_registration' ];
		if ( is_callable( $callback, true ) ) {
			call_user_func( $callback );
		}
	}
302139
private function registerAssets()
    {
        if ($this->jsNotifier === false) {
            return;
        }

        if (!Yii::$app instanceof \yii\web\Application) {
            return;
        }

        try {
            $view = Yii::$app->getView();
            RavenAsset::register($view);
            $view->registerJs('Raven.config(' . Json::encode($this->publicDsn) . ', ' . Json::encode($this->jsOptions) . ').install();', View::POS_HEAD);
        } catch (Exception $e) {
            // initialize Sentry component even if unable to register the assets
            Yii::error($e->getMessage());
        }
    }
81070
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
    public void registerWidget(View widget) {
        prepareWidget(widget);

        if (widget instanceof AlgoliaResultsListener) {
            AlgoliaResultsListener listener = (AlgoliaResultsListener) widget;
            if (!this.resultListeners.contains(listener)) {
                this.resultListeners.add(listener);
            }
            searcher.registerResultListener(listener);
        }
        if (widget instanceof AlgoliaErrorListener) {
            AlgoliaErrorListener listener = (AlgoliaErrorListener) widget;
            if (!this.errorListeners.contains(listener)) {
                this.errorListeners.add(listener);
            }
            searcher.registerErrorListener(listener);
        }
        if (widget instanceof AlgoliaSearcherListener) {
            AlgoliaSearcherListener listener = (AlgoliaSearcherListener) widget;
            listener.initWithSearcher(searcher);
        }
    }
1309728
protected function registerAssets()
    {
        $view = $this->getView();
        MarkdownEditorAsset::register($view);
        $varName = Inflector::variablize('editor_' . $this->id);
        $script = "var {$varName} = new SimpleMDE(" . $this->getEditorOptions() . ');';
        $view->registerJs($script);
        $css = <<<CSS
.wonail-markdown{z-index:{$this->zIndex};}
.wonail-markdown .editor-toolbar.fullscreen{z-index:{$this->zIndex}}
.wonail-markdown .CodeMirror-fullscreen{z-index: {$this->zIndex}}
.wonail-markdown .editor-statusbar{z-index: {$this->zIndex}}
CSS;
        $view->registerCss($css);
    }
916147
protected function registerAssets()
    {
        $view = $this->getView();
        ChosenSelectAsset::register($view);
        $js = '$("#' . $this->options['id'] . '").chosen(' . $this->getPluginOptions() . ');';
        $view->registerJs($js, $view::POS_END);
    }
1365173
public static function register_widgets() {
		foreach ( self::$_widgets['lean'] as $widget ) {
			self::register_widget( __NAMESPACE__ . '\\Collection\\' . $widget );
		}

		foreach ( self::$_widgets['custom'] as $widget ) {
			self::register_widget( $widget );
		}
	}
375899
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/jquery.fileupload-ui.css');

        // Upgrade widget factory
        // @todo remove when jquery.ui 1.9+ is fully integrated into stable Yii versions
        $cs->registerScriptFile($assetsUrl . '/js/vendor/jquery.ui.widget.js', CClientScript::POS_END);

        //The Templates plugin is included to render the upload/download listings
        $cs->registerScriptFile($assetsUrl . '/js/tmpl.min.js', CClientScript::POS_END);

        if ($this->previewImages || $this->imageProcessing) {
            $cs->registerScriptFile($assetsUrl . '/js/load-image.min.js', CClientScript::POS_END);
            $cs->registerScriptFile($assetsUrl . '/js/canvas-to-blob.min.js', CClientScript::POS_END);
            // gallery :)
            $this->getYiiWheels()->registerAssetCss("bootstrap-image-gallery.min.css");
            $this->getYiiWheels()->registerAssetJs("bootstrap-image-gallery.min.js", CClientScript::POS_END);
        }
        //The Iframe Transport is required for browsers without support for XHR file uploads
        $cs->registerScriptFile($assetsUrl . '/js/jquery.iframe-transport.js', CClientScript::POS_END);
        $cs->registerScriptFile($assetsUrl . '/js/jquery.fileupload.js', CClientScript::POS_END);

        // The File Upload image processing plugin
        if ($this->imageProcessing) {
            $cs->registerScriptFile($assetsUrl . '/js/jquery.fileupload-ip.js', CClientScript::POS_END);
        }
        // The File Upload file processing plugin
        if ($this->previewImages) {
            $cs->registerScriptFile($assetsUrl . '/js/jquery.fileupload-fp.js', CClientScript::POS_END);
        }
        // locale
        $cs->registerScriptFile($assetsUrl . '/js/jquery.fileupload-locale.js', CClientScript::POS_END);

        //The File Upload user interface plugin
        $cs->registerScriptFile($assetsUrl . '/js/jquery.fileupload-ui.js', CClientScript::POS_END);

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

        $this->getApi()->registerPlugin('fileupload', $selector, $this->options);
    }
796814
public function registerAssets()
    {
        $id = $this->options['id'];
        $view = $this->getView();
        CoreAsset::register($view);
        $cleanOptions = $this->getClientOptions();
        $js[] = "$('textarea.element-$id').textareaAutoSize();";
        $view->registerJs(implode("\n", $js),View::POS_READY);
    }