2 @namespace Holds functionality related to running plugins.
4 JSDOC
.PluginManager
= {
8 @param name A unique name that identifies that plugin.
9 @param handlers A collection of named functions. The names correspond to hooks in the core code.
11 JSDOC
.PluginManager
.registerPlugin
= function(/**String*/name
, /**Object*/handlers
) {
12 if (!defined(JSDOC
.PluginManager
.plugins
))
13 /** The collection of all plugins. Requires a unique name for each.
15 JSDOC
.PluginManager
.plugins
= {};
18 JSDOC
.PluginManager
.plugins
[name
] = handlers
;
22 @param hook The name of the hook that is being caught.
23 @param target Any object. This will be passed as the only argument to the handler whose
24 name matches the hook name. Handlers cannot return a value, so must modify the target
25 object to have an effect.
27 JSDOC
.PluginManager
.run
= function(/**String*/hook
, /**Mixed*/target
) {
28 for (var name
in JSDOC
.PluginManager
.plugins
) {
29 if (defined(JSDOC
.PluginManager
.plugins
[name
][hook
])) {
30 JSDOC
.PluginManager
.plugins
[name
][hook
](target
);