instiki/public/MathJax/extensions/FontWarnings.js

19 lines
4.2 KiB
JavaScript
Raw Normal View History

/*
* ../SourceForge/trunk/mathjax/extensions/FontWarnings.js
*
* Copyright (c) 2010 Design Science, Inc.
*
* Part of the MathJax library.
* See http://www.mathjax.org for details.
*
* Licensed under the Apache License, Version 2.0;
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Unpack([
['(','function','(d,g){var f="1.0";var b=d.Insert({','messageStyle',':{position:"','fixed",bottom:"4em",left:"3em",width:"40em",border:"3px solid #880000','","background-color":"#','E0E0E0",padding:"1em","font-size":"small","white-space":"normal","','border-radius":".','75em','","-webkit-',8,9,'","-moz-',8,9,'","-khtml-',8,9,'","','box-shadow":"4px 4px 10px #AAAAAA',10,20,13,20,16,20,'",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=3, OffY=3, Color=\'gray\', Positive=\'true\')"},Message:{webFont',':[["closeBox"],"MathJax is ','using',' web-based fonts',' to display',' the mathematics',' ","on this page. These take time to download, so the page would","render faster if you installed math fonts directly in your ","system\'s font folder.",["fonts"]],imageFonts',28,'using its',' image fonts',' rather than local or',30,'. ","This will render slower than usual, and',32,' may not print ","at the full resolution of your printer','.",["fonts"],["webfonts','"]],noFonts',28,'unable to locate a font to use',31,' ","its mathematics, and',36,' are not available, so it ","is falling back on generic unicode characters in hopes that ","your browser will be able',31,' them. Some characters ","may not show up properly, or possibly not at all',42,'"]]},HTML:{closeBox:[["div",{style',4,'absolute",overflow:"hidden",top:".1em",right:".1em",border:"1px outset",width:"1em",height:"1em","text-align":"center",cursor:"pointer',6,'EEEEEE",color:"#606060","',8,'5em',10,8,'5em',13,8,'5em',16,8,'5em"},onclick:',1,'(){if(c.div&&c.fade===0){if(c.timer){clearTimeout(c.timer)}','c.div.style.display="none','"}}},[["span",{style',4,'relative",bottom:".2em"}},["x"]]]]],webfonts:[["p"],"Most modern browsers allow for fonts to be downloaded over the web. ","Updating to a more recent version of your browser (or changing browsers) ","could improve the quality of',32,' on this page."],fonts:[["p"],"MathJax can use either',' the ",["a",{href:"http://www.stixfonts.org/",target:"_blank"},"STIX fonts','"]," or',' the ",["a",{href:"http://www.mathjax.org/help/fonts/",target:"_blank"},["MathJax TeX fonts"]],". Download and install ','either one',' to improve your MathJax experience','."],STIXfonts:[["p"],"This page is designed to use',77,'"],". Download and install those fonts',81,'."],TeXfonts:[["p"],"This page is designed to use',79,'those fonts',81,'."]},','removeAfter',':12*1000,','fadeoutSteps',':10,','fadeoutTime',':1.5*1000},(d.config.FontWarnings||{}));var c={div:null,fade:0};var a=',1,'(k){if(c.div){return}','var h=MathJax.OutputJax["HTML-CSS"],l=','document.body',';if(d.Browser.isMSIE){if(b.',3,'.position','==="fixed"){MathJax.Message.Init();l=document.getElementById("MathJax_MSIE_frame");b.',3,103,'="absolute"}}else{delete b.',3,'.filter}b.',3,'.maxWidth=(',100,'.clientWidth-75)+"px";var j=0;while(j<k.length){if(k[j] instanceof Array&&b.HTML[k[j][0]]){k.splice.apply(k,[j,1].concat(b.HTML[k[j][0]]))}else{j++}}c.div=h.addElement(l,"div",{id:"MathJax_FontWarning",style:b.',3,'},k);if(b.',91,'){d.Register.StartupHook("End",',1,'(){c.timer=','setTimeout(e,b.',91,')})}g.Cookie.Set("fontWarn",{warned:true})};var e=',1,'(){c.fade++;if(c.timer){delete c.timer}if(c.fade<b.',93,'){var h=1-c.fade/b.',93,';c.div.style.','opacity=h',128,'filter="alpha(opacity="+Math.floor(100*h)+")";',120,95,'/b.',93,')}else{',71,'"}};if(!g.Cookie.Get("fontWarn").warned){d.Startup.signal.Interest(',1,'(k){if(k.match(/HTML-CSS Jax - /)&&!c.div){',99,'h.config.availableFonts,j;var i=(l&&l.length);if(!i){b.HTML.fonts=[""]}else{if(l.length===1){b.HTML.fonts=b.HTML[l[0]+"fonts"]}}if(h.allowWebFonts){b.HTML.webfonts=[""]}','if(k.match(/- ','Web-Font/)){if(i){j="webFont"}}else{',143,'using',36,'/)){j="imageFonts"}else{',143,'no valid font/)){j="noFonts"}}}if(j&&b.Message[j]){a(b.Message[j])}}})}})(MathJax.Hub,MathJax.HTML);MathJax.Ajax.loadComplete("[MathJax]/extensions/FontWarnings.js");']
]);