mirror of
https://github.com/friendica/friendica
synced 2025-04-26 17:50:11 +00:00
Code organisation and documentation of JS hook code
This commit is contained in:
parent
ef01dfefd4
commit
a11103a3a7
2 changed files with 29 additions and 14 deletions
|
@ -395,19 +395,6 @@ function NavUpdate() {
|
|||
timer = setTimeout(NavUpdate, updateInterval);
|
||||
}
|
||||
|
||||
function callAddonHooks(typeOfHook) {
|
||||
if (typeof addon_hooks !== 'undefined') {
|
||||
var myTypeOfHooks = addon_hooks[typeOfHook];
|
||||
if (typeof myTypeOfHooks !== 'undefined') {
|
||||
for (addon_hook_idx = 0; addon_hook_idx < myTypeOfHooks.length; addon_hook_idx++) {
|
||||
var hookfnstr = myTypeOfHooks[addon_hook_idx];
|
||||
var hookfn = window[hookfnstr];
|
||||
if (typeof hookfn === "function") hookfn();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function liveUpdate(src) {
|
||||
if ((src == null) || stopped || !profile_uid) {
|
||||
$('.like-rotator').hide(); return;
|
||||
|
@ -473,7 +460,7 @@ function liveUpdate(src) {
|
|||
prev = ident;
|
||||
});
|
||||
|
||||
callAddonHooks("postprocess");
|
||||
callAddonHooks("postprocess_liveupdate");
|
||||
|
||||
$('.like-rotator').hide();
|
||||
if (commentBusy) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue