mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-79039-master' of https://github.com/andrewnicols/moodle
This commit is contained in:
commit
394dbffc24
2
filter/mathjaxloader/amd/build/loader.min.js
vendored
2
filter/mathjaxloader/amd/build/loader.min.js
vendored
@ -6,6 +6,6 @@ define("filter_mathjaxloader/loader",["exports","core_filters/events"],(function
|
||||
* @copyright 2014 Damyon Wiese <damyon@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
let lang="",configured=!1;_exports.configure=params=>{let script=document.createElement("script");script.type="text/x-mathjax-config",script[window.opera?"innerHTML":"text"]=params.mathjaxconfig,document.getElementsByTagName("head")[0].appendChild(script),lang=params.lang,document.addEventListener(_events.eventTypes.filterContentUpdated,contentUpdated)};const setLocale=()=>{configured||void 0!==window.MathJax&&(window.MathJax.Hub.Queue((function(){window.MathJax.Localization.setLocale(lang)})),window.MathJax.Hub.Configured(),configured=!0)};_exports.typeset=()=>{if(!configured){setLocale();const elements=document.getElementsByClassName("filter_mathjaxloader_equation");elements&&elements.forEach((element=>{void 0!==window.MathJax&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,element])}))}};const contentUpdated=event=>{if(void 0===window.MathJax)return;const processDelay=window.MathJax.Hub.processSectionDelay;window.MathJax.Hub.processSectionDelay=0,window.MathJax.Hub.Config({positionToHash:!1}),setLocale(),event.detail.nodes.forEach((node=>{node.getElementsByClassName("filter_mathjaxloader_equation").forEach((node=>{window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,node])}))})),window.MathJax.Hub.processSectionDelay=processDelay};_exports.contentUpdated=contentUpdated}));
|
||||
let lang="",configured=!1;_exports.configure=params=>{let script=document.createElement("script");script.type="text/x-mathjax-config",script[window.opera?"innerHTML":"text"]=params.mathjaxconfig,document.getElementsByTagName("head")[0].appendChild(script),lang=params.lang,document.addEventListener(_events.eventTypes.filterContentUpdated,contentUpdated)};const setLocale=()=>{configured||void 0!==window.MathJax&&(window.MathJax.Hub.Queue((function(){window.MathJax.Localization.setLocale(lang)})),window.MathJax.Hub.Configured(),configured=!0)};_exports.typeset=()=>{if(!configured){setLocale();const elements=document.getElementsByClassName("filter_mathjaxloader_equation");elements&&elements.forEach((element=>{void 0!==window.MathJax&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,element])}))}};const contentUpdated=event=>{if(void 0===window.MathJax)return;const processDelay=window.MathJax.Hub.processSectionDelay;window.MathJax.Hub.processSectionDelay=0,window.MathJax.Hub.Config({positionToHash:!1}),setLocale(),event.detail.nodes.forEach((node=>{if(!(node instanceof HTMLElement))return;node.getElementsByClassName("filter_mathjaxloader_equation").forEach((node=>{window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,node])}))})),window.MathJax.Hub.processSectionDelay=processDelay};_exports.contentUpdated=contentUpdated}));
|
||||
|
||||
//# sourceMappingURL=loader.min.js.map
|
File diff suppressed because one or more lines are too long
@ -116,6 +116,10 @@ export const contentUpdated = (event) => {
|
||||
setLocale();
|
||||
// The list of HTMLElements in an Array.
|
||||
event.detail.nodes.forEach((node) => {
|
||||
if (!(node instanceof HTMLElement)) {
|
||||
// We may have been passed a #text node.
|
||||
return;
|
||||
}
|
||||
const mathjaxElements = node.getElementsByClassName('filter_mathjaxloader_equation');
|
||||
mathjaxElements.forEach((node) => {
|
||||
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub, node]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user