mirror of
https://github.com/friendica/friendica
synced 2025-04-24 13:10:11 +00:00
5118 Create Javascript hook mechanism
This commit is contained in:
parent
b53e74d989
commit
d488512ca0
3 changed files with 33 additions and 0 deletions
12
view/js/addon-hooks.js
Normal file
12
view/js/addon-hooks.js
Normal 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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue