5118 Create Javascript hook mechanism

This commit is contained in:
Pascal Deklerck 2018-06-07 22:23:30 +02:00
parent b53e74d989
commit d488512ca0
3 changed files with 33 additions and 0 deletions

12
view/js/addon-hooks.js Normal file
View file

@ -0,0 +1,12 @@
var addon_hooks={};
function Addon_registerHook( type, hookfnstr )
{
if (!addon_hooks.hasOwnProperty(type)) {
addon_hooks[type]=[];
}
addon_hooks[type].push( hookfnstr );
console.log("addon_hooks type "+type+" has "+addon_hooks[type].length+" hooks registered");
}