diff --git a/KiwixWebApp.jsproj.user b/KiwixWebApp.jsproj.user index 6d8f5393..1a8add84 100644 --- a/KiwixWebApp.jsproj.user +++ b/KiwixWebApp.jsproj.user @@ -21,6 +21,6 @@ F0AB49D8-754C-4531-A635-E6B4395FD39A;Mobile Emulator 10.0.15063.0 QHD 5.2 inch 3GB - AppHostDeviceDebugger + AppHostLocalDebugger \ No newline at end of file diff --git a/bin/Release/AppX/vs.appxrecipe b/bin/Release/AppX/vs.appxrecipe index beb5108c..5f2a55bf 100644 --- a/bin/Release/AppX/vs.appxrecipe +++ b/bin/Release/AppX/vs.appxrecipe @@ -32,7 +32,7 @@ AppxManifest.xml true - 2017-08-07T05:59:43.248 + 2017-08-07T07:17:46.496 @@ -531,7 +531,7 @@ www\js\app.js - 2017-08-07T05:50:10.176 + 2017-08-07T06:45:19.435 www\js\init.js @@ -603,7 +603,7 @@ www\js\MathJax\config\config.js - 2017-08-05T18:18:34.635 + 2017-08-07T07:17:27.329 www\js\MathJax\extensions\a11y\accessibility-menu.js @@ -1456,7 +1456,7 @@ resources.pri true - 2017-08-07T05:58:16.299 + 2017-08-07T06:40:52.194 diff --git a/bin/Release/AppX/www/js/MathJax/config/config.js b/bin/Release/AppX/www/js/MathJax/config/config.js index 9a034620..d81b86f4 100644 --- a/bin/Release/AppX/www/js/MathJax/config/config.js +++ b/bin/Release/AppX/www/js/MathJax/config/config.js @@ -1,6 +1,9 @@ MathJax.Hub.Config({ extensions: ["tex2jax.js"], jax: ["input/TeX", "output/HTML-CSS"], + TeX: { + extensions: ["AMSmath.js", "AMSsymbols.js"] + }, "HTML-CSS": { availableFonts: ["TeX"], imageFont: null @@ -10,10 +13,4 @@ MathJax.Hub.Config({ showFontMenu: false, showLocale: false } -}); -function Typeset(element) { - MathJax.Hub.Queue(["Typeset", MathJax.Hub, element]); -} -function Configured() { - MathJax.Hub.Configured(); -} +}); \ No newline at end of file diff --git a/bin/Release/AppX/www/js/app.js b/bin/Release/AppX/www/js/app.js index 3683bf61..8e7f0d28 100644 --- a/bin/Release/AppX/www/js/app.js +++ b/bin/Release/AppX/www/js/app.js @@ -1320,25 +1320,27 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles //TESTING if (countImages <= maxVisibleSliceSize + prefetchSliceSize) { console.timeEnd("Time to Document Ready"); } - //Use the MathJax method of typesetting formulae if user has requested this - if (params['useMathJax']) { - var counter = 0; - $(svgSlice).each(function () { - var node = this; - if (/mwe-math-fallback-image/i.test(node.className) && node.alt) { - var text = node.alt; - var script = document.createElement("script"); - script.type = "math/tex"; - script.text = text; - $(this).replaceWith(script); - console.log("Typesetting image #" + countImages + "..."); - countImages++; - svgSlice.splice(counter, 1); - } else { - counter++; - } - }); - window.frames[0].MathJax.Hub.Queue(["Typeset", window.frames[0].MathJax.Hub]); + if (svgSlice.length) { + //Use the MathJax method of typesetting formulae if user has requested this + if (params['useMathJax'] && window.frames[0].MathJax) { + var counter = 0; + $(svgSlice).each(function () { + var node = this; + if (/mwe-math-fallback-image/i.test(node.className) && node.alt) { + var text = node.alt; + var script = document.createElement("script"); + script.type = "math/tex"; + script.text = text; + $(this).replaceWith(script); + console.log("Typesetting image #" + countImages + "..."); + countImages++; + svgSlice.splice(counter, 1); + } else { + counter++; + } + }); + window.frames[0].MathJax.Hub.Queue(["Typeset", window.frames[0].MathJax.Hub]); + } } //If there are any SVGs left which were not dealt with by MathJax, process fallback images if (svgSlice.length) { diff --git a/www/js/MathJax/config/config.js b/www/js/MathJax/config/config.js index 9a034620..d81b86f4 100644 --- a/www/js/MathJax/config/config.js +++ b/www/js/MathJax/config/config.js @@ -1,6 +1,9 @@ MathJax.Hub.Config({ extensions: ["tex2jax.js"], jax: ["input/TeX", "output/HTML-CSS"], + TeX: { + extensions: ["AMSmath.js", "AMSsymbols.js"] + }, "HTML-CSS": { availableFonts: ["TeX"], imageFont: null @@ -10,10 +13,4 @@ MathJax.Hub.Config({ showFontMenu: false, showLocale: false } -}); -function Typeset(element) { - MathJax.Hub.Queue(["Typeset", MathJax.Hub, element]); -} -function Configured() { - MathJax.Hub.Configured(); -} +}); \ No newline at end of file diff --git a/www/js/app.js b/www/js/app.js index 9fbb2c0c..8e7f0d28 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1322,7 +1322,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles if (svgSlice.length) { //Use the MathJax method of typesetting formulae if user has requested this - if (params['useMathJax']) { + if (params['useMathJax'] && window.frames[0].MathJax) { var counter = 0; $(svgSlice).each(function () { var node = this;