40 275
ediciones
m (oops) |
m (always forward args) |
||
// this gadget sets up all the extra hooks that the coppermind uses for it's other gadgets
mw.hook('wikipage.content').add(function extra_hooks(content) {
/// hook for catching particular pages
const page_hook = mw.config.get('wgPageName')
console.debug('extra-hook:', page_hook)
mw.hook(page_hook).fire(content)
}
const ns_hook = 'mw-ns-'+ mw.config.get('wgNamespaceNumber')
console.debug('extra-hook:', ns_hook)
mw.hook(ns_hook).fire(content)
}
const act_hook = 'mw-action.'+ mw.config.get('wgAction')
console.debug('extra-hook:', act_hook)
mw.hook(act_hook).fire(content)
}
const act_hook = 'mw-action.just-saved'
console.debug('extra-hook:', act_hook)
mw.hook(act_hook).fire(content)
}
|