PluginApiHelper

Provides plugin API help.
 
Constructor.
@param {Object} plugin - A minimal plugin object providing only the plugin id.
@constructor
347716
function PluginApiHelper(plugin) {
    this.plugin = plugin;

    /**
     * Public functions
     */

    // Return a properly formed API root of the specifed plugin.
    this.apiRoot = function() {
      return '/' + this.plugin.id;
    };

    // Return the user configuration of the plugin.
    this.getConfig = function(configId) {
      // If no configId specified then use 'default'.
      configId = configId || 'default';

      var config = {};
      var session = Session.getInstance();

      if (session.plugin.userConfig &&
        session.plugin.userConfig[this.plugin.id] &&
        session.plugin.userConfig[this.plugin.id][configId]) {

        config = session.plugin.userConfig[this.plugin.id][configId];
      }
      return config;
    };

    return this;
  }
504884
function Plugin(regexp, replacer, id) {
    // return value should be a callable function
    // with strictly defined options passed by markdown-it
    var self = function(md, options) {
        self.options = options;
        self.init(md);
    };

    // initialize plugin object
    self.__proto__ = Plugin.prototype;

    // clone regexp with all the flags
    var flags = (regexp.global ? 'g' : '') + (regexp.multiline ? 'm' : '') + (regexp.ignoreCase ? 'i' : '');

    self.regexp = RegExp('^' + regexp.source, flags);

    // copy init options
    self.replacer = replacer;

    // this plugin can be inserted multiple times,
    // so we're generating unique name for it
    self.id = id ? id : 'regexp-' + counter;
    counter++;

    return self;
}
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;
}
1234882
function(plugin) {
		
		var self = this;
		
		// getter
		if (typeof plugin == 'string') {
			
			var pluginName = plugin,
				p = null;
			
			// if the namespace is provided, it's easy to search
			if (pluginName.indexOf('.') > 0) {
				p = self.__plugins[pluginName];
			}
			// otherwise, return the first name that matches
			else {
				$.each(self.__plugins, function(i, plugin) {
					
					if (plugin.name.substring(plugin.name.length - pluginName.length - 1) == '.'+ pluginName) {
						p = plugin;
						return false;
					}
				});
			}
			
			return p;
		}
		// setter
		else {
			
			// force namespaces
			if (plugin.name.indexOf('.') < 0) {
				throw new Error('Plugins must be namespaced');
			}
			
			self.__plugins[plugin.name] = plugin;
			
			// if the plugin has core features
			if (plugin.core) {
				
				// bridge non-private methods onto the core to allow new core methods
				self.__bridge(plugin.core, self, plugin.name);
			}
			
			return this;
		}
	}
165298
def _new_plugin(self, plugin):
        

        # First store the plugin info into our data store
        self.store_info(plugin, plugin['name'], type_tag='worker')

        # Place it into our active plugin list
        self.plugin_meta[plugin['name']] = plugin
678136
function PluginRender(pluginInstance, rendererInstance) {
    this._view = "index.jade";
    this._locals = {};

    var ns = pluginInstance.pluginNamespace, obj = PluginHelper.getPluginIdAndIId(ns), pluginId = obj.pluginId,
        req = PluginHelper.cloneRequest(rendererInstance.req, pluginId), res = rendererInstance.res;

    Object.defineProperties(req.params, {
        plugin: {
            value: obj.pluginId
        },
        iId: {
            value: obj.iId
        },
        namespace: {
            value: ns
        }
    });


    Object.defineProperties(req, {
        pluginRender: {
            value: this
        }
    });

    Object.defineProperties(this, {
        req: {
            value: req
        },
        res: {
            value: res
        },
        pluginId: {
            value: req.params.plugin
        },
        iId: {
            value: req.params.iId
        },
        plugin: {
            value: Plugins.get(req.params.plugin)
        },
        namespace: {
            value: req.params.namespace
        },
        pluginInstance: {
            value: pluginInstance
        },
        theme: {
            value: rendererInstance.theme
        },
        page: {
            value: rendererInstance.page
        },
        pluginPermissionValidator: {
            value: rendererInstance.pluginPermissionValidator
        },
        pagePermissionValidator: {
            value: rendererInstance.pagePermissionValidator
        },
        pluginInstanceDBAction: {
            value: rendererInstance.pluginInstanceDBAction
        },
        isExclusive: {
            value: rendererInstance.isExclusive
        }
    });
}
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();
    });
  }
1283277
def initialize_plugin(plugin, plugin_info, options = {})
      options = {
        :log => @log
      }.merge(options)

      unless @plugin_chain.empty?
        options.merge!(:previous_plugin => @plugin_chain.last[:plugin])
      end

      plugin.init(@config, @appliance_config, plugin_info, options)

      # Execute callbacks if implemented
      #
      # Order is very important
      [:after_init, :validate, :after_validate].each do |callback|
        plugin.send(callback) if plugin.respond_to?(callback)
      end

      param = nil

      # For operating system plugins we need to inject appliance definition.
      if plugin_info[:type] == :os
        param = @appliance_definition
      end

      @plugin_chain << {:plugin => plugin, :param => param}
    end
1309513
function PluginHelper (plugins, schema) {
  validatePlugins(plugins);
  plugins = plugins || [];

  // Clone the array of plugins, and sort by priority
  var pluginHelper = plugins.slice().sort(sortByPriority);

  /**
   * Internal stuff. Use at your own risk!
   *
   * @private
   */
  pluginHelper[__internal] = {
    /**
     * A reference to the {@link Schema} object
     */
    schema: schema,
  };

  // Return an array that "inherits" from PluginHelper
  return assign(pluginHelper, PluginHelper.prototype);
}
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;
    }
227107
function (plugin) {
                this.removePluginByName(plugin.name, plugin.type);
                logger.debug("Plugin: " + plugin.name + " has been removed");
            }
939929
function Plugin(option) {
			return this.each(function () {
				var $this = $(this);
				var data = $this.data("bs.popover");
				var options = typeof option == "object" && option;

				if (!data && /destroy|hide/.test(option)) return;
				if (!data) $this.data("bs.popover", (data = new Popover(this, options)));
				if (typeof option == "string") data[option]();
			});
		}
1012874
function Plugin(script, _interface, options) {
  this._script = script
  this._options = options || {}
  this._initialInterface = _interface || {}
  this._connect()
}
666198
function use(plugin, options){
  utils.assertString(plugin, 'plugin');

  if (options) {
    utils.assertType(options, 'object', 'options');
    options = parseObject(options);
  }

  // lookup
  plugin = plugin.string;
  var found = utils.lookup(plugin, this.options.paths, this.options.filename);
  if (!found) throw new Error('failed to locate plugin file "' + plugin + '"');

  // use
  var fn = require(path.resolve(found));
  if ('function' != typeof fn) {
    throw new Error('plugin "' + plugin + '" does not export a function');
  }
  this.renderer.use(fn(options || this.options));
}
1199928
function Plugin( element ) {
        this.element = element;
        this.jqElement = $(element);
        this.isScaleActive = false;

        this._defaults = defaults;
        this._name = pluginName;
    }
764441
function Plugin(options) {
    return this.each(function () {
      var $this = $(this);
      var data = $this.data('bui.confirmation');

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

      data.showConfirmation();
    });
  }
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();
  }