Add extensions information to the about box, and add browser and font type

This commit is contained in:
Davide P. Cervone 2011-02-28 14:08:59 -05:00
parent bc193eedd2
commit 0c11aa2bf6
10 changed files with 27 additions and 18 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,8 @@
(function (HUB,HTML,AJAX) { (function (HUB,HTML,AJAX) {
var VERSION = "1.0.4"; var VERSION = "1.0.4";
MathJax.Extension.MathMenu = {version: VERSION};
var isPC = HUB.Browser.isPC, isMSIE = HUB.Browser.isMSIE; var isPC = HUB.Browser.isPC, isMSIE = HUB.Browser.isMSIE;
var ROUND = (isPC ? null : "5px"); var ROUND = (isPC ? null : "5px");
@ -501,17 +503,23 @@
MENU.About = function () { MENU.About = function () {
var HTMLCSS = MathJax.OutputJax["HTML-CSS"] || {fontInUse: ""}; var HTMLCSS = MathJax.OutputJax["HTML-CSS"] || {fontInUse: ""};
var local = (HTMLCSS.webFonts ? "" : "local "), web = (HTMLCSS.webFonts ? " web" : ""); var local = (HTMLCSS.webFonts ? "" : "local "), web = (HTMLCSS.webFonts ? " web" : "");
var font = (HTMLCSS.imgFonts ? "Image" : local+HTMLCSS.fontInUse+web); var font = (HTMLCSS.imgFonts ? "Image" : local+HTMLCSS.fontInUse+web) + " fonts";
var jax = []; var jax = [];
MENU.About.GetJax(jax,MathJax.InputJax,"Input"); MENU.About.GetJax(jax,MathJax.InputJax,"Input Jax");
MENU.About.GetJax(jax,MathJax.OutputJax,"Output"); MENU.About.GetJax(jax,MathJax.OutputJax,"Output Jax");
MENU.About.GetJax(jax,MathJax.ElementJax,"Element"); MENU.About.GetJax(jax,MathJax.ElementJax,"Element Jax");
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]);
MENU.About.GetJax(jax,MathJax.Extension,"Extension",true);
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}],["center",{},[
HUB.Browser + " v"+HUB.Browser.version +
(HTMLCSS.webFonts ? " \u2014 "+HTMLCSS.allowWebFonts+" fonts" : "")
]]);
MENU.About.div = MENU.Background(MENU.About); MENU.About.div = MENU.Background(MENU.About);
var about = MathJax.HTML.addElement(MENU.About.div,"div",{ var about = MathJax.HTML.addElement(MENU.About.div,"div",{
id: "MathJax_About", onclick: MENU.About.Remove id: "MathJax_About", onclick: MENU.About.Remove
},[ },[
["b",{style:{fontSize:"120%"}},["MathJax"]]," v"+MathJax.version,["br"], ["b",{style:{fontSize:"120%"}},["MathJax"]]," v"+MathJax.version,["br"],
"using "+font+" fonts",["br"],["br"], "using "+font,["br"],["br"],
["span",{style:{ ["span",{style:{
display:"inline-block", "text-align":"left", "font-size":"80%", display:"inline-block", "text-align":"left", "font-size":"80%",
"background-color":"#E4E4E4", padding:".4em .6em", border:"1px inset" "background-color":"#E4E4E4", padding:".4em .6em", border:"1px inset"
@ -532,13 +540,14 @@
MENU.About.Remove = function (event) { MENU.About.Remove = function (event) {
if (MENU.About.div) {document.body.removeChild(MENU.About.div); delete MENU.About.div} if (MENU.About.div) {document.body.removeChild(MENU.About.div); delete MENU.About.div}
}; };
MENU.About.GetJax = function (jax,JAX,type) { MENU.About.GetJax = function (jax,JAX,type,noTypeCheck) {
for (var id in JAX) {if (JAX.hasOwnProperty(id)) { for (var id in JAX) {if (JAX.hasOwnProperty(id) && JAX[id]) {
if (JAX[id].isa && JAX[id].isa(JAX)) if (noTypeCheck || (JAX[id].isa && JAX[id].isa(JAX)))
{jax.push(JAX[id].id+" "+type+" Jax v"+JAX[id].version,["br"])} {jax.push((JAX[id].id||id)+" "+type+" v"+JAX[id].version,["br"])}
}} }}
return jax; return jax;
}; };
/* /*
* Handle the MathJax HELP menu * Handle the MathJax HELP menu