Pass state rather than scripts to pre- and postTranslate methods (let them get the scripts from the state)

This commit is contained in:
Davide P. Cervone 2011-09-04 12:34:17 -04:00
parent 922fc81461
commit 0145248359
8 changed files with 12 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1506,7 +1506,7 @@ MathJax.Hub = {
while (state.j < state.jaxIDs.length) {
var id = state.jaxIDs[state.j], JAX = MathJax.OutputJax[id];
if (JAX[method]) {
try {JAX[method](state.jax[id],state)} catch (err) {
try {JAX[method](state)} catch (err) {
if (!err.restart) {
MathJax.Message.Set("Error preparing "+id+" output ("+method+")",null,600);
MathJax.Hub.lastPrepError = err;

View File

@ -366,8 +366,9 @@
}
},
preTranslate: function (scripts) {
var i, m = scripts.length, script, prev, span, div, jax, ex, em, scale;
preTranslate: function (state) {
var scripts = state.jax[this.id], i, m = scripts.length,
script, prev, span, div, jax, ex, em, scale;
for (i = 0; i < m; i++) {
script = scripts[i]; if (!script.parentNode) continue;
//
@ -457,7 +458,8 @@
}
},
postTranslate: function (scripts) {
postTranslate: function (state) {
var scripts = state.jax[this.id];
if (!this.hideProcessedMath) return;
for (var i = 0, m = scripts.length; i < m; i++) {
var script = scripts[i];