Properly handle menu renderer settings when combined config files are used. (REsolves issue 51)
This commit is contained in:
parent
5d513b383d
commit
c1de343e4e
File diff suppressed because one or more lines are too long
|
@ -29,7 +29,7 @@ if (document.getElementById && document.childNodes && document.createElement) {
|
||||||
if (!window.MathJax) {window.MathJax= {}}
|
if (!window.MathJax) {window.MathJax= {}}
|
||||||
if (!MathJax.Hub) { // skip if already loaded
|
if (!MathJax.Hub) { // skip if already loaded
|
||||||
|
|
||||||
MathJax.version = "1.0.9";
|
MathJax.version = "1.0.10";
|
||||||
|
|
||||||
/**********************************************************/
|
/**********************************************************/
|
||||||
|
|
||||||
|
@ -1169,7 +1169,7 @@ MathJax.Hub = {
|
||||||
|
|
||||||
preProcessors: [], // list of callbacks for preprocessing (initialized by extensions)
|
preProcessors: [], // list of callbacks for preprocessing (initialized by extensions)
|
||||||
inputJax: {}, // mime-type mapped to input jax (by registration)
|
inputJax: {}, // mime-type mapped to input jax (by registration)
|
||||||
outputJax: {}, // mime-type mapped to output jax list (by registration)
|
outputJax: {order:{}}, // mime-type mapped to output jax list (by registration)
|
||||||
|
|
||||||
menuSettings: {
|
menuSettings: {
|
||||||
//format: "MathML", // the Show Source format (set in MathMenu.js)
|
//format: "MathML", // the Show Source format (set in MathMenu.js)
|
||||||
|
@ -1562,7 +1562,6 @@ MathJax.Hub.Startup = {
|
||||||
Jax: function () {
|
Jax: function () {
|
||||||
var config = MathJax.Hub.config;
|
var config = MathJax.Hub.config;
|
||||||
// Save the order of the output jax since they are loading asynchronously
|
// 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++) {
|
for (var i = 0, m = config.jax.length, k = 0; i < m; i++) {
|
||||||
if (config.jax[i].substr(0,7) === "output/")
|
if (config.jax[i].substr(0,7) === "output/")
|
||||||
{config.outputJax.order[config.jax[i].substr(7)] = k; k++}
|
{config.outputJax.order[config.jax[i].substr(7)] = k; k++}
|
||||||
|
@ -1586,6 +1585,19 @@ MathJax.Hub.Startup = {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set the math menu renderer, if it isn't already
|
||||||
|
// (this must come after the jax are loaded)
|
||||||
|
//
|
||||||
|
Menu: function () {
|
||||||
|
var menu = MathJax.Hub.config.menuSettings, jax = MathJax.Hub.config.outputJax;
|
||||||
|
if (!menu.renderer) {
|
||||||
|
for (var id in jax) {if (jax.hasOwnProperty(id)) {
|
||||||
|
if (jax[id].length) {menu.renderer = jax[id][0].id; return}
|
||||||
|
}}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setup the onload callback
|
// Setup the onload callback
|
||||||
//
|
//
|
||||||
|
@ -1759,13 +1771,10 @@ MathJax.Hub.Startup = {
|
||||||
BASE.OutputJax = JAX.Subclass({
|
BASE.OutputJax = JAX.Subclass({
|
||||||
Register: function (mimetype) {
|
Register: function (mimetype) {
|
||||||
var jax = HUB.config.outputJax;
|
var jax = HUB.config.outputJax;
|
||||||
if (!jax[mimetype]) {
|
if (!jax[mimetype]) {jax[mimetype] = []}
|
||||||
jax[mimetype] = [];
|
|
||||||
if (!HUB.config.menuSettings.renderer)
|
|
||||||
{HUB.config.menuSettings.renderer = this.id}
|
|
||||||
}
|
|
||||||
// If the output jax is earlier in the original configuration list, put it first here
|
// 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))
|
if (jax[mimetype].length && (this.id === HUB.config.menuSettings.renderer ||
|
||||||
|
(jax.order[this.id]||0) < (jax.order[jax[mimetype][0].id]||0)))
|
||||||
{jax[mimetype].unshift(this)} else {jax[mimetype].push(this)}
|
{jax[mimetype].unshift(this)} else {jax[mimetype].push(this)}
|
||||||
// Make sure the element jax is loaded before Startup is called
|
// Make sure the element jax is loaded before Startup is called
|
||||||
if (!this.require) {this.require = []}
|
if (!this.require) {this.require = []}
|
||||||
|
@ -1774,7 +1783,7 @@ MathJax.Hub.Startup = {
|
||||||
},
|
},
|
||||||
Remove: function (jax) {}
|
Remove: function (jax) {}
|
||||||
},{
|
},{
|
||||||
version: "1.0.1",
|
version: "1.0.2",
|
||||||
directory: JAX.directory+"/output",
|
directory: JAX.directory+"/output",
|
||||||
extensionDir: JAX.extensionDir,
|
extensionDir: JAX.extensionDir,
|
||||||
fontDir: ROOT+(BASE.isPacked?"":"/..")+"/fonts"
|
fontDir: ROOT+(BASE.isPacked?"":"/..")+"/fonts"
|
||||||
|
@ -1975,6 +1984,7 @@ MathJax.Hub.Startup = {
|
||||||
);
|
);
|
||||||
return queue.Push({});
|
return queue.Push({});
|
||||||
},
|
},
|
||||||
|
["Menu",STARTUP],
|
||||||
STARTUP.onLoad(),
|
STARTUP.onLoad(),
|
||||||
function () {MathJax.isReady = true}, // indicates that MathJax is ready to process math
|
function () {MathJax.isReady = true}, // indicates that MathJax is ready to process math
|
||||||
["Typeset",STARTUP],
|
["Typeset",STARTUP],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user