Merge branch 'detect-edge' into develop

This commit is contained in:
Davide P. Cervone 2015-09-14 06:53:16 -04:00
commit 253c5a7b04
2 changed files with 14 additions and 4 deletions

View File

@ -3092,11 +3092,13 @@ MathJax.Hub.Startup = {
isMac: (navigator.platform.substr(0,3) === "Mac"), isMac: (navigator.platform.substr(0,3) === "Mac"),
isPC: (navigator.platform.substr(0,3) === "Win"), isPC: (navigator.platform.substr(0,3) === "Win"),
isMSIE: ("ActiveXObject" in window && "clipboardData" in window), isMSIE: ("ActiveXObject" in window && "clipboardData" in window),
isEdge: ("MSGestureEvent" in window && "chrome" in window &&
window.chrome.loadTimes == null),
isFirefox: (!!AGENT.match(/Gecko\//) && !AGENT.match(/like Gecko/)), isFirefox: (!!AGENT.match(/Gecko\//) && !AGENT.match(/like Gecko/)),
isSafari: (!!AGENT.match(/ (Apple)?WebKit\//) && !AGENT.match(/ like iPhone /) && isSafari: (!!AGENT.match(/ (Apple)?WebKit\//) && !AGENT.match(/ like iPhone /) &&
(!window.chrome || window.chrome.loadTimes == null)), (!window.chrome || window.chrome.app == null)),
isChrome: (window.chrome != null && window.chrome.loadTimes != null), isChrome: ("chrome" in window && window.chrome.loadTimes != null),
isOpera: (window.opera != null && window.opera.version != null), isOpera: ("opera" in window && window.opera.version != null),
isKonqueror: ("konqueror" in window && navigator.vendor == "KDE"), isKonqueror: ("konqueror" in window && navigator.vendor == "KDE"),
versionAtLeast: function (v) { versionAtLeast: function (v) {
var bv = (this.version).split('.'); v = (new String(v)).split('.'); var bv = (this.version).split('.'); v = (new String(v)).split('.');
@ -3124,7 +3126,7 @@ MathJax.Hub.Startup = {
HUB.Browser = HUB.Insert(new String(browser),BROWSERS); HUB.Browser = HUB.Insert(new String(browser),BROWSERS);
var VERSION = new RegExp( var VERSION = new RegExp(
".*(Version/| Trident/.*; rv:)((?:\\d+\\.)+\\d+)|" + // for Safari, Opera10, and IE11+ ".*(Version/| Trident/.*; rv:)((?:\\d+\\.)+\\d+)|" + // for Safari, Opera10, and IE11+
".*("+browser+")"+(browser == "MSIE" ? " " : "/")+"((?:\\d+\\.)*\\d+)|"+ // for one of the main browser ".*("+browser+")"+(browser == "MSIE" ? " " : "/")+"((?:\\d+\\.)*\\d+)|"+ // for one of the main browsers
"(?:^|\\(| )([a-z][-a-z0-9._: ]+|(?:Apple)?WebKit)/((?:\\d+\\.)+\\d+)"); // for unrecognized browser "(?:^|\\(| )([a-z][-a-z0-9._: ]+|(?:Apple)?WebKit)/((?:\\d+\\.)+\\d+)"); // for unrecognized browser
var MATCH = VERSION.exec(xAGENT) || ["","","","unknown","0.0"]; var MATCH = VERSION.exec(xAGENT) || ["","","","unknown","0.0"];
HUB.Browser.name = (MATCH[1] != "" ? browser : (MATCH[3] || MATCH[5])); HUB.Browser.name = (MATCH[1] != "" ? browser : (MATCH[3] || MATCH[5]));
@ -3178,8 +3180,15 @@ MathJax.Hub.Startup = {
AGENT.match(/ Fennec\//) != null || AGENT.match(/ Fennec\//) != null ||
AGENT.match(/Mobile/) != null); AGENT.match(/Mobile/) != null);
}, },
Chrome: function (browser) {
browser.noContextMenu = browser.isMobile = !!navigator.userAgent.match(/ Mobile[ \/]/);
},
Opera: function (browser) {browser.version = opera.version()}, Opera: function (browser) {browser.version = opera.version()},
Edge: function (browser) {
browser.isMobile = !!navigator.userAgent.match(/ Phone/);
},
MSIE: function (browser) { MSIE: function (browser) {
browser.isMobile = !!navigator.userAgent.match(/ Phone/);
browser.isIE9 = !!(document.documentMode && (window.performance || window.msPerformance)); browser.isIE9 = !!(document.documentMode && (window.performance || window.msPerformance));
MathJax.HTML.setScriptBug = !browser.isIE9 || document.documentMode < 9; MathJax.HTML.setScriptBug = !browser.isIE9 || document.documentMode < 9;
MathJax.Hub.msieHTMLCollectionBug = (document.documentMode < 9); MathJax.Hub.msieHTMLCollectionBug = (document.documentMode < 9);

View File

@ -1213,6 +1213,7 @@
if (BROWSER.isChrome && BROWSER.version.substr(0,3) !== "24.") {message = MESSAGE.MML.WebKit} if (BROWSER.isChrome && BROWSER.version.substr(0,3) !== "24.") {message = MESSAGE.MML.WebKit}
else if (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0")) {message = MESSAGE.MML.WebKit} else if (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0")) {message = MESSAGE.MML.WebKit}
else if (BROWSER.isMSIE) {if (!BROWSER.hasMathPlayer) {message = MESSAGE.MML.MSIE}} else if (BROWSER.isMSIE) {if (!BROWSER.hasMathPlayer) {message = MESSAGE.MML.MSIE}}
else if (BROWSER.isEdge) {message = MESSAGE.MML.WebKit}
else {message = MESSAGE.MML[BROWSER]} else {message = MESSAGE.MML[BROWSER]}
warned = "warnedMML"; warned = "warnedMML";
} }