Skip to content

Commit d9e019b

Browse files
committed
Merge branch 'issue297' into develop
2 parents 38c2f56 + a30d906 commit d9e019b

File tree

8 files changed

+50
-9
lines changed

8 files changed

+50
-9
lines changed

MathJax.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/TeX-AMS-MML_SVG-full.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/TeX-AMS-MML_SVG.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jax/output/SVG/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
* http://www.apache.org/licenses/LICENSE-2.0
1313
*/
1414

15-
MathJax.OutputJax.SVG=MathJax.OutputJax({id:"SVG",version:"2.0.9",directory:MathJax.OutputJax.directory+"/SVG",extensionDir:MathJax.OutputJax.extensionDir+"/SVG",autoloadDir:MathJax.OutputJax.directory+"/SVG/autoload",fontDir:MathJax.OutputJax.directory+"/SVG/fonts",config:{scale:100,minScaleAdjust:50,font:"TeX",blacker:10,mtextFontInherit:false,undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",addMMLclasses:false,EqnChunk:(MathJax.Hub.Browser.isMobile?10:50),EqnChunkFactor:1.5,EqnChunkDelay:100,linebreaks:{automatic:false,width:"container"},styles:{".MathJax_SVG_Display":{"text-align":"center",margin:"1em 0em"},"#MathJax_SVG_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",padding:"3px 4px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.SVG.Register("jax/mml")}MathJax.OutputJax.SVG.loadComplete("config.js");
15+
MathJax.OutputJax.SVG=MathJax.OutputJax({id:"SVG",version:"2.0.10",directory:MathJax.OutputJax.directory+"/SVG",extensionDir:MathJax.OutputJax.extensionDir+"/SVG",autoloadDir:MathJax.OutputJax.directory+"/SVG/autoload",fontDir:MathJax.OutputJax.directory+"/SVG/fonts",config:{scale:100,minScaleAdjust:50,font:"TeX",blacker:10,mtextFontInherit:false,undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",addMMLclasses:false,EqnChunk:(MathJax.Hub.Browser.isMobile?10:50),EqnChunkFactor:1.5,EqnChunkDelay:100,linebreaks:{automatic:false,width:"container"},styles:{".MathJax_SVG_Display":{"text-align":"center",margin:"1em 0em"},"#MathJax_SVG_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",padding:"3px 4px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.SVG.Register("jax/mml")}MathJax.OutputJax.SVG.loadComplete("config.js");
1616

jax/output/SVG/jax.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unpacked/MathJax.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,8 +1923,21 @@ MathJax.Hub.Startup = {
19231923
for (var i = 0, m = a.length; i < m; i++)
19241924
{if (a[i].name === name) {target = a[i]; break}}
19251925
}
1926-
if (target) {setTimeout(function () {target.scrollIntoView(true)},1)}
1926+
if (target) {
1927+
while (!target.scrollIntoView) {target = target.parentNode}
1928+
target = this.HashCheck(target);
1929+
if (target && target.scrollIntoView)
1930+
{setTimeout(function () {target.scrollIntoView(true)},1)}
1931+
}
1932+
}
1933+
},
1934+
HashCheck: function (target) {
1935+
if (target.isMathJax) {
1936+
var jax = MathJax.Hub.getJaxFor(target);
1937+
if (jax && MathJax.OutputJax[jax.outputJax].hashCheck)
1938+
{target = MathJax.OutputJax[jax.outputJax].hashCheck(target)}
19271939
}
1940+
return target;
19281941
},
19291942

19301943
//

unpacked/jax/output/SVG/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
MathJax.OutputJax.SVG = MathJax.OutputJax({
2626
id: "SVG",
27-
version: "2.0.9",
27+
version: "2.0.10",
2828
directory: MathJax.OutputJax.directory + "/SVG",
2929
extensionDir: MathJax.OutputJax.extensionDir + "/SVG",
3030
autoloadDir: MathJax.OutputJax.directory + "/SVG/autoload",

unpacked/jax/output/SVG/jax.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
display: "block",
5858
width: "100%"
5959
},
60+
61+
".MathJax_SVG svg a > g, .MathJax_SVG_Display svg a > g": {
62+
fill: "blue", stroke: "blue"
63+
},
6064

6165
".MathJax_SVG_Processing": {
6266
visibility: "hidden", position:"absolute", top:0, left:0,
@@ -341,6 +345,16 @@
341345
state.SVGlast = state.SVGeqn;
342346
},
343347

348+
//
349+
// Return the containing HTML element rather than the SVG element, since
350+
// most browsers can't position to an SVG element properly.
351+
//
352+
hashCheck: function (target) {
353+
if (target && target.nodeName === "g")
354+
{do {target = target.parentNode} while (target && target.firstChild.nodeName !== "svg")}
355+
return target;
356+
},
357+
344358
getJaxFromMath: function (math) {
345359
if (math.parentNode.className === "MathJax_SVG_Display") {math = math.parentNode}
346360
return HUB.getJaxFor(math.nextSibling);
@@ -1001,8 +1015,9 @@
10011015
if (this.href) {
10021016
var a = SVG.Element("a");
10031017
a.setAttributeNS(XLINKNS,"href",this.href);
1018+
a.onclick = this.SVGlink;
10041019
SVG.addElement(a,"rect",{width:svg.w, height:svg.h+svg.d, y:-svg.d,
1005-
fill:"none", stroke:"none", "pointer-events":"all"});
1020+
fill:"none", stroke:"none", "pointer-events":"all"});
10061021
if (svg.type === "svg") {
10071022
// for svg element, put <a> inside the main <g> element
10081023
var g = svg.element.firstChild;
@@ -1029,6 +1044,19 @@
10291044
if (svg.removeable) {svg.removeable = svg.element.style.cssText === ""}
10301045
}
10311046
},
1047+
//
1048+
// WebKit currently scrolls to the BOTTOM of an svg element if it contains the
1049+
// target of the link, so implement link by hand, to the containing span element.
1050+
//
1051+
SVGlink: function () {
1052+
var href = this.href.animVal;
1053+
if (href.charAt(0) === "#") {
1054+
var target = SVG.hashCheck(document.getElementById(href.substr(1)));
1055+
if (target && target.scrollIntoView)
1056+
{setTimeout(function () {target.parentNode.scrollIntoView(true)},1)}
1057+
}
1058+
document.location = href;
1059+
},
10321060

10331061
SVGgetStyles: function () {
10341062
if (this.style) {

0 commit comments

Comments
 (0)