Stephen McKamey avatar Stephen McKamey committed 7a36727

adding fix for PhantomJS

Comments (0)

Files changed (5)

 \.iws
 .*\.bat
 .*\.psd
+.*\.ai
 .*\.sh
 ga\.js
 
 	User-agent specific CSS support
 
 	Created: 2006-06-10-1635
-	Modified: 2012-07-01-1236
+	Modified: 2012-09-09-2120
 
 	Copyright (c)2006-2012 Stephen M. McKamey
 	Distributed under The MIT License.
 				delete ua.applewebkit;
 
 				if (ua.safari) {
-					if (ua.chrome || ua.crios || ua.fluidapp || (ua.mobile && !ua.ios)) {
+					if (ua.chrome || ua.crios || ua.fluidapp || ua.phantomjs || (ua.mobile && !ua.ios)) {
 						delete ua.safari;
 
 					} else if (ua.version && !ua.rim_tablet_os) {
 var cssua=function(i,l){var m=/\s*([\-\w ]+)[\s\/]([\d_]+\b([\-\._\/]\w+)*)/,n=/([\w\-\.]+[\s\/][v]?[\d_]+\b([\-\._\/]\w+)*)/g,o=/\bfluidapp\b/,p=/rv[:](\d+(\.\w+)*).*?\bgecko[\/]\w+/,q=/\bblackberry\w*[\s\/]+(\d+(\.\w+)*)/,r=/(\bwindows\b|\bmacintosh\b|\blinux\b|\bunix\b)/,s=/(\bandroid\b|\bipad\b|\bipod\b|\bblackberry|\brim tablet os\b|\bwebos\b|\bwindows ce\b|\bwindows phone os\b|\bwindows ce\b|\bpalm|\bsymbian|\bj2me\b|\bdocomo\b|\bpda\b|\bchtml\b|\bmidp\b|\bcldc\b|\w*?mobile\w*?|\w*?phone\w*?)/,
 t=/(\bxbox\b|\bplaystation\b|\bnintendo\s+\w+)/,d={parse:function(c){var a={},c=(""+c).toLowerCase();if(!c)return a;for(var b,g,e=c.split(/[()]/),f=0,d=e.length;f<d;f++)if(f%2){var j=e[f].split(";");for(b=0,g=j.length;b<g;b++)if(m.exec(j[b])){var h=RegExp.$1.split(" ").join("_"),i=RegExp.$2;if(!a[h]||parseFloat(a[h])<parseFloat(i))a[h]=i}}else if(j=e[f].match(n))for(b=0,g=j.length;b<g;b++)h=j[b].split(/[\/\s]+/),h.length&&"mozilla"!==h[0]&&(a[h[0].split(" ").join("_")]=h.slice(1).join("-"));if(s.exec(c)){if(a.mobile=
 RegExp.$1,q.exec(c))a.blackberry=RegExp.$1}else if(r.exec(c))a.desktop=RegExp.$1;else if(t.exec(c)&&(a.game=RegExp.$1,b=a.game.split(" ").join("_"),a.version&&!a[b]))a[b]=a.version;if(a.intel_mac_os_x)a.mac_os_x=a.intel_mac_os_x.split("_").join("."),delete a.intel_mac_os_x;else if(a.cpu_iphone_os)a.ios=a.cpu_iphone_os.split("_").join("."),delete a.cpu_iphone_os;else if(a.cpu_os)a.ios=a.cpu_os.split("_").join("."),delete a.cpu_os;else if("iphone"===a.mobile&&!a.ios)a.ios="1";if(a.opera&&a.version)a.opera=
-a.version;else if(o.exec(c))a.fluidapp=a.version;if(a.applewebkit){if(a.webkit=a.applewebkit,delete a.applewebkit,a.safari)a.chrome||a.crios||a.fluidapp||a.mobile&&!a.ios?delete a.safari:a.safari=a.version&&!a.rim_tablet_os?a.version:{419:"2.0.4",417:"2.0.3",416:"2.0.2",412:"2.0",312:"1.3",125:"1.2",85:"1.0"}[parseInt(a.safari,10)]||a.safari}else if(a.msie){if(!a.opera)a.ie=a.msie;delete a.msie}else if(p.exec(c))a.gecko=RegExp.$1;a.version&&delete a.version;return a},format:function(c){var a="",b;
-for(b in c)if(b&&c.hasOwnProperty(b)){var g=b,e=c[b],g=g.split(".").join("-"),f=" ua-"+g;if(e){for(var e=e.split(" ").join("_").split(".").join("-"),d=e.indexOf("-");0<d;)f+=" ua-"+g+"-"+e.substring(0,d),d=e.indexOf("-",d+1);f+=" ua-"+g+"-"+e}a+=f}return a},encode:function(c){var a="",b;for(b in c)b&&c.hasOwnProperty(b)&&(a&&(a+="&"),a+=encodeURIComponent(b)+"="+encodeURIComponent(c[b]));return a}};d.userAgent=d.ua=d.parse(l);var k=d.format(d.ua)+" js";i.className=i.className?i.className.replace(/\bno-js\b/g,
+a.version;else if(o.exec(c))a.fluidapp=a.version;if(a.applewebkit){if(a.webkit=a.applewebkit,delete a.applewebkit,a.safari)a.chrome||a.crios||a.fluidapp||a.phantomjs||a.mobile&&!a.ios?delete a.safari:a.safari=a.version&&!a.rim_tablet_os?a.version:{419:"2.0.4",417:"2.0.3",416:"2.0.2",412:"2.0",312:"1.3",125:"1.2",85:"1.0"}[parseInt(a.safari,10)]||a.safari}else if(a.msie){if(!a.opera)a.ie=a.msie;delete a.msie}else if(p.exec(c))a.gecko=RegExp.$1;a.version&&delete a.version;return a},format:function(c){var a=
+"",b;for(b in c)if(b&&c.hasOwnProperty(b)){var g=b,e=c[b],g=g.split(".").join("-"),f=" ua-"+g;if(e){for(var e=e.split(" ").join("_").split(".").join("-"),d=e.indexOf("-");0<d;)f+=" ua-"+g+"-"+e.substring(0,d),d=e.indexOf("-",d+1);f+=" ua-"+g+"-"+e}a+=f}return a},encode:function(c){var a="",b;for(b in c)b&&c.hasOwnProperty(b)&&(a&&(a+="&"),a+=encodeURIComponent(b)+"="+encodeURIComponent(c[b]));return a}};d.userAgent=d.ua=d.parse(l);var k=d.format(d.ua)+" js";i.className=i.className?i.className.replace(/\bno-js\b/g,
 "")+k:k.substr(1);return d}(document.documentElement,navigator.userAgent);

test/styles/browsers.css

 	border-left-color: #7AB35D;
 	background-image: url(browsers/Fluid_128.png);
 }
+.ua-phantomjs .browser-info
+{
+	border-color: #008D92;
+	border-top-color: #00CDD7;
+	border-left-color: #00CDD7;
+	background-image: url(browsers/PhantomJS_128.png);
+}
 .ua-shiira .browser-info
 {
 	border-color: #0198C2;
Add a comment to this file

test/styles/browsers/PhantomJS_128.png

Added
New image
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.