Add SpeedGrader for iPad to the list of recognized browsers.

fixes #3606

Change-Id: I875171ac8a4474a38c7fbc836cf52c5be4b0dbe5
Reviewed-on: https://gerrit.instructure.com/2226
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
This commit is contained in:
Mark Suman 2011-02-09 12:34:11 -07:00
parent e693c6ebba
commit 01d9f66a5b
1 changed files with 5 additions and 2 deletions

View File

@ -2690,13 +2690,14 @@
$.parseUserAgentString = function(userAgent) {
userAgent = (userAgent || "").toLowerCase();
var data = {
version: (userAgent.match( /.+(?:me|ox|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,null])[1],
version: (userAgent.match( /.+(?:me|ox|it|ra|ie|er)[\/: ]([\d.]+)/ ) || [0,null])[1],
chrome: /chrome/.test( userAgent ),
safari: /webkit/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !(/opera/.test( userAgent )),
firefox: /firefox/.test( userAgent),
mozilla: /mozilla/.test( userAgent ) && !(/(compatible|webkit)/.test( userAgent ))
mozilla: /mozilla/.test( userAgent ) && !(/(compatible|webkit)/.test( userAgent )),
speedgrader: /speedgrader/.test( userAgent )
};
var browser = "Unrecognized Browser";
if(data.chrome) {
@ -2711,6 +2712,8 @@
browser = "Firefox";
} else if(data.mozilla) {
browser = "Mozilla";
} else if(data.speedgrader) {
browser = "SpeedGrader for iPad";
}
if(browser != "Unrecognized Browser" && data.version) {
data.version = data.version.split(/\./).slice(0,2).join(".");