mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 05:03:42 +00:00
5118 Implement MathJax JS hook to update contents after live update
This commit is contained in:
parent
3540d3d2d6
commit
b5fe8d61dd
2 changed files with 12 additions and 0 deletions
5
mathjax/mathjax.js
Normal file
5
mathjax/mathjax.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
Addon_registerHook("postprocess","mathjax_postprocess_liveupdate");
|
||||
function mathjax_postprocess_liveupdate()
|
||||
{
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
|
||||
}
|
|
@ -16,12 +16,19 @@ function mathjax_install() {
|
|||
Addon::registerHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
|
||||
Addon::registerHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
|
||||
Addon::registerHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
|
||||
Addon::registerHook('template_vars','addon/mathjax/mathjax.php', 'mathjax_template_vars');
|
||||
logger('installed js_math addon');
|
||||
}
|
||||
|
||||
function mathjax_template_vars($a, &$arr) {
|
||||
$arr['vars']['addon_hooks'][] = "mathjax";
|
||||
}
|
||||
|
||||
function mathjax_uninstall() {
|
||||
Addon::unregisterHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
|
||||
Addon::unregisterHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
|
||||
Addon::unregisterHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
|
||||
Addon::unregisterHook('template_vars','addon/mathjax/mathjax.php', 'mathjax_template_vars');
|
||||
}
|
||||
function mathjax_settings_post ($a, $post) {
|
||||
if (! local_user())
|
||||
|
|
Loading…
Reference in a new issue