Sha256: 97a3d929674cfe91bd23687355cf1fe166bfa958dba988d63433d35a02838224

Contents?: true

Size: 1.06 KB

Versions: 10

Compression:

Stored size: 1.06 KB

Contents

/**
  @namespace Holds functionality related to running plugins.
*/
JSDOC.PluginManager = {
}

/**
  @param name A unique name that identifies that plugin.
  @param handlers A collection of named functions. The names correspond to hooks in the core code.
*/
JSDOC.PluginManager.registerPlugin = function(/**String*/name, /**Object*/handlers) {
  if (!defined(JSDOC.PluginManager.plugins))
    /** The collection of all plugins. Requires a unique name for each.
    */
    JSDOC.PluginManager.plugins = {};
  
  
  JSDOC.PluginManager.plugins[name] = handlers;
}

/**
  @param hook The name of the hook that is being caught.
  @param target Any object. This will be passed as the only argument to the handler whose
  name matches the hook name. Handlers cannot return a value, so must modify the target
  object to have an effect.
*/
JSDOC.PluginManager.run = function(/**String*/hook, /**Mixed*/target) {
  for (var name in JSDOC.PluginManager.plugins) {
    if (defined(JSDOC.PluginManager.plugins[name][hook])) {
      JSDOC.PluginManager.plugins[name][hook](target);
    }
  }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sproutcore-0.9.15 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.14 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.18 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.16 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.17 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.19 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.22 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.20 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.21 jsdoc/app/lib/JSDOC/PluginManager.js
sproutcore-0.9.23 jsdoc/app/lib/JSDOC/PluginManager.js