Skip to content

Commit c83db73

Browse files
committed
Fix problems found during packing of files
1 parent ce99625 commit c83db73

File tree

9 files changed

+34
-38
lines changed

9 files changed

+34
-38
lines changed

unpacked/MathJax.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1040,15 +1040,15 @@ MathJax.HTML = {
10401040
// " for more details.)"]);
10411041
//
10421042
Element: function (type,def,contents) {
1043-
var obj = document.createElement(type);
1043+
var obj = document.createElement(type), id;
10441044
if (def) {
10451045
if (def.style) {
10461046
var style = def.style; def.style = {};
1047-
for (var id in style) {if (style.hasOwnProperty(id))
1047+
for (id in style) {if (style.hasOwnProperty(id))
10481048
{def.style[id.replace(/-([a-z])/g,this.ucMatch)] = style[id]}}
10491049
}
10501050
MathJax.Hub.Insert(obj,def);
1051-
for (var id in def) {
1051+
for (id in def) {
10521052
if (id === "role" || id.substr(0,5) === "aria-") obj.setAttribute(id,def[id]);
10531053
}
10541054
}

unpacked/extensions/MathMenu.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@
623623
if (!this.hidden) {
624624
var def = this.Attributes();
625625
var label = this.Label(def,menu);
626-
var node = HTML.addElement(menu, "div", def, label);
626+
HTML.addElement(menu, "div", def, label);
627627
}
628628
},
629629
Name: function () {return _(this.name[0],this.name[1])},
@@ -1034,7 +1034,6 @@
10341034
* Handle the ABOUT box
10351035
*/
10361036
MENU.About = function (event) {
1037-
var HTMLCSS = OUTPUT["HTML-CSS"] || {};
10381037
var font = MENU.About.GetFont();
10391038
var format = MENU.About.GetFormat();
10401039
var jax = ["MathJax.js v"+MathJax.fileversion,["br"]];

unpacked/jax/output/CommonHTML/autoload/maction.js

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
2828
var VERSION = "2.6.0-beta";
2929
var MML = MathJax.ElementJax.mml,
30-
HTML = MathJax.HTML,
3130
CHTML = MathJax.OutputJax.CommonHTML;
3231

3332
var currentTip, hover, clear;

unpacked/jax/output/CommonHTML/autoload/menclose.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
2828
var VERSION = "2.6.0-beta";
2929
var MML = MathJax.ElementJax.mml,
30-
HTML = MathJax.HTML,
3130
CHTML = MathJax.OutputJax.CommonHTML;
3231

3332
var SVGNS = "http://www.w3.org/2000/svg";
@@ -107,7 +106,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
107106

108107
circle: function (child,cbox,bb,p,t,SOLID) {
109108
var H = bb.H, D = bb.D, W = bb.W;
110-
svg = this.CHTMLsvg(child,bb,t);
109+
var svg = this.CHTMLsvg(child,bb,t);
111110
this.CHTMLsvgElement(svg.firstChild,"ellipse",{
112111
rx:CHTML.Px(W/2-t/2), ry:CHTML.Px((H+D)/2-t/2),
113112
cx:CHTML.Px(W/2), cy:CHTML.Px((H+D)/2)
@@ -184,7 +183,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
184183

185184
updiagonalstrike: function (child,cbox,bb,p,t,SOLID) {
186185
var H = bb.H, D = bb.D, W = bb.W;
187-
svg = this.CHTMLsvg(child,bb,t);
186+
var svg = this.CHTMLsvg(child,bb,t);
188187
this.CHTMLsvgElement(svg.firstChild,"line",{
189188
x1:CHTML.Px(t/2), y1:CHTML.Px(H+D-t), x2:CHTML.Px(W-t), y2:CHTML.Px(t/2)
190189
});
@@ -194,7 +193,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
194193

195194
downdiagonalstrike: function (child,cbox,bb,p,t,SOLID) {
196195
var H = bb.H, D = bb.D, W = bb.W;
197-
svg = this.CHTMLsvg(child,bb,t);
196+
var svg = this.CHTMLsvg(child,bb,t);
198197
this.CHTMLsvgElement(svg.firstChild,"line",{
199198
x1:CHTML.Px(t/2), y1:CHTML.Px(t/2), x2:CHTML.Px(W-t), y2:CHTML.Px(H+D-t)
200199
});
@@ -206,7 +205,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
206205
var H = bb.H + bb.D - t, W = bb.W - t/2;
207206
var a = Math.atan2(H,W)*(-180/Math.PI).toFixed(3);
208207
var R = Math.sqrt(H*H + W*W);
209-
svg = this.CHTMLsvg(child,bb,t);
208+
var svg = this.CHTMLsvg(child,bb,t);
210209
var g = this.CHTMLsvgElement(svg.firstChild,"g",{
211210
fill:"currentColor",
212211
transform:"translate("+this.CHTMLpx(t/2)+" "+this.CHTMLpx(H+t/2)+") rotate("+a+")"
@@ -227,9 +226,11 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
227226
/********************************************************/
228227

229228
phasorangle: function (child,cbox,bb,p,t,SOLID) {
230-
var P = p, H = bb.H, D = bb.D, p = (H+D)/2, W = bb.W + p - P; bb.W = W; bb.L = p;
229+
var P = p, H = bb.H, D = bb.D;
230+
p = (H+D)/2;
231+
var W = bb.W + p - P; bb.W = W; bb.L = p;
231232
child.style.margin = "0 0 0 "+CHTML.Em(p-P);
232-
svg = this.CHTMLsvg(child,bb,t);
233+
var svg = this.CHTMLsvg(child,bb,t);
233234
this.CHTMLsvgElement(svg.firstChild,"path",{
234235
d: "M "+this.CHTMLpx(p)+",1 " +
235236
"L 1,"+this.CHTMLpx(H+D-t)+" L "+this.CHTMLpx(W)+","+this.CHTMLpx(H+D-t)
@@ -242,7 +243,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
242243
bb.W += 1.5*p; bb.L += 1.5*p;
243244
var H = bb.H, D = bb.D, W = bb.W;
244245
child.style.margin = "0 0 0 "+CHTML.Em(1.5*p);
245-
svg = this.CHTMLsvg(child,bb,t);
246+
var svg = this.CHTMLsvg(child,bb,t);
246247
this.CHTMLsvgElement(svg.firstChild,"path",{
247248
d: "M "+this.CHTMLpx(W)+",1 L 1,1 "+
248249
"a"+this.CHTMLpx(p)+","+this.CHTMLpx((H+D)/2-t/2)+" 0 0,1 1,"+this.CHTMLpx(H+D-1.5*t)
@@ -255,7 +256,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
255256
bb.W += 1.5*p; bb.L += 1.5*p;
256257
var H = bb.H, D = bb.D, W = bb.W;
257258
child.style.margin = "0 0 0 "+CHTML.Em(1.5*p);
258-
svg = this.CHTMLsvg(child,bb,t);
259+
var svg = this.CHTMLsvg(child,bb,t);
259260
this.CHTMLsvgElement(svg.firstChild,"path",{
260261
d: "M 1,"+this.CHTMLpx(.6*(H+D)) +
261262
" L "+this.CHTMLpx(p)+","+this.CHTMLpx(H+D) +

unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
2828
var VERSION = "2.6.0-beta";
2929
var MML = MathJax.ElementJax.mml,
30-
HTML = MathJax.HTML,
3130
CHTML = MathJax.OutputJax.CommonHTML;
3231

3332
MML.mmultiscripts.Augment({

unpacked/jax/output/CommonHTML/autoload/mtable.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
2828
var VERSION = "2.6.0-beta";
2929
var MML = MathJax.ElementJax.mml,
30-
HTML = MathJax.HTML, CONFIG = MathJax.Hub.config,
30+
CONFIG = MathJax.Hub.config,
3131
CHTML = MathJax.OutputJax.CommonHTML,
3232
SPLIT = MathJax.Hub.SplitList;
3333

@@ -179,22 +179,22 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
179179
// Add styles to cells to handle borders, spacing, alignment, etc.
180180
//
181181
CHTMLadjustCells: function(values,state) {
182-
var ROWS = state.rows, H = state.H, D = state.D,
182+
var ROWS = state.rows,
183183
CSPACE = state.CSPACE, CLINES = state.CLINES,
184184
RSPACE = state.RSPACE, RLINES = state.RLINES,
185185
CALIGN = state.CALIGN, RALIGN = state.RALIGN,
186186
RCALIGN = state.RCALIGN;
187187
CSPACE[state.J] *= 2; RSPACE[ROWS.length-1] *= 2; // since halved below
188188
var LH = CHTML.FONTDATA.lineH * values.useHeight,
189189
LD = CHTML.FONTDATA.lineD * values.useHeight;
190-
var T = "0", B, R, L, border, HD, cbox, align;
190+
var T = "0", B, R, L, border, cbox, align;
191191
if (values.fspace) T = CHTML.Em(state.FSPACE[1]);
192192
for (var i = 0, m = ROWS.length; i < m; i++) {
193193
var row = ROWS[i], rdata = this.data[i];
194194
//
195195
// Space and borders between rows
196196
//
197-
B = RSPACE[i]/2; border = F = null; L = "0";
197+
B = RSPACE[i]/2; border = null; L = "0";
198198
if (RLINES[i] !== MML.LINES.NONE) {
199199
border = "1px "+RLINES[i];
200200
B -= 1/CHTML.em/2;

unpacked/jax/output/CommonHTML/autoload/multiline.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
2828
var VERSION = "2.6.0-beta";
2929
var MML = MathJax.ElementJax.mml,
30-
HTML = MathJax.HTML, CONFIG = MathJax.Hub.config,
30+
CONFIG = MathJax.Hub.config,
3131
CHTML = MathJax.OutputJax.CommonHTML;
3232

3333
//
@@ -170,7 +170,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
170170
},
171171
CHTMLaddWidth: function (i,info,scanW) {
172172
if (this.data[i]) {
173-
var node = this.data[i].CHTMLnodeElement(), bbox = this.data[i].CHTML;
173+
var bbox = this.data[i].CHTML;
174174
scanW += bbox.w + (bbox.L||0) + (bbox.R||0);
175175
info.W = info.scanW = scanW; info.w = 0;
176176
}
@@ -563,7 +563,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
563563
},
564564

565565
CHTMLmoveLine: function (start,end,node,state,values) {
566-
var NODE = this.CHTMLnodeElement(), data = this.CHTML, BOX = this.CHTMLbbox, NODE;
566+
var NODE = this.CHTMLnodeElement(), BOX = this.CHTMLbbox, w;
567567
//
568568
// If this is the start, move the prescripts, if any.
569569
//
@@ -575,7 +575,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
575575
if (prestack) node.appendChild(prestack);
576576
else if (presup) node.appendChild(presup);
577577
else if (presub) node.appendChild(presub);
578-
var w = state.bbox.w, bbox;
578+
w = state.bbox.w;
579579
if (presup) state.bbox.combine(BOX.presup,w+BOX.presup.X,BOX.presup.Y);
580580
if (presub) state.bbox.combine(BOX.presub,w+BOX.presub.X,BOX.presub.Y);
581581
}
@@ -604,7 +604,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
604604
if (stack) node.appendChild(stack);
605605
else if (sup) node.appendChild(sup);
606606
else if (sub) node.appendChild(sub);
607-
var w = state.bbox.w, bbox;
607+
w = state.bbox.w;
608608
if (sup) state.bbox.combine(BOX.sup,w,BOX.sup.Y);
609609
if (sub) state.bbox.combine(BOX.sub,w,BOX.sub.Y);
610610
}
@@ -638,7 +638,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
638638
//
639639
// Get the default penalty for this location
640640
//
641-
var W = info.scanW, mo = (info.embellished||this); delete info.embellished;
641+
var W = info.scanW; delete info.embellished;
642642
var w = this.CHTML.w + (this.CHTML.L||0) + (this.CHTML.R||0);
643643
if (values.linebreakstyle === MML.LINEBREAKSTYLE.AFTER) {W += w; w = 0}
644644
if (W - info.shift === 0 && values.linebreak !== MML.LINEBREAK.NEWLINE)

unpacked/jax/output/CommonHTML/jax.js

+9-11
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@
190190
/************************************************************/
191191

192192
var BIGDIMEN = 1000000;
193-
var V = "V", H = "H";
194193
var LINEBREAKS = {}, CONFIG = MathJax.Hub.config;
195194

196195
CHTML.Augment({
@@ -726,7 +725,7 @@
726725
// require looking through the data again.
727726
//
728727
getCharList: function (variant,n) {
729-
var id, M, list = [], cache = variant.cache, N = n;
728+
var id, M, list = [], cache = variant.cache, nn = n;
730729
if (cache[n]) return cache[n];
731730
var RANGES = this.FONTDATA.RANGES, VARIANT = this.FONTDATA.VARIANT;
732731
if (n >= RANGES[0].low && n <= RANGES[RANGES.length-1].high) {
@@ -764,7 +763,7 @@
764763
if (variant.cache[n]) {list = variant.cache[n]}
765764
else {variant.cache[n] = list = [this.lookupChar(variant,n)]}
766765
}
767-
cache[N] = list;
766+
cache[nn] = list;
768767
return list;
769768
},
770769
//
@@ -895,7 +894,7 @@
895894
//
896895
// Character from the known fonts
897896
//
898-
char: function (item,node,bbox,state,m) {
897+
"char": function (item,node,bbox,state,m) {
899898
var font = item.font;
900899
if (state.className && font.className !== state.className) this.flushText(node,state);
901900
if (!state.a) state.a = font.centerline/1000;
@@ -924,7 +923,7 @@
924923
// An unknown character (one not in the font data)
925924
//
926925
unknown: function (item,node,bbox,state) {
927-
this.char(item,node,bbox,state,0);
926+
(this["char"])(item,node,bbox,state,0);
928927
var C = item.font[item.n];
929928
if (C[5].a) {
930929
state.a = C[5].a;
@@ -1494,7 +1493,7 @@
14941493

14951494
CHTMLhandleStyle: function (node) {
14961495
if (!this.style) return;
1497-
var BBOX = this.CHTML, style = node.style;
1496+
var style = node.style;
14981497
style.cssText = this.style; this.removedStyles = {};
14991498
for (var i = 0, m = CHTML.removeStyles.length; i < m; i++) {
15001499
var id = CHTML.removeStyles[i];
@@ -1832,7 +1831,6 @@
18321831
// something, so put them over a space and remove the space's width
18331832
//
18341833
node = node.firstChild;
1835-
var char = node.textContent;
18361834
var space = CHTML.Element("mjx-span",{style:{width:".25em","margin-left":"-.25em"}});
18371835
node.insertBefore(space,node.firstChild);
18381836
},
@@ -1996,7 +1994,7 @@
19961994
}
19971995
var cbox = this.CHTMLbboxFor(0);
19981996
var values = this.getValues("width","height","depth","lspace","voffset");
1999-
var dimen, x = 0, y = 0, w = cbox.w, h = cbox.h, d = cbox.d;
1997+
var x = 0, y = 0, w = cbox.w, h = cbox.h, d = cbox.d;
20001998
child.style.width = 0; child.style.margin = CHTML.Em(-h)+" 0 "+CHTML.Em(-d);
20011999
if (values.width !== "") w = this.CHTMLdimen(values.width,"w",w,0);
20022000
if (values.height !== "") h = this.CHTMLdimen(values.height,"h",h,0);
@@ -2124,7 +2122,7 @@
21242122
//
21252123
CHTMLaddOverscript: function (over,boxes,values,delta,base,stretch) {
21262124
var BBOX = this.CHTML;
2127-
var w, z1, z2, z3 = CHTML.TEX.big_op_spacing5, k;
2125+
var z1, z2, z3 = CHTML.TEX.big_op_spacing5, k;
21282126
var obox = boxes[this.over], bbox = boxes[this.base], scale = obox.rscale;
21292127
//
21302128
// Put the base and script into a stack
@@ -2171,8 +2169,8 @@
21712169
//
21722170
CHTMLaddUnderscript: function (under,boxes,values,delta,node,stack,stretch) {
21732171
var BBOX = this.CHTML;
2174-
var w, x = 0, z1, z2, z3 = CHTML.TEX.big_op_spacing5, k;
2175-
var ubox = boxes[this.under], bbox = boxes[this.base], scale = ubox.rscale;
2172+
var z1, z2, z3 = CHTML.TEX.big_op_spacing5, k;
2173+
var ubox = boxes[this.under], scale = ubox.rscale;
21762174
//
21772175
// Create a table for the underscript
21782176
//

unpacked/jax/output/HTML-CSS/autoload/mtable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
428428
var labelspace = HTMLCSS.length2em(values.minlabelspacing,mu,HTMLCSS.cwidth);
429429
var labelW = labelspace + C[LABEL].bbox.w, labelshift = 0, tw = mw;
430430
var dIndent = HTMLCSS.length2em(this.displayIndent,mu,HTMLCSS.cwidth);
431-
var s = (CALIGN[LABEL] === MML.INDENTALIGN.RIGHT ? -1 : 1);
431+
s = (CALIGN[LABEL] === MML.INDENTALIGN.RIGHT ? -1 : 1);
432432
if (indent.indentalign === MML.INDENTALIGN.CENTER) {
433433
tw += 2 * (labelW - s*(shift + dIndent));
434434
shift += dIndent;

0 commit comments

Comments
 (0)