Skip to content

Commit d0ecea1

Browse files
committed
Merge branch 'menu-patch' into develop
2 parents 32c540b + beb8efa commit d0ecea1

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

unpacked/MathJax.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,8 @@ MathJax.Hub = {
18961896
mpContext: false, // true means pass menu events to MathPlayer in IE
18971897
mpMouse: false, // true means pass mouse events to MathPlayer in IE
18981898
texHints: true, // include class names for TeXAtom elements
1899+
FastPreview: true, // use PreviewHTML output as preview?
1900+
assistiveMML: true, // include hidden MathML for screen readers?
18991901
inTabOrder: true, // set to false if math elements should be included in the tabindex
19001902
semantics: false // add semantics tag with original form in MathML output
19011903
},
@@ -2127,6 +2129,7 @@ MathJax.Hub = {
21272129
if (script.MathJax.state !== STATE.PENDING) {this.scriptAction[action](script)}
21282130
}
21292131
if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}}
2132+
if (script.MathJax.error) delete script.MathJax.error;
21302133
if (script.MathJax.state !== STATE.PROCESSED) {state.scripts.push(script)}
21312134
}
21322135
}
@@ -2350,7 +2353,8 @@ MathJax.Hub = {
23502353
if (err.line||err.lineNumber) message += "\n"+LOCALIZE("ErrorLine","line: %1",err.line||err.lineNumber);
23512354
message += "\n\n"+LOCALIZE("ErrorTips","Debugging tips: use %1, inspect %2 in the browser console","'unpacked/MathJax.js'","'MathJax.Hub.lastError'");
23522355
script.MathJax.error = MathJax.OutputJax.Error.Jax(message,script);
2353-
2356+
if (script.MathJax.elementJax)
2357+
script.MathJax.error.inputID = script.MathJax.elementJax.inputID;
23542358
//
23552359
// Create the [Math Processing Error] span
23562360
//
@@ -2359,28 +2363,23 @@ MathJax.Hub = {
23592363
var error = MathJax.HTML.Element("span", {
23602364
className:"MathJax_Error", jaxID:"Error", isMathJax:true,
23612365
id: script.MathJax.error.inputID+"-Frame"
2362-
},errorText);
2366+
},[["span",null,errorText]]);
23632367
//
23642368
// Attach the menu events
23652369
//
2366-
if (MathJax.Extension.MathEvents) {
2367-
var EVENT = MathJax.Extension.MathEvents.Event;
2370+
MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
2371+
var EVENT = MathJax.Extension.MathEvents.Event
2372+
HUB = MathJax.Hub;
23682373
error.oncontextmenu = EVENT.Menu;
23692374
error.onmousedown = EVENT.Mousedown;
23702375
error.onkeydown = EVENT.Keydown;
2371-
error.tabIndex = this.getTabOrder(this.getJaxFor(script));
2372-
} else {
2373-
MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
2374-
var EVENT = MathJax.Extension.MathEvents.Event;
2375-
error.oncontextmenu = EVENT.Menu;
2376-
error.onmousedown = EVENT.Mousedown;
2377-
error.keydown = EVENT.Keydown;
2378-
error.tabIndex = this.getTabOrder(this.getJaxFor(script));
2379-
});
2380-
}
2376+
error.tabIndex = HUB.getTabOrder(HUB.getJaxFor(script));
2377+
});
23812378
//
23822379
// Insert the error into the page and remove any preview
23832380
//
2381+
var node = document.getElementById(error.id);
2382+
if (node) node.parentNode.removeChild(node);
23842383
script.parentNode.insertBefore(error,script);
23852384
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
23862385
//

unpacked/config/default.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,17 @@ MathJax.Hub.Config({
240240
ALT: false, // require Alt or Option?
241241
CMD: false, // require CMD?
242242
Shift: false, // require Shift?
243+
discoverable: false, // make math menu discoverable on hover?
243244
zscale: "200%", // the scaling factor for MathZoom
245+
renderer: "", // set when Jax are loaded
244246
font: "Auto", // what font HTML-CSS should use
245247
context: "MathJax", // or "Browser" for pass-through to browser menu
248+
locale: "en", // the language to use for messages
246249
mpContext: false, // true means pass menu events to MathPlayer in IE
247250
mpMouse: false, // true means pass mouse events to MathPlayer in IE
248251
texHints: true, // include class names for TeXAtom elements
252+
FastPreview: true, // use PreviewHTML output as preview?
253+
assistiveMML: true, // include hidden MathML for screen readers?
249254
inTabOrder: true, // set to true if math elements should be included in the tabindex
250255
semantics: false // add semantics tag with original form in MathML output
251256
},

unpacked/extensions/MathMenu.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,16 +1543,16 @@
15431543
),
15441544
ITEM.RULE(),
15451545
ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer},
1546-
ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}),
1547-
ITEM.RADIO("Common HTML","renderer", {action: MENU.Renderer, value:"CommonHTML"}),
1548-
ITEM.RADIO("Fast HTML", "renderer", {action: MENU.Renderer, value:"PreviewHTML"}),
1549-
ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}),
1550-
ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer}),
1551-
ITEM.RADIO("PlainSource","renderer", {action: MENU.Renderer, value:"PlainSource"}),
1546+
ITEM.RADIO(["HTML-CSS","HTML-CSS"], "renderer", {action: MENU.Renderer}),
1547+
ITEM.RADIO(["CommonHTML","Common HTML"], "renderer", {action: MENU.Renderer, value:"CommonHTML"}),
1548+
ITEM.RADIO(["PreviewHTML","Preview HTML"],"renderer", {action: MENU.Renderer, value:"PreviewHTML"}),
1549+
ITEM.RADIO(["MathML","MathML"], "renderer", {action: MENU.Renderer, value:"NativeMML"}),
1550+
ITEM.RADIO(["SVG","SVG"], "renderer", {action: MENU.Renderer}),
1551+
ITEM.RADIO(["PlainSource","Plain Source"],"renderer", {action: MENU.Renderer, value:"PlainSource"}),
15521552
ITEM.RULE(),
1553-
ITEM.CHECKBOX("Fast Preview", "FastPreview"),
1554-
ITEM.CHECKBOX("Assistive MathML", "assistiveMML", {action:MENU.AssistiveMML}),
1555-
ITEM.CHECKBOX("Include in Tab Order", "inTabOrder")
1553+
ITEM.CHECKBOX(["FastPreview","Fast Preview"], "FastPreview"),
1554+
ITEM.CHECKBOX(["AssistiveMML","Assistive MathML"], "assistiveMML", {action:MENU.AssistiveMML}),
1555+
ITEM.CHECKBOX(["InTabOrder","Include in Tab Order"], "inTabOrder")
15561556
),
15571557
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
15581558
disabled:!HUB.Browser.hasMathPlayer},
@@ -1579,7 +1579,7 @@
15791579
ITEM.RADIO(["NeoEulerWeb","Neo Euler (web)"], "font", {action: MENU.Font})
15801580
),
15811581
ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext},
1582-
ITEM.RADIO("MathJax", "context"),
1582+
ITEM.RADIO(["MathJax","MathJax"], "context"),
15831583
ITEM.RADIO(["Browser","Browser"], "context")
15841584
),
15851585
ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale),

0 commit comments

Comments
 (0)