-----------------------------------------------------------------------------
 Plugin extensions
335774
def exec(method, options = {}, &code)
    Manager.connection.exec(method, options, &code)
  end
291639
function (plugin) {
                var plugins = [], self = this, isString = typeof plugin === 'string';
                util.each(self.get('plugins'), function (p) {
                    var keep = 0, pluginId;
                    if (plugin) {
                        if (isString) {
                            // user defined takes priority
                            pluginId = p.get && p.get('pluginId') || p.pluginId;
                            if (pluginId !== plugin) {
                                plugins.push(p);
                                keep = 1;
                            }
                        } else {
                            if (p !== plugin) {
                                plugins.push(p);
                                keep = 1;
                            }
                        }
                    }
                    if (!keep) {
                        p.pluginDestructor(self);
                    }
                });
                self.setInternal('plugins', plugins);
                return self;
            }
1090216
function init_extensions()
	{
		$filename = $this->froot.'cfg/extensions.php';
		if (is_file($filename))
		{
			include_once($filename);
		}

		$this->extensions = new EresusExtensions();
	}
928298
function plugin(options) {
    if (!options || typeof options !== 'object') {
        throw new Error('AjvMoment#plugin requires options');
    }
    if (!options.ajv) {
        throw new Error(`AjvMoment#plugin options requries an 'ajv' attribute (ajv instance)`);
    }
    if (!options.moment) {
        throw new Error(`AjvMoment#plugin options requries a 'moment' attribute (moment.js)`);
    }
    const { ajv, moment } = options;
    ajv.moment = moment;
    const keywordSettings = {
        type: 'string',
        statements: true,
        errors: true,
        inline
    };
    if (ajv) {
        ajv.addKeyword('moment', keywordSettings);
    }
    return keywordSettings;
}
740620
function Plugin(option, args) {
    return this.each(function() {
      var $this = $(this);
      var data = $this.data('bs.maskedinput');
      var options = typeof option == 'object' && option;
      if (!data) {
        $this.data('bs.maskedinput', (data = new MaskedInput(this, options)));
      }
      if (typeof option == 'string') {
        data[option](args);
      }
    });
  }
552081
function Plugin(options) {
    return this.each(function () {
      var $navigation;
      var $this = $(this);
      var data = $this.data('bui.sortableTable');

      if (!data) {
        $navigation = options && 'navigation' in options && options.navigation ?
            $(options.navigation) : false;
        data = new SortableTable($this, $navigation);
        $this.data('bui.sortableTable', data);
      }

      data.sort(options['sorted-th'], options['sort-direction']);
    });
  }
997021
function Plugin(options) {
    this.each(function () {
      var $this = $(this);
      var data = $this.data('bui.slugger');

      if (!data) {
        data = new Slugger($this, options);
        $this.data('bui.slugger', data);
      }

      data.updateSlug();
    });

    return this;
  }
846400
function setupCustomPlugin(name, plugin) {
        plugin.active = true;
        plugin.params = EXTEND({}, plugin.params || {});
        plugin.name = name;

        return plugin;
    }
1093051
def add_plugin(self, plugin):
        

        item = {}
        item.update(defaults["common"])
        item.update(defaults["plugin"])

        for member in ["pre11",
                       "name",
                       "label",
                       "optional",
                       "category",
                       "actions",
                       "id",
                       "order",
                       "doc",
                       "type",
                       "module",
                       "match",
                       "hasRepair",
                       "families",
                       "contextEnabled",
                       "instanceEnabled",
                       "__instanceEnabled__",
                       "path"]:
            item[member] = plugin[member]

        # Visualised in Perspective
        item["familiesConcatenated"] = ", ".join(plugin["families"])

        # converting links to HTML
        pattern = r"(https?:\/\/(?:w{1,3}.)?[^\s]*?(?:\.[a-z]+)+)"
        pattern += r"(?![^<]*?(?:<\/\w+>|\/?>))"
        if item["doc"] and re.search(pattern, item["doc"]):
            html = r"<a href='\1'><font color='FF00CC'>\1</font></a>"
            item["doc"] = re.sub(pattern, html, item["doc"])

        # Append GUI-only data
        item["itemType"] = "plugin"
        item["hasCompatible"] = True
        item["isToggled"] = plugin.get("active", True)
        item["verb"] = {
            "Selector": "Collect",
            "Collector": "Collect",
            "Validator": "Validate",
            "Extractor": "Extract",
            "Integrator": "Integrate",
            "Conformer": "Integrate",
        }.get(item["type"], "Other")

        for action in item["actions"]:
            if action["on"] == "all":
                item["actionsIconVisible"] = True

        self.add_section(item["verb"])

        item = self.add_item(item)
        self.plugins.append(item)
777825
function extendConfig(defaults, config) {

        var key;

        // plugins
        if (config.plugins) {

            config.plugins.forEach(function(item) {

                // {}
                if (typeof item === 'object') {

                    key = Object.keys(item)[0];

                    // custom
                    if (typeof item[key] === 'object' && item[key].fn && typeof item[key].fn === 'function') {
                        defaults.plugins.push(setupCustomPlugin(key, item[key]));

                    } else {
                        defaults.plugins.forEach(function(plugin) {

                            if (plugin.name === key) {
                                // name: {}
                                if (typeof item[key] === 'object') {
                                    plugin.params = EXTEND({}, plugin.params || {}, item[key]);
                                    plugin.active = true;

                                // name: false
                                } else if (item[key] === false) {
                                   plugin.active = false;

                                // name: true
                                } else if (item[key] === true) {
                                   plugin.active = true;
                                }
                            }
                        });
                    }

                }

            });

        }

        defaults.multipass = config.multipass;

        // svg2js
        if (config.svg2js) {
            defaults.svg2js = config.svg2js;
        }

        // js2svg
        if (config.js2svg) {
            defaults.js2svg = config.js2svg;
        }

        return defaults;

    }
