register base js config
342520
public function initConfig ()
    {
        if (empty(Yii::$app->params['domain'])) {
            throw new InvalidConfigException("param `domain` must set.", 1);
        }
        $this->_config = $this->mergeConfig();
        $config = Json::htmlEncode($this->_config);
        $js = <<<JS
            var {$this->_hashVar} = {$config};
            $('#{$this->_hashVar}').webupload_fileinput({$this->_hashVar});
JS;
        $this->_view->registerJs($js);
    }
964126
public function registerClientLib()
    {
        $jsPath = trim(Template::js('', $this->extension->getId()), '/');
        ClientLibRegistry::getRegistry()->register($this->extension->getId(), $jsPath);

        $cssPath = trim(Template::css('', $this->extension->getId()), '/');
        ClientLibRegistry::getRegistry()->register($this->extension->getId().'Css', $cssPath);
    }
1155830
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/ace.js', CClientScript::POS_END);

        $id = TbArray::getValue('id', $this->htmlOptions, $this->getId());

        /* Global value that will hold the editor */
        $cs->registerScript(uniqid(__CLASS__ . '#' . $id, true), 'var ' . $id . ';', CClientScript::POS_HEAD);

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

        echo $selector . '= ace.edit("' . $id . '");' . PHP_EOL;
        echo $selector . '.setTheme("ace/theme/' . $this->theme . '");' . PHP_EOL;
        echo $selector . '.getSession().setMode(' . (is_array($this->mode) ? CJavaScript::encode(
                $this->mode
            ) : '"ace/mode/' . $this->mode . '"') . ');' . PHP_EOL;
        echo $selector . '.setValue($("#' . $this->htmlOptions['textareaId'] . '").val());' . PHP_EOL;
        echo $selector . '.getSession().on("change", function(){
                var theVal = ' . $selector . '.getSession().getValue();
                $("#' . $this->htmlOptions['textareaId'] . '").val(theVal);
            });';

        if (!empty($this->events) && is_array($this->events)) {
            foreach ($this->events as $name => $handler) {
                $handler = ($handler instanceof CJavaScriptExpression)
                    ? $handler
                    : new CJavaScriptExpression($handler);

                echo $id . ".getSession().on('{$name}', {$handler});" . PHP_EOL;
            }
        }

        if (!empty($this->pluginOptions))
            echo $selector . '.setOptions(' . CJavaScript::encode($this->pluginOptions) . ')';

        $cs->registerScript(uniqid(__CLASS__ . '#ReadyJS' . $id, true), ob_get_clean());
    }
