MDL-43856 MathJax: Improvements to the MathJax filter

* Remove all traces of mathjax from the atto equation editor - it is filter agnostic
* Add a M.core.event module for core events that can be published/subscribed to by plugins (loose coupling)
* Add a FILTER_CONTENT_UPDATED event so plugins can tell the filter system when nodes are added to the page
* Implement a listener for this event in the MathJax filter
* Fire this event from the equation editor and from the glossary filter
* Add a nolink tag to the mathjax filter, so equations will not be processed by the other filters
* Add a smarter throttle function to the equation editor preview updates (Y.throttle is dumb)
This commit is contained in:
Damyon Wiese
2014-04-03 14:36:36 +08:00
parent 289ed254a7
commit cc90cedc85
26 changed files with 656 additions and 240 deletions
+6 -13
View File
@@ -44,6 +44,12 @@ if ($ADMIN->fulltree) {
PARAM_RAW);
$settings->add($item);
$item = new admin_setting_configcheckbox('filter_mathjaxloader/texfiltercompatibility',
new lang_string('texfiltercompatibility', 'filter_mathjaxloader'),
new lang_string('texfiltercompatibility_help', 'filter_mathjaxloader'),
0);
$settings->add($item);
$default = '
MathJax.Hub.Config({
config: ["MMLorHTML.js", "Safe.js"],
@@ -58,19 +64,6 @@ MathJax.Hub.Config({
mpMouse: true
},
errorSettings: { message: ["!"] },
tex2jax: {
skipTags: ["script","noscript","style","textarea"],
inlineMath: [
["\\\\(","\\\\)"],
["$$","$$"],
["\\\\[","\\\\]"]
],
displayMath: [
["[tex]","[/tex]"],
],
balanceBraces: true,
preview: "TeX"
},
skipStartupTypeset: true,
messageStyle: "none"
});