Update menu items for easier access, and use more variables to access MathJax components, when possible; remove some unneeded variables from NativeMML jax.

This commit is contained in:
Davide P. Cervone 2011-08-24 15:31:06 -04:00
parent 820afa0357
commit 3edf60dc0f
29 changed files with 125 additions and 120 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

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
*/ */
MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.1.4",directory:MathJax.InputJax.directory+"/MathML",extensionDir:MathJax.InputJax.extensionDir+"/MathML",entityDir:MathJax.InputJax.directory+"/MathML/entities",config:{useMathMLspacing:false}});MathJax.InputJax.MathML.Register("math/mml");MathJax.InputJax.MathML.loadComplete("config.js"); MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.1.5",directory:MathJax.InputJax.directory+"/MathML",extensionDir:MathJax.InputJax.extensionDir+"/MathML",entityDir:MathJax.InputJax.directory+"/MathML/entities",config:{useMathMLspacing:false}});MathJax.InputJax.MathML.Register("math/mml");MathJax.InputJax.MathML.loadComplete("config.js");

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
*/ */
MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.1",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js"); MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.2",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js");

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
*/ */
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.11",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js"); MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.12",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
*/ */
MathJax.OutputJax.NativeMML=MathJax.OutputJax({id:"NativeMML",version:"1.1.7",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.NativeMML.Register("jax/mml")}MathJax.OutputJax.NativeMML.loadComplete("config.js"); MathJax.OutputJax.NativeMML=MathJax.OutputJax({id:"NativeMML",version:"1.1.8",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.NativeMML.Register("jax/mml")}MathJax.OutputJax.NativeMML.loadComplete("config.js");

File diff suppressed because one or more lines are too long

View File

@ -1197,7 +1197,6 @@ MathJax.Hub = {
outputJax: {order:{}}, // mime-type mapped to output jax list (by registration) outputJax: {order:{}}, // mime-type mapped to output jax list (by registration)
menuSettings: { menuSettings: {
//format: "MathML", // the Show Source format (set in MathMenu.js)
zoom: "None", // when to do MathZoom zoom: "None", // when to do MathZoom
CTRL: false, // require CTRL for MathZoom? CTRL: false, // require CTRL for MathZoom?
ALT: false, // require Alt or Option? ALT: false, // require Alt or Option?

View File

@ -22,7 +22,7 @@
* limitations under the License. * limitations under the License.
*/ */
(function (HUB,HTML,AJAX,CALLBACK,OUTPUT) { (function (HUB,HTML,AJAX,CALLBACK,OUTPUT,INPUT) {
var VERSION = "1.1"; var VERSION = "1.1";
var EXTENSION = MathJax.Extension; var EXTENSION = MathJax.Extension;
@ -149,8 +149,8 @@
var MENU = MathJax.Menu; var MENU = MathJax.Menu;
if (MENU) { if (MENU) {
MENU.jax = jax; MENU.jax = jax;
MENU.menu.Find("Format").menu.items[1].name = MENU.menu.Find("Show Math As").menu.items[1].name =
(jax.inputJax.id === "MathML" ? "Original" : jax.inputJax.id); (INPUT[jax.inputJax.id].sourceMenuTitle||"Original Form");
return MENU.menu.Post(event); return MENU.menu.Post(event);
} else { } else {
if (!AJAX.loadingMathMenu) { if (!AJAX.loadingMathMenu) {
@ -498,4 +498,4 @@
["loadComplete",AJAX,"[MathJax]/extensions/MathEvents.js"] ["loadComplete",AJAX,"[MathJax]/extensions/MathEvents.js"]
); );
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback,MathJax.OutputJax); })(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback,MathJax.OutputJax,MathJax.InputJax);

View File

@ -23,8 +23,8 @@
* limitations under the License. * limitations under the License.
*/ */
(function (HUB,HTML,AJAX) { (function (HUB,HTML,AJAX,CALLBACK,OUTPUT) {
var VERSION = "1.1.6"; var VERSION = "1.1.8";
MathJax.Extension.MathMenu = {version: VERSION}; MathJax.Extension.MathMenu = {version: VERSION};
@ -34,6 +34,7 @@
var CONFIG = HUB.CombineConfig("MathMenu",{ var CONFIG = HUB.CombineConfig("MathMenu",{
delay: 150, // the delay for submenus delay: 150, // the delay for submenus
helpURL: "http://www.mathjax.org/help/user/", // the URL for the "MathJax Help" menu helpURL: "http://www.mathjax.org/help/user/", // the URL for the "MathJax Help" menu
closeImg: AJAX.fileURL(OUTPUT.imageDir+"/CloseX-31.png"), // image for close "X" for mobiles
showRenderer: true, // show the "Math Renderer" menu? showRenderer: true, // show the "Math Renderer" menu?
showFontMenu: false, // show the "Font Preference" menu? showFontMenu: false, // show the "Font Preference" menu?
@ -130,12 +131,18 @@
".MathJax_MenuActive": { ".MathJax_MenuActive": {
"background-color": (isPC ? "Highlight" : "#606872"), "background-color": (isPC ? "Highlight" : "#606872"),
color: (isPC ? "HighlightText" : "white") color: (isPC ? "HighlightText" : "white")
} },
".MathJax_Menu_Close": {
position:"absolute",
width: "31px", height: "31px",
top:"-15px", left:"-15px"
},
} }
}); });
var FALSE, HOVER; var FALSE, HOVER;
MathJax.Hub.Register.StartupHook("MathEvents Ready",function () { HUB.Register.StartupHook("MathEvents Ready",function () {
FALSE = MathJax.Extension.MathEvents.Event.False; FALSE = MathJax.Extension.MathEvents.Event.False;
HOVER = MathJax.Extension.MathEvents.Hover; HOVER = MathJax.Extension.MathEvents.Hover;
}); });
@ -175,9 +182,7 @@
for (var i = 0, m = this.items.length; i < m; i++) {this.items[i].Create(menu)} for (var i = 0, m = this.items.length; i < m; i++) {this.items[i].Create(menu)}
if (MENU.isMobile) { if (MENU.isMobile) {
HTML.addElement(menu,"img",{ HTML.addElement(menu,"img",{
src: MathJax.Ajax.fileURL(MathJax.OutputJax.imageDir+"/CloseX-31.png"), className: "MathJax_Menu_Close", menu: parent, src: CONFIG.closeImg,
width: 31, height: 31, menu: parent,
style: {position:"absolute", top:"-15px", left:"-15px"},
ontouchstart: MENU.Close, ontouchend: FALSE, onmousedown: MENU.Close ontouchstart: MENU.Close, ontouchend: FALSE, onmousedown: MENU.Close
}); });
} }
@ -323,10 +328,7 @@
// Preload images so they show up with the menu // Preload images so they show up with the menu
// //
getImages: function () { getImages: function () {
if (MENU.isMobile) { if (MENU.isMobile) {var close = new Image(); close.src = CONFIG.closeImg}
var close = new Image();
close.src = AJAX.fileURL(MathJax.OutputJax.imageDir+"/CloseX-31.png");
}
} }
}); });
@ -439,7 +441,7 @@
Timer: function (event,menu) { Timer: function (event,menu) {
if (this.timer) {clearTimeout(this.timer)} if (this.timer) {clearTimeout(this.timer)}
event = {clientX: event.clientX, clientY: event.clientY}; // MSIE can't pass the event below event = {clientX: event.clientX, clientY: event.clientY}; // MSIE can't pass the event below
this.timer = setTimeout(MathJax.Callback(["Mouseup",this,event,menu]),CONFIG.delay); this.timer = setTimeout(CALLBACK(["Mouseup",this,event,menu]),CONFIG.delay);
}, },
Touchend: function (event,menu) { Touchend: function (event,menu) {
var forceout = this.menu.posted; var forceout = this.menu.posted;
@ -563,7 +565,7 @@
* Handle the ABOUT box * Handle the ABOUT box
*/ */
MENU.About = function () { MENU.About = function () {
var HTMLCSS = MathJax.OutputJax["HTML-CSS"] || {fontInUse: ""}; var HTMLCSS = OUTPUT["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) + " fonts"; var font = (HTMLCSS.imgFonts ? "Image" : local+HTMLCSS.fontInUse+web) + " fonts";
var jax = ["MathJax.js v"+MathJax.fileversion,["br"]]; var jax = ["MathJax.js v"+MathJax.fileversion,["br"]];
@ -578,7 +580,7 @@
(HTMLCSS.webFonts ? " \u2014 "+HTMLCSS.allowWebFonts+" fonts" : "") (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 = 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"],
@ -626,21 +628,24 @@
if (!event) {event = window.event} if (!event) {event = window.event}
var EVENT = {screenX:event.screenX, screenY:event.screenY}; var EVENT = {screenX:event.screenX, screenY:event.screenY};
if (!MENU.jax) return; if (!MENU.jax) return;
if (CONFIG.settings.format === "MathML") { if (this.format === "MathML") {
var MML = MathJax.ElementJax.mml; var MML = MathJax.ElementJax.mml;
if (MML && typeof(MML.mbase.prototype.toMathML) !== "undefined") { if (MML && typeof(MML.mbase.prototype.toMathML) !== "undefined") {
// toMathML() can call MathJax.Hub.RestartAfter, so trap errors and check // toMathML() can call MathJax.Hub.RestartAfter, so trap errors and check
try {MENU.ShowSource.Text(MENU.jax.root.toMathML(),event)} catch (err) { try {MENU.ShowSource.Text(MENU.jax.root.toMathML(),event)} catch (err) {
if (!err.restart) {throw err} if (!err.restart) {throw err}
MathJax.Callback.After([this,arguments.callee,EVENT]); CALLBACK.After([this,MENU.ShowSource,EVENT]);
} }
} else if (!AJAX.loadingToMathML) { } else if (!AJAX.loadingToMathML) {
AJAX.loadingToMathML = true; AJAX.loadingToMathML = true;
MENU.ShowSource.Window(event); // WeBKit needs to open window on click event MENU.ShowSource.Window(event); // WeBKit needs to open window on click event
MathJax.Callback.Queue( CALLBACK.Queue(
AJAX.Require("[MathJax]/extensions/toMathML.js"), AJAX.Require("[MathJax]/extensions/toMathML.js"),
function () {delete AJAX.loadingToMathML}, function () {
[this,arguments.callee,EVENT] // call this function again delete AJAX.loadingToMathML;
if (!MML.mbase.prototype.toMathML) {MML.mbase.prototype.toMathML = function () {}}
},
[this,MENU.ShowSource,EVENT] // call this function again
); );
return; return;
} }
@ -692,7 +697,7 @@
* Handle rescaling all the math * Handle rescaling all the math
*/ */
MENU.Scale = function () { MENU.Scale = function () {
var HTMLCSS = MathJax.OutputJax["HTML-CSS"], nMML = MathJax.OutputJax.NativeMML; var HTMLCSS = OUTPUT["HTML-CSS"], nMML = OUTPUT.NativeMML;
var SCALE = (HTMLCSS ? HTMLCSS.config.scale : nMML.config.scale); var SCALE = (HTMLCSS ? HTMLCSS.config.scale : nMML.config.scale);
var scale = prompt("Scale all mathematics (compared to surrounding text) by",SCALE+"%"); var scale = prompt("Scale all mathematics (compared to surrounding text) by",SCALE+"%");
if (scale) { if (scale) {
@ -723,11 +728,11 @@
MENU.Renderer = function () { MENU.Renderer = function () {
var jax = HUB.config.outputJax["jax/mml"]; var jax = HUB.config.outputJax["jax/mml"];
if (jax[0] !== CONFIG.settings.renderer) { if (jax[0] !== CONFIG.settings.renderer) {
MathJax.Callback.Queue( CALLBACK.Queue(
["Require",AJAX,"[MathJax]/jax/output/"+CONFIG.settings.renderer+"/config.js"], ["Require",AJAX,"[MathJax]/jax/output/"+CONFIG.settings.renderer+"/config.js"],
["Post",HUB.Startup.signal,CONFIG.settings.renderer+" output selected"], ["Post",HUB.Startup.signal,CONFIG.settings.renderer+" output selected"],
[function () { [function () {
var JAX = MathJax.OutputJax[CONFIG.settings.renderer]; var JAX = OUTPUT[CONFIG.settings.renderer];
for (var i = 0, m = jax.length; i < m; i++) for (var i = 0, m = jax.length; i < m; i++)
{if (jax[i] === JAX) {jax.splice(i,1); break}} {if (jax[i] === JAX) {jax.splice(i,1); break}}
jax.unshift(JAX); jax.unshift(JAX);
@ -741,7 +746,7 @@
* Handle setting the HTMLCSS fonts * Handle setting the HTMLCSS fonts
*/ */
MENU.Font = function () { MENU.Font = function () {
var HTMLCSS = MathJax.OutputJax["HTML-CSS"]; if (!HTMLCSS) return; var HTMLCSS = OUTPUT["HTML-CSS"]; if (!HTMLCSS) return;
document.location.reload(); document.location.reload();
}; };
@ -767,8 +772,8 @@
MENU.skipMousedown = browser.isMobile; MENU.skipMousedown = browser.isMobile;
} }
}); });
MENU.isMobile = MathJax.Hub.Browser.isMobile; MENU.isMobile = HUB.Browser.isMobile;
MENU.noContextMenu = MathJax.Hub.Browser.noContextMenu; MENU.noContextMenu = HUB.Browser.noContextMenu;
/*************************************************************/ /*************************************************************/
@ -780,8 +785,6 @@
* it wasn't set in the cookie. * it wasn't set in the cookie.
*/ */
CONFIG.settings = HUB.config.menuSettings; CONFIG.settings = HUB.config.menuSettings;
if (!CONFIG.settings.format)
{CONFIG.settings.format = (MathJax.InputJax.TeX ? "Original" : "MathML")}
if (typeof(CONFIG.settings.showRenderer) !== "undefined") {CONFIG.showRenderer = CONFIG.settings.showRenderer} if (typeof(CONFIG.settings.showRenderer) !== "undefined") {CONFIG.showRenderer = CONFIG.settings.showRenderer}
if (typeof(CONFIG.settings.showFontMenu) !== "undefined") {CONFIG.showFontMenu = CONFIG.settings.showFontMenu} if (typeof(CONFIG.settings.showFontMenu) !== "undefined") {CONFIG.showFontMenu = CONFIG.settings.showFontMenu}
if (typeof(CONFIG.settings.showContext) !== "undefined") {CONFIG.showContext = CONFIG.settings.showContext} if (typeof(CONFIG.settings.showContext) !== "undefined") {CONFIG.showContext = CONFIG.settings.showContext}
@ -791,13 +794,12 @@
* The main menu * The main menu
*/ */
MENU.menu = MENU( MENU.menu = MENU(
ITEM.COMMAND("Show Source",MENU.ShowSource,{nativeTouch: true}), ITEM.SUBMENU("Show Math As",
ITEM.SUBMENU("Format", ITEM.COMMAND("MathML Code", MENU.ShowSource, {nativeTouch: true, format: "MathML"}),
ITEM.RADIO("MathML", "format"), ITEM.COMMAND("Original Form", MENU.ShowSource, {nativeTouch: true})
ITEM.RADIO("Original", "format", {value: "Original"})
), ),
ITEM.RULE(), ITEM.RULE(),
ITEM.SUBMENU("Settings", ITEM.SUBMENU("Math Settings",
ITEM.SUBMENU("Zoom Trigger", ITEM.SUBMENU("Zoom Trigger",
ITEM.RADIO("Hover", "zoom", {action: MENU.Zoom}), ITEM.RADIO("Hover", "zoom", {action: MENU.Zoom}),
ITEM.RADIO("Click", "zoom", {action: MENU.Zoom}), ITEM.RADIO("Click", "zoom", {action: MENU.Zoom}),
@ -839,7 +841,9 @@
ITEM.RADIO("MathJax", "context"), ITEM.RADIO("MathJax", "context"),
ITEM.RADIO("Browser", "context") ITEM.RADIO("Browser", "context")
), ),
ITEM.COMMAND("Scale All Math ...",MENU.Scale) ITEM.COMMAND("Scale All Math ...",MENU.Scale),
ITEM.RULE(),
ITEM.CHECKBOX("Highlight on Hover", "discoverable")
), ),
ITEM.RULE(), ITEM.RULE(),
ITEM.COMMAND("About MathJax",MENU.About), ITEM.COMMAND("About MathJax",MENU.About),
@ -850,21 +854,21 @@
MENU.showRenderer = function (show) { MENU.showRenderer = function (show) {
MENU.cookie.showRenderer = CONFIG.showRenderer = show; MENU.saveCookie(); MENU.cookie.showRenderer = CONFIG.showRenderer = show; MENU.saveCookie();
MENU.menu.Find("Settings","Math Renderer").hidden = !show; MENU.menu.Find("Math Settings","Math Renderer").hidden = !show;
}; };
MENU.showFontMenu = function (show) { MENU.showFontMenu = function (show) {
MENU.cookie.showFontMenu = CONFIG.showFontMenu = show; MENU.saveCookie(); MENU.cookie.showFontMenu = CONFIG.showFontMenu = show; MENU.saveCookie();
MENU.menu.Find("Settings","Font Preference").hidden = !show; MENU.menu.Find("Math Settings","Font Preference").hidden = !show;
}; };
MENU.showContext = function (show) { MENU.showContext = function (show) {
MENU.cookie.showContext = CONFIG.showContext = show; MENU.saveCookie(); MENU.cookie.showContext = CONFIG.showContext = show; MENU.saveCookie();
MENU.menu.Find("Settings","Contextual Menu").hidden = !show; MENU.menu.Find("Math Settings","Contextual Menu").hidden = !show;
}; };
if (MENU.isMobile) { if (MENU.isMobile) {
(function () { (function () {
var settings = CONFIG.settings; var settings = CONFIG.settings;
var trigger = MENU.menu.Find("Settings","Zoom Trigger").menu; var trigger = MENU.menu.Find("Math Settings","Zoom Trigger").menu;
trigger.items[0].disabled = trigger.items[1].disabled = true; trigger.items[0].disabled = trigger.items[1].disabled = true;
if (settings.zoom === "Hover" || settings.zoom == "Click") {settings.zoom = "None"} if (settings.zoom === "Hover" || settings.zoom == "Click") {settings.zoom = "None"}
trigger.items = trigger.items.slice(0,4); trigger.items = trigger.items.slice(0,4);
@ -877,11 +881,12 @@
/*************************************************************/ /*************************************************************/
MathJax.Callback.Queue( CALLBACK.Queue(
["Styles",AJAX,CONFIG.styles], HUB.Register.StartupHook("End Config",{}), // wait until config is complete complete
["getImages",MENU], ["getImages",MENU],
["Styles",AJAX,CONFIG.styles],
["Post",HUB.Startup.signal,"MathMenu Ready"], ["Post",HUB.Startup.signal,"MathMenu Ready"],
["loadComplete",AJAX,"[MathJax]/extensions/MathMenu.js"] ["loadComplete",AJAX,"[MathJax]/extensions/MathMenu.js"]
); );
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax); })(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.CallBack,MathJax.OutputJax);

View File

@ -24,7 +24,7 @@
MathJax.InputJax.MathML = MathJax.InputJax({ MathJax.InputJax.MathML = MathJax.InputJax({
id: "MathML", id: "MathML",
version: "1.1.4", version: "1.1.5",
directory: MathJax.InputJax.directory + "/MathML", directory: MathJax.InputJax.directory + "/MathML",
extensionDir: MathJax.InputJax.extensionDir + "/MathML", extensionDir: MathJax.InputJax.extensionDir + "/MathML",
entityDir: MathJax.InputJax.directory + "/MathML/entities", entityDir: MathJax.InputJax.directory + "/MathML/entities",

View File

@ -128,6 +128,8 @@
/************************************************************************/ /************************************************************************/
MATHML.Augment({ MATHML.Augment({
sourceMenuTitle: "Original MathML",
Translate: function (script) { Translate: function (script) {
if (!this.ParseXML) {this.ParseXML = this.createParser()} if (!this.ParseXML) {this.ParseXML = this.createParser()}
var mml, math; var mml, math;

View File

@ -24,7 +24,7 @@
MathJax.InputJax.TeX = MathJax.InputJax({ MathJax.InputJax.TeX = MathJax.InputJax({
id: "TeX", id: "TeX",
version: "1.1.1", version: "1.1.2",
directory: MathJax.InputJax.directory + "/TeX", directory: MathJax.InputJax.directory + "/TeX",
extensionDir: MathJax.InputJax.extensionDir + "/TeX", extensionDir: MathJax.InputJax.extensionDir + "/TeX",

View File

@ -1701,6 +1701,8 @@
MAXBUFFER: 5*1024 // maximum size of TeX string to process MAXBUFFER: 5*1024 // maximum size of TeX string to process
}, },
sourceMenuTitle: "TeX Commands",
Translate: function (script) { Translate: function (script) {
var mml, math = script.innerHTML.replace(/^\s+/,"").replace(/\s+$/,""); var mml, math = script.innerHTML.replace(/^\s+/,"").replace(/\s+$/,"");
if (MathJax.Hub.Browser.isKonqueror) if (MathJax.Hub.Browser.isKonqueror)

View File

@ -24,7 +24,7 @@
MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({ MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
id: "HTML-CSS", id: "HTML-CSS",
version: "1.1.11", version: "1.1.12",
directory: MathJax.OutputJax.directory + "/HTML-CSS", directory: MathJax.OutputJax.directory + "/HTML-CSS",
extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS", extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS",
autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload", autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload",

View File

@ -415,6 +415,7 @@
script.parentNode.insertBefore(frame,script); var isHidden; script.parentNode.insertBefore(frame,script); var isHidden;
try {this.getScales(span); isHidden = (this.em === 0 || String(this.em) === "NaN")} catch (err) {isHidden = true} try {this.getScales(span); isHidden = (this.em === 0 || String(this.em) === "NaN")} catch (err) {isHidden = true}
if (isHidden) {this.hiddenDiv.appendChild(frame); this.getScales(span)} if (isHidden) {this.hiddenDiv.appendChild(frame); this.getScales(span)}
jax.em = this.em; jax.outerEm = this.outerEm; jax.scale = this.scale;
this.initImg(span); this.initImg(span);
this.initHTML(math,span); this.initHTML(math,span);
math.setTeXclass(); math.setTeXclass();
@ -432,7 +433,7 @@
}, },
getHoverSpan: function (jax) {return jax.root.HTMLspanElement()}, getHoverSpan: function (jax) {return jax.root.HTMLspanElement()},
getHoverBBox: function (jax,span) { getHoverBBox: function (jax,span) {
var bbox = span.bbox, em = HTMLCSS.outerEm; var bbox = span.bbox, em = jax.outerEm;
var BBOX = {w:bbox.w*em, h:bbox.h*em, d:bbox.d*em}; var BBOX = {w:bbox.w*em, h:bbox.h*em, d:bbox.d*em};
if (bbox.width) {BBOX.width = bbox.width} if (bbox.width) {BBOX.width = bbox.width}
return BBOX; return BBOX;

View File

@ -24,7 +24,7 @@
MathJax.OutputJax.NativeMML = MathJax.OutputJax({ MathJax.OutputJax.NativeMML = MathJax.OutputJax({
id: "NativeMML", id: "NativeMML",
version: "1.1.7", version: "1.1.8",
directory: MathJax.OutputJax.directory + "/NativeMML", directory: MathJax.OutputJax.directory + "/NativeMML",
extensionDir: MathJax.OutputJax.extensionDir + "/NativeMML", extensionDir: MathJax.OutputJax.extensionDir + "/NativeMML",

View File

@ -28,16 +28,12 @@
var EVENT, TOUCH, HOVER; // filled in later var EVENT, TOUCH, HOVER; // filled in later
nMML.Augment({ nMML.Augment({
LEFTBUTTON: (isMSIE ? 1 : 0), // the event.button value for left button
MENUKEY: "altKey", // the event value for alternate context menu
noContextMenuBug: HUB.Browser.isKonequeror,
msieQuirks: (isMSIE && !(document.compatMode === "BackCompat")),
msieEventBug: HUB.Browser.isIE9,
// //
// User can configure styles // User can configure styles
// //
config: {styles: {}}, settings: HUB.config.menuSettings, config: {styles: {}},
settings: HUB.config.menuSettings,
Startup: function () { Startup: function () {
// Set up event handling // Set up event handling
EVENT = MathJax.Extension.MathEvents.Event; EVENT = MathJax.Extension.MathEvents.Event;