693544
public function registerClientScript()
    {
        $inputId = $this->options['id'];
        $jsTreeId = $this->getJsTreeId();
        $options = $this->getClientOptions();
        $options = empty($options) ? '' : Json::encode($options);

        $onChanged = '';
        if ($this->onChanged)
            $onChanged = ".on('changed.jstree', {$this->onChanged})";

        $onSelect = '';
        if ($this->onSelect)
            $onSelect = ".on('select_node.jstree', {$this->onSelect})";

        $view = $this->getView();
        JsTreeAsset::register($view);
        $view->registerJs("
            jQuery('#$jsTreeId')
                .on('loaded.jstree', function() { jQuery(this).jstree('select_node', jQuery('#$inputId').val().split(','), true); })
                .on('changed.jstree', function(e, data) { jQuery('#$inputId').val(data.selected.join()); })
                $onChanged
                $onSelect
                .jstree($options);
        ");
    }
2302
function(config){
        
        if(isString(config)){
            this.config.appBase = config;
        }else if(isObject(config)){// If the config object is provided
            this.config = Object.assign(this.config, config);
        }

        // If the app base isn't provided
        if(!this.config.appBase){
            this.config.appBase = utils.getAppLocalPath();
        }else if(this.config.appBase.length && this.config.appBase[this.config.appBase.length-1] !== '/'){
            this.config.appBase += '/';
        }

        // If the layouts list was passed in the config
        if(this.config.layouts && isObject(this.config.layouts)){
            Object.keys(this.config.layouts).forEach(key => {
                layouts.add(key, this.config.layouts[key]);
            });
        }

        // If the dev mode is on
        if(this.config.devMode === true){
            // Attach some shortcuts
            Application.on('ready', function(){

                // Ctrl+F12 to toggle the dev tools
                Shortcuts.register('CmdOrCtrl+F12', function(){
                    const window = windowManager.getCurrent();
                    if(window) window.toggleDevTools();
                });

                // Ctrl+R to reload the page
                Shortcuts.register('CmdOrCtrl+R', function(){
                    const window = windowManager.getCurrent();
                    if(window) window.reload();
                });

            });
        }

        // If a default setup is provided
        if(this.config.defaultSetup){
            this.setDefaultSetup(this.config.defaultSetup);
            delete this.config.defaultSetup;
        }
    }
442973
def register_plugin(self):
        """"""
        ipyconsole = self.main.ipyconsole
        treewidget = self.fileexplorer.treewidget

        self.main.add_dockwidget(self)
        self.fileexplorer.sig_open_file.connect(self.main.open_file)
        self.register_widget_shortcuts(treewidget)

        treewidget.sig_edit.connect(self.main.editor.load)
        treewidget.sig_removed.connect(self.main.editor.removed)
        treewidget.sig_removed_tree.connect(self.main.editor.removed_tree)
        treewidget.sig_renamed.connect(self.main.editor.renamed)
        treewidget.sig_renamed_tree.connect(self.main.editor.renamed_tree)
        treewidget.sig_create_module.connect(self.main.editor.new)
        treewidget.sig_new_file.connect(lambda t: self.main.editor.new(text=t))
        treewidget.sig_open_interpreter.connect(
            ipyconsole.create_client_from_path)
        treewidget.redirect_stdio.connect(
            self.main.redirect_internalshell_stdio)
        treewidget.sig_run.connect(
            lambda fname:
            ipyconsole.run_script(fname, osp.dirname(fname), '', False, False,
                                  False, True))
        treewidget.sig_open_dir.connect(
            lambda dirname:
            self.main.workingdirectory.chdir(dirname,
                                             refresh_explorer=False,
                                             refresh_console=True))

        self.main.editor.open_dir.connect(self.chdir)

        # Signal "set_explorer_cwd(QString)" will refresh only the
        # contents of path passed by the signal in explorer:
        self.main.workingdirectory.set_explorer_cwd.connect(
                     lambda directory: self.refresh_plugin(new_path=directory,
                                                           force_current=True))
633869
function registerExtension(name, extension, options, mergeConfig) {
  var params = name;

  if (!isObject(name)) {
    params = {};
    params[name] = {
      extension: extension,
      options: options
    };
  }

  each(params, function (v, name) {
    if (v) {
      var _extension = v.extension,
          _options3 = v.options;

      if (_extension) {
        extensions[name] = _extension;
      } else if (!mergeConfig) {
        extensions[name] = v;
      }

      if (mergeConfig) {
        if (!extensionConfig[name]) {
          extensionConfig[name] = _config();
        }

        assign(extensionConfig[name], _options3);
      } else {
        extensionConfig[name] = _config(_options3);
      }
    }
  }, false);
}
949004
protected function registerConfig()
    {
        $location = __DIR__ . '/../config/' . $this->shortName . '.php';

        $this->mergeConfigFrom(
            $location, $this->shortName
        );

        $this->publishes([
            $location => config_path($this->shortName . '.php'),
        ], 'config');
    }
510334
def base(ctx, verbose, config):
    """"""
    # configure root logger to print to STDERR
    loglevel = LEVELS.get(min(verbose, 3))
    configure_stream(level=loglevel)
    ctx.obj = {}
    if config and os.path.exists(config):
        ctx.obj = yaml.load(open(config, 'r')) or {}
        ctx.obj['config_path'] = config
    # launch the command line interface
    logger.debug('Booting up command line interface')
700452
def register_plugin(self):
        """"""
        self.focus_changed.connect(self.main.plugin_focus_changed)
        self.main.add_dockwidget(self)
#        self.main.console.set_historylog(self)
        self.main.console.shell.refresh.connect(self.refresh_plugin)
1030938
protected function registerConfig()
    {
        // Merge project config and default package config
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/auth.php'), 'nodes.api.auth');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/errors.php'), 'nodes.api.errors');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/middleware.php'), 'nodes.api.middleware');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/response.php'), 'nodes.api.response');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/settings.php'), 'nodes.api.settings');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/throttling.php'), 'nodes.api.throttling');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/transformer.php'), 'nodes.api.transformer');

        if (! $this->app->runningInConsole() && empty(config('nodes.api.settings.prefix')) && empty(config('nodes.api.settings.domain'))) {
            throw new RuntimeException(sprintf('Unable to boot [%s], configure an API domain or prefix.', 'Nodes\Api\ServiceProvider'));
        }
    }
