Merge branch 'issue297' into develop

This commit is contained in:
Davide P. Cervone 2012-09-06 11:10:50 -04:00
commit d9e019b790
8 changed files with 50 additions and 9 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

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
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");
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");

File diff suppressed because one or more lines are too long

View File

@ -1923,9 +1923,22 @@ MathJax.Hub.Startup = {
for (var i = 0, m = a.length; i < m; i++)
{if (a[i].name === name) {target = a[i]; break}}
}
if (target) {setTimeout(function () {target.scrollIntoView(true)},1)}
if (target) {
while (!target.scrollIntoView) {target = target.parentNode}
target = this.HashCheck(target);
if (target && target.scrollIntoView)
{setTimeout(function () {target.scrollIntoView(true)},1)}
}
}
},
HashCheck: function (target) {
if (target.isMathJax) {
var jax = MathJax.Hub.getJaxFor(target);
if (jax && MathJax.OutputJax[jax.outputJax].hashCheck)
{target = MathJax.OutputJax[jax.outputJax].hashCheck(target)}
}
return target;
},
//
// Load the Menu and Zoom code, if it hasn't already been loaded.

View File

@ -24,7 +24,7 @@
MathJax.OutputJax.SVG = MathJax.OutputJax({
id: "SVG",
version: "2.0.9",
version: "2.0.10",
directory: MathJax.OutputJax.directory + "/SVG",
extensionDir: MathJax.OutputJax.extensionDir + "/SVG",
autoloadDir: MathJax.OutputJax.directory + "/SVG/autoload",

View File

@ -57,6 +57,10 @@
display: "block",
width: "100%"
},
".MathJax_SVG svg a > g, .MathJax_SVG_Display svg a > g": {
fill: "blue", stroke: "blue"
},
".MathJax_SVG_Processing": {
visibility: "hidden", position:"absolute", top:0, left:0,
@ -341,6 +345,16 @@
state.SVGlast = state.SVGeqn;
},
//
// Return the containing HTML element rather than the SVG element, since
// most browsers can't position to an SVG element properly.
//
hashCheck: function (target) {
if (target && target.nodeName === "g")
{do {target = target.parentNode} while (target && target.firstChild.nodeName !== "svg")}
return target;
},
getJaxFromMath: function (math) {
if (math.parentNode.className === "MathJax_SVG_Display") {math = math.parentNode}
return HUB.getJaxFor(math.nextSibling);
@ -1001,8 +1015,9 @@
if (this.href) {
var a = SVG.Element("a");
a.setAttributeNS(XLINKNS,"href",this.href);
a.onclick = this.SVGlink;
SVG.addElement(a,"rect",{width:svg.w, height:svg.h+svg.d, y:-svg.d,
fill:"none", stroke:"none", "pointer-events":"all"});
fill:"none", stroke:"none", "pointer-events":"all"});
if (svg.type === "svg") {
// for svg element, put <a> inside the main <g> element
var g = svg.element.firstChild;
@ -1029,6 +1044,19 @@
if (svg.removeable) {svg.removeable = svg.element.style.cssText === ""}
}
},
//
// WebKit currently scrolls to the BOTTOM of an svg element if it contains the
// target of the link, so implement link by hand, to the containing span element.
//
SVGlink: function () {
var href = this.href.animVal;
if (href.charAt(0) === "#") {
var target = SVG.hashCheck(document.getElementById(href.substr(1)));
if (target && target.scrollIntoView)
{setTimeout(function () {target.parentNode.scrollIntoView(true)},1)}
}
document.location = href;
},
SVGgetStyles: function () {
if (this.style) {