Merge dpvc/parallel branch

This commit is contained in:
Davide P. Cervone 2010-12-30 14:37:37 -05:00
commit b24524afcf
14 changed files with 109 additions and 44 deletions

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,6 @@
*/
MathJax.Unpack([
['MathJax.InputJax','.MathML','=',0,'({id:"','MathML",','version:"1.0.3",directory:',0,'.directory+"/',5,'extensionDir',':',0,'.',10,'+"/',5,'entityDir:',0,8,'MathML/entities",require:[MathJax.ElementJax',8,'mml/jax.js"],config:{useMathMLspacing:false}});',0,1,'.Register("math/mml");',0,1,'.loadComplete("config.js");']
['MathJax.InputJax','.MathML','=',0,'({id:"MathML",version:"1.0.3",directory:',0,'.directory+"/MathML','",extensionDir:',0,'.extensionDir+"/MathML",entityDir:',0,6,'/entities",config:{useMathMLspacing:false}});',0,1,'.Register("math/mml");',0,1,'.loadComplete("config.js");']
]);

View File

@ -13,6 +13,6 @@
*/
MathJax.Unpack([
['MathJax.InputJax','.TeX','=',0,'({id:"TeX",version:"1.0.3",directory:',0,'.directory+"/','TeX",extensionDir:',0,'.extensionDir+"/TeX",require:[MathJax.ElementJax',6,'mml/jax.js"],config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});',0,1,'.Register("math/tex");',0,1,'.loadComplete("config.js");']
['MathJax.InputJax','.TeX','=',0,'({id:"TeX",version:"1.0.3",directory:',0,'.directory+"/TeX",extensionDir:',0,'.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});',0,1,'.Register("math/tex");',0,1,'.loadComplete("config.js");']
]);