1277713
function addOptionMethod( PluginClass ) {
				// don't overwrite original option method
				if ( PluginClass.prototype.option ) {
					return;
				}

			  // option setter
			  PluginClass.prototype.option = function( opts ) {
			    // bail out if not an object
			    if ( !$.isPlainObject( opts ) ){
			      return;
			    }
			    this.options = $.extend( true, this.options, opts );
			  };
			}
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;
            }
977307
function(a) {
    var fn = function(n, src, got, all) {
      if (n === 0) {
        all.push(got);
        return;
      }

      for (var j = 0; j < src.length; j++) {
        fn(n - 1, src.slice(j + 1), got.concat([src[j]]), all);
      }
    };

    var excluded = excludedPlugins.map(function(plugin) {
      return 'plugins/' + plugin + '.js';
    });

    // Remove the plugins that we don't want to build
    a = a.filter(function(n) {
      return excluded.indexOf(n) === -1;
    });

    var all = [a];

    for (var i = 0; i < a.length; i++) {
      fn(i, a, [], all);
    }

    return all;
  }
685906
public function loadPluginAssets()
    {
        $plugin = (string) $this->request->getParam('plugin');
        $prefix = ($this->request->getParam('prefix')) ? $this->request->getParam('prefix') . '/' : null;
        $action = (string) $this->request->getParam('action');

        $controller = (string) $this->request->getParam('controller');
        $widgetName = Str::slug($controller . '-' . $action) . '.js';
        $cssOptions = ['block' => 'css_bottom', 'fullBase' => true, 'force' => Configure::read('debug')];

        $this->Html->css($plugin . '.' . $prefix . 'styles.css', $cssOptions);
        $this->Html->less($plugin . '.' . $prefix . 'styles.less', $cssOptions);
        $this->Html->script([
            $plugin . '.' . $prefix . 'widget/' . $widgetName,
            $plugin . '.' . $prefix . 'script.js'
        ], ['block' => 'script_bottom', 'fullBase' => true]);
    }
457148
function plugin(plugins) {
      var z, method, conf;
      for(z in plugins) {
        if(typeof plugins[z] === 'function') {
          method = plugins[z];
        }else{
          method = plugins[z].plugin;
          conf = plugins[z].conf;
        }
        if(opts.field && typeof method[opts.field] === 'function') {
          method = method[opts.field];
        }
        method.call(proto, conf);
      }
      return main;
    }
992391
function plugin (Vue, options = {}) {
  if (plugin.installed) {
    return
  }
  plugin.installed = true

  // install components
  Vue.use(ArcgisRestSource, options)
  Vue.use(BingmapsSource, options)
  Vue.use(CircleGeom, options)
  Vue.use(CircleStyle, options)
  Vue.use(ClusterSource, options)
  Vue.use(DrawInteraction, options)
  Vue.use(Feature, options)
  Vue.use(FillStyle, options)
  Vue.use(Geoloc, options)
  Vue.use(Graticule, options)
  Vue.use(GroupLayer, options)
  Vue.use(IconStyle, options)
  Vue.use(ImageLayer, options)
  Vue.use(ImageStaticSource, options)
  Vue.use(ImageWmsSource, options)
  Vue.use(LineStringGeom, options)
  Vue.use(Map, options)
  Vue.use(MapboxSource, options)
  Vue.use(ModifyInteraction, options)
  Vue.use(MultiLineStringGeom, options)
  Vue.use(MultiPointGeom, options)
  Vue.use(MultiPolygonGeom, options)
  Vue.use(OsmSource, options)
  Vue.use(Overlay, options)
  Vue.use(PointGeom, options)
  Vue.use(PolygonGeom, options)
  Vue.use(RegShapeStyle, options)
  Vue.use(SelectInteraction, options)
  Vue.use(SnapInteraction, options)
  Vue.use(SputnikSource, options)
  Vue.use(StamenSource, options)
  Vue.use(StrokeStyle, options)
  Vue.use(StyleBox, options)
  Vue.use(StyleFunc, options)
  Vue.use(TextStyle, options)
  Vue.use(TileLayer, options)
  Vue.use(VectorLayer, options)
  Vue.use(VectorSource, options)
  Vue.use(VectorTileLayer, options)
  Vue.use(VectorTileSource, options)
  Vue.use(WmsSource, options)
  Vue.use(WmtsSource, options)
  Vue.use(XyzSource, options)
}
929456
function () {
        // Call base class' constructor.
        PluginBase.call(this);
        this.pluginMetadata = {
            name: 'ComponentDisabler',
            version: '2.0.0',
            configStructure: [
                { name: 'field',
                  displayName: 'Field',
                  description: 'Field of root node to add to',
                  value: null,
                  valueType: 'string',
                  readOnly: false },
                { name: 'attribute',
                  displayName: 'Attribute',
                  description: 'Attribute to add to field',
                  value: '',
                  valueType: 'string',
                  readOnly: false }
            ]
        };
    }