Merge branch 'menu-patch' into develop

This commit is contained in:
Davide P. Cervone 2016-02-06 19:28:43 -05:00
commit d0ecea125f
3 changed files with 28 additions and 24 deletions

View File

@ -1896,6 +1896,8 @@ MathJax.Hub = {
mpContext: false, // true means pass menu events to MathPlayer in IE mpContext: false, // true means pass menu events to MathPlayer in IE
mpMouse: false, // true means pass mouse events to MathPlayer in IE mpMouse: false, // true means pass mouse events to MathPlayer in IE
texHints: true, // include class names for TeXAtom elements texHints: true, // include class names for TeXAtom elements
FastPreview: true, // use PreviewHTML output as preview?
assistiveMML: true, // include hidden MathML for screen readers?
inTabOrder: true, // set to false if math elements should be included in the tabindex inTabOrder: true, // set to false if math elements should be included in the tabindex
semantics: false // add semantics tag with original form in MathML output semantics: false // add semantics tag with original form in MathML output
}, },
@ -2127,6 +2129,7 @@ MathJax.Hub = {
if (script.MathJax.state !== STATE.PENDING) {this.scriptAction[action](script)} if (script.MathJax.state !== STATE.PENDING) {this.scriptAction[action](script)}
} }
if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}} if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}}
if (script.MathJax.error) delete script.MathJax.error;
if (script.MathJax.state !== STATE.PROCESSED) {state.scripts.push(script)} if (script.MathJax.state !== STATE.PROCESSED) {state.scripts.push(script)}
} }
} }
@ -2350,7 +2353,8 @@ MathJax.Hub = {
if (err.line||err.lineNumber) message += "\n"+LOCALIZE("ErrorLine","line: %1",err.line||err.lineNumber); if (err.line||err.lineNumber) message += "\n"+LOCALIZE("ErrorLine","line: %1",err.line||err.lineNumber);
message += "\n\n"+LOCALIZE("ErrorTips","Debugging tips: use %1, inspect %2 in the browser console","'unpacked/MathJax.js'","'MathJax.Hub.lastError'"); message += "\n\n"+LOCALIZE("ErrorTips","Debugging tips: use %1, inspect %2 in the browser console","'unpacked/MathJax.js'","'MathJax.Hub.lastError'");
script.MathJax.error = MathJax.OutputJax.Error.Jax(message,script); script.MathJax.error = MathJax.OutputJax.Error.Jax(message,script);
if (script.MathJax.elementJax)
script.MathJax.error.inputID = script.MathJax.elementJax.inputID;
// //
// Create the [Math Processing Error] span // Create the [Math Processing Error] span
// //
@ -2359,28 +2363,23 @@ MathJax.Hub = {
var error = MathJax.HTML.Element("span", { var error = MathJax.HTML.Element("span", {
className:"MathJax_Error", jaxID:"Error", isMathJax:true, className:"MathJax_Error", jaxID:"Error", isMathJax:true,
id: script.MathJax.error.inputID+"-Frame" id: script.MathJax.error.inputID+"-Frame"
},errorText); },[["span",null,errorText]]);
// //
// Attach the menu events // Attach the menu events
// //
if (MathJax.Extension.MathEvents) { MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
var EVENT = MathJax.Extension.MathEvents.Event; var EVENT = MathJax.Extension.MathEvents.Event
HUB = MathJax.Hub;
error.oncontextmenu = EVENT.Menu; error.oncontextmenu = EVENT.Menu;
error.onmousedown = EVENT.Mousedown; error.onmousedown = EVENT.Mousedown;
error.onkeydown = EVENT.Keydown; error.onkeydown = EVENT.Keydown;
error.tabIndex = this.getTabOrder(this.getJaxFor(script)); error.tabIndex = HUB.getTabOrder(HUB.getJaxFor(script));
} else { });
MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
var EVENT = MathJax.Extension.MathEvents.Event;
error.oncontextmenu = EVENT.Menu;
error.onmousedown = EVENT.Mousedown;
error.keydown = EVENT.Keydown;
error.tabIndex = this.getTabOrder(this.getJaxFor(script));
});
}
// //
// Insert the error into the page and remove any preview // Insert the error into the page and remove any preview
// //
var node = document.getElementById(error.id);
if (node) node.parentNode.removeChild(node);
script.parentNode.insertBefore(error,script); script.parentNode.insertBefore(error,script);
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""} if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
// //

