From 8204d27ab03a9cec7455360e7ccbdc612b9236f3 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 14 Feb 2011 20:24:14 -0500 Subject: [PATCH] Update tests to work with changes in HTML jax (different timing of the setup for HTMLCSS.Fonts object). Remove test for version 1 of fonts (now that fonts are in the archive). Update warning messages for current usage, and switch SourceForge references. --- test/index.html | 72 +++++++++++++------------------------------------ 1 file changed, 19 insertions(+), 53 deletions(-) diff --git a/test/index.html b/test/index.html index a7b27c98b..68d7540f8 100644 --- a/test/index.html +++ b/test/index.html @@ -19,21 +19,20 @@ jax: ["input/TeX","output/HTML-CSS"], "HTML-CSS": { availableFonts:[], - styles: {".MathJax_Preview": {visibility: "hidden"}}, - Augment: { - Font: { - loadError: function (font) { - MathJax.Message.Set("Can't load web font TeX/"+font.directory,null,2000); - document.getElementById("noWebFont").style.display = ""; - }, - firefoxFontError: function (font) { - MathJax.Message.Set("Firefox can't load web fonts from a remote host",null,3000); - document.getElementById("ffWebFont").style.display = ""; - } - } - } + styles: {".MathJax_Preview": {visibility: "hidden"}} } }); + MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { + var FONT = MathJax.OutputJax["HTML-CSS"].Font; + FONT.loadError = function (font) { + MathJax.Message.Set("Can't load web font TeX/"+font.directory,null,2000); + document.getElementById("noWebFont").style.display = ""; + }; + FONT.firefoxFontError = function (font) { + MathJax.Message.Set("Firefox can't load web fonts from a remote host",null,3000); + document.getElementById("ffWebFont").style.display = ""; + }; + }); (function (HUB) { @@ -59,11 +58,7 @@ MathJax.Hub.Register.StartupHook("End",function () { var HTMLCSS = MathJax.OutputJax["HTML-CSS"]; - var MAIN = HTMLCSS.FONTDATA.FONTS["MathJax_Main"]; - if (MAIN.version < 2) { - document.getElementById("version").innerHTML = MAIN.version; - document.getElementById("webfonts").style.display=""; - } else if (HTMLCSS.imgFonts) { + if (HTMLCSS.imgFonts) { alert("The browser you are using does not seem to support web-based " + "fonts, so we can't test the MathJax web fonts with this browser " + "(image fonts have been used instead)\n\n" + @@ -85,12 +80,6 @@ If your browser supports JavaScript, be sure it is enabled.
- -

MathJax Test Page

If you see typeset mathematics below, then MathJax is working. If you see @@ -119,35 +108,12 @@ MathJax is not working! -

- - - -

@@ -158,8 +124,8 @@ above: the radial will be out of place.