366587
public function registerClientScript()
    {
        $view = $this->view;
        ToggleAsset::register($view);
        //$this->clientOptions['animate'] = ArrayHelper::getValue($this->clientOptions, 'animate', true);
        $options = Json::encode($this->options);
        $js[] = "jQuery('$this->selector').bootstrapToggle($options);";
        if (!empty($this->clientEvents)) {
            foreach ($this->clientEvents as $event => $handler) {
                $js[] = "jQuery('$this->selector').on('$event', $handler);";
            }
        }
        $view->registerJs(implode("\n", $js));
    }
1156346
private function registerBase()
    {
        if (!empty(Config::get('cache')) && Config::get('cache') instanceof CacheInterface) {
            $this['cache'] = Config::get('cache');
        } else {
            $this['cache'] = function () {
                return new FilesystemCache(sys_get_temp_dir());
            };
        }
    }
222845
protected function registerClientScript()
    {
        $view = $this->getView();

        BootstrapTypeAheadAsset::register($view);

        $id = $this->options['id'];

        $options = $this->clientOptions !== false && !empty($this->clientOptions) ? Json::encode($this->clientOptions) : 'null';

        foreach($this->dataSets as $dataSet) {
            if(empty($dataSet)) {
                continue;
            }
            $dataSets[] = Json::encode($dataSet);
        }

        $dataSets = !empty($dataSets) ? implode(", ", $dataSets) : '{}';

        foreach ($this->engines as $bloodhound) {
            if ($bloodhound instanceof BootstrapTypeAheadBloodhound) {
                $js[] = $bloodhound->getClientScript();
            }
        }
        $js[] = "jQuery('#$id').typeahead($options, $dataSets);";
        foreach ($this->clientEvents as $eventName => $handler) {
            $js[] = "jQuery('#$id').on('$eventName', $handler);";
        }
        $view->registerJs(implode("\n", $js));
    }
313217
public function registerAssets()
    {
        $view = $this->getView();
        JsTreeAsset::register($view);

        $config = [
            'core' => array_merge(['data' => $this->data], $this->core),
            'checkbox' => $this->checkbox,
            'contextmenu' => $this->contextmenu,
            'dnd' => $this->dnd,
            'search' => $this->search,
            'sort' => $this->sort,
            'state' => $this->state,
            'plugins' => $this->plugins,
            'types' => $this->types
        ];
        $defaults = Json::encode($config);

        $inputId = (!$this->hasModel()) ? $this->options['id'] : Html::getInputId($this->model, $this->attribute);

        $js = <<<SCRIPT
;(function($, window, document, undefined) {
    $('#jsTree_{$this->options['id']}')
        .bind("loaded.jstree", function (event, data) {
                $("#{$inputId}").val(JSON.stringify(data.selected));
            })
        .bind("changed.jstree", function(e, data, x){
                $("#{$inputId}").val(JSON.stringify(data.selected));
        })
        .jstree({$defaults});
})(window.jQuery, window, document);
SCRIPT;
        $view->registerJs($js);
    }
819441
public function registerJs() {
			if ( Yii::$app->request->isAjax ) {
				return;
			}
			$js = <<<'JS'
			$(document.body).on("click", "a.toggle-column", function(e) {
			    e.preventDefault();
			    $.post($(this).attr("href"), function(data) {
			        var pjaxId = $(e.target).closest("[data-pjax-container]").attr("id");
			        $.pjax.reload({container:"#" + pjaxId});
			    });
    return false;
});
JS;
			$this->grid->view->registerJs( $js, View::POS_READY, 'pheme-toggle-column' );
		}
1287861
protected function registerBaseBindings()
    {
        static::setInstance($this);

        $this->instance('app', $this);

        $this->instance(Container::class, $this);
    }