View File

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

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,6 @@
*/
MathJax.Unpack([
['MathJax.OutputJax','.','NativeMML','=',0,'({id:"',2,'",version:"1.0.1",directory:',0,'.directory+"/',2,'",extensionDir:',0,'.extensionDir+"/',2,'",config:{scale:100,showMathMenu:true,showMathMenuMSIE:true,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});',0,'.',2,'.Register("jax/mml");(function(b){if(b.isMSIE){var a=document.createElement("object");a.id="mathplayer";a.classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987";document.getElementsByTagName("head")[0].appendChild(a);','document.namespaces.','add("mjx","http://www.w3.org/1998/Math/MathML");',20,'mjx.doImport("#mathplayer")}})(MathJax.Hub.Browser);',0,'.',2,'.loadComplete("config.js");']
['MathJax.OutputJax','.','NativeMML','=',0,'({id:"',2,'",version:"1.0.2",directory:',0,'.directory+"/',2,'",extensionDir:',0,'.extensionDir+"/',2,'",config:{scale:100,showMathMenu:true,showMathMenuMSIE:true,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});',0,'.',2,'.Register("jax/mml");(function(b){if(b.isMSIE){var a=document.createElement("object");a.id="mathplayer";a.classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987";document.getElementsByTagName("head")[0].appendChild(a);','document.namespaces.','add("mjx","http://www.w3.org/1998/Math/MathML");',20,'mjx.doImport("#mathplayer")}})(MathJax.Hub.Browser);',0,'.',2,'.loadComplete("config.js");']
]);

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ if (document.getElementById && document.childNodes && document.createElement) {
if (!window.MathJax) {window.MathJax= {}}
if (!MathJax.Hub) { // skip if already loaded
MathJax.version = "1.0.7";
MathJax.version = "1.0.8";
/**********************************************************/
@ -348,7 +348,7 @@ MathJax.version = "1.0.7";
//
// Create a callback that is called when a collection of other callbacks have
// all been executed. If the callback gets calledimmediately (i.e., the
// all been executed. If the callback gets called immediately (i.e., the
// others are all already called), check if it returns another callback
// and return that instead.
//
@ -1533,9 +1533,17 @@ MathJax.Hub.Startup = {
// Load the input and output jax
//
Jax: function () {
return this.queue.Push(
var config = MathJax.Hub.config;
// Save the order of the output jax since they are loading asynchronously
config.outputJax.order = {};
for (var i = 0, m = config.jax.length, k = 0; i < m; i++) {
if (config.jax[i].substr(0,7) === "output/")
{config.outputJax.order[config.jax[i].substr(7)] = k; k++}
}
var queue = MathJax.Callback.Queue();
return queue.Push(
["Post",this.signal,"Begin Jax"],
["loadArray",this,MathJax.Hub.config.jax,"jax","config.js",true],
["loadArray",this,config.jax,"jax","config.js"],
["Post",this.signal,"End Jax"]
);
},
@ -1543,7 +1551,8 @@ MathJax.Hub.Startup = {
// Load the extensions
//
Extensions: function () {
return this.queue.Push(
var queue = MathJax.Callback.Queue();
return queue.Push(
["Post",this.signal,"Begin Extensions"],
["loadArray",this,MathJax.Hub.config.extensions,"extensions"],
["Post",this.signal,"End Extensions"]
@ -1613,6 +1622,7 @@ MathJax.Hub.Startup = {
var HUB = BASE.Hub, AJAX = BASE.Ajax, CALLBACK = BASE.Callback;
var JAX = MathJax.Object.Subclass({
JAXFILE: "jax.js",
require: null, // array of files to load before jax.js is complete
config: {},
//
@ -1644,10 +1654,10 @@ MathJax.Hub.Startup = {
},
Translate: function (element) {
this.constructor.prototype.Translate = this.noTranslate;
return AJAX.Require(this.directory+"/jax.js");
return AJAX.Require(this.directory+"/"+this.JAXFILE);
},
noTranslate: function (element) {
throw Error(this.directory+"/jax.js failed to redefine the Translate() method");
throw Error(this.directory+"/"+this.JAXFILE+" failed to redefine the Translate() method");
},
Register: function (mimetype) {},
Config: function () {
@ -1656,7 +1666,9 @@ MathJax.Hub.Startup = {
},
Startup: function () {},
loadComplete: function (file) {
if (file === "jax.js") {
if (file === "config.js") {
return AJAX.loadComplete(this.directory+"/"+file);
} else {
var queue = CALLBACK.Queue();
queue.Push(["Post",HUB.Startup.signal,this.id+" Jax Config"]);
queue.Push(["Config",this]);
@ -1670,8 +1682,6 @@ MathJax.Hub.Startup = {
queue.Push(["Startup",this]);
queue.Push(["Post",HUB.Startup.signal,this.id+" Jax Ready"]);
return queue.Push(["loadComplete",AJAX,this.directory+"/"+file]);
} else {
return AJAX.loadComplete(this.directory+"/"+file);
}
}
},{
@ -1684,12 +1694,33 @@ MathJax.Hub.Startup = {
/***********************************/
BASE.InputJax = JAX.Subclass({
elementJax: "mml", // the element jax to load for this input jax
Translate: function (element) {
// Make Translate produce an error message until the true one is loaded
this.constructor.prototype.Translate = this.noTranslate;
var queue = CALLBACK.Queue();
// Load any needed element jax
var jax = this.elementJax; if (!(jax instanceof Array)) {jax = [jax]}
for (var i = 0, m = jax.length; i < m; i++) {
var file = BASE.ElementJax.directory+"/"+jax[i]+"/"+this.JAXFILE;
if (!this.require) {this.require = []}
else if (!(this.require instanceof Array)) {this.require = [this.require]};
this.require.push(file); // so Startup will wait for it to be loaded
queue.Push(AJAX.Require(file));
}
// Load the input jax
queue.Push(AJAX.Require(this.directory+"/"+this.JAXFILE));
// Load the associated output jax
jax = HUB.config.outputJax["jax/"+jax[0]];
if (jax) {queue.Push(AJAX.Require(jax[0].directory+"/"+this.JAXFILE))}
return queue.Push({});
},
Register: function (mimetype) {
if (!BASE.Hub.config.inputJax) {HUB.config.inputJax = {}}
HUB.config.inputJax[mimetype] = this;
}
},{
version: "1.0",
version: "1.0.1",
directory: JAX.directory+"/input",
extensionDir: JAX.extensionDir
});
@ -1698,16 +1729,23 @@ MathJax.Hub.Startup = {
BASE.OutputJax = JAX.Subclass({
Register: function (mimetype) {
if (!HUB.config.outputJax) {HUB.config.outputJax = {}}
if (!HUB.config.outputJax[mimetype]) {
HUB.config.outputJax[mimetype] = [];
if (!HUB.config.menuSettings.renderer) {HUB.config.menuSettings.renderer = this.id}
var jax = HUB.config.outputJax;
if (!jax[mimetype]) {
jax[mimetype] = [];
if (!HUB.config.menuSettings.renderer)
{HUB.config.menuSettings.renderer = this.id}
}
HUB.config.outputJax[mimetype].push(this);
// If the output jax is earlier in the original configuration list, put it first here
if (jax[mimetype].length && (jax.order[this.id]||0) < (jax.order[jax[mimetype][0].id]||0))
{jax[mimetype].unshift(this)} else {jax[mimetype].push(this)}
// Make sure the element jax is loaded before Startup is called
if (!this.require) {this.require = []}
else if (!(this.require instanceof Array)) {this.require = [this.require]};
this.require.push(BASE.ElementJax.directory+"/"+(mimetype.split(/\//)[1])+"/"+this.JAXFILE);
},
Remove: function (jax) {}
},{
version: "1.0",
version: "1.0.1",
directory: JAX.directory+"/output",
extensionDir: JAX.extensionDir,
fontDir: ROOT+(BASE.isPacked?"":"/..")+"/fonts"
@ -1900,8 +1938,14 @@ MathJax.Hub.Startup = {
["Config",STARTUP],
["Cookie",STARTUP],
["Styles",STARTUP],
["Jax",STARTUP],
["Extensions",STARTUP],
function () {
// Do Jax and Extensions in parallel, but wait for them all to complete
var queue = BASE.Callback.Queue(
STARTUP.Jax(),
STARTUP.Extensions()
);
return queue.Push({});
},
STARTUP.onLoad(),
function () {MathJax.isReady = true}, // indicates that MathJax is ready to process math
["Typeset",STARTUP],

View File

@ -28,7 +28,6 @@ MathJax.InputJax.MathML = MathJax.InputJax({
directory: MathJax.InputJax.directory + "/MathML",
extensionDir: MathJax.InputJax.extensionDir + "/MathML",
entityDir: MathJax.InputJax.directory + "/MathML/entities",
require: [MathJax.ElementJax.directory + "/mml/jax.js"],
config: {
useMathMLspacing: false // false means use TeX spacing, true means MML spacing

View File

@ -27,7 +27,6 @@ MathJax.InputJax.TeX = MathJax.InputJax({
version: "1.0.3",
directory: MathJax.InputJax.directory + "/TeX",
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
require: [MathJax.ElementJax.directory + "/mml/jax.js"],
config: {
TagSide: "right",

View File

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

View File

@ -23,7 +23,9 @@
* limitations under the License.
*/
(function (MML,AJAX,HUB,HTMLCSS) {
(function (AJAX,HUB,HTMLCSS) {
var MML;
var FONTTEST = MathJax.Object.Subclass({
timeout: 5*1000, // timeout for loading web fonts
@ -179,7 +181,6 @@
});
HTMLCSS.Augment({
config: {
useOldImageData: true, // for now
@ -1149,6 +1150,10 @@
rfuzz: 0 // adjustment to rule placements in roots
});
MathJax.Hub.Register.StartupHook("mml Jax Ready",function () {
MML = MathJax.ElementJax.mml;
MML.mbase.Augment({
toHTML: function (span) {
var split = this.HTMLlineBreaks();
@ -2092,6 +2097,15 @@
return span;
}
});
//
// Loading isn't complete until the element jax is modified,
// but can't call loadComplete within the callback for "mml Jax Ready"
// (it would call HTMLCSS's Require routine, asking for the mml jax again)
// so wait until after the mml jax has finished processing.
//
setTimeout(MathJax.Callback(["loadComplete",HTMLCSS,"jax.js"]),0);
});
//
// Handle browser-specific setup
@ -2220,7 +2234,5 @@
if (HUB.config.menuSettings.zoom !== "None")
{AJAX.Require("[MathJax]/extensions/MathZoom.js")}
HTMLCSS.loadComplete("jax.js");
})(MathJax.ElementJax.mml, MathJax.Ajax, MathJax.Hub, MathJax.OutputJax["HTML-CSS"]);
})(MathJax.Ajax, MathJax.Hub, MathJax.OutputJax["HTML-CSS"]);

View File

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

View File

@ -22,8 +22,8 @@
* limitations under the License.
*/
(function (MML,nMML,HUB,AJAX) {
var isMSIE = HUB.Browser.isMSIE;
(function (nMML,HUB,AJAX) {
var MML, isMSIE = HUB.Browser.isMSIE;
nMML.Augment({
LEFTBUTTON: (isMSIE ? 1 : 0), // the event.button value for left button
@ -207,7 +207,11 @@
negativeveryverythickmathspace: "-.3889em"
}
});
MathJax.Hub.Register.StartupHook("mml Jax Ready",function () {
MML = MathJax.ElementJax.mml;
MML.mbase.Augment({
//
// Add a MathML tag of the correct type, and set its attributes
@ -434,10 +438,17 @@
toNativeMML: function (parent) {this.Core().toNativeMML(parent)}
});
});
//
// Loading isn't complete until the element jax is modified,
// but can't call loadComplete within the callback for "mml Jax Ready"
// (it would call NativeMML's Require routine, asking for the mml jax again)
// so wait until after the mml jax has finished processing.
//
setTimeout(MathJax.Callback(["loadComplete",nMML,"jax.js"]),0);
});
if (HUB.config.menuSettings.zoom !== "None")
{AJAX.Require("[MathJax]/extensions/MathZoom.js")}
nMML.loadComplete("jax.js");
})(MathJax.ElementJax.mml, MathJax.OutputJax.NativeMML, MathJax.Hub, MathJax.Ajax);
})(MathJax.OutputJax.NativeMML, MathJax.Hub, MathJax.Ajax);