diff --git a/code/hooks.js b/code/hooks.js index 1de476f3..1dce5d8e 100644 --- a/code/hooks.js +++ b/code/hooks.js @@ -85,6 +85,13 @@ window.runHooks = function(event, data) { return !interrupted; } +// helper method to allow plugins to create new hooks +window.pluginCreateHook = function(event) { + if($.inArray(event, window.VALID_HOOKS) < 0) { + window.VALID_HOOKS.push(event); + } +} + window.addHook = function(event, callback) { if(VALID_HOOKS.indexOf(event) === -1) {