Fix WARNINGs generated by the MathJax packer. #534
This commit is contained in:
parent
b73eafd431
commit
90749a7afe
|
@ -61,6 +61,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
for (var i = 0, m = nl.length; i < m; i++) notation[nl[i]] = true;
|
for (var i = 0, m = nl.length; i < m; i++) notation[nl[i]] = true;
|
||||||
if (notation[MML.NOTATION.UPDIAGONALARROW]) notation[MML.NOTATION.UPDIAGONALSTRIKE] = false;
|
if (notation[MML.NOTATION.UPDIAGONALARROW]) notation[MML.NOTATION.UPDIAGONALSTRIKE] = false;
|
||||||
|
|
||||||
|
var line;
|
||||||
for (var n in notation) {
|
for (var n in notation) {
|
||||||
if (!notation.hasOwnProperty(n) || !notation[n]) continue;
|
if (!notation.hasOwnProperty(n) || !notation[n]) continue;
|
||||||
switch (n) {
|
switch (n) {
|
||||||
|
@ -117,8 +118,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MML.NOTATION.VERTICALSTRIKE:
|
case MML.NOTATION.VERTICALSTRIKE:
|
||||||
var vline = HTMLCSS.createRule(stack,H+D-t/2,0,t);
|
line = HTMLCSS.createRule(stack,H+D-t/2,0,t);
|
||||||
HTMLCSS.addBox(stack,vline); HTMLCSS.placeBox(vline,p+t+base.bbox.w/2,-D,true);
|
HTMLCSS.addBox(stack,line); HTMLCSS.placeBox(line,p+t+base.bbox.w/2,-D,true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MML.NOTATION.TOP:
|
case MML.NOTATION.TOP:
|
||||||
|
@ -130,14 +131,14 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MML.NOTATION.HORIZONTALSTRIKE:
|
case MML.NOTATION.HORIZONTALSTRIKE:
|
||||||
var hline = HTMLCSS.createRule(stack,t,0,W-t/2);
|
line = HTMLCSS.createRule(stack,t,0,W-t/2);
|
||||||
HTMLCSS.addBox(stack,hline); HTMLCSS.placeBox(hline,0,(H+D)/2-D,true);
|
HTMLCSS.addBox(stack,line); HTMLCSS.placeBox(line,0,(H+D)/2-D,true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MML.NOTATION.UPDIAGONALSTRIKE:
|
case MML.NOTATION.UPDIAGONALSTRIKE:
|
||||||
if (HTMLCSS.useVML) {
|
if (HTMLCSS.useVML) {
|
||||||
if (!vml) {vml = this.HTMLvml(stack,H,D,W,t,values.mathcolor)}
|
if (!vml) {vml = this.HTMLvml(stack,H,D,W,t,values.mathcolor)}
|
||||||
var line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+",0"});
|
line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+",0"});
|
||||||
} else {
|
} else {
|
||||||
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
|
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
|
||||||
this.HTMLsvgElement(svg.firstChild,"line",{
|
this.HTMLsvgElement(svg.firstChild,"line",{
|
||||||
|
@ -149,7 +150,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
case MML.NOTATION.UPDIAGONALARROW:
|
case MML.NOTATION.UPDIAGONALARROW:
|
||||||
if (HTMLCSS.useVML) {
|
if (HTMLCSS.useVML) {
|
||||||
if (!vml) {vml = this.HTMLvml(stack,H,D,W,t,values.mathcolor)}
|
if (!vml) {vml = this.HTMLvml(stack,H,D,W,t,values.mathcolor)}
|
||||||
var line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+","+this.HTMLpx(t)});
|
line = this.HTMLvmlElement(vml,"line",{from: "0,"+this.HTMLpx(H+D-t), to: this.HTMLpx(W)+","+this.HTMLpx(t)});
|
||||||
this.HTMLvmlElement(line,"stroke",{endarrow:"classic"});
|
this.HTMLvmlElement(line,"stroke",{endarrow:"classic"});
|
||||||
} else {
|
} else {
|
||||||
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
|
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
|
||||||
|
|
|
@ -902,6 +902,7 @@
|
||||||
MML.math.Augment({
|
MML.math.Augment({
|
||||||
toNativeMML: function (parent) {
|
toNativeMML: function (parent) {
|
||||||
var tag = this.NativeMMLelement(this.type), math = tag, jax;
|
var tag = this.NativeMMLelement(this.type), math = tag, jax;
|
||||||
|
var i, m;
|
||||||
nMML.adjustWidths = [];
|
nMML.adjustWidths = [];
|
||||||
//
|
//
|
||||||
// Some browsers don't seem to add the xmlns attribute, so do it by hand.
|
// Some browsers don't seem to add the xmlns attribute, so do it by hand.
|
||||||
|
@ -916,7 +917,7 @@
|
||||||
//
|
//
|
||||||
// Add the children
|
// Add the children
|
||||||
//
|
//
|
||||||
for (var i = 0, m = this.data.length; i < m; i++) {
|
for (i = 0, m = this.data.length; i < m; i++) {
|
||||||
if (this.data[i]) {this.data[i].toNativeMML(tag)}
|
if (this.data[i]) {this.data[i].toNativeMML(tag)}
|
||||||
else {tag.appendChild(this.NativeMMLelement("mrow"))}
|
else {tag.appendChild(this.NativeMMLelement("mrow"))}
|
||||||
}
|
}
|
||||||
|
@ -969,8 +970,8 @@
|
||||||
// fix them up. Use ex's so that they print properly (see above).
|
// fix them up. Use ex's so that they print properly (see above).
|
||||||
//
|
//
|
||||||
var mtd = [];
|
var mtd = [];
|
||||||
for (var i = 0, m = nMML.adjustWidths.length; i < m; i++) {
|
for (i = 0, m = nMML.adjustWidths.length; i < m; i++) {
|
||||||
var tag = nMML.adjustWidths[i];
|
tag = nMML.adjustWidths[i];
|
||||||
var style = tag.getAttribute("style") || "";
|
var style = tag.getAttribute("style") || "";
|
||||||
if (!style.match(/(^|;)\s*min-width:/)) {
|
if (!style.match(/(^|;)\s*min-width:/)) {
|
||||||
mtd.push(tag.scrollWidth);
|
mtd.push(tag.scrollWidth);
|
||||||
|
@ -1215,11 +1216,11 @@
|
||||||
//
|
//
|
||||||
// Process the postscript pairs
|
// Process the postscript pairs
|
||||||
//
|
//
|
||||||
var m = this.data.length, i;
|
var m = this.data.length, i, msubsup;
|
||||||
for (i = 1; i < m; i+=2) {
|
for (i = 1; i < m; i+=2) {
|
||||||
if (this.data[i].type === "mprescripts") break;
|
if (this.data[i].type === "mprescripts") break;
|
||||||
|
|
||||||
var msubsup = this.NativeMMLelement("msubsup");
|
msubsup = this.NativeMMLelement("msubsup");
|
||||||
msubsup.appendChild(base);
|
msubsup.appendChild(base);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1243,7 +1244,7 @@
|
||||||
// Process the prescript pairs
|
// Process the prescript pairs
|
||||||
//
|
//
|
||||||
for (i++; i < m; i+=2) {
|
for (i++; i < m; i+=2) {
|
||||||
var msubsup = this.NativeMMLelement("msubsup");
|
msubsup = this.NativeMMLelement("msubsup");
|
||||||
msubsup.appendChild(this.NativeMMLelement("mrow"));
|
msubsup.appendChild(this.NativeMMLelement("mrow"));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -116,7 +116,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
||||||
|
|
||||||
// perform some reduction e.g. eliminate duplicate notations.
|
// perform some reduction e.g. eliminate duplicate notations.
|
||||||
var nl = MathJax.Hub.SplitList(values.notation), notation = {};
|
var nl = MathJax.Hub.SplitList(values.notation), notation = {};
|
||||||
for (var i = 0, m = nl.length; i < m; i++) notation[nl[i]] = true;
|
for (i = 0, m = nl.length; i < m; i++) notation[nl[i]] = true;
|
||||||
if (notation[MML.NOTATION.UPDIAGONALARROW]) notation[MML.NOTATION.UPDIAGONALSTRIKE] = false;
|
if (notation[MML.NOTATION.UPDIAGONALARROW]) notation[MML.NOTATION.UPDIAGONALSTRIKE] = false;
|
||||||
|
|
||||||
for (var n in notation) {
|
for (var n in notation) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user