This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
146 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// handle older versions of IE with onload | ||
if (window.addEventListener) { | ||
window.addEventListener("load",cm,false); | ||
} else if (window.attachEvent ) { | ||
window.attachEvent("onload",cm); | ||
} else if (window.onLoad) { | ||
window.onload = cm; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Modernizr.addTest('ps-webgl', function() { | ||
return !!window.WebGLRenderingContext; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Low Battery Level | ||
// Enable a developer to remove CPU intensive CSS/JS when battery is low | ||
// developer.mozilla.org/en/DOM/window.navigator.mozBattery | ||
// By: Paul Sayre | ||
|
||
Modernizr.addTest('ps-lowbattery', function () { | ||
var minLevel = 0.20, | ||
battery = Modernizr.prefixed('battery', navigator); | ||
return !!(battery && !battery.charging && battery.level <= minLevel); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// by tauren | ||
// https://github.com/Modernizr/Modernizr/issues/191 | ||
|
||
Modernizr.addTest('ps-cookies', function () { | ||
// Quick test if browser has cookieEnabled host property | ||
if (navigator.cookieEnabled) return true; | ||
// Create cookie | ||
document.cookie = "cookietest=1"; | ||
var ret = document.cookie.indexOf("cookietest=") != -1; | ||
// Delete cookie | ||
document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT"; | ||
return ret; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// IE8 compat mode aka Fake IE7 | ||
// by Erich Ocean | ||
|
||
// In this case, IE8 will be acting as IE7. You may choose to remove features in this case. | ||
|
||
// related: | ||
// james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ | ||
|
||
Modernizr.addTest('ps-ie8compat',function(){ | ||
return (!window.addEventListener && document.documentMode && document.documentMode === 7); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// determining low-bandwidth via navigator.connection | ||
|
||
// There are two iterations of the navigator.connection interface: | ||
|
||
// The first is present in Android 2.2+ and only in the Browser (not WebView) | ||
// : docs.phonegap.com/en/1.2.0/phonegap_connection_connection.md.html#connection.type | ||
// : davidbcalhoun.com/2010/using-navigator-connection-android | ||
|
||
// The second is specced at dev.w3.org/2009/dap/netinfo/ and perhaps landing in WebKit | ||
// : bugs.webkit.org/show_bug.cgi?id=73528 | ||
|
||
// unknown devices are assumed as fast | ||
// for more rigorous network testing, consider boomerang.js: github.com/bluesmoon/boomerang/ | ||
|
||
Modernizr.addTest('ps-lowbandwidth', function() { | ||
|
||
var connection = navigator.connection || { type: 0 }; // polyfill | ||
|
||
return connection.type == 3 || // connection.CELL_2G | ||
connection.type == 4 || // connection.CELL_3G | ||
/^[23]g$/.test(connection.type); // string value in new spec | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Unicode special character support | ||
* | ||
* Detection is made by testing missing glyph box rendering against star character | ||
* If widths are the same, this "probably" means the browser didn't support the star character and rendered a glyph box instead | ||
* Just need to ensure the font characters have different widths | ||
* | ||
* Warning : positive Unicode support doesn't mean you can use it inside <title>, this seams more related to OS & Language packs | ||
*/ | ||
Modernizr.addTest('ps-unicode', function() { | ||
|
||
var bool, | ||
missingGlyph = document.createElement('span'), | ||
star = document.createElement('span'); | ||
|
||
Modernizr.testStyles('#modernizr{font-family:Arial,sans;font-size:300em;}', function(node) { | ||
missingGlyph.innerHTML = 'ᝣ'; | ||
star.innerHTML = '☆'; | ||
node.appendChild(missingGlyph); | ||
node.appendChild(star); | ||
bool = 'offsetWidth' in missingGlyph && missingGlyph.offsetWidth !== star.offsetWidth; | ||
}); | ||
|
||
return bool; | ||
|
||
}); |