View File

@ -240,12 +240,17 @@ MathJax.Hub.Config({
ALT: false, // require Alt or Option? ALT: false, // require Alt or Option?
CMD: false, // require CMD? CMD: false, // require CMD?
Shift: false, // require Shift? Shift: false, // require Shift?
discoverable: false, // make math menu discoverable on hover?
zscale: "200%", // the scaling factor for MathZoom zscale: "200%", // the scaling factor for MathZoom
renderer: "", // set when Jax are loaded
font: "Auto", // what font HTML-CSS should use font: "Auto", // what font HTML-CSS should use
context: "MathJax", // or "Browser" for pass-through to browser menu context: "MathJax", // or "Browser" for pass-through to browser menu
locale: "en", // the language to use for messages
mpContext: false, // true means pass menu events to MathPlayer in IE mpContext: false, // true means pass menu events to MathPlayer in IE
mpMouse: false, // true means pass mouse events to MathPlayer in IE mpMouse: false, // true means pass mouse events to MathPlayer in IE
texHints: true, // include class names for TeXAtom elements texHints: true, // include class names for TeXAtom elements
FastPreview: true, // use PreviewHTML output as preview?
assistiveMML: true, // include hidden MathML for screen readers?
inTabOrder: true, // set to true if math elements should be included in the tabindex inTabOrder: true, // set to true if math elements should be included in the tabindex
semantics: false // add semantics tag with original form in MathML output semantics: false // add semantics tag with original form in MathML output
}, },

View File

@ -1543,16 +1543,16 @@
), ),
ITEM.RULE(), ITEM.RULE(),
ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer}, ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer},
ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}), ITEM.RADIO(["HTML-CSS","HTML-CSS"], "renderer", {action: MENU.Renderer}),
ITEM.RADIO("Common HTML","renderer", {action: MENU.Renderer, value:"CommonHTML"}), ITEM.RADIO(["CommonHTML","Common HTML"], "renderer", {action: MENU.Renderer, value:"CommonHTML"}),
ITEM.RADIO("Fast HTML", "renderer", {action: MENU.Renderer, value:"PreviewHTML"}), ITEM.RADIO(["PreviewHTML","Preview HTML"],"renderer", {action: MENU.Renderer, value:"PreviewHTML"}),
ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}), ITEM.RADIO(["MathML","MathML"], "renderer", {action: MENU.Renderer, value:"NativeMML"}),
ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer}), ITEM.RADIO(["SVG","SVG"], "renderer", {action: MENU.Renderer}),
ITEM.RADIO("PlainSource","renderer", {action: MENU.Renderer, value:"PlainSource"}), ITEM.RADIO(["PlainSource","Plain Source"],"renderer", {action: MENU.Renderer, value:"PlainSource"}),
ITEM.RULE(), ITEM.RULE(),
ITEM.CHECKBOX("Fast Preview", "FastPreview"), ITEM.CHECKBOX(["FastPreview","Fast Preview"], "FastPreview"),
ITEM.CHECKBOX("Assistive MathML", "assistiveMML", {action:MENU.AssistiveMML}), ITEM.CHECKBOX(["AssistiveMML","Assistive MathML"], "assistiveMML", {action:MENU.AssistiveMML}),
ITEM.CHECKBOX("Include in Tab Order", "inTabOrder") ITEM.CHECKBOX(["InTabOrder","Include in Tab Order"], "inTabOrder")
), ),
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer, ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
disabled:!HUB.Browser.hasMathPlayer}, disabled:!HUB.Browser.hasMathPlayer},
@ -1579,7 +1579,7 @@
ITEM.RADIO(["NeoEulerWeb","Neo Euler (web)"], "font", {action: MENU.Font}) ITEM.RADIO(["NeoEulerWeb","Neo Euler (web)"], "font", {action: MENU.Font})
), ),
ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext}, ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext},
ITEM.RADIO("MathJax", "context"), ITEM.RADIO(["MathJax","MathJax"], "context"),
ITEM.RADIO(["Browser","Browser"], "context") ITEM.RADIO(["Browser","Browser"], "context")
), ),
ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale), ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale),