Make AJAX.loadComplete() work even if no AJAX.Load() was called (in preparation for putting multiple files into a single configuration file that can include all the common extensions and setup files)

git-svn-id: https://mathjax.svn.sourceforge.net/svnroot/mathjax/trunk@618 b8fd5906-0fad-46e2-a0d3-10d94ff285d1
This commit is contained in:
dpvc 2010-09-29 02:49:27 +00:00
parent b8350ca60c
commit 89fab25603
2 changed files with 13 additions and 14 deletions

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.4";
MathJax.version = "1.0.5";
/**********************************************************/
@ -631,7 +631,8 @@ MathJax.version = "1.0.4";
else {type = file.split(/\./).pop().toUpperCase()}
file = this.fileURL(file);
if (this.loading[file]) {
this.loading[file].callbacks.push(callback);
if (!this.loadHooks[file]) {this.loadHooks[file] = []}
this.loadHooks[file].push(callback);
} else {
this.head = HEAD(this.head);
if (this.loader[type]) {this.loader[type].call(this,file,callback)}
@ -669,7 +670,7 @@ MathJax.version = "1.0.4";
var script = document.createElement("script");
var timeout = BASE.Callback(["loadTimeout",this,file]);
this.loading[file] = {
callbacks: [callback],
callback: callback,
message: BASE.Message.File(file),
timeout: setTimeout(timeout,this.timeout),
status: this.STATUS.OK,
@ -687,7 +688,7 @@ MathJax.version = "1.0.4";
var link = document.createElement("link");
link.rel = "stylesheet"; link.type = "text/css"; link.href = file;
this.loading[file] = {
callbacks: [callback],
callback: callback,
message: BASE.Message.File(file),
status: this.STATUS.OK
};
@ -803,15 +804,13 @@ MathJax.version = "1.0.4";
SCRIPTS.push(loading.script);
}
this.loaded[file] = loading.status; delete this.loading[file];
if (this.loadHooks[file]) {
BASE.Callback.Queue(
[BASE.Callback.ExecuteHooks,this.loadHooks[file],loading.status],
[BASE.Callback.ExecuteHooks,loading.callbacks,loading.status]
);
} else {
BASE.Callback.ExecuteHooks(loading.callbacks,loading.status);
}
if (!this.loadHooks[file]) {this.loadHooks[file] = []}
this.loadHooks[file].push(loading.callback);
} else {
this.loaded[file] = this.STATUS.OK;
loading = {status: this.STATUS.OK}
}
BASE.Callback.ExecuteHooks(this.loadHooks[file],loading.status);
},
//