helper function for plugins to create new hooks

This commit is contained in:
Jon Atkins 2014-07-04 19:38:21 +01:00
parent 2a35330fb7
commit 2e4b54e868

View File

@ -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) {