forked from cbsandeep10/IMathAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmathgraphcheck.js
More file actions
executable file
·79 lines (71 loc) · 1.97 KB
/
mathgraphcheck.js
File metadata and controls
executable file
·79 lines (71 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var MathJaxCompatible = true;
var AMnoMathML = true;
var ASnoSVG = true;
function AMisMathMLavailable() {
//return null if OK, 1 otherwise
if (isMathJaxavailable()) {
return null;
} else {
return 1;
}
}
AMnoMathML = (AMisMathMLavailable() != null);
function isMathJaxavailable() {
var MINVERSION = {
Firefox: 3.0,
Opera: 9.52,
MSIE: 6.0,
Chrome: 0.3,
Safari: 2.0,
Konqueror: 4.0,
Unknown: 10000.0 // always disable unknown browsers
};
if (!MathJax.Hub||!MathJax.Hub.Browser.versionAtLeast(MINVERSION[MathJax.Hub.Browser]||0.0)) {
return false;
} else {
return true;
}
}
MathJaxCompatible = isMathJaxavailable();
function isSVGavailable() {
//return null if we've got SVG
//WebKit got good at SVG after 531.22.7
if ((ver = navigator.userAgent.toLowerCase().match(/webkit\/(\d+)/))!=null) {
if (navigator.userAgent.toLowerCase().match(/android/)) {
return 1; //Android still can't do SVG yet
}
if (ver[1]>531) {
return null;
}
}
//Opera can do SVG, but not very pretty, so skip it
// } else if ((ver = navigator.userAgent.toLowerCase().match(/opera\/([\d\.]+)/))!=null) {
// if (ver[1]>9.1) {
// return null;
// }
else if (navigator.product && navigator.product=='Gecko') {
var rv = navigator.userAgent.toLowerCase().match(/rv:\s*([\d\.]+)/);
if (rv!=null) {
rv = rv[1].split('.');
if (rv.length<3) { rv[2] = 0;}
if (rv.length<2) { rv[1] = 0;}
}
if (rv!=null && 10000*rv[0]+100*rv[1]+1*rv[2]>=10800) return null;
else return 1;
}
else if (navigator.appName.slice(0,9)=="Microsoft") {
version = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (version >= 9) {
//IE 9+ can do SVG
return null;
} else {
try {
var oSVG=eval("new ActiveXObject('Adobe.SVGCtl.3');");
return null;
} catch (e) {
return 1;
}
}
} else return 1;
}
ASnoSVG = (isSVGavailable()!=null);