Make constant messages be translated when they are used rather than when they are defined. Rework About box, add menu ID's. Make TeX.Error() and MathML.Error() handle localization. Break up Fred's French data into separate files. Make localization data load on demand. Other miscellaneous updates.
This commit is contained in:
parent
503f997064
commit
660f38959a
1154
unpacked/MathJax.js
1154
unpacked/MathJax.js
File diff suppressed because it is too large
Load Diff
|
@ -24,8 +24,8 @@ MathJax.Hub.Config({
|
|||
mpMouse: true
|
||||
},
|
||||
errorSettings: {
|
||||
// Localization: should be updated when the language is changed
|
||||
message: ["["+MathJax.Localization._("MathError", "Math Error")+"]"]
|
||||
message: ["[Math Error]"],
|
||||
messageId: "MathErrorHTML"
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ MathJax.Hub.Config({
|
|||
mpMouse: true
|
||||
},
|
||||
errorSettings: {
|
||||
// Localization: should be updated when the language is changed
|
||||
message: ["["+MathJax.Localization._("MathError", "Math Error")+"]"]
|
||||
message: ["[Math Error]"],
|
||||
messageId: "MathErrorHTML"
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -98,9 +98,9 @@
|
|||
HUB.PreProcess.disabled = true;
|
||||
HUB.prepareScripts.disabled = true;
|
||||
MathJax.Message.Set(
|
||||
MathJax.Localization._(["Message", MathJaxNotSupported],
|
||||
"Your browser does not support MathJax"),
|
||||
null,4000);
|
||||
["MathJaxNotSupported","Your browser does not support MathJax"],
|
||||
null,4000
|
||||
);
|
||||
HUB.Startup.signal.Post("MathJax not supported");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -236,10 +236,8 @@ MathJax.Hub.Config({
|
|||
// jax that prevents it from operating properly).
|
||||
//
|
||||
errorSettings: {
|
||||
// Localization:
|
||||
// TODO
|
||||
// should be updated when the language is changed
|
||||
message: ["[MathProcessingError]"], // HTML snippet structure for message to use
|
||||
message: ["[Math Processing Error]"], // HTML snippet structure for message to use
|
||||
messageId: "MathProcessingError", // ID of snippet for localization
|
||||
style: {color: "#CC0000", "font-style":"italic"} // style for message
|
||||
},
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/FontWarnings.js
|
||||
|
@ -85,11 +86,11 @@
|
|||
*/
|
||||
|
||||
(function (HUB,HTML) {
|
||||
var VERSION = "2.1";
|
||||
var VERSION = "2.1.1";
|
||||
|
||||
var _ = function (id) {
|
||||
return MathJax.Localization._.apply(MathJax.Localization,
|
||||
[ ["FontWarnings",id] ].concat([].slice.call(arguments,1))
|
||||
[["FontWarnings",id]].concat([].slice.call(arguments,1))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -194,7 +195,7 @@
|
|||
],
|
||||
|
||||
fonts: _("fonts",
|
||||
"%1 MathJax can use either the %2 or the % "+
|
||||
"%1 MathJax can use either the %2 or the %3 "+
|
||||
". Download and install either one to improve your MathJax experience.",
|
||||
[["p"]],
|
||||
[["a",{href:"http://www.stixfonts.org/",target:"_blank"},
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
(function (HUB,HTML,AJAX,CALLBACK,OUTPUT,INPUT) {
|
||||
var VERSION = "2.1";
|
||||
(function (HUB,HTML,AJAX,CALLBACK,LOCALE,OUTPUT,INPUT) {
|
||||
var VERSION = "2.1.1";
|
||||
|
||||
var EXTENSION = MathJax.Extension;
|
||||
var ME = EXTENSION.MathEvents = {version: VERSION};
|
||||
|
@ -141,33 +141,46 @@
|
|||
}
|
||||
|
||||
//
|
||||
// If the menu code is loaded, post the menu
|
||||
// Otherwse lad the menu code and try again
|
||||
// If the menu code is loaded,
|
||||
// Check if localization needs loading;
|
||||
// If not, post the menu, and return.
|
||||
// Otherwise wait for the localization to load
|
||||
// Otherwse load the menu code.
|
||||
// Try again after the file is loaded.
|
||||
//
|
||||
var MENU = MathJax.Menu;
|
||||
var MENU = MathJax.Menu; var load, fn;
|
||||
if (MENU) {
|
||||
MENU.jax = jax;
|
||||
var source = MENU.menu.Find("Show Math As").menu;
|
||||
source.items[1].name = (INPUT[jax.inputJax].sourceMenuTitle||"Original Form");
|
||||
source.items[0].hidden = (jax.inputJax === "Error"); // hide MathML choice for error messages
|
||||
var MathPlayer = MENU.menu.Find("Math Settings","MathPlayer");
|
||||
MathPlayer.hidden = !(jax.outputJax === "NativeMML" && HUB.Browser.hasMathPlayer);
|
||||
return MENU.menu.Post(event);
|
||||
} else {
|
||||
if (!AJAX.loadingMathMenu) {
|
||||
AJAX.loadingMathMenu = true;
|
||||
var ev = {
|
||||
pageX:event.pageX, pageY:event.pageY,
|
||||
clientX:event.clientX, clientY:event.clientY
|
||||
};
|
||||
CALLBACK.Queue(
|
||||
AJAX.Require("[MathJax]/extensions/MathMenu.js"),
|
||||
function () {delete AJAX.loadingMathMenu; if (!MathJax.Menu) {MathJax.Menu = {}}},
|
||||
["ContextMenu",this,ev,math,force] // call this function again
|
||||
);
|
||||
if (MENU.loadingDomain) {return EVENT.False(event)}
|
||||
load = LOCALE.loadDomain("MathMenu");
|
||||
if (!load) {
|
||||
MENU.jax = jax;
|
||||
var source = MENU.menu.Find("Show Math As").menu;
|
||||
source.items[1].name = INPUT[jax.inputJax].sourceMenuTitle;
|
||||
source.items[0].hidden = (jax.inputJax === "Error"); // hide MathML choice for error messages
|
||||
var MathPlayer = MENU.menu.Find("Math Settings","MathPlayer");
|
||||
MathPlayer.hidden = !(jax.outputJax === "NativeMML" && HUB.Browser.hasMathPlayer);
|
||||
return MENU.menu.Post(event);
|
||||
}
|
||||
MENU.loadingDomain = true;
|
||||
fn = function () {delete MENU.loadingDomain};
|
||||
} else {
|
||||
if (AJAX.loadingMathMenu) {return EVENT.False(event)}
|
||||
AJAX.loadingMathMenu = true;
|
||||
load = AJAX.Require("[MathJax]/extensions/MathMenu.js");
|
||||
fn = function () {
|
||||
delete AJAX.loadingMathMenu;
|
||||
if (!MathJax.Menu) {MathJax.Menu = {}}
|
||||
}
|
||||
return EVENT.False(event);
|
||||
}
|
||||
var ev = {
|
||||
pageX:event.pageX, pageY:event.pageY,
|
||||
clientX:event.clientX, clientY:event.clientY
|
||||
};
|
||||
CALLBACK.Queue(
|
||||
load, fn, // load the file and delete the marker when done
|
||||
["ContextMenu",EVENT,ev,math,force] // call this function again
|
||||
);
|
||||
return EVENT.False(event);
|
||||
},
|
||||
|
||||
//
|
||||
|
@ -530,4 +543,5 @@
|
|||
["loadComplete",AJAX,"[MathJax]/extensions/MathEvents.js"]
|
||||
);
|
||||
|
||||
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback,MathJax.OutputJax,MathJax.InputJax);
|
||||
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback,
|
||||
MathJax.Localization,MathJax.OutputJax,MathJax.InputJax);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/MathMenu.js
|
||||
|
@ -26,7 +27,7 @@
|
|||
*/
|
||||
|
||||
(function (HUB,HTML,AJAX,CALLBACK,OUTPUT) {
|
||||
var VERSION = "2.1";
|
||||
var VERSION = "2.1.1";
|
||||
|
||||
var SIGNAL = MathJax.Callback.Signal("menu") // signal for menu events
|
||||
|
||||
|
@ -38,7 +39,7 @@
|
|||
var _ = function (id) {
|
||||
return MathJax.Localization._.apply(
|
||||
MathJax.Localization,
|
||||
[ ["Menu", id] ].concat([].slice.call(arguments,1))
|
||||
[["MathMenu",id]].concat([].slice.call(arguments,1))
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -184,7 +185,6 @@
|
|||
*/
|
||||
Post: function (event,parent) {
|
||||
if (!event) {event = window.event};
|
||||
var title = (!this.title ? null : [["div",{className: "MathJax_MenuTitle"},[this.title]]]);
|
||||
var div = document.getElementById("MathJax_MenuFrame");
|
||||
if (!div) {
|
||||
div = MENU.Background(this);
|
||||
|
@ -196,7 +196,8 @@
|
|||
onmouseup: MENU.Mouseup, ondblclick: FALSE,
|
||||
ondragstart: FALSE, onselectstart: FALSE, oncontextmenu: FALSE,
|
||||
menuItem: this, className: "MathJax_Menu"
|
||||
},title);
|
||||
});
|
||||
MathJax.Localization.setCSS(menu);
|
||||
|
||||
for (var i = 0, m = this.items.length; i < m; i++) {this.items[i].Create(menu)}
|
||||
if (MENU.isMobile) {
|
||||
|
@ -260,16 +261,17 @@
|
|||
},
|
||||
|
||||
/*
|
||||
* Find a named item in a menu (or submenu).
|
||||
* A list of names means descend into submenus.
|
||||
* Find an item in a menu (or submenu) by name (Find) or ID (FindID).
|
||||
* A list of names or IDs means descend into submenus.
|
||||
*/
|
||||
Find: function (name) {
|
||||
var names = [].slice.call(arguments,1);
|
||||
Find: function (name) {return this.FindN(1,name,[].slice.call(arguments,1))},
|
||||
FindId: function (name) {return this.FindN(0,name,[].slice.call(arguments,1))},
|
||||
FindN: function (n,name,names) {
|
||||
for (var i = 0, m = this.items.length; i < m; i++) {
|
||||
if (this.items[i].name === name) {
|
||||
if (this.items[i].name[n] === name) {
|
||||
if (names.length) {
|
||||
if (!this.items[i].menu) {return null}
|
||||
return this.items[i].menu.Find.apply(this.items[i].menu,names);
|
||||
return this.items[i].menu.FindN(n,names[0],names.slice(1));
|
||||
}
|
||||
return this.items[i];
|
||||
}
|
||||
|
@ -280,9 +282,11 @@
|
|||
/*
|
||||
* Find the index of a menu item (so we can insert before or after it)
|
||||
*/
|
||||
IndexOf: function (name) {
|
||||
IndexOf: function (name) {return this.IndexOfN(1,name)},
|
||||
IndexOfId: function (name) {return this.IndexOfN(0,name)},
|
||||
IndexOfN: function (n,name) {
|
||||
for (var i = 0, m = this.items.length; i < m; i++)
|
||||
{if (this.items[i].name === name) {return i}}
|
||||
{if (this.items[i].name[n] === name) {return i}}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -370,7 +374,7 @@
|
|||
* The menu item root subclass
|
||||
*/
|
||||
var ITEM = MENU.ITEM = MathJax.Object.Subclass({
|
||||
name: "", // the menu item's label
|
||||
name: "", // the menu item's label as [id,label] pair
|
||||
|
||||
Create: function (menu) {
|
||||
if (!this.hidden) {
|
||||
|
@ -385,6 +389,7 @@
|
|||
HTML.addElement(menu,"div",def,this.Label(def,menu));
|
||||
}
|
||||
},
|
||||
Name: function () {return _(this.name[0],this.name[1])},
|
||||
|
||||
Mouseover: function (event,menu) {
|
||||
if (!this.disabled) {this.Activate(menu)}
|
||||
|
@ -442,11 +447,12 @@
|
|||
action: function () {},
|
||||
|
||||
Init: function (name,action,def) {
|
||||
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
|
||||
this.name = name; this.action = action;
|
||||
this.With(def);
|
||||
},
|
||||
|
||||
Label: function (def,menu) {return [this.name]},
|
||||
Label: function (def,menu) {return [this.Name()]},
|
||||
Mouseup: function (event,menu) {
|
||||
if (!this.disabled) {
|
||||
this.Remove(event,menu);
|
||||
|
@ -466,13 +472,14 @@
|
|||
marker: (isPC && !HUB.Browser.isSafari ? "\u25B6" : "\u25B8"), // the menu arrow
|
||||
|
||||
Init: function (name,def) {
|
||||
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
|
||||
this.name = name; var i = 1;
|
||||
if (!(def instanceof MENU.ITEM)) {this.With(def), i++}
|
||||
this.menu = MENU.apply(MENU,[].slice.call(arguments,i));
|
||||
},
|
||||
Label: function (def,menu) {
|
||||
this.menu.posted = false;
|
||||
return [this.name+" ",["span",{className:"MathJax_MenuArrow"},[this.marker]]];
|
||||
return [this.Name()+" ",["span",{className:"MathJax_MenuArrow"},[this.marker]]];
|
||||
},
|
||||
Timer: function (event,menu) {
|
||||
if (this.timer) {clearTimeout(this.timer)}
|
||||
|
@ -515,13 +522,14 @@
|
|||
marker: (isPC ? "\u25CF" : "\u2713"), // the checkmark
|
||||
|
||||
Init: function (name,variable,def) {
|
||||
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
|
||||
this.name = name; this.variable = variable; this.With(def);
|
||||
if (this.value == null) {this.value = this.name}
|
||||
if (this.value == null) {this.value = this.name[0]}
|
||||
},
|
||||
Label: function (def,menu) {
|
||||
var span = {className:"MathJax_MenuRadioCheck"};
|
||||
if (CONFIG.settings[this.variable] !== this.value) {span = {style:{display:"none"}}}
|
||||
return [["span",span,[this.marker]]," "+this.name];
|
||||
return [["span",span,[this.marker]]," "+this.Name()];
|
||||
},
|
||||
Mouseup: function (event,menu) {
|
||||
if (!this.disabled) {
|
||||
|
@ -551,12 +559,13 @@
|
|||
marker: "\u2713", // the checkmark
|
||||
|
||||
Init: function (name,variable,def) {
|
||||
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
|
||||
this.name = name; this.variable = variable; this.With(def);
|
||||
},
|
||||
Label: function (def,menu) {
|
||||
var span = {className:"MathJax_MenuCheck"};
|
||||
if (!CONFIG.settings[this.variable]) {span = {style:{display:"none"}}}
|
||||
return [["span",span,[this.marker]]," "+this.name];
|
||||
return [["span",span,[this.marker]]," "+this.Name()];
|
||||
},
|
||||
Mouseup: function (event,menu) {
|
||||
if (!this.disabled) {
|
||||
|
@ -576,11 +585,14 @@
|
|||
* A menu item that is a label
|
||||
*/
|
||||
MENU.ITEM.LABEL = MENU.ITEM.Subclass({
|
||||
Init: function (name,def) {this.name = name; this.With(def)},
|
||||
Init: function (name,def) {
|
||||
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
|
||||
this.name = name; this.With(def);
|
||||
},
|
||||
Label: function (def,menu) {
|
||||
delete def.onmouseover, delete def.onmouseout; delete def.onmousedown;
|
||||
def.className += " MathJax_MenuLabel";
|
||||
return [this.name];
|
||||
return [this.Name()];
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -604,36 +616,33 @@
|
|||
*/
|
||||
// Localization: need to be reorganized. currently, there are concatenation
|
||||
// of HTMLCSS.fontInUse and English strings based on the values of
|
||||
// HTMLCSS.webFonts and HTMLCSS.imgFonts, HTMLCSS.allowWebFonts etc Update
|
||||
// MENU.About.GetJax too.
|
||||
// HTMLCSS.webFonts and HTMLCSS.imgFonts, HTMLCSS.allowWebFonts etc
|
||||
MENU.About = function () {
|
||||
var HTMLCSS = OUTPUT["HTML-CSS"] || {fontInUse: ""};
|
||||
var local = (HTMLCSS.webFonts ? "" : "local "), web = (HTMLCSS.webFonts ? " web" : "");
|
||||
var font = (HTMLCSS.imgFonts ? "Image" : local+HTMLCSS.fontInUse+web) + " fonts";
|
||||
if (font === "local fonts" && OUTPUT.SVG) {font = "web SVG fonts"}
|
||||
var HTMLCSS = OUTPUT["HTML-CSS"] || {};
|
||||
var font =
|
||||
(HTMLCSS.imgFonts ? "image" :
|
||||
(HTMLCSS.fontInUse ?
|
||||
(HTMLCSS.webFonts ? "web" : "local")+" "+HTMLCSS.fontInUse :
|
||||
(OUTPUT.SVG ? "web SVG" : "generic")) ) + " fonts";
|
||||
var format = (!HTMLCSS.webFonts || HTMLCSS.imgFonts ? null :
|
||||
HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts");
|
||||
var jax = ["MathJax.js v"+MathJax.fileversion,["br"]];
|
||||
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]);
|
||||
MENU.About.GetJax(jax,MathJax.InputJax,"Input Jax");
|
||||
MENU.About.GetJax(jax,MathJax.OutputJax,"Output Jax");
|
||||
MENU.About.GetJax(jax,MathJax.ElementJax,"Element Jax");
|
||||
MENU.About.GetJax(jax,MathJax.InputJax,_("InputJax","Input Jax"));
|
||||
MENU.About.GetJax(jax,MathJax.OutputJax,_("OutputJax","Output Jax"));
|
||||
MENU.About.GetJax(jax,MathJax.ElementJax,_("ElementJax","Element Jax"));
|
||||
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]);
|
||||
MENU.About.GetJax(jax,MathJax.Extension,"Extension",true);
|
||||
MENU.About.GetJax(jax,MathJax.Extension,_("Extension","Extension"),true);
|
||||
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}],["center",{},[
|
||||
HUB.Browser + " v"+HUB.Browser.version +
|
||||
(HTMLCSS.webFonts && !HTMLCSS.imgFonts ? " \u2014 " +
|
||||
HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts" : "")
|
||||
HUB.Browser + " v"+HUB.Browser.version + (format ?
|
||||
" \u2014 " + _(format.replace(/ /g,""),format) : "")
|
||||
]]);
|
||||
// Localization:
|
||||
// - decide HTML snippet format
|
||||
// - how do we ensure it is updated when the language is changed?
|
||||
MENU.About.div = MENU.Background(MENU.About);
|
||||
var about = HTML.addElement(MENU.About.div,"div",{
|
||||
id: "MathJax_About"
|
||||
},
|
||||
_("AboutBox", "%1 using %2",
|
||||
[["b",{style:{fontSize:"120%"}},["MathJax"]],
|
||||
" v"+MathJax.version,["br"]],
|
||||
[font,["br"],["br"],
|
||||
},[
|
||||
["b",{style:{fontSize:"120%"}},["MathJax"]]," v"+MathJax.version,["br"],
|
||||
_(font.replace(/ /g,""),"using "+font),["br"],["br"],
|
||||
["span",{style:{
|
||||
display:"inline-block", "text-align":"left", "font-size":"80%",
|
||||
"max-height":"20em", overflow:"auto",
|
||||
|
@ -644,8 +653,9 @@
|
|||
src: CONFIG.closeImg,
|
||||
style: {width:"21px", height:"21px", position:"absolute", top:".2em", right:".2em"},
|
||||
onclick: MENU.About.Remove
|
||||
}]])
|
||||
);
|
||||
}]
|
||||
]);
|
||||
MathJax.Localization.setCSS(about);
|
||||
var doc = (document.documentElement||{});
|
||||
var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0;
|
||||
if (MENU.prototype.msieAboutBug) {
|
||||
|
@ -709,7 +719,7 @@
|
|||
}
|
||||
} else {
|
||||
if (MENU.jax.originalText == null) {
|
||||
alert(_("NoOriginalForm", "No original form available"));
|
||||
alert(_("NoOriginalForm","No original form available"));
|
||||
return;
|
||||
}
|
||||
MENU.ShowSource.Text(MENU.jax.originalText,event);
|
||||
|
@ -727,12 +737,12 @@
|
|||
var w = MENU.ShowSource.Window(event); delete MENU.ShowSource.w;
|
||||
text = text.replace(/^\s*/,"").replace(/\s*$/,"");
|
||||
text = text.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||
var title = _("EqSource", "MathJax Equation Source");
|
||||
var title = _("EqSource","MathJax Equation Source");
|
||||
if (MENU.isMobile) {
|
||||
w.document.open();
|
||||
w.document.write("<html><head><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>"+title+"</title></head><body style='font-size:85%'>");
|
||||
w.document.write("<pre>"+text+"</pre>");
|
||||
w.document.write("<hr><input type='button' value='"+_("Close", "Close")+"' onclick='window.close()' />");
|
||||
w.document.write("<hr><input type='button' value='"+_("Close","Close")+"' onclick='window.close()' />");
|
||||
w.document.write("</body></html>");
|
||||
w.document.close();
|
||||
} else {
|
||||
|
@ -774,7 +784,7 @@
|
|||
MENU.cookie.scale = scale;
|
||||
MENU.saveCookie(); HUB.Reprocess();
|
||||
}
|
||||
} else {alert(_("NonZeroScale", "The scale should not be zero"))}
|
||||
} else {alert(_("NonZeroScale","The scale should not be zero"))}
|
||||
} else {alert(_("PercentScale",
|
||||
"The scale should be a percentage (e.g., 120%%)"))}
|
||||
}
|
||||
|
@ -800,7 +810,8 @@
|
|||
switch (CONFIG.settings.renderer) {
|
||||
case "NativeMML":
|
||||
if (!CONFIG.settings.warnedMML) {
|
||||
if (BROWSER.isChrome || (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0"))) {message = MESSAGE.MML.WebKit}
|
||||
if (BROWSER.isChrome && BROWSER.version.substr(0,3) !== "24.") {message = MESSAGE.MML.WebKit}
|
||||
else if (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0")) {message = MESSAGE.MML.WebKit}
|
||||
else if (BROWSER.isMSIE) {if (!BROWSER.hasMathPlayer) {message = MESSAGE.MML.MSIE}}
|
||||
else {message = MESSAGE.MML[BROWSER]}
|
||||
warned = "warnedMML";
|
||||
|
@ -814,7 +825,7 @@
|
|||
break;
|
||||
}
|
||||
if (message) {
|
||||
// Localization: concatenation, new line
|
||||
message = _(message[0],message[1]);
|
||||
message += "\n\n";
|
||||
message += _("SwitchAnyway",
|
||||
"Switch the renderer anyway?\n\n" +
|
||||
|
@ -831,36 +842,34 @@
|
|||
};
|
||||
MENU.Renderer.Messages = {
|
||||
MML: {
|
||||
// Localization: should be updated when the language is changed
|
||||
// concatenation
|
||||
WebKit: _("WebkitNativeMMLWarning",
|
||||
WebKit: ["WebkitNativeMMLWarning",
|
||||
"Your browser doesn't seem to support MathML natively, " +
|
||||
"so switching to MathML output may cause the mathematics " +
|
||||
"on the page to become unreadable."),
|
||||
"on the page to become unreadable."],
|
||||
|
||||
MSIE: _("MSIENativeMMLWarning",
|
||||
MSIE: ["MSIENativeMMLWarning",
|
||||
"Internet Explorer requires the MathPlayer plugin " +
|
||||
"in order to process MathML output."),
|
||||
"in order to process MathML output."],
|
||||
|
||||
Opera: _("OperaNativeMMLWarning",
|
||||
Opera: ["OperaNativeMMLWarning",
|
||||
"Opera's support for MathML is limited, so switching to " +
|
||||
"MathML output may cause some expressions to render poorly."),
|
||||
"MathML output may cause some expressions to render poorly."],
|
||||
|
||||
Safari: _("SafariNativeMMLWarning",
|
||||
Safari: ["SafariNativeMMLWarning",
|
||||
"Your browser's native MathML does not implement all the features " +
|
||||
"used by MathJax, so some expressions may not render properly."),
|
||||
"used by MathJax, so some expressions may not render properly."],
|
||||
|
||||
Firefox: _("FirefoxNativeMMLWarning",
|
||||
Firefox: ["FirefoxNativeMMLWarning",
|
||||
"Your browser's native MathML does not implement all the features " +
|
||||
"used by MathJax, so some expressions may not render properly.")
|
||||
"used by MathJax, so some expressions may not render properly."]
|
||||
},
|
||||
|
||||
SVG: {
|
||||
MSIE: _("MSIESVGWarning",
|
||||
MSIE: ["MSIESVGWarning",
|
||||
"SVG is not implemented in Internet Explorer prior to " +
|
||||
"IE9, or when the browser is emulating IE8 or below. " +
|
||||
"Switching to SVG output will cause the mathemtics to " +
|
||||
"not display properly.")
|
||||
"not display properly."]
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -879,7 +888,7 @@
|
|||
var discoverable = CONFIG.settings.discoverable,
|
||||
MESSAGE = MENU.MPEvents.Messages;
|
||||
if (!isIE9) {
|
||||
if (CONFIG.settings.mpMouse && !confirm(MESSAGE.IE8warning)) {
|
||||
if (CONFIG.settings.mpMouse && !confirm(_.apply(_,MESSAGE.IE8warning))) {
|
||||
delete MENU.cookie.mpContext; delete CONFIG.settings.mpContext;
|
||||
delete MENU.cookie.mpMouse; delete CONFIG.settings.mpMouse;
|
||||
MENU.saveCookie();
|
||||
|
@ -889,23 +898,20 @@
|
|||
MENU.cookie.mpContext = MENU.cookie.mpMouse = CONFIG.settings.mpMouse;
|
||||
MENU.saveCookie();
|
||||
MathJax.Hub.Queue(["Rerender",MathJax.Hub])
|
||||
} else if (!discoverable && item.name === "Menu Events" && CONFIG.settings.mpContext) {
|
||||
alert(MESSAGE.IE9warning);
|
||||
} else if (!discoverable && item.name[0] === "Menu Events" && CONFIG.settings.mpContext) {
|
||||
alert(_.apply(_,MESSAGE.IE9warning));
|
||||
}
|
||||
};
|
||||
// Localization: should be updated when the language is changed
|
||||
// concatenation
|
||||
|
||||
MENU.MPEvents.Messages = {
|
||||
IE8warning:
|
||||
_("IE8warning",
|
||||
IE8warning: ["IE8warning",
|
||||
"This will disable the MathJax menu and zoom features, " +
|
||||
"but you can Alt-Click on an expression to obtain the MathJax " +
|
||||
"menu instead.\n\nReally change the MathPlayer settings?"),
|
||||
"menu instead.\n\nReally change the MathPlayer settings?"],
|
||||
|
||||
IE9warning:
|
||||
_("IE9warning",
|
||||
IE9warning: ["IE9warning",
|
||||
"The MathJax contextual menu will be disabled, but you can " +
|
||||
"Alt-Click on an expression to obtain the MathJax menu instead.")
|
||||
"Alt-Click on an expression to obtain the MathJax menu instead."]
|
||||
};
|
||||
|
||||
/*************************************************************/
|
||||
|
@ -954,27 +960,27 @@
|
|||
*/
|
||||
// Localization: items used as key, should be refactored.
|
||||
MENU.menu = MENU(
|
||||
ITEM.SUBMENU("Show Math As",
|
||||
ITEM.COMMAND("MathML Code", MENU.ShowSource, {nativeTouch: true, format: "MathML"}),
|
||||
ITEM.COMMAND("Original Form", MENU.ShowSource, {nativeTouch: true}),
|
||||
ITEM.SUBMENU(["Show","Show Math As"],
|
||||
ITEM.COMMAND(["MathMLcode","MathML Code"], MENU.ShowSource, {nativeTouch: true, format: "MathML"}),
|
||||
ITEM.COMMAND(["Original","Original Form"], MENU.ShowSource, {nativeTouch: true}),
|
||||
ITEM.RULE(),
|
||||
ITEM.CHECKBOX("Show TeX hints in MathML", "texHints")
|
||||
ITEM.CHECKBOX(["texHints","Show TeX hints in MathML"], "texHints")
|
||||
),
|
||||
ITEM.RULE(),
|
||||
ITEM.SUBMENU("Math Settings",
|
||||
ITEM.SUBMENU("Zoom Trigger",
|
||||
ITEM.RADIO("Hover", "zoom", {action: MENU.Zoom}),
|
||||
ITEM.RADIO("Click", "zoom", {action: MENU.Zoom}),
|
||||
ITEM.RADIO("Double-Click", "zoom", {action: MENU.Zoom}),
|
||||
ITEM.RADIO("No Zoom", "zoom", {value: "None"}),
|
||||
ITEM.SUBMENU(["Settings","Math Settings"],
|
||||
ITEM.SUBMENU(["ZoomTrigger","Zoom Trigger"],
|
||||
ITEM.RADIO(["Hover","Hover"], "zoom", {action: MENU.Zoom}),
|
||||
ITEM.RADIO(["Click","Click"], "zoom", {action: MENU.Zoom}),
|
||||
ITEM.RADIO(["DoubleClick","Double-Click"], "zoom", {action: MENU.Zoom}),
|
||||
ITEM.RADIO(["NoZoom","No Zoom"], "zoom", {value: "None"}),
|
||||
ITEM.RULE(),
|
||||
ITEM.LABEL("Trigger Requires:"),
|
||||
ITEM.CHECKBOX((HUB.Browser.isMac ? "Option" : "Alt"), "ALT"),
|
||||
ITEM.CHECKBOX("Command", "CMD", {hidden: !HUB.Browser.isMac}),
|
||||
ITEM.CHECKBOX("Control", "CTRL", {hidden: HUB.Browser.isMac}),
|
||||
ITEM.CHECKBOX("Shift", "Shift")
|
||||
ITEM.LABEL(["TriggerRequires","Trigger Requires:"]),
|
||||
ITEM.CHECKBOX((HUB.Browser.isMac ? ["Option","Option"] : ["Alt","Alt"]), "ALT"),
|
||||
ITEM.CHECKBOX(["Command","Command"], "CMD", {hidden: !HUB.Browser.isMac}),
|
||||
ITEM.CHECKBOX(["Control","Control"], "CTRL", {hidden: HUB.Browser.isMac}),
|
||||
ITEM.CHECKBOX(["Shift","Shift"], "Shift")
|
||||
),
|
||||
ITEM.SUBMENU("Zoom Factor",
|
||||
ITEM.SUBMENU(["ZoomFactor","Zoom Factor"],
|
||||
ITEM.RADIO("125%", "zscale"),
|
||||
ITEM.RADIO("133%", "zscale"),
|
||||
ITEM.RADIO("150%", "zscale"),
|
||||
|
@ -985,40 +991,39 @@
|
|||
ITEM.RADIO("400%", "zscale")
|
||||
),
|
||||
ITEM.RULE(),
|
||||
ITEM.SUBMENU("Math Renderer", {hidden:!CONFIG.showRenderer},
|
||||
ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer},
|
||||
ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}),
|
||||
ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}),
|
||||
ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer})
|
||||
),
|
||||
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE ||
|
||||
!CONFIG.showMathPlayer,
|
||||
disabled:!HUB.Browser.hasMathPlayer},
|
||||
ITEM.LABEL("Let MathPlayer Handle:"),
|
||||
ITEM.CHECKBOX("Menu Events", "mpContext", {action: MENU.MPEvents, hidden:!isIE9}),
|
||||
ITEM.CHECKBOX("Mouse Events", "mpMouse", {action: MENU.MPEvents, hidden:!isIE9}),
|
||||
ITEM.CHECKBOX("Mouse and Menu Events", "mpMouse", {action: MENU.MPEvents, hidden:isIE9})
|
||||
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
|
||||
disabled:!HUB.Browser.hasMathPlayer},
|
||||
ITEM.LABEL(["MPHandles","Let MathPlayer Handle:"]),
|
||||
ITEM.CHECKBOX(["MenuEvents","Menu Events"], "mpContext", {action: MENU.MPEvents, hidden:!isIE9}),
|
||||
ITEM.CHECKBOX(["MouseEvents","Mouse Events"], "mpMouse", {action: MENU.MPEvents, hidden:!isIE9}),
|
||||
ITEM.CHECKBOX(["MenuAndMouse","Mouse and Menu Events"], "mpMouse", {action: MENU.MPEvents, hidden:isIE9})
|
||||
),
|
||||
ITEM.SUBMENU("Font Preference", {hidden:!CONFIG.showFontMenu},
|
||||
ITEM.LABEL("For HTML-CSS:"),
|
||||
ITEM.RADIO("Auto", "font", {action: MENU.Font}),
|
||||
ITEM.SUBMENU(["FontPrefs","Font Preference"], {hidden:!CONFIG.showFontMenu},
|
||||
ITEM.LABEL(["ForHTMLCSS","For HTML-CSS:"]),
|
||||
ITEM.RADIO(["Auto","Auto"], "font", {action: MENU.Font}),
|
||||
ITEM.RULE(),
|
||||
ITEM.RADIO("TeX (local)", "font", {action: MENU.Font}),
|
||||
ITEM.RADIO("TeX (web)", "font", {action: MENU.Font}),
|
||||
ITEM.RADIO("TeX (image)", "font", {action: MENU.Font}),
|
||||
ITEM.RADIO(["TeXLocal","TeX (local)"], "font", {action: MENU.Font}),
|
||||
ITEM.RADIO(["TeXWeb","TeX (web)"], "font", {action: MENU.Font}),
|
||||
ITEM.RADIO(["TeXImage","TeX (image)"], "font", {action: MENU.Font}),
|
||||
ITEM.RULE(),
|
||||
ITEM.RADIO("STIX (local)", "font", {action: MENU.Font})
|
||||
ITEM.RADIO(["STIXlocal","STIX (local)"], "font", {action: MENU.Font})
|
||||
),
|
||||
ITEM.SUBMENU("Contextual Menu", {hidden:!CONFIG.showContext},
|
||||
ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext},
|
||||
ITEM.RADIO("MathJax", "context"),
|
||||
ITEM.RADIO("Browser", "context")
|
||||
ITEM.RADIO(["Browser","Browser"], "context")
|
||||
),
|
||||
ITEM.COMMAND("Scale All Math ...",MENU.Scale),
|
||||
ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:"discover_rule"}),
|
||||
ITEM.CHECKBOX("Highlight on Hover", "discoverable", {hidden:!CONFIG.showDiscoverable})
|
||||
ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale),
|
||||
ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:["","discover_rule"]}),
|
||||
ITEM.CHECKBOX(["Discoverable","Highlight on Hover"], "discoverable", {hidden:!CONFIG.showDiscoverable})
|
||||
),
|
||||
ITEM.RULE(),
|
||||
ITEM.COMMAND("About MathJax",MENU.About),
|
||||
ITEM.COMMAND("MathJax Help",MENU.Help)
|
||||
ITEM.COMMAND(["About","About MathJax"],MENU.About),
|
||||
ITEM.COMMAND(["Help","MathJax Help"],MENU.Help)
|
||||
);
|
||||
|
||||
if (MENU.isMobile) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/AMSmath.js
|
||||
|
@ -24,7 +25,7 @@
|
|||
*/
|
||||
|
||||
MathJax.Extension["TeX/AMSmath"] = {
|
||||
version: "2.1",
|
||||
version: "2.1.1",
|
||||
|
||||
number: 0, // current equation number
|
||||
startNumber: 0, // current starting equation number (for when equation is restarted)
|
||||
|
@ -162,15 +163,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (!star) {arg = CONFIG.formatTag(arg)}
|
||||
var global = this.stack.global; global.tagID = tag;
|
||||
if (global.notags) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "CommandNotAllowedInEnv"],
|
||||
"%1 not allowed in %2 environment",
|
||||
name, global.notags)
|
||||
)
|
||||
}
|
||||
if (global.tag) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "MultipleCommand"],
|
||||
"Multiple %1", name))
|
||||
TEX.Error(["CommandNotAllowedInEnv",
|
||||
"%1 not allowed in %2 environment",
|
||||
name,global.notags]
|
||||
);
|
||||
}
|
||||
if (global.tag) {TEX.Error(["MultipleCommand","Multiple %1",name])}
|
||||
global.tag = MML.mtd.apply(MML,this.InternalMath(arg)).With({id:CONFIG.formatID(tag)});
|
||||
},
|
||||
HandleNoTag: function (name) {
|
||||
|
@ -185,16 +183,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
var global = this.stack.global, label = this.GetArgument(name);
|
||||
if (label === "") return;
|
||||
if (!AMS.refUpdate) {
|
||||
if (global.label) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "MultipleCommand"],
|
||||
"Multiple %1", name))
|
||||
}
|
||||
if (global.label) {TEX.Error(["MultipleCommand","Multiple %1",name])}
|
||||
global.label = label;
|
||||
if (AMS.labels[label] || AMS.eqlabels[label]) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "MultipleLabel"],
|
||||
"Label '%1' mutiply defined",
|
||||
label)
|
||||
}
|
||||
if (AMS.labels[label] || AMS.eqlabels[label])
|
||||
{TEX.Error(["MultipleLabel","Label '%1' mutiply defined",label])}
|
||||
AMS.eqlabels[label] = "???"; // will be replaced by tag value later
|
||||
}
|
||||
},
|
||||
|
@ -239,8 +231,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
HandleShove: function (name,shove) {
|
||||
var top = this.stack.Top();
|
||||
if (top.type !== "multline" || top.data.length) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "CommandAtTheBeginingOfLine",
|
||||
"%1 must come at the beginning of the line"))
|
||||
TEX.Error(["CommandAtTheBeginingOfLine",
|
||||
"%1 must come at the beginning of the line",name]);
|
||||
}
|
||||
top.data.shove = shove;
|
||||
},
|
||||
|
@ -255,11 +247,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
var frac = MML.mfrac(TEX.Parse('\\strut\\textstyle{'+num+'}',this.stack.env).mml(),
|
||||
TEX.Parse('\\strut\\textstyle{'+den+'}',this.stack.env).mml());
|
||||
lr = ({l:MML.ALIGN.LEFT, r:MML.ALIGN.RIGHT,"":""})[lr];
|
||||
if (lr == null) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "IllegalAlign"],
|
||||
"Illegal alignment specified in %1",
|
||||
name))
|
||||
}
|
||||
if (lr == null)
|
||||
{TEX.Error(["IllegalAlign","Illegal alignment specified in %1",name])}
|
||||
if (lr) {frac.numalign = frac.denomalign = lr}
|
||||
this.Push(frac);
|
||||
},
|
||||
|
@ -279,10 +268,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (left || right) {frac = MML.mfenced(frac).With({open: left, close: right})}
|
||||
if (style !== "") {
|
||||
var STYLE = (["D","T","S","SS"])[style];
|
||||
if (STYLE == null) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "BadMathStyleFor"],
|
||||
"Bad math style for %1", name)
|
||||
}
|
||||
if (STYLE == null)
|
||||
{TEX.Error(["BadMathStyleFor","Bad math style for %1",name])}
|
||||
frac = MML.mstyle(frac);
|
||||
if (STYLE === "D") {frac.displaystyle = true; frac.scriptlevel = 0}
|
||||
else {frac.displaystyle = false; frac.scriptlevel = style - 1}
|
||||
|
@ -334,9 +321,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (!taggable) {valign = this.GetBrackets("\\begin{"+begin.name+"}")}
|
||||
n = this.GetArgument("\\begin{"+begin.name+"}");
|
||||
if (n.match(/[^0-9]/)) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "PositiveIntegerArg"],
|
||||
"Argument to %1 must me a positive integer"),
|
||||
"\\begin{"+begin.name+"}")
|
||||
TEX.Error(["PositiveIntegerArg","Argument to %1 must me a positive integer",
|
||||
"\\begin{"+begin.name+"}"]);
|
||||
}
|
||||
while (n > 0) {align += "rl"; spacing.push("0em 0em"); n--}
|
||||
spacing = spacing.join(" ");
|
||||
|
@ -362,12 +348,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
* Check for bad nesting of equation environments
|
||||
*/
|
||||
checkEqnEnv: function () {
|
||||
if (this.stack.global.eqnenv) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(["TeX", "ErroneousNestingEq"],
|
||||
"Erroneous nesting of equation structures")
|
||||
)
|
||||
}
|
||||
if (this.stack.global.eqnenv)
|
||||
{TEX.Error(["ErroneousNestingEq","Erroneous nesting of equation structures"])}
|
||||
this.stack.global.eqnenv = true;
|
||||
},
|
||||
|
||||
|
@ -413,9 +395,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
var c = this.trimSpaces(this.GetArgument(name));
|
||||
if (c == "") {return null}
|
||||
if (TEXDEF.delimiter[c] == null) {
|
||||
TEX.Error(MathJax.Localization._(["TeX",
|
||||
"MissingOrUnrecognizedDelim"],
|
||||
"Missing or unrecognized delimiter for %1", name))
|
||||
TEX.Error(["MissingOrUnrecognizedDelim",
|
||||
"Missing or unrecognized delimiter for %1",name]);
|
||||
}
|
||||
return this.convertDelimiter(c);
|
||||
},
|
||||
|
@ -479,10 +460,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
},
|
||||
EndRow: function () {
|
||||
if (this.row.length != 1) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(["TeX", "MultipleRowsOneCol"],
|
||||
"multline rows must have exactly one column")
|
||||
)
|
||||
TEX.Error(["MultipleRowsOneCol",
|
||||
"multline rows must have exactly one column"]);
|
||||
}
|
||||
this.table.push(this.row); this.row = [];
|
||||
},
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/bbox.js
|
||||
|
@ -45,7 +46,7 @@
|
|||
*/
|
||||
|
||||
MathJax.Extension["TeX/bbox"] = {
|
||||
version: "2.1"
|
||||
version: "2.1.1"
|
||||
};
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
|
@ -64,39 +65,24 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
var part = parts[i].replace(/^\s+/,'').replace(/\s+$/,'');
|
||||
var match = part.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/);
|
||||
if (match) {
|
||||
if (def)
|
||||
{TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2","Padding",name])}
|
||||
var pad = match[1]+match[3];
|
||||
if (def) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "MultipleBboxProperty"],
|
||||
"%1 specified twice in %2", "Padding", name)
|
||||
)
|
||||
}
|
||||
def = {height:"+"+pad, depth:"+"+pad, lspace:pad, width:"+"+(2*match[1])+match[3]};
|
||||
} else if (part.match(/^([a-z0-9]+|\#[0-9a-f]{6}|\#[0-9a-f]{3})$/i)) {
|
||||
if (background) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "MultipleBboxProperty"],
|
||||
"%1 specified twice in %2", "Background", name)
|
||||
)
|
||||
}
|
||||
if (background)
|
||||
{TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2","Background",name])}
|
||||
background = part;
|
||||
} else if (part.match(/^[-a-z]+:/i)) {
|
||||
if (style) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "MultipleBboxProperty"],
|
||||
"%1 specified twice in %2", "Style", name)
|
||||
)
|
||||
}
|
||||
if (style)
|
||||
{TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2", "Style",name])}
|
||||
style = part;
|
||||
} else if (part !== "") {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "InvalidBboxProperty"],
|
||||
"'%1' doesn't look like a color, a padding dimension, or a style",
|
||||
part);
|
||||
["InvalidBBoxProperty",
|
||||
"'%1' doesn't look like a color, a padding dimension, or a style",
|
||||
part]
|
||||
);
|
||||
}
|
||||
}
|
||||
if (def) {math = MML.mpadded(math).With(def)}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/begingroup.js
|
||||
|
@ -25,7 +26,7 @@
|
|||
*/
|
||||
|
||||
MathJax.Extension["TeX/begingroup"] = {
|
||||
version: "2.1"
|
||||
version: "2.1.1"
|
||||
};
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
|
@ -215,12 +216,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (TEX.eqnStack.top > 1) {
|
||||
TEX.eqnStack.Pop();
|
||||
} else if (TEX.rootStack.top === 1) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "ExtraEndMissingBegin"],
|
||||
"Extra %1 or missing \\begingroup", name
|
||||
)
|
||||
)
|
||||
TEX.Error(["ExtraEndMissingBegin","Extra %1 or missing \\begingroup",name]);
|
||||
} else {
|
||||
TEX.eqnStack.Clear();
|
||||
TEX.rootStack.Pop();
|
||||
|
@ -296,11 +292,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
Global: function (name) {
|
||||
var i = this.i; var cs = this.GetCSname(name); this.i = i;
|
||||
if (cs !== "let" && cs !== "def" && cs !== "newcommand") {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "GlobalNotFollowedBy"],
|
||||
"%1 not followed by \\let, \\def, or \\newcommand", name)
|
||||
)
|
||||
TEX.Error(["GlobalNotFollowedBy",
|
||||
"%1 not followed by \\let, \\def, or \\newcommand",name]);
|
||||
}
|
||||
this.stack.env.isGlobal = true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/color.js
|
||||
|
@ -30,7 +31,7 @@
|
|||
// The configuration defaults, augmented by the user settings
|
||||
//
|
||||
MathJax.Extension["TeX/color"] = {
|
||||
version: "2.1",
|
||||
version: "2.1.1",
|
||||
|
||||
config: MathJax.Hub.CombineConfig("TeX.color",{
|
||||
padding: "5px",
|
||||
|
@ -114,12 +115,7 @@ MathJax.Extension["TeX/color"] = {
|
|||
getColor: function (model,def) {
|
||||
if (!model) {model = "named"}
|
||||
var fn = this["get_"+model];
|
||||
if (!fn) {
|
||||
this.TEX.Error(
|
||||
MathJax.Localization._(["TeX", "UndefinedColorModel"],
|
||||
"Color model '%1' not defined", model)
|
||||
)
|
||||
}
|
||||
if (!fn) {this.TEX.Error(["UndefinedColorModel","Color model '%1' not defined",model])}
|
||||
return fn.call(this,def);
|
||||
},
|
||||
|
||||
|
@ -128,24 +124,14 @@ MathJax.Extension["TeX/color"] = {
|
|||
*/
|
||||
get_rgb: function (rgb) {
|
||||
rgb = rgb.split(/,/); var RGB = "#";
|
||||
if (rgb.length !== 3) {
|
||||
this.TEX.Error(MathJax.Localization._(["TeX", "rgbArg1"],
|
||||
"rgb colors require 3 decimal numbers"))
|
||||
}
|
||||
if (rgb.length !== 3)
|
||||
{this.TEX.Error(["rgbArg1","rgb colors require 3 decimal numbers"])}
|
||||
for (var i = 0; i < 3; i++) {
|
||||
if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/)) {
|
||||
this.TEX.Error(
|
||||
MathJax.Localization._(["TeX", "InvalidDecimalNumber"],
|
||||
"Invalid decimal number")
|
||||
)
|
||||
}
|
||||
if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/))
|
||||
{this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])}
|
||||
var n = parseFloat(rgb[i]);
|
||||
if (n < 0 || n > 1) {
|
||||
this.TEX.Error(
|
||||
MathJax.Localization._(["TeX", "rgbArg2"],
|
||||
"rgb values must be between 0 and 1")
|
||||
)
|
||||
}
|
||||
if (n < 0 || n > 1)
|
||||
{this.TEX.Error(["rgbArg2","rgb values must be between 0 and 1"])}
|
||||
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
|
||||
RGB += n;
|
||||
}
|
||||
|
@ -157,22 +143,14 @@ MathJax.Extension["TeX/color"] = {
|
|||
*/
|
||||
get_RGB: function (rgb) {
|
||||
rgb = rgb.split(/,/); var RGB = "#";
|
||||
if (rgb.length !== 3) {
|
||||
this.TEX.Error(MathJax.Localization._(["TeX", "RGBArg1"],
|
||||
"RGB colors require 3 numbers"))
|
||||
}
|
||||
if (rgb.length !== 3)
|
||||
{this.TEX.Error(["RGBArg1","RGB colors require 3 numbers"])}
|
||||
for (var i = 0; i < 3; i++) {
|
||||
if (!rgb[i].match(/^\d+$/)) {
|
||||
this.TEX.Error(MathJax.Localization._(["TeX", "InvalidNumber"],
|
||||
"Invalid number"))
|
||||
}
|
||||
if (!rgb[i].match(/^\d+$/))
|
||||
{this.TEX.Error(["InvalidNumber","Invalid number"])}
|
||||
var n = parseInt(rgb[i]);
|
||||
if (n > 255) {
|
||||
this.TEX.Error(
|
||||
MathJax.Localization._(["TeX", "RGBArg2"],
|
||||
"RGB values must be between 0 and 255")
|
||||
)
|
||||
}
|
||||
if (n > 255)
|
||||
{this.TEX.Error(["RGBArg2","RGB values must be between 0 and 255"])}
|
||||
n = n.toString(16); if (n.length < 2) {n = "0"+n}
|
||||
RGB += n;
|
||||
}
|
||||
|
@ -183,18 +161,11 @@ MathJax.Extension["TeX/color"] = {
|
|||
* Get a gray-scale value
|
||||
*/
|
||||
get_gray: function (gray) {
|
||||
if (!gray.match(/^(\d+(\.\d*)?|\.\d+)$/)) {
|
||||
this.TEX.Error(
|
||||
MathJax.Localization._(["TeX", "InvalidDecimalNumber"],
|
||||
"Invalid decimal number")
|
||||
)
|
||||
}
|
||||
if (!gray.match(/^(\d+(\.\d*)?|\.\d+)$/))
|
||||
{this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])}
|
||||
var n = parseFloat(gray);
|
||||
if (n < 0 || n > 1) {
|
||||
this.TEX.Error(
|
||||
MathJax.Localization._(["TeX", "GrayScalerArg"],
|
||||
"Grey-scale values must be between 0 and 1"))
|
||||
}
|
||||
if (n < 0 || n > 1)
|
||||
{this.TEX.Error(["GrayScalerArg","Grey-scale values must be between 0 and 1"])}
|
||||
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
|
||||
return "#"+n+n+n;
|
||||
},
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/extpfeil.js
|
||||
|
@ -24,7 +25,7 @@
|
|||
*/
|
||||
|
||||
MathJax.Extension["TeX/extpfeil"] = {
|
||||
version: "2.1"
|
||||
version: "2.1.1"
|
||||
};
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
|
@ -73,23 +74,22 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
space = this.GetArgument(name),
|
||||
chr = this.GetArgument(name);
|
||||
if (!cs.match(/^\\([a-z]+|.)$/i)) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(["TeX", "NewextarrowArg1"]
|
||||
"First argument to %1 must be a control sequence name", name)
|
||||
)
|
||||
TEX.Error(["NewextarrowArg1",
|
||||
"First argument to %1 must be a control sequence name",name]);
|
||||
}
|
||||
if (!space.match(/^(\d+),(\d+)$/)) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(["TeX", "NewextarrowArg2"]
|
||||
"Second argument to %1 must be two integers separated by a comma",
|
||||
name)
|
||||
)
|
||||
["NewextarrowArg2",
|
||||
"Second argument to %1 must be two integers separated by a comma",
|
||||
name]
|
||||
);
|
||||
}
|
||||
if (!chr.match(/^(\d+|0x[0-9A-F]+)$/i)) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(["TeX", "NewextarrowArg3"]
|
||||
"Third argument to %1 must be a unicode character number", name)
|
||||
)
|
||||
["NewextarrowArg3",
|
||||
"Third argument to %1 must be a unicode character number",
|
||||
name]
|
||||
);
|
||||
}
|
||||
cs = cs.substr(1); space = space.split(","); chr = parseInt(chr);
|
||||
TEXDEF.macros[cs] = ['xArrow',chr,parseInt(space[0]),parseInt(space[1])];
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/mhchem.js
|
||||
|
@ -25,7 +26,7 @@
|
|||
*/
|
||||
|
||||
MathJax.Extension["TeX/mhchem"] = {
|
||||
version: "2.1"
|
||||
version: "2.1.1"
|
||||
};
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
|
@ -353,21 +354,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (C === "}") {
|
||||
if (braces) {braces--}
|
||||
else {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "ExtraCloseMissingOpen"],
|
||||
"Extra close brace or missing open brace"
|
||||
)
|
||||
)
|
||||
TEX.Error(["ExtraCloseMissingOpen","Extra close brace or missing open brace"])
|
||||
}
|
||||
}
|
||||
}
|
||||
if (braces) {
|
||||
TEX.Error(MathJax.Localization._(["TeX", "MissingCloseBrace"],
|
||||
"Missing close brace"))
|
||||
};
|
||||
TEX.Error(MathJax.Localization._(["TeX", "NoClosingChar"],
|
||||
"Can't find closing %1", c)
|
||||
if (braces) {TEX.Error(["MissingCloseBrace","Missing close brace"])}
|
||||
TEX.Error(["NoClosingChar","Can't find closing %1",c]);
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/newcommand.js
|
||||
|
@ -25,16 +26,11 @@
|
|||
*/
|
||||
|
||||
MathJax.Extension["TeX/newcommand"] = {
|
||||
version: "2.1"
|
||||
version: "2.1.1"
|
||||
};
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
|
||||
var _ = function (id) {
|
||||
return MathJax.Localization._.apply(MathJax.Localization,
|
||||
[ ["TeX", id] ].concat([].slice.call(arguments,1)))
|
||||
};
|
||||
|
||||
var TEX = MathJax.InputJax.TeX;
|
||||
var TEXDEF = TEX.Definitions;
|
||||
|
||||
|
@ -61,14 +57,14 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
def = this.GetArgument(name);
|
||||
if (cs.charAt(0) === "\\") {cs = cs.substr(1)}
|
||||
if (!cs.match(/^(.|[a-z]+)$/i)) {
|
||||
TEX.Error(_("IllegalControlSequenceName",
|
||||
"Illegal control sequence name for %1", name))
|
||||
TEX.Error(["IllegalControlSequenceName",
|
||||
"Illegal control sequence name for %1",name]);
|
||||
}
|
||||
if (n) {
|
||||
n = this.trimSpaces(n);
|
||||
if (!n.match(/^[0-9]+$/)) {
|
||||
TEX.Error(_("IllegalParamNumber"
|
||||
"Illegal number of parameters specified in %1", name))
|
||||
TEX.Error(["IllegalParamNumber",
|
||||
"Illegal number of parameters specified in %1",name]);
|
||||
}
|
||||
}
|
||||
this.setDef(cs,['Macro',def,n,opt]);
|
||||
|
@ -85,8 +81,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (n) {
|
||||
n = this.trimSpaces(n);
|
||||
if (!n.match(/^[0-9]+$/)) {
|
||||
TEX.Error(_("IllegalParamNumber"
|
||||
"Illegal number of parameters specified in %1", name))
|
||||
TEX.Error(["IllegalParamNumber",
|
||||
"Illegal number of parameters specified in %1",name]);
|
||||
}
|
||||
}
|
||||
this.setEnv(env,['BeginEnv','EndEnv',bdef,edef,n]);
|
||||
|
@ -145,8 +141,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
GetCSname: function (cmd) {
|
||||
var c = this.GetNext();
|
||||
if (c !== "\\") {
|
||||
TEX.Error(_("DoubleBackSlash",
|
||||
"\\ must be followed by a control sequence"))
|
||||
TEX.Error(["DoubleBackSlash",
|
||||
"\\ must be followed by a control sequence"])
|
||||
}
|
||||
var cs = this.trimSpaces(this.GetArgument(cmd));
|
||||
return cs.substr(1);
|
||||
|
@ -164,13 +160,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)}
|
||||
c = this.string.charAt(++this.i);
|
||||
if (!c.match(/^[1-9]$/)) {
|
||||
TEX.Error(_("CantUseHash2",
|
||||
"Illegal use of # in template for %1", cs))
|
||||
TEX.Error(["CantUseHash2",
|
||||
"Illegal use of # in template for %1",cs]);
|
||||
}
|
||||
if (parseInt(c) != ++n) {
|
||||
TEX.Error(_(
|
||||
"SequentialParam",
|
||||
"Parameters for %1 must be numbered sequentially", cs))
|
||||
TEX.Error(["SequentialParam",
|
||||
"Parameters for %1 must be numbered sequentially",cs]);
|
||||
}
|
||||
i = this.i+1;
|
||||
} else if (c === '{') {
|
||||
|
@ -179,8 +174,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
}
|
||||
this.i++;
|
||||
}
|
||||
TEX.Error(_("MissingReplacementString",
|
||||
"Missing replacement string for definition of %1", cmd));
|
||||
TEX.Error(["MissingReplacementString",
|
||||
"Missing replacement string for definition of %1",cmd]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -190,10 +185,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
if (n) {
|
||||
var args = []; this.GetNext();
|
||||
if (params[0] && !this.MatchParam(params[0])) {
|
||||
TEX.Error(
|
||||
_("MismatchUseDef",
|
||||
"Use of %1 doesn't match its definition", name))
|
||||
)
|
||||
TEX.Error(["MismatchUseDef",
|
||||
"Use of %1 doesn't match its definition",name]);
|
||||
}
|
||||
for (var i = 0; i < n; i++) {args.push(this.GetParameter(name,params[i+1]))}
|
||||
text = this.SubstituteArgs(args,text);
|
||||
|
@ -201,10 +194,9 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
this.string = this.AddArgs(text,this.string.slice(this.i));
|
||||
this.i = 0;
|
||||
if (++this.macroCount > TEX.config.MAXMACROS) {
|
||||
TEX.Error(
|
||||
_("MaxMacroSub1",
|
||||
"MathJax maximum macro substitution count exceeded; is there a recursive macro call?")
|
||||
)
|
||||
TEX.Error(["MaxMacroSub1",
|
||||
"MathJax maximum macro substitution count exceeded; " +
|
||||
"is there a recursive macro call?"]);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -244,9 +236,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
this.i++; j++; hasBraces = 0;
|
||||
}
|
||||
}
|
||||
TEX.Error(
|
||||
_("RunawayArgument", "Runaway argument for %1?", name)
|
||||
);
|
||||
TEX.Error(["RunawayArgument","Runaway argument for %1?",name]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/verb.js
|
||||
|
@ -25,7 +26,7 @@
|
|||
*/
|
||||
|
||||
MathJax.Extension["TeX/verb"] = {
|
||||
version: "2.1"
|
||||
version: "2.1.1"
|
||||
};
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
|
@ -43,19 +44,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
*/
|
||||
Verb: function (name) {
|
||||
var c = this.GetNext(); var start = ++this.i;
|
||||
if (c == "" ) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "MissingArgFor"],
|
||||
"Argument manquant pour la commande %1", name))
|
||||
}
|
||||
if (c == "" ) {TEX.Error(["MissingArgFor","Missing argument for %1",name])}
|
||||
while (this.i < this.string.length && this.string.charAt(this.i) != c) {this.i++}
|
||||
if (this.i == this.string.length) {
|
||||
TEX.Error(
|
||||
MathJax.Localization._(
|
||||
["TeX", "NoClosinDelim"],
|
||||
"Can't find closing delimiter for %1", name))
|
||||
}
|
||||
if (this.i == this.string.length)
|
||||
{TEX.Error(["NoClosingDelim","Can't find closing delimiter for %1", name])}
|
||||
var text = this.string.slice(start,this.i); this.i++;
|
||||
this.Push(MML.mtext(text).With({mathvariant:MML.VARIANT.MONOSPACE}));
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
MathJax.InputJax.AsciiMath = MathJax.InputJax({
|
||||
id: "AsciiMath",
|
||||
version: "2.1",
|
||||
version: "2.1.1",
|
||||
directory: MathJax.InputJax.directory + "/AsciiMath",
|
||||
extensionDir: MathJax.InputJax.extensionDir + "/AsciiMath",
|
||||
|
||||
|
|
|
@ -1268,7 +1268,7 @@ junk = null;
|
|||
var MML;
|
||||
|
||||
ASCIIMATH.Augment({
|
||||
sourceMenuTitle: "AsciiMath Input",
|
||||
sourceMenuTitle: /*_(MathMenu)*/ ["AsciiMathInput","AsciiMath Input"],
|
||||
|
||||
prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing AsciiMath
|
||||
postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing AsciiMath
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
MathJax.InputJax.MathML = MathJax.InputJax({
|
||||
id: "MathML",
|
||||
version: "2.1",
|
||||
version: "2.1.1",
|
||||
directory: MathJax.InputJax.directory + "/MathML",
|
||||
extensionDir: MathJax.InputJax.extensionDir + "/MathML",
|
||||
entityDir: MathJax.InputJax.directory + "/MathML/entities",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/jax/input/MathML/jax.js
|
||||
|
@ -29,8 +30,8 @@
|
|||
var MML;
|
||||
|
||||
var _ = function (id) {
|
||||
return MathJax.Localization._.apply(MathJax.Localization,[
|
||||
["MathML",id] ].concat([].slice.call(arguments,1)))
|
||||
return MathJax.Localization._.apply(MathJax.Localization,
|
||||
[["MathML",id]].concat([].slice.call(arguments,1)))
|
||||
};
|
||||
|
||||
MATHML.Parse = MathJax.Object.Subclass({
|
||||
|
@ -54,33 +55,23 @@
|
|||
math = math.replace(/^\s*(?:\/\/)?<!(--)?\[CDATA\[((.|\n)*)(\/\/)?\]\]\1>\s*$/,"$2");
|
||||
math = math.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity);
|
||||
doc = MATHML.ParseXML(math);
|
||||
if (doc == null) {
|
||||
MATHML.Error(_("ErrorParsingMathML", "Error parsing MathML"))
|
||||
}
|
||||
if (doc == null) {MATHML.Error(["ErrorParsingMathML","Error parsing MathML"])}
|
||||
}
|
||||
var err = doc.getElementsByTagName("parsererror")[0];
|
||||
// Localization: This seems to replace error messages produced
|
||||
// by browsers. Does that work in all languages?
|
||||
if (err) MATHML.Error("Error parsing MathML: "+err.textContent.replace(/This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g,""));
|
||||
if (doc.childNodes.length !== 1) {
|
||||
MATHML.Error(
|
||||
_("MathMLSingleElement", "MathML must be formed by a single element")
|
||||
);
|
||||
}
|
||||
if (err) MATHML.Error(["ParsingError","Error parsing MathML: %1",
|
||||
err.textContent.replace(/This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g,"")]);
|
||||
if (doc.childNodes.length !== 1)
|
||||
{MATHML.Error(["MathMLSingleElement","MathML must be formed by a single element"])}
|
||||
if (doc.firstChild.nodeName.toLowerCase() === "html") {
|
||||
var h1 = doc.getElementsByTagName("h1")[0];
|
||||
if (h1 && h1.textContent === "XML parsing error" && h1.nextSibling)
|
||||
// Localization: This seems to replace error messages produced
|
||||
// by browsers. Does that work in all languages?
|
||||
MATHML.Error("Error parsing MathML: "+String(h1.nextSibling.nodeValue).replace(/fatal parsing error: /,""));
|
||||
MATHML.Error(["ParsingError","Error parsing MathML: %1",
|
||||
String(h1.nextSibling.nodeValue).replace(/fatal parsing error: /,"")]);
|
||||
}
|
||||
if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !==
|
||||
"math") {
|
||||
MATHML.Error(
|
||||
_("MathMLRootElement",
|
||||
if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !== "math") {
|
||||
MATHML.Error(["MathMLRootElement",
|
||||
"MathML must be formed by a <math> element, not %1",
|
||||
"<"+doc.firstChild.nodeName+">")
|
||||
);
|
||||
"<"+doc.firstChild.nodeName+">"]);
|
||||
}
|
||||
this.mml = this.MakeMML(doc.firstChild);
|
||||
},
|
||||
|
@ -96,10 +87,7 @@
|
|||
mml = this.TeXAtom(match[2]);
|
||||
} else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) {
|
||||
MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]);
|
||||
return MML.merror(
|
||||
MathJax.Localization._(
|
||||
"UnknownNodeType", "Unknown node type: %1", type)
|
||||
);
|
||||
return MML.merror(_("UnknownNodeType","Unknown node type: %1",type));
|
||||
} else {
|
||||
mml = MML[type]();
|
||||
}
|
||||
|
@ -175,10 +163,8 @@
|
|||
var text = child.nodeValue.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity);
|
||||
mml.Append(MML.chars(this.trimSpace(text)));
|
||||
} else if (child.nodeValue.match(/\S/)) {
|
||||
MATHML.Error(
|
||||
_("UnexpectedTextNode", "Unexpected text node: %1",
|
||||
"'"+child.nodeValue+"'")
|
||||
);
|
||||
MATHML.Error(["UnexpectedTextNode",
|
||||
"Unexpected text node: %1","'"+child.nodeValue+"'"]);
|
||||
}
|
||||
} else if (mml.type === "annotation-xml") {
|
||||
mml.Append(MML.xml(child));
|
||||
|
@ -223,7 +209,7 @@
|
|||
/************************************************************************/
|
||||
|
||||
MATHML.Augment({
|
||||
sourceMenuTitle: "Original MathML",
|
||||
sourceMenuTitle: /*_(MathMenu)*/ ["OriginalMathML","Original MathML"],
|
||||
|
||||
prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing MathML
|
||||
postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing MathML
|
||||
|
@ -257,6 +243,10 @@
|
|||
return MML.merror(message);
|
||||
},
|
||||
Error: function (message) {
|
||||
//
|
||||
// Translate message if it is ["id","message",args]
|
||||
//
|
||||
if (message instanceof Array) {message = _.apply(_,message)}
|
||||
throw MathJax.Hub.Insert(Error(message),{mathmlError: true});
|
||||
},
|
||||
//
|
||||
|
@ -282,12 +272,7 @@
|
|||
for (var i = 0, m = xml.length; i < m && !this.parser; i++)
|
||||
{try {this.parser = new ActiveXObject(xml[i])} catch (err) {}}
|
||||
if (!this.parser) {
|
||||
alert("MathJax can't create an XML parser for MathML. Check that\n"+
|
||||
"the 'Script ActiveX controls marked safe for scripting' security\n"+
|
||||
"setting is enabled (use the Internet Options item in the Tools\n"+
|
||||
"menu, and select the Security panel, then press the Custom Level\n"+
|
||||
"button to check this).\n\n"+
|
||||
"MathML equations will not be able to be processed by MathJax.");
|
||||
MathJax.Localization.Try(this.parserCreationError);
|
||||
return(this.parseError);
|
||||
}
|
||||
this.parser.async = false;
|
||||
|
@ -301,6 +286,15 @@
|
|||
else {document.body.insertBefore(this.div,document.body.firstChild)}
|
||||
return(this.parseDIV);
|
||||
},
|
||||
parserCreationError: function () {
|
||||
alert(_("MathPlayer",
|
||||
"MathJax can't create an XML parser for MathML. Check that\n"+
|
||||
"the 'Script ActiveX controls marked safe for scripting' security\n"+
|
||||
"setting is enabled (use the Internet Options item in the Tools\n"+
|
||||
"menu, and select the Security panel, then press the Custom Level\n"+
|
||||
"button to check this).\n\n"+
|
||||
"MathML equations will not be able to be processed by MathJax."));
|
||||
},
|
||||
//
|
||||
// Initialize the parser object (whichever type is used)
|
||||
//
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
MathJax.InputJax.TeX = MathJax.InputJax({
|
||||
id: "TeX",
|
||||
version: "2.1",
|
||||
version: "2.1.1",
|
||||
directory: MathJax.InputJax.directory + "/TeX",
|
||||
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/jax/input/TeX/jax.js
|
||||
|
@ -30,7 +31,7 @@
|
|||
|
||||
var _ = function (id) {
|
||||
return MathJax.Localization._.apply(MathJax.Localization,
|
||||
[ ["TeX", id] ].concat([].slice.call(arguments,1)))
|
||||
[["TeX", id]].concat([].slice.call(arguments,1)));
|
||||
};
|
||||
|
||||
var STACK = MathJax.Object.Subclass({
|
||||
|
@ -79,14 +80,8 @@
|
|||
|
||||
var STACKITEM = STACK.Item = MathJax.Object.Subclass({
|
||||
type: "base",
|
||||
// Localization: should be updated when the language is changed
|
||||
// This is used in TEX.Error(this[item.type+"Error"]) below, perhaps a if
|
||||
// could just be used directly, or make the messageID contains close/right
|
||||
// Add a note about the \\ syntax.
|
||||
closeError: _("ExtraCloseMissingOpen",
|
||||
"Extra close brace or missing open brace"),
|
||||
rightError: _("MissingLeftExtraRight",
|
||||
"Missing \\left or extra \\right"),
|
||||
closeError: ["ExtraCloseMissingOpen","Extra close brace or missing open brace"],
|
||||
rightError: ["MissingLeftExtraRight","Missing \\left or extra \\right"],
|
||||
Init: function () {
|
||||
if (this.isOpen) {this.env = {}}
|
||||
this.data = [];
|
||||
|
@ -103,7 +98,7 @@
|
|||
if (item.type === "over" && this.isOpen) {item.num = this.mmlData(false); this.data = []}
|
||||
if (item.type === "cell" && this.isOpen) {
|
||||
if (item.linebreak) {return false}
|
||||
TEX.Error(_("Misplaced %1", "Misplaced ", item.name));
|
||||
TEX.Error(["Misplaced %1","Misplaced ",item.name]);
|
||||
}
|
||||
if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])}
|
||||
if (!item.isNotStack) {return true}
|
||||
|
@ -134,12 +129,10 @@
|
|||
|
||||
STACKITEM.open = STACKITEM.Subclass({
|
||||
type: "open", isOpen: true,
|
||||
// Localization: should be updated when the language is changed
|
||||
stopError: _("ExtraOpenMissingClose",
|
||||
"Extra open brace or missing close brace"),
|
||||
stopError: ["ExtraOpenMissingClose","Extra open brace or missing close brace"],
|
||||
checkItem: function (item) {
|
||||
if (item.type === "close") {
|
||||
var mml = this.mmlData(); // this.mmlData(true,true); // force row
|
||||
var mml = this.mmlData();
|
||||
return STACKITEM.mml(MML.TeXAtom(mml)); // TeXAtom make it an ORD to prevent spacing (FIXME: should be another way)
|
||||
}
|
||||
return this.SUPER(arguments).checkItem.call(this,item);
|
||||
|
@ -162,9 +155,7 @@
|
|||
|
||||
STACKITEM.subsup = STACKITEM.Subclass({
|
||||
type: "subsup",
|
||||
// Localization: should be updated when the language is changed
|
||||
stopError: _("MissingScript",
|
||||
"Missing superscript or subscript argument"),
|
||||
stopError: ["MissingScript","Missing superscript or subscript argument"],
|
||||
checkItem: function (item) {
|
||||
var script = ["","subscript","superscript"][this.position];
|
||||
if (item.type === "open" || item.type === "left") {return true}
|
||||
|
@ -176,10 +167,8 @@
|
|||
this.data[0].SetData(this.position,item.data[0]);
|
||||
return STACKITEM.mml(this.data[0]);
|
||||
}
|
||||
if (this.SUPER(arguments).checkItem.call(this,item)) {
|
||||
TEX.Error(_("MissingOpenForScript",
|
||||
"Missing open brace for %1", script))
|
||||
}
|
||||
if (this.SUPER(arguments).checkItem.call(this,item))
|
||||
{TEX.Error(["MissingOpenForScript","Missing open brace for %1",script])}
|
||||
},
|
||||
Pop: function () {}
|
||||
});
|
||||
|
@ -187,9 +176,8 @@
|
|||
STACKITEM.over = STACKITEM.Subclass({
|
||||
type: "over", isClose: true, name: "\\over",
|
||||
checkItem: function (item,stack) {
|
||||
if (item.type === "over") {
|
||||
TEX.Error(_("AmbiguousUseOf", "Ambiguous use of %1", item.name))
|
||||
}
|
||||
if (item.type === "over")
|
||||
{TEX.Error(["AmbiguousUseOf","Ambiguous use of %1",item.name])}
|
||||
if (item.isClose) {
|
||||
var mml = MML.mfrac(this.num,this.mmlData(false));
|
||||
if (this.thickness != null) {mml.linethickness = this.thickness}
|
||||
|
@ -207,9 +195,7 @@
|
|||
|
||||
STACKITEM.left = STACKITEM.Subclass({
|
||||
type: "left", isOpen: true, delim: '(',
|
||||
// Localization: should be updated when the language is changed
|
||||
// Add a note about the \\ syntax.
|
||||
stopError: _("ExtraLeftMissingRight", "Extra \\left or missing \\right"),
|
||||
stopError: ["ExtraLeftMissingRight", "Extra \\left or missing \\right"],
|
||||
checkItem: function (item) {
|
||||
if (item.type === "right") {
|
||||
var mml = MML.mfenced(this.data.length === 1 ? this.data[0] : MML.mrow.apply(MML,this.data));
|
||||
|
@ -227,17 +213,13 @@
|
|||
type: "begin", isOpen: true,
|
||||
checkItem: function (item) {
|
||||
if (item.type === "end") {
|
||||
if (item.name !== this.name) {
|
||||
TEX.Error(_("EnvBadEnd",
|
||||
"\\begin{%1} ended with \\end{%2}",
|
||||
this.name, item.name))
|
||||
}
|
||||
if (item.name !== this.name)
|
||||
{TEX.Error(["EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.name,item.name])}
|
||||
if (!this.end) {return STACKITEM.mml(this.mmlData())}
|
||||
return this.parse[this.end].call(this.parse,this,this.data);
|
||||
}
|
||||
if (item.type === "stop") {
|
||||
TEX.Error(_("EnvMissingEnd", "Missing \\end{%1}", this.name))
|
||||
}
|
||||
if (item.type === "stop")
|
||||
{TEX.Error(["EnvMissingEnd","Missing \\end{%1}",this.name])}
|
||||
return this.SUPER(arguments).checkItem.call(this,item);
|
||||
}
|
||||
});
|
||||
|
@ -258,9 +240,7 @@
|
|||
STACKITEM.position = STACKITEM.Subclass({
|
||||
type: "position",
|
||||
checkItem: function (item) {
|
||||
if (item.isClose) {
|
||||
TEX.Error(_("MissingBoxFor", "Missing box for %1"))
|
||||
}
|
||||
if (item.isClose) {TEX.Error(["MissingBoxFor","Missing box for %1"])}
|
||||
if (item.isNotStack) {
|
||||
var mml = item.mmlData();
|
||||
switch (this.move) {
|
||||
|
@ -302,7 +282,7 @@
|
|||
mml = STACKITEM.mml(mml);
|
||||
if (this.requireClose) {
|
||||
if (item.type === 'close') {return mml}
|
||||
TEX.Error(_("MissingCloseBrace", "Missing close brace"));
|
||||
TEX.Error(["MissingCloseBrace","Missing close brace"]);
|
||||
}
|
||||
return [mml,item];
|
||||
}
|
||||
|
@ -1146,8 +1126,7 @@
|
|||
// (overridden in noUndefined extension)
|
||||
//
|
||||
csUndefined: function (name) {
|
||||
TEX.Error(_("UndefinedControlSequence",
|
||||
"Undefined control sequence %1", name));
|
||||
TEX.Error(["UndefinedControlSequence","Undefined control sequence %1",name]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -1192,10 +1171,8 @@
|
|||
else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}}
|
||||
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
|
||||
if (base.type === "msubsup") {
|
||||
if (base.data[base.sup]) {
|
||||
TEX.Error(_("DoubleExponent",
|
||||
"Double exponent: use braces to clarify"))
|
||||
}
|
||||
if (base.data[base.sup])
|
||||
{TEX.Error(["DoubleExponent","Double exponent: use braces to clarify"])}
|
||||
position = base.sup;
|
||||
} else if (base.movesupsub) {
|
||||
if (base.type !== "munderover" || base.data[base.over]) {
|
||||
|
@ -1217,10 +1194,8 @@
|
|||
else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}}
|
||||
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
|
||||
if (base.type === "msubsup") {
|
||||
if (base.data[base.sub]) {
|
||||
TEX.Error(_("DoubleSubscripts",
|
||||
"Double subscripts: use braces to clarify"))
|
||||
}
|
||||
if (base.data[base.sub])
|
||||
{TEX.Error(["DoubleSubscripts","Double subscripts: use braces to clarify"])}
|
||||
position = base.sub;
|
||||
} else if (base.movesupsub) {
|
||||
if (base.type !== "munderover" || base.data[base.under]) {
|
||||
|
@ -1238,8 +1213,8 @@
|
|||
Prime: function (c) {
|
||||
var base = this.stack.Prev(); if (!base) {base = MML.mi()}
|
||||
if (base.type === "msubsup" && base.data[base.sup]) {
|
||||
TEX.Error(_("DoubleExponentPrime",
|
||||
"Prime causes double exponent: use braces to clarify"))
|
||||
TEX.Error(["DoubleExponentPrime",
|
||||
"Prime causes double exponent: use braces to clarify"]);
|
||||
}
|
||||
var sup = ""; this.i--;
|
||||
do {sup += this.PRIME; this.i++, c = this.GetNext()}
|
||||
|
@ -1267,8 +1242,8 @@
|
|||
* Handle hash marks outside of definitions
|
||||
*/
|
||||
Hash: function (c) {
|
||||
TEX.Error(_("CantUseHash1",
|
||||
"You can't use 'macro parameter character #' in math mode"));
|
||||
TEX.Error(["CantUseHash1",
|
||||
"You can't use 'macro parameter character #' in math mode"]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -1321,9 +1296,8 @@
|
|||
|
||||
Middle: function (name) {
|
||||
var delim = this.GetDelimiter(name);
|
||||
if (this.stack.Top().type !== "left") {
|
||||
TEX.Error(_("MisplacedMiddle",
|
||||
"%1 must be within \\left and \\right", name))}
|
||||
if (this.stack.Top().type !== "left")
|
||||
{TEX.Error(["MisplacedMiddle","%1 must be within \\left and \\right",name])}
|
||||
this.Push(MML.mo(delim).With({stretchy:true}));
|
||||
},
|
||||
|
||||
|
@ -1346,10 +1320,8 @@
|
|||
},
|
||||
Limits: function (name,limits) {
|
||||
var op = this.stack.Prev("nopop");
|
||||
if (!op || op.texClass !== MML.TEXCLASS.OP) {
|
||||
TEX.Error(_("MisplacedLimits",
|
||||
"%1 is allowed only on operators", name))
|
||||
}
|
||||
if (!op || op.texClass !== MML.TEXCLASS.OP)
|
||||
{TEX.Error(["MisplacedLimits","%1 is allowed only on operators",name])}
|
||||
op.movesupsub = (limits ? true : false);
|
||||
op.movablelimits = false;
|
||||
},
|
||||
|
@ -1398,18 +1370,13 @@
|
|||
return n;
|
||||
},
|
||||
MoveRoot: function (name,id) {
|
||||
if (!this.stack.env.inRoot) {
|
||||
TEX.Error(_("BadMoveRoot", "%1 can appear only within a root"));
|
||||
}
|
||||
if (this.stack.global[id]) {
|
||||
TEX.Error(_("MultipleMoveRoot",
|
||||
"Multiple use of %1", name));
|
||||
}
|
||||
if (!this.stack.env.inRoot)
|
||||
{TEX.Error(["BadMoveRoot","%1 can appear only within a root"])}
|
||||
if (this.stack.global[id])
|
||||
{TEX.Error(["MultipleMoveRoot","Multiple use of %1",name])}
|
||||
var n = this.GetArgument(name);
|
||||
if (!n.match(/-?[0-9]+/)) {
|
||||
TEX.Error(_("IntegerArg",
|
||||
"The argument to %1 must be an integer", name));
|
||||
}
|
||||
if (!n.match(/-?[0-9]+/))
|
||||
{TEX.Error(["IntegerArg","The argument to %1 must be an integer",name])}
|
||||
n = (n/15)+"em";
|
||||
if (n.substr(0,1) !== "-") {n = "+"+n}
|
||||
this.stack.global[id] = n;
|
||||
|
@ -1464,20 +1431,17 @@
|
|||
attr = this.GetBrackets(name,"").replace(/^\s+/,""),
|
||||
data = this.GetArgument(name),
|
||||
def = {attrNames:[]}, match;
|
||||
if (!MML[type] || !MML[type].prototype.isToken) {
|
||||
TEX.Error(_("NotMathMLToken", "%1 is not a token element", type))
|
||||
}
|
||||
if (!MML[type] || !MML[type].prototype.isToken)
|
||||
{TEX.Error(["NotMathMLToken", "%1 is not a token element",type])}
|
||||
while (attr !== "") {
|
||||
match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^ ]*)\s*/i);
|
||||
if (!match) {
|
||||
TEX.Error("InvalidMathMLAttr",
|
||||
"Invalid MathML attribute: %1", attr)
|
||||
}
|
||||
match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|\"[^"]*"|[^ ]*)\s*/i);
|
||||
if (!match)
|
||||
{TEX.Error("InvalidMathMLAttr","Invalid MathML attribute: %1",attr)}
|
||||
if (!MML[type].prototype.defaults[match[1]] &&
|
||||
!this.MmlTokenAllow[match[1]]) {
|
||||
TEX.Error(_("UnknownAttrForElement",
|
||||
"%1 is not a recognized attribute for %2",
|
||||
match[1], type))
|
||||
TEX.Error(["UnknownAttrForElement",
|
||||
"%1 is not a recognized attribute for %2",
|
||||
match[1],type]);
|
||||
}
|
||||
def[match[1]] = match[2].replace(/^(['"])(.*)\1$/,"$2");
|
||||
def.attrNames.push(match[1]);
|
||||
|
@ -1625,16 +1589,16 @@
|
|||
this.string = this.AddArgs(macro,this.string.slice(this.i));
|
||||
this.i = 0;
|
||||
if (++this.macroCount > TEX.config.MAXMACROS) {
|
||||
TEX.Error(_("MaxMacroSub",
|
||||
"MathJax maximum macro substitution count exceeded; is there a recursive macro call?"))
|
||||
TEX.Error(["MaxMacroSub",
|
||||
"MathJax maximum macro substitution count exceeded; " +
|
||||
"is there a recursive macro call?"]);
|
||||
}
|
||||
},
|
||||
|
||||
Matrix: function (name,open,close,align,spacing,vspacing,style,cases) {
|
||||
var c = this.GetNext();
|
||||
if (c === "") {
|
||||
TEX.Error(_("MissingArgFor", "Missing argument for %1", name))
|
||||
}
|
||||
if (c === "")
|
||||
{TEX.Error(["MissingArgFor","Missing argument for %1",name])}
|
||||
if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0}
|
||||
var array = STACKITEM.array().With({
|
||||
requireClose: true,
|
||||
|
@ -1660,8 +1624,7 @@
|
|||
if (c === "{") {braces++; i++}
|
||||
else if (c === "}") {if (braces === 0) {m = 0} else {braces--; i++}}
|
||||
else if (c === "&" && braces === 0) {
|
||||
TEX.Error(_("ExtraAlignTab",
|
||||
"Extra alignment tab in \\cases text"))
|
||||
TEX.Error(["ExtraAlignTab","Extra alignment tab in \\cases text"]);
|
||||
} else if (c === "\\") {
|
||||
if (string.substr(i).match(/^((\\cr)[^a-zA-Z]|\\\\)/)) {m = 0} else {i += 2}
|
||||
} else {i++}
|
||||
|
@ -1684,8 +1647,8 @@
|
|||
n = this.GetBrackets(name,"").replace(/ /g,"");
|
||||
if (n &&
|
||||
!n.match(/^((-?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/)) {
|
||||
TEX.Error(_("BracketMustBeDimension",
|
||||
"Bracket argument to %1 must be a dimension", name))
|
||||
TEX.Error(["BracketMustBeDimension",
|
||||
"Bracket argument to %1 must be a dimension",name]);
|
||||
}
|
||||
}
|
||||
this.Push(STACKITEM.cell().With({isCR: true, name: name, linebreak: true}));
|
||||
|
@ -1725,9 +1688,8 @@
|
|||
HLine: function (name,style) {
|
||||
if (style == null) {style = "solid"}
|
||||
var top = this.stack.Top();
|
||||
if (!top.isa(STACKITEM.array) || top.data.length) {
|
||||
TEX.Error(_("Misplaced", "Misplaced %1", name))
|
||||
}
|
||||
if (!top.isa(STACKITEM.array) || top.data.length)
|
||||
{TEX.Error(["Misplaced","Misplaced %1",name])}
|
||||
if (top.table.length == 0) {
|
||||
top.frame.push("top");
|
||||
} else {
|
||||
|
@ -1745,18 +1707,15 @@
|
|||
|
||||
Begin: function (name) {
|
||||
var env = this.GetArgument(name);
|
||||
if (env.match(/[^a-z*]/i)) {
|
||||
TEX.Error(_("InvalidEnv",
|
||||
"Invalid environment name '%1'", env))
|
||||
}
|
||||
if (env.match(/[^a-z*]/i))
|
||||
{TEX.Error(["InvalidEnv","Invalid environment name '%1'",env])}
|
||||
var cmd = this.envFindName(env);
|
||||
if (!cmd) {
|
||||
TEX.Error(_("UnknownEnv",
|
||||
"Unknown environment '%1'", env))
|
||||
}
|
||||
if (!cmd)
|
||||
{TEX.Error(["UnknownEnv","Unknown environment '%1'",env])}
|
||||
if (++this.macroCount > TEX.config.MAXMACROS) {
|
||||
TEX.Error(_("MaxMacroSub2",
|
||||
"MathJax maximum substitution count exceeded; is there a recursive latex environment?"))
|
||||
TEX.Error(["MaxMacroSub2",
|
||||
"MathJax maximum substitution count exceeded; " +
|
||||
"is there a recursive latex environment?"]);
|
||||
}
|
||||
if (!(cmd instanceof Array)) {cmd = [cmd]}
|
||||
var mml = STACKITEM.begin().With({name: env, end: cmd[1], parse:this});
|
||||
|
@ -1867,14 +1826,12 @@
|
|||
GetArgument: function (name,noneOK) {
|
||||
switch (this.GetNext()) {
|
||||
case "":
|
||||
if (!noneOK) {
|
||||
TEX.Error(_("MissingArgFor", "Missing argument for %1", name))
|
||||
}
|
||||
if (!noneOK) {TEX.Error(["MissingArgFor","Missing argument for %1",name])}
|
||||
return null;
|
||||
case '}':
|
||||
if (!noneOK) {
|
||||
TEX.Error(_("ExtraCloseMissingOpen",
|
||||
"Extra close brace or missing open brace"))
|
||||
TEX.Error(["ExtraCloseMissingOpen",
|
||||
"Extra close brace or missing open brace"]);
|
||||
}
|
||||
return null;
|
||||
case '\\':
|
||||
|
@ -1886,14 +1843,12 @@
|
|||
case '\\': this.i++; break;
|
||||
case '{': parens++; break;
|
||||
case '}':
|
||||
if (parens == 0) {
|
||||
TEX.Error(_("ExtraClose", "Extra close brace"))
|
||||
}
|
||||
if (parens == 0) {TEX.Error(["ExtraClose","Extra close brace"])}
|
||||
if (--parens == 0) {return this.string.slice(j,this.i-1)}
|
||||
break;
|
||||
}
|
||||
}
|
||||
TEX.Error(_("MissingCloseBrace", "Missing close brace"));
|
||||
TEX.Error(["MissingCloseBrace","Missing close brace"]);
|
||||
break;
|
||||
}
|
||||
return this.string.charAt(this.i++);
|
||||
|
@ -1911,8 +1866,8 @@
|
|||
case '\\': this.i++; break;
|
||||
case '}':
|
||||
if (parens-- <= 0) {
|
||||
TEX.Error(_("ExtraCloseInBrackets",
|
||||
"Extra close brace while looking for ']'"))
|
||||
TEX.Error(["ExtraCloseBrace",
|
||||
"Extra close brace while looking for %1","']'"]);
|
||||
}
|
||||
break;
|
||||
case ']':
|
||||
|
@ -1920,9 +1875,8 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
TEX.Error(
|
||||
_("MissingCloseBracket",
|
||||
"Couldn't find closing ']' for argument to %1", name));
|
||||
TEX.Error(["MissingCloseBracket",
|
||||
"Couldn't find closing ']' for argument to %1",name]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -1935,8 +1889,8 @@
|
|||
this.i++; if (c == "\\") {c += this.GetCS(name)}
|
||||
if (TEXDEF.delimiter[c] != null) {return this.convertDelimiter(c)}
|
||||
}
|
||||
TEX.Error(_("MissingOrUnrecognizedDelim",
|
||||
"Missing or unrecognized delimiter for %1", name));
|
||||
TEX.Error(["MissingOrUnrecognizedDelim",
|
||||
"Missing or unrecognized delimiter for %1",name]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -1957,8 +1911,8 @@
|
|||
return match[1].replace(/ /g,"");
|
||||
}
|
||||
}
|
||||
TEX.Error(_("MissingDimOrUnits",
|
||||
"Missing dimension or its units for %1", name));
|
||||
TEX.Error(["MissingDimOrUnits",
|
||||
"Missing dimension or its units for %1",name]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -1974,16 +1928,16 @@
|
|||
case '{': parens++; break;
|
||||
case '}':
|
||||
if (parens == 0) {
|
||||
TEX.Error(_("ExtraCloseBraceInUpTo",
|
||||
"Extra close brace while looking for %1", token))
|
||||
TEX.Error(["ExtraCloseBrace",
|
||||
"Extra close brace while looking for %1",token])
|
||||
}
|
||||
parens--;
|
||||
break;
|
||||
}
|
||||
if (parens == 0 && c == token) {return this.string.slice(j,k)}
|
||||
}
|
||||
TEX.Error(_("TokenNotFoundForCommand",
|
||||
"Couldn't find %1 for %2", token, name));
|
||||
TEX.Error(["TokenNotFoundForCommand",
|
||||
"Couldn't find %1 for %2",token,name]);
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -2032,9 +1986,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
if (match !== '') {
|
||||
TEX.Error(_("MathNotTerminated", "Math not terminated in text box"))
|
||||
}
|
||||
if (match !== '')
|
||||
{TEX.Error(["MathNotTerminated","Math not terminated in text box"])}
|
||||
if (k < text.length) {mml.push(this.InternalText(text.slice(k),def))}
|
||||
return mml;
|
||||
},
|
||||
|
@ -2055,8 +2008,8 @@
|
|||
c = string.charAt(i++);
|
||||
if (c === '#') {text += c} else {
|
||||
if (!c.match(/[1-9]/) || c > args.length) {
|
||||
TEX.Error(_("IllegalMacroParam",
|
||||
"Illegal macro parameter reference"))
|
||||
TEX.Error(["IllegalMacroParam",
|
||||
"Illegal macro parameter reference"]);
|
||||
}
|
||||
newstring = this.AddArgs(this.AddArgs(newstring,text),args[c-1]);
|
||||
text = '';
|
||||
|
@ -2073,8 +2026,8 @@
|
|||
AddArgs: function (s1,s2) {
|
||||
if (s2.match(/^[a-z]/i) && s1.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)) {s1 += ' '}
|
||||
if (s1.length + s2.length > TEX.config.MAXBUFFER) {
|
||||
TEX.Error(_("MaxBufferSize",
|
||||
"MathJax internal buffer size exceeded; is there a recursive macro call?"))
|
||||
TEX.Error(["MaxBufferSize",
|
||||
"MathJax internal buffer size exceeded; is there a recursive macro call?"]);
|
||||
}
|
||||
return s1+s2;
|
||||
}
|
||||
|
@ -2091,7 +2044,7 @@
|
|||
MAXBUFFER: 5*1024 // maximum size of TeX string to process
|
||||
},
|
||||
|
||||
sourceMenuTitle: "TeX Commands",
|
||||
sourceMenuTitle: /*_(MathMenu)*/ ["TeXCommands","TeX Commands"],
|
||||
|
||||
prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing TeX
|
||||
postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing TeX
|
||||
|
@ -2147,6 +2100,10 @@
|
|||
// Produce an error and stop processing this equation
|
||||
//
|
||||
Error: function (message) {
|
||||
//
|
||||
// Translate message if it is ["id","message",args]
|
||||
//
|
||||
if (message instanceof Array) {message = _.apply(_,message)}
|
||||
throw HUB.Insert(Error(message),{texError: true});
|
||||
},
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/jax/output/HTML-CSS/autoload/mglyph.js
|
||||
|
@ -24,9 +25,10 @@
|
|||
*/
|
||||
|
||||
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||
var VERSION = "2.1";
|
||||
var VERSION = "2.1.1";
|
||||
var MML = MathJax.ElementJax.mml,
|
||||
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
|
||||
HTMLCSS = MathJax.OutputJax["HTML-CSS"],
|
||||
LOCALE = MathJax.Localization;
|
||||
|
||||
MML.mglyph.Augment({
|
||||
toHTML: function (span,variant) {
|
||||
|
@ -41,11 +43,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
if (HTMLCSS.Font.testFont(font)) {
|
||||
this.HTMLhandleVariant(span,variant,String.fromCharCode(index));
|
||||
} else {
|
||||
if (values.alt === "") {
|
||||
values.alt =
|
||||
MathJax.Localization._(["MathML", "BadMglyphFont"],
|
||||
"Bad font: %1", font.family);
|
||||
}
|
||||
if (values.alt === "")
|
||||
{values.alt = LOCALE._(["MathML","BadMglyphFont"],"Bad font: %1",font.family)}
|
||||
err = MML.merror(values.alt).With({mathsize:"75%"});
|
||||
this.Append(err); err.toHTML(span); this.data.pop();
|
||||
span.bbox = err.HTMLspanElement().bbox;
|
||||
|
@ -64,8 +63,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
}
|
||||
if (this.img.status !== "OK") {
|
||||
err = MML.merror(
|
||||
MathJax.Localization._(["MathML", "BadMglyph"],
|
||||
"Bad mglyph: %1", values.src)
|
||||
LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src)
|
||||
).With({mathsize:"75%"});
|
||||
this.Append(err); err.toHTML(span); this.data.pop();
|
||||
span.bbox = err.HTMLspanElement().bbox;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
|
||||
id: "HTML-CSS",
|
||||
version: "2.1",
|
||||
version: "2.1.1",
|
||||
directory: MathJax.OutputJax.directory + "/HTML-CSS",
|
||||
extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS",
|
||||
autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload",
|
||||
|
@ -147,10 +147,8 @@ MathJax.Hub.Register.StartupHook("End Config",[function (HUB,HTMLCSS) {
|
|||
!HUB.Browser.versionAtLeast(CONFIG.minBrowserVersion[HUB.Browser]||0.0)) {
|
||||
HTMLCSS.Translate = CONFIG.minBrowserTranslate;
|
||||
HUB.Config({showProcessingMessages: false});
|
||||
MathJax.Message.Set(
|
||||
MathJax.Localization._(["Message", "MathJaxNotSupported"],
|
||||
"Your browser does not support MathJax"),
|
||||
null,4000);
|
||||
MathJax.Message.Set(["MathJaxNotSupported",
|
||||
"Your browser does not support MathJax"],null,4000);
|
||||
HUB.Startup.signal.Post("MathJax not supported");
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,12 @@
|
|||
|
||||
(function (AJAX,HUB,HTMLCSS) {
|
||||
var MML, isMobile = HUB.Browser.isMobile;
|
||||
|
||||
var MESSAGE = function () {
|
||||
var data = [].slice.call(arguments,0);
|
||||
data[0][0] = ["HTML-CSS",data[0][0]];
|
||||
return MathJax.Message.Set.apply(MathJax.Message,data);
|
||||
};
|
||||
|
||||
var FONTTEST = MathJax.Object.Subclass({
|
||||
timeout: (isMobile? 15:8)*1000, // timeout for loading web fonts
|
||||
|
@ -131,12 +137,7 @@
|
|||
|
||||
loadWebFont: function (font) {
|
||||
HUB.Startup.signal.Post("HTML-CSS Jax - Web-Font "+HTMLCSS.fontInUse+"/"+font.directory);
|
||||
var n = MathJax.Message.File(
|
||||
// Localization: Message.File(fileName) will write "Loading "+fileName
|
||||
// Here, this will become "Loading Web-Font "+fileName. Does it work
|
||||
// for all languages (word order might be different)?
|
||||
"Web-Font "+HTMLCSS.fontInUse+"/"+font.directory
|
||||
);
|
||||
var n = MESSAGE(["LoadWebFont","Loading webfont %1",HTMLCSS.fontInUse+"/"+font.directory]);
|
||||
var done = MathJax.Callback({}); // called when font is loaded
|
||||
var callback = MathJax.Callback(["loadComplete",this,font,n,done]);
|
||||
AJAX.timer.start(AJAX,[this.checkWebFont,font,callback],0,this.timeout);
|
||||
|
@ -156,17 +157,11 @@
|
|||
if (!this.webFontLoaded) {HTMLCSS.loadWebFontError(font,done)} else {done()}
|
||||
},
|
||||
loadError: function (font) {
|
||||
MathJax.Message.Set(
|
||||
MathJax.Localization._("Message", "CantLoadWebFont",
|
||||
"Can't load web font %1", HTMLCSS.fontInUse+"/"+font.directory),
|
||||
null,2000);
|
||||
MESSAGE(["CantLoadWebFont","Can't load web font %1",HTMLCSS.fontInUse+"/"+font.directory],null,2000);
|
||||
HUB.Startup.signal.Post(["HTML-CSS Jax - web font error",HTMLCSS.fontInUse+"/"+font.directory,font]);
|
||||
},
|
||||
firefoxFontError: function (font) {
|
||||
MathJax.Message.Set(
|
||||
MathJax.Localization._(["Message", "FirefoxCantLoadWebFont"],
|
||||
"Firefox can't load web fonts from a remote host"),
|
||||
null,3000);
|
||||
MESSAGE(["FirefoxCantLoadWebFont","Firefox can't load web fonts from a remote host"],null,3000);
|
||||
HUB.Startup.signal.Post("HTML-CSS Jax - Firefox web fonts on remote host error");
|
||||
},
|
||||
|
||||
|
@ -334,11 +329,8 @@
|
|||
HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts");
|
||||
}
|
||||
} else {
|
||||
MathJax.Message.Set(
|
||||
MathJax.Localization._(["Message", "CantFindFontUsing"],
|
||||
"Can't find a valid font using %1",
|
||||
"["+this.config.availableFonts.join(", ")+"]"),
|
||||
null,3000);
|
||||
MESSAGE(["CantFindFontUsing","Can't find a valid font using %1",
|
||||
"["+this.config.availableFonts.join(", ")+"]"],null,3000);
|
||||
this.FONTDATA = {
|
||||
TeX_factor: 1, baselineskip: 1.2, lineH: .8, lineD: .2, ffLineH: .8,
|
||||
FONTS: {}, VARIANT: {normal: {fonts:[]}}, RANGES: [],
|
||||
|
@ -1486,10 +1478,7 @@
|
|||
this.imgFonts = true;
|
||||
HUB.Startup.signal.Post("HTML-CSS Jax - switch to image fonts");
|
||||
HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts");
|
||||
MathJax.Message.Set(
|
||||
MathJax.Localization._(["Message", "WebFontNotAvailable"],
|
||||
"Web-Fonts not available -- using image fonts instead"),
|
||||
null,3000);
|
||||
MESSAGE(["WebFontNotAvailable","Web-Fonts not available -- using image fonts instead"],null,3000);
|
||||
AJAX.Require(this.directory+"/imageFonts.js",done);
|
||||
} else {
|
||||
this.allowWebFonts = false;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/jax/output/SVG/autoload/mglyph.js
|
||||
|
@ -27,7 +28,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
var VERSION = "2.1";
|
||||
var MML = MathJax.ElementJax.mml,
|
||||
SVG = MathJax.OutputJax.SVG,
|
||||
BBOX = SVG.BBOX;
|
||||
BBOX = SVG.BBOX,
|
||||
LOCALE = MathJax.Localization;
|
||||
|
||||
var XLINKNS = "http://www.w3.org/1999/xlink";
|
||||
|
||||
|
@ -73,8 +75,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
}
|
||||
if (this.img.status !== "OK") {
|
||||
err = MML.merror(
|
||||
MathJax.Localization._(["MathML", "BadMglyph"],
|
||||
"Bad mglyph: %1", values.src)
|
||||
LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src)
|
||||
).With({mathsize:"75%"});
|
||||
this.Append(err); svg = err.toSVG(); this.data.pop();
|
||||
} else {
|
||||
|
|
53
unpacked/localization/fr/FontWarnings.js
Normal file
53
unpacked/localization/fr/FontWarnings.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{
|
||||
FontWarnings: {
|
||||
isLoaded: true,
|
||||
strings: {
|
||||
|
||||
webFont:
|
||||
"MathJax utilise les polices Web pour afficher les expressions " +
|
||||
"mathématiques sur cette page. Celles-ci mettent du temps à être "+
|
||||
"téléchargées et la page serait affichée plus rapidement si vous "+
|
||||
"installiez les polices mathématiques directement dans le dossier "+
|
||||
"des polices de votre système.",
|
||||
|
||||
imageFonts:
|
||||
"MathJax utilise des images de caractères plutôt que les polices "+
|
||||
"Web ou locales. Ceci rend le rendu plus lent que la normale et "+
|
||||
"les expressions mathématiques peuvent ne pas s'imprimer à la "+
|
||||
"résolution maximale de votre imprimante",
|
||||
|
||||
noFonts:
|
||||
"MathJax n'est pas parvenu à localiser une police pour afficher "+
|
||||
"les expressions mathématiques et les images de caractères ne "+
|
||||
"sont pas disponibles. Comme solution de dernier recours, il "+
|
||||
"utilise des caractères Unicode génériques en espérant que votre "+
|
||||
"navigateur sera capable de les afficher. Certains pourront ne "+
|
||||
"être rendus de façon incorrect voire pas du tout.",
|
||||
|
||||
webFonts:
|
||||
"La plupart des navigateurs modernes permettent de télécharger "+
|
||||
"des polices à partir du Web. En mettant à jour pour une version "+
|
||||
"plus récente de votre navigateur (ou en changeant de navigateur) "+
|
||||
"la qualité des expressions mathématiques sur cette page pourrait "+
|
||||
"être améliorée.",
|
||||
|
||||
fonts:
|
||||
"%1 MathJax peut utiliser les %2 ou bien les %3. Téléchargez et"+
|
||||
"installez l'une de ces familles de polices pour améliorer votre"+
|
||||
"expérience avec MathJax.",
|
||||
|
||||
PageDesigned:
|
||||
"%1 Cette page est conçue pour utiliser les %2. Téléchargez "+
|
||||
" et installez ces polices pour améliorer votre expérience "+
|
||||
"avec MathJax",
|
||||
|
||||
STIXfonts:
|
||||
"Polices STIX",
|
||||
|
||||
TeXfonts:
|
||||
"Polices TeX de MathJax"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/FontWarnings.js");
|
49
unpacked/localization/fr/MathML.js
Normal file
49
unpacked/localization/fr/MathML.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{
|
||||
MathML: {
|
||||
isLoaded: true,
|
||||
strings: {
|
||||
|
||||
BadMglyph:
|
||||
"Élement mglyph incorrect: %1",
|
||||
|
||||
BadMglyphFont:
|
||||
"Police de caractère incorrecte: %1",
|
||||
|
||||
MathPlayer:
|
||||
"MathJax n'est pas parvenu à configurer MathPlayer.\n\n"+
|
||||
"Vous devez d'abord installer MathPlayer. Si c'est déjà le cas,\n"+
|
||||
"vos paramètres de sécurités peuvent empêcher l'exécution des\n"+
|
||||
"contrôles ActiveX. Sélectionnez Options Internet dans le menu\n"+
|
||||
"Outils et sélectionnez l'onglet Sécurité. Appuyez ensuite sur\n"+
|
||||
"le menu Niveau Personalisé. Assurez vous que les paramètres\n"+
|
||||
"Exécution des contrôles ActiveX et Comportements des exécutables\n"+
|
||||
"et des scripts sont activés.\n\n"+
|
||||
"Actuellement, vous verez des messages d'erreur à la place des\n"+
|
||||
"expressions mathématiques.",
|
||||
|
||||
CantCreateXMLParser:
|
||||
"MathJax ne peut créer un analyseur grammatical XML pour le MathML",
|
||||
|
||||
UnknownNodeType:
|
||||
"Type de noeud inconnu: %1",
|
||||
|
||||
UnexpectedTextNode:
|
||||
"Noeud de texte inattendu: %1",
|
||||
|
||||
ErrorParsingMathML:
|
||||
"Erreur lors de l'analyse grammaticale du code MathML",
|
||||
|
||||
ParsingError:
|
||||
"Erreur lors de l'analyse du code MathML: %1",
|
||||
|
||||
MathMLSingleElement:
|
||||
"Le code MathML doit être formé d'un unique élément",
|
||||
|
||||
MathMLRootElement:
|
||||
"Le code MathML doit être formé d'un élément <math> et non un élément %1"
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathML.js");
|
118
unpacked/localization/fr/MathMenu.js
Normal file
118
unpacked/localization/fr/MathMenu.js
Normal file
|
@ -0,0 +1,118 @@
|
|||
MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{
|
||||
MathMenu: {
|
||||
isLoaded: true,
|
||||
strings: {
|
||||
|
||||
Show: "Voir Maths Comme",
|
||||
MathMLcode: "du Code MathML",
|
||||
OriginalMathML: "d'Origine MathML",
|
||||
TeXCommands: "Commandes TeX",
|
||||
AsciiMathInput: "AsciiMathml Entrée",
|
||||
Original: "Forme Originale",
|
||||
ErrorMessage: "Message d'Erreur",
|
||||
texHints: "Voir les notes TeX dans MathML",
|
||||
Settings: "Paramètres Maths",
|
||||
ZoomTrigger: "Trigger Zoom",
|
||||
Hover: "Flotter",
|
||||
Click: "Clic de Souris",
|
||||
DoubleClick: "Double-Clic",
|
||||
NoZoom: "Pas de Zoom",
|
||||
TriggerRequires: "Trigger Nécessite",
|
||||
Option: "Option",
|
||||
Alt: "Alt",
|
||||
Command: "Command",
|
||||
Control: "Control",
|
||||
Shift: "Shift",
|
||||
ZoomFactor: "Facteur de Zoom",
|
||||
Renderer: "Traduire Maths",
|
||||
MPHandles: "Laissez MathPlayer Gérer:",
|
||||
MenuEvents: "Sélections du menu",
|
||||
MouseEvents: "Êvénements de la Souris",
|
||||
MenuAndMouse: "Les Êvénements de Menu et de la Souris",
|
||||
FontPrefs: "Préférences des Polices",
|
||||
ForHTMLCSS: "Pour le HTML-CSS:",
|
||||
Auto: "Auto",
|
||||
TeXLocal: "TeX (local)",
|
||||
TeXWeb: "TeX (web)",
|
||||
TeXImage: "TeX (image)",
|
||||
STIXLocal: "STIX (local)",
|
||||
ContextMenu: "Menu Contextuel",
|
||||
Browser: "Navigateur",
|
||||
Scale: "Ajuster tous les Maths ...",
|
||||
Discoverable: "Mettez en Surbrillance lors de Survol",
|
||||
About: "À propos de MathJax",
|
||||
Help: "Aide MathJax",
|
||||
|
||||
localTeXfonts: "utilisant les polices locales TeX",
|
||||
webTeXfonts: "utilisant les polices internet TeX",
|
||||
imagefonts: "utilisant les polices d'image",
|
||||
localSTIXfonts: "utilisant les polices locales STIX",
|
||||
webSVGfonts: "utilisant les polices internet SVG",
|
||||
genericfonts: "utilisant les polices locales génériques",
|
||||
|
||||
wofforotffonts: "les polices woff ou otf",
|
||||
eotffonts: "les polices eot",
|
||||
svgfonts: "les polices svg",
|
||||
|
||||
WebkitNativeMMLWarning:
|
||||
"Votre navigateur ne semble pas comporter de support MathML, " +
|
||||
"changer le mode de rendu pourrait rendre illisibles " +
|
||||
"les expressions mathématiques.",
|
||||
|
||||
MSIENativeMMLWarning:
|
||||
"Internet Explorer a besoin de module complémentaire MathPlayer " +
|
||||
"pour afficher le MathML.",
|
||||
|
||||
OperaNativeMMLWarning:
|
||||
"Le support MathML d'Opera est limité, changer le mode de rendu " +
|
||||
"pourrait entrainer un affichage médiocre de certaines expressions.",
|
||||
|
||||
SafariNativeMMLWarning:
|
||||
"Le support MathML natif de votre navigateur ne comporte pas " +
|
||||
"toutes les fonctionnalités requises par MathJax, certaines " +
|
||||
"expressions pourront donc ne pas s'afficher correctement.",
|
||||
|
||||
FirefoxNativeMMLWarning:
|
||||
"Le support MathML natif de votre navigateur ne comporte pas " +
|
||||
"toutes les fonctionnalités requises par MathJax, certaines " +
|
||||
"expressions pourront donc ne pas s'afficher correctement.",
|
||||
|
||||
SwitchAnyway:
|
||||
"Êtes vous certain de vouloir changer le mode de rendu ?\n\n" +
|
||||
"Appuyez sur OK pour valider ou Annuler pour continuer avec le " +
|
||||
"mode de rendu actuellement sélectionné.",
|
||||
|
||||
ScaleMath:
|
||||
"Mise à l'échelle des expressions mathématiques (par rapport au " +
|
||||
"text environnant) de %1%%",
|
||||
|
||||
NonZeroScale:
|
||||
"L'échelle ne peut être nulle",
|
||||
|
||||
PercentScale:
|
||||
"L'échelle doit être un pourcentage (e.g. 120%%)",
|
||||
|
||||
IE8warning:
|
||||
"Ceci désactivera le menu de MathJax et les fonctionalités de " +
|
||||
"zoom mais vous pourrez toujours obtenir le menu de MathJax " +
|
||||
"en utilisant la commande Alt+Clic sur une expression.\n\n" +
|
||||
"Êtes vous certain de vouloir choisir les options de MathPlayer?",
|
||||
|
||||
IE9warning:
|
||||
"Le menu contextuel de MathJax sera désactivé, " +
|
||||
"mais vous pourrez toujours obtenir le menu de MathJax " +
|
||||
"en utilisant la commande Alt-Clic sur une expression.",
|
||||
|
||||
NoOriginalForm:
|
||||
"Aucune forme d'origine disponible.",
|
||||
|
||||
Close:
|
||||
"Fermer",
|
||||
|
||||
EqSource:
|
||||
"Source de l'équation MathJax"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathMenu.js");
|
254
unpacked/localization/fr/TeX.js
Normal file
254
unpacked/localization/fr/TeX.js
Normal file
|
@ -0,0 +1,254 @@
|
|||
MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{
|
||||
TeX: {
|
||||
isLoaded: true,
|
||||
strings: {
|
||||
ExtraOpenMissingClose:
|
||||
"Accolade ouvrant manquante ou accolade fermante non attendue",
|
||||
|
||||
ExtraCloseMissingOpen:
|
||||
"Accolade fermante non attendue ou accolade ouvrante manquante",
|
||||
|
||||
MissingLeftExtraRight:
|
||||
"Commande \\left manquante or ou commande \\right non attendue",
|
||||
|
||||
MissingScript:
|
||||
"Argument en exposant ou en indice manquant",
|
||||
|
||||
ExtraLeftMissingRight:
|
||||
"Commande \\left inattendue or ou commande \\right manquante",
|
||||
|
||||
Misplaced:
|
||||
"Mauvaise position pour la commande %1",
|
||||
|
||||
MissingOpenForScript:
|
||||
"Accolade ouvrante manquante pour le script %1",
|
||||
|
||||
AmbiguousUseOf:
|
||||
"Usage ambigu de la commande %1",
|
||||
|
||||
EnvBadEnd:
|
||||
"\\begin{%1} s'est terminé par un \\end{%2}",
|
||||
|
||||
EnvMissingEnd:
|
||||
"\\end{%1} manquant",
|
||||
|
||||
MissingBoxFor:
|
||||
"Boite manquante pour la commande %1",
|
||||
|
||||
MissingCloseBrace:
|
||||
"Accolade fermante manquante",
|
||||
|
||||
UndefinedControlSequence:
|
||||
"Commande %1 non définie",
|
||||
|
||||
IllegalControlSequenceName:
|
||||
"Nom de contrôle de séquence non autorisé pour la commande %1",
|
||||
|
||||
IllegalParamNumber:
|
||||
"Nombre de paramètres incorrect pour la commande %1",
|
||||
|
||||
DoubleExponent:
|
||||
"Double exposant: utilisez des accolades pour clarifier",
|
||||
|
||||
DoubleSubscripts:
|
||||
"Double indice: utilisez des accolades pour clarifier",
|
||||
|
||||
DoubleExponentPrime:
|
||||
"Un prime entraine un double exposant: utilisez "+
|
||||
"des accolades pour clarifier",
|
||||
|
||||
CantUseHash1:
|
||||
"Vous ne pouvez pas utilisez le caractère #, indiquant un "+
|
||||
"paramètre de macro, dans le mode mathématique",
|
||||
|
||||
CantUseHash2:
|
||||
"Usage du caractère # non autorisé dans le modèle pour la séquence "+
|
||||
"de contrôle %1",
|
||||
|
||||
MisplacedMiddle:
|
||||
"La commande %1 doit être placée à l'intérieur d'une section "+
|
||||
"\\left ... \right",
|
||||
|
||||
MisplacedLimits:
|
||||
"La commande %1 n'est autorisée que sur les opérateurs",
|
||||
|
||||
MisplacedMoveRoot:
|
||||
"La commande %1 n'est autorisée qu'à l'intérieur d'une racine",
|
||||
|
||||
MultipleMoveRoot:
|
||||
"Commande %1 redondante",
|
||||
|
||||
IntegerArg:
|
||||
"L'argument de la commande %1 doit être un entier",
|
||||
|
||||
PositiveIntegerArg:
|
||||
"L'argument de la commande %1 doit être un entier strictement "+
|
||||
"positif",
|
||||
|
||||
NotMathMLToken:
|
||||
"L'élément %1 n'est pas un élément MathML élémentaire",
|
||||
|
||||
InvalidMathMLAttr:
|
||||
"Attribut MathML non valide: %1",
|
||||
|
||||
UnknownAttrForElement:
|
||||
"Attribut %1 inconnu pour l'élément %2",
|
||||
|
||||
MaxMacroSub1:
|
||||
"Le nombre maximal de substitution de macro autorisé par MathJax "+
|
||||
"a été dépassé. Il y a t'il un appel de macro récursif?",
|
||||
|
||||
MaxMacroSub2:
|
||||
"Le nombre maximal de substitution de macro autorisé par MathJax "+
|
||||
"a été dépassé. Il y a t'il un environnement LaTeX récursif?",
|
||||
|
||||
MissingArgFor:
|
||||
"Argument manquant pour la commande %1",
|
||||
|
||||
ExtraAlignTab:
|
||||
"Tabulation d'alignement non attendu pour le texte de la commande "+
|
||||
"\\cases",
|
||||
|
||||
BracketMustBeDimension:
|
||||
"L'argument entre crochets de la commande %1 doit être une "+
|
||||
"dimension",
|
||||
|
||||
InvalidEnv:
|
||||
"Nom d'environnement '%1' non valide",
|
||||
|
||||
UnknownEnv:
|
||||
"Environnement '%1' inconnu",
|
||||
|
||||
ExtraClose:
|
||||
"Accolade fermante non attendue",
|
||||
|
||||
ExtraCloseInBrackets:
|
||||
"Accolade fermante non attendue avant le crochet fermant.",
|
||||
|
||||
MissingCloseBracket:
|
||||
"Impossible de trouver le crochet fermant pour l'argument de la "+
|
||||
"commande %1",
|
||||
|
||||
MissingOrUnrecognizedDelim:
|
||||
"Délimiteur manquant ou non reconnu pour la commande %1",
|
||||
|
||||
MissingDimOrUnits:
|
||||
"Dimension ou unité manquante pour la commande %1",
|
||||
|
||||
ExtraCloseBraceInUpTo:
|
||||
"Accolade fermante non attendue avant la commande %1",
|
||||
|
||||
TokenNotFoundForCommand:
|
||||
"Impossible de trouver la commande %1 pour la commande %2",
|
||||
|
||||
MathNotTerminated:
|
||||
"Expression mathématique non terminée à l'intérieur de cette boite "+
|
||||
"de texte",
|
||||
|
||||
IllegalMacroParam:
|
||||
"Paramètre de référence de macro non autorisé",
|
||||
|
||||
MaxBufferSize:
|
||||
"Taille maximale du tampon interne de MathJax dépassée. " +
|
||||
"Il y a t'il un appel de macro récursif?",
|
||||
|
||||
CommandNotAllowedInEnv:
|
||||
"La commande %1 n'est pas autorisé à l'intérieur de "+
|
||||
"l'environnement %2",
|
||||
|
||||
MultipleCommand:
|
||||
"Usage multiple de la commande %1",
|
||||
|
||||
MultipleLabel:
|
||||
"Étiquette '%1' déjà définie",
|
||||
|
||||
CommandAtTheBeginingOfLine:
|
||||
"La commande %1 doit être placée en début de ligne",
|
||||
|
||||
IllegalAlign:
|
||||
"Alignement non autorisé pour la commande %1",
|
||||
|
||||
BadMathStyleFor:
|
||||
"Style mathématique non valide pour la commande %1",
|
||||
|
||||
ErroneousNestingEq:
|
||||
"Emboitement incorrect des structures d'équation",
|
||||
|
||||
MultipleRowsOneCol:
|
||||
"Les lignes multiples doivent avoir exactement une colonne",
|
||||
|
||||
NoClosingDelim:
|
||||
"Impossible de trouver le délimiteur fermant pour la commande %1",
|
||||
|
||||
NoClosingChar:
|
||||
"Impossible de trouver le délimiteur '%1' fermant",
|
||||
|
||||
MultipleBBoxProperty:
|
||||
"La propriété %1 de la commande %2 spécifiée deux fois",
|
||||
|
||||
InvalidBBoxProperty:
|
||||
"La valeur '%1' ne semble pas être une couleur, une dimension ou "+
|
||||
"de marge intérieur ou un style.",
|
||||
|
||||
ExtraEndMissingBegin:
|
||||
"Commande %1 non attendue ou commande \\begingroup manquante",
|
||||
|
||||
GlobalNotFollowedBy:
|
||||
"Command %1 non suivie d'une commande \\let, \\def ou \newcommand",
|
||||
|
||||
NewextarrowArg1:
|
||||
"Le premier argument de la commande %1 doit être le nom d'une "+
|
||||
"séquence de contrôle",
|
||||
|
||||
NewextarrowArg2:
|
||||
"Le second argument de la commande %1 doit être deux entiers "+
|
||||
"séparés par une virgule",
|
||||
|
||||
NewextarrowArg3:
|
||||
"Le troisième argument de la commande %1 doit être la valeur d'un "+
|
||||
"caractère unicode",
|
||||
|
||||
UndefinedColorModel:
|
||||
"Le modèle de couleur '%1' n'est pas défini",
|
||||
|
||||
rgbArg1:
|
||||
"Les couleurs rgb nécéssitent 3 nombres décimaux",
|
||||
|
||||
InvalidDecimalNumber:
|
||||
"Nombre décimal non valide",
|
||||
|
||||
rgbArg2:
|
||||
"Les valeurs rgb doivent être comprises entre 0 et 1",
|
||||
|
||||
RGBArg1:
|
||||
"Les couleurs RGB nécéssitent 3 nombres",
|
||||
|
||||
InvalidNumber:
|
||||
"Nombre non valide",
|
||||
|
||||
RGBArg2:
|
||||
"Les valeurs RGB doivent être comprises entre 0 et 255",
|
||||
|
||||
GrayScalerArg:
|
||||
"Les valeurs de dégradé de gris doivent être comprises entre 0 et 1",
|
||||
|
||||
DoubleBackSlash:
|
||||
"\\ doit être suivi d'une séquence de contrôle",
|
||||
|
||||
SequentialParam:
|
||||
"Les paramètres de la séquence de contrôle %1 doivent être "+
|
||||
"énumérés de façon séquentielle",
|
||||
|
||||
MissingReplacementString:
|
||||
"Chaine de caractère de remplacement manquante pour la définition %1",
|
||||
|
||||
MismatchUseDef:
|
||||
"L'utilisation de la commande %1 ne correspond pas à sa définition",
|
||||
|
||||
RunawayArgument:
|
||||
"Argument manquant pour la commande %1?"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/TeX.js");
|
72
unpacked/localization/fr/fr.js
Normal file
72
unpacked/localization/fr/fr.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
MathJax.Hub.Insert(MathJax.Localization.strings.fr,{
|
||||
isLoaded: true,
|
||||
domains: {
|
||||
"_": {
|
||||
isLoaded: true,
|
||||
strings: {
|
||||
|
||||
CookieConfig:
|
||||
"MathJax a trouvé un cookie de configuration utilisateur qui inclut"+
|
||||
"du code à exécuter. Souhaitez vous l'exécuter?\n\n"+
|
||||
"(Choisissez Annuler sauf si vous avez créé ce cookie vous-même",
|
||||
|
||||
MathProcessingError:
|
||||
"Erreur de traitement de la formule mathématique",
|
||||
|
||||
MathProcessingErrorHTML:
|
||||
["[Erreur de traitement de la formule mathématique]"],
|
||||
|
||||
MathErrorHTML:
|
||||
["[Erreur dans la formule mathématique]"],
|
||||
|
||||
LoadFile: "Téléchargement %1",
|
||||
|
||||
Loading: "Téléchargement",
|
||||
|
||||
LoadFailed: "Échec du téléchargement de %1",
|
||||
|
||||
CantLoadWebFont: "Impossible de télécharcharger la police Web %1",
|
||||
|
||||
ProcessMath: "Traitement des maths: %1%%",
|
||||
|
||||
Processing: "Traitement",
|
||||
|
||||
TypesetMath: "Composition des maths: %1%%",
|
||||
|
||||
Typesetting: "Composition",
|
||||
|
||||
FirefoxCantLoadWebFont:
|
||||
"Firefox ne peut télécharger les polices Web à partir d'un hôte"+
|
||||
"distant",
|
||||
|
||||
CantFindFontUsing:
|
||||
"Impossible de trouver une police valide en utilisant %1",
|
||||
|
||||
WebFontsNotAvailable:
|
||||
"Polices Web non disponibles -- des images de caractères vont être"+
|
||||
"utilisées à la place",
|
||||
|
||||
MathJaxNotSupported:
|
||||
"Votre navigateur ne supporte pas MathJax"
|
||||
|
||||
}
|
||||
},
|
||||
MathMenu: {},
|
||||
FontWarnings: {},
|
||||
"v1.0-warning": {},
|
||||
TeX: {},
|
||||
MathML: {}
|
||||
},
|
||||
|
||||
plural: function(n) {
|
||||
if (0 <= n && n < 2) {return 1} // one
|
||||
return 2; // other
|
||||
},
|
||||
|
||||
number: function(n) {
|
||||
return n.replace(".", ","); // replace dot by comma
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/fr.js");
|
15
unpacked/localization/fr/v1.0-warning.js
Normal file
15
unpacked/localization/fr/v1.0-warning.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
MathJax.Hub.Insert(MathJax.Localization.strings.fr.domains,{
|
||||
"v1.0-warning": {
|
||||
isLoaded: true,
|
||||
strings: {
|
||||
MissingConfig:
|
||||
"%1 MathJax ne charge plus de fichier de configuration par défaut; "+
|
||||
"vous devez spécifier ces fichiers de façons explicites. Cette "+
|
||||
"page semble utiliser l'ancien fichier de configuration par "+
|
||||
"défaut %2 and doit donc être mise à jour. Ceci est expliqué "+
|
||||
"en détails à l'addresse suivante: %3"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/v1.0-warning.js");
|
Loading…
Reference in New Issue
Block a user