Switch to plugin.
505858
def switch_to_plugin(self):
        """"""
        # Unmaxizime currently maximized plugin
        if (self.main.last_plugin is not None and
                self.main.last_plugin.ismaximized and
                self.main.last_plugin is not self):
            self.main.maximize_dockwidget()

        # Show plugin only if it was already visible
        if self.get_option('visible_if_project_open'):
            if not self.toggle_view_action.isChecked():
                self.toggle_view_action.setChecked(True)
            self.visibility_changed(True)
830430
def add_plugin(self, plugin):
        """"""
        # allow plugins loaded via entry points to override builtin plugins
        new_name = self.plugin_name(plugin)
        self._plugins[:] = [p for p in self._plugins
                            if self.plugin_name(p) != new_name]
        self._plugins.append(plugin)
221793
private function toggle()
    {
        $q = Eresus_DB::getHandler()->createUpdateQuery();
        $e = $q->expr;
        $q->update('plugins')
            ->set('active', $e->not('active'))
            ->where(
                $e->eq('name', $q->bindValue(arg('toggle')))
            );
        $q->execute();

        HttpResponse::redirect(Eresus_Kernel::app()->getPage()->url());
    }
1298422
function (target, e) {
            if (this.current_plugin !== this.plugin_count || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
                return;
            }

            switch (e.which) {
                case 83: // W
                case 65: // A
                case 40: // DOWN
                case 37: // LEFT
                    e.preventDefault();
                    this.moveByKey(false);
                    break;

                case 87: // S
                case 68: // D
                case 38: // UP
                case 39: // RIGHT
                    e.preventDefault();
                    this.moveByKey(true);
                    break;
            }

            return true;
        }
906628
def refresh_plugin(self):
        """"""
        nb = None
        if self.tabwidget.count():
            client = self.tabwidget.currentWidget()
            nb = client.notebookwidget
            nb.setFocus()
        else:
            nb = None
        self.update_notebook_actions()
617788
function Plugin() {
    this.each(function () {
      var $this = $(this);
      var data = $this.data('bui.disable');

      if (!data) {
        data = new Disable($this);
        $this.data('bui.disable', data);
      }

      data.toggle();
    });

    return this;
  }
978453
function Plugin(element, options) {
    this.element = element;
    this.settings = $.extend({}, defaults, options);
    this.periodOptions = {
      title: this.settings.periodTitle,
      backgroundColor: this.settings.periodBackgroundColor,
      borderColor: this.settings.periodBorderColor,
      textColor: this.settings.periodTextColor
    };
    this.init();
  }
1355029
def register_plugin(self):
        """"""
        self.main.add_dockwidget(self)

        self.focus_changed.connect(self.main.plugin_focus_changed)
        self.edit_goto.connect(self.main.editor.load)
        self.edit_goto[str, int, str, bool].connect(
                         lambda fname, lineno, word, processevents:
                         self.main.editor.load(fname, lineno, word,
                                               processevents=processevents))
        self.main.editor.breakpoints_saved.connect(self.set_spyder_breakpoints)
        self.main.editor.run_in_current_ipyclient.connect(self.run_script)
        self.main.editor.run_cell_in_ipyclient.connect(self.run_cell)
        self.main.workingdirectory.set_current_console_wd.connect(
                                     self.set_current_client_working_directory)

        self.tabwidget.currentChanged.connect(self.update_working_directory)

        self._remove_old_stderr_files()
194081
def run(opts, args):
        '''
        '''
        setup_options(opts)

        mode = Modes.ONCE
        if len(args) > 0 and hasattr(Modes, args[0].upper()):
            _mode = args.pop(0).upper()
            mode = getattr(Modes, _mode)

        url = None
        if len(args) > 0:
            # A url was specified
            url = args.pop(0)

        plugin_mgr = PluginManager.load_plugin_from_addonxml(mode, url)
        plugin_mgr.run()
435051
def save(self):
        """"""
        if self.SacrificeDate:
            self.Active = False
        super(PlugEvents, self).save()
105044
function Plugin(option) {
			return this.each(function () {
				var $this = $(this);
				var data = $this.data("bs.tab");

				if (!data) $this.data("bs.tab", (data = new Tab(this)));
				if (typeof option == "string") data[option]();
			});
		}
1317072
def switch(self):
        """"""
        t = self.system.dae.t
        for idx in range(0, self.n):
            if t >= self.tl[idx]:
                if self.en[idx] == 0:
                    self.en[idx] = 1
                    logger.info(
                        'Extended ACE <{}> activated at t = {}.'.format(
                            self.idx[idx], t))
521262
def register_plugin(self):
        """"""
        self.focus_changed.connect(self.main.plugin_focus_changed)
        self.main.add_dockwidget(self)
        self.ipyconsole = self.main.ipyconsole
        self.create_new_client(give_focus=False)
        icon_path = os.path.join(PACKAGE_PATH, 'images', 'icon.svg')
        self.main.add_to_fileswitcher(self, self.tabwidget, self.clients,
                                      QIcon(icon_path))
        self.recent_notebook_menu.aboutToShow.connect(self.setup_menu_actions)
481963
function Plugin(option) {
    return this.each(function () {
      var $this = $(this);
      var data  = $this.data(DataKey);

      if (!data) {
        var options = $.extend({}, Default, $this.data(), typeof option == 'object' && option);
        $this.data(DataKey, (data = new ControlSidebar($this, options)));
      }

      if (typeof option == 'string') data.toggle();
    });
  }
1117124
function Plugin(options) {
    if (this.length) {
      if (options === 'reset') {
        $(document).trigger('resetStart.bui.filterable');
      } else {
        $(document).trigger('filter.bui.filterable');
      }

      this.each(function () {
        var data;
        var $this = $(this);

        data = $this.data('bui.filterable');
        if (!data) {
          data = new Filterable($this);
          $this.data('bui.filterable', data);
        }

        if (options === 'reset') {
          data.resetFilter();
        } else {
          data.filter(options);
        }
      });

      if (options === 'reset') {
        $(document).trigger('resetEnd.bui.filterable');
      } else {
        $(document).trigger('filtered.bui.filterable');
      }
    }

    return this;
  }
818020
function() {

    // Switch based on framework
    // @todo: what does this look like on wordpress/backdrop
    switch (app.config.pluginconfig.pantheon.framework) {
      case 'drupal': return commands.drush(['rr']);
      case 'drupal8': return commands.drush(['cr']);
      //case 'wordpress': return wp(['']);
      //case 'backdrop': return drush(['cr'])
      default: return true;
    }

  }
216616
function (plugin) {
                var self = this;
                if (typeof plugin === 'function') {
                    var Plugin = plugin;
                    plugin = new Plugin();
                }    // initialize plugin
                     //noinspection JSUnresolvedVariable
                // initialize plugin
                //noinspection JSUnresolvedVariable
                if (plugin.pluginInitializer) {
                    // noinspection JSUnresolvedFunction
                    plugin.pluginInitializer(self);
                }
                self.get('plugins').push(plugin);
                return self;
            }