Skip to content

Commit

Permalink
Meta Daytah
Browse files Browse the repository at this point in the history
  • Loading branch information
SlexAxton committed May 14, 2013
1 parent 98d877f commit 44eddf9
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 65 deletions.
6 changes: 1 addition & 5 deletions feature-detects/es5/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"href": "http://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"async": false,
"authors": ["Ron Waldon (@jokeyrhyme)"],
"knownBugs": [],
"tags": []
"tags": ["es5"]
}
!*/
/* DOC
Expand All @@ -19,8 +17,6 @@ Check if browser implements ECMAScript 5 Array per specification.
*/
define(['Modernizr'], function (Modernizr) {
// es5array
// test by @jokeyrhyme
Modernizr.addTest('es5array', function () {
return Array.prototype &&
Array.prototype.every &&
Expand Down
6 changes: 1 addition & 5 deletions feature-detects/es5/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"href": "http://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"async": false,
"authors": ["Ron Waldon (@jokeyrhyme)"],
"knownBugs": [],
"tags": []
"tags": ["es5"]
}
!*/
/* DOC
Expand All @@ -19,8 +17,6 @@ Check if browser implements ECMAScript 5 Date per specification.
*/
define(['Modernizr'], function (Modernizr) {
// es5date
// test by @jokeyrhyme
Modernizr.addTest('es5date', function () {
var isoDate = '2013-04-12T06:06:37.307Z',
canParseISODate = false;
Expand Down
6 changes: 1 addition & 5 deletions feature-detects/es5/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"href": "http://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"async": false,
"authors": ["Ron Waldon (@jokeyrhyme)"],
"knownBugs": [],
"tags": []
"tags": ["es5"]
}
!*/
/* DOC
Expand All @@ -19,8 +17,6 @@ Check if browser implements ECMAScript 5 Function per specification.
*/
define(['Modernizr'], function (Modernizr) {
// es5function
// test by @jokeyrhyme
Modernizr.addTest('es5function', function () {
return Function.prototype && Function.prototype.bind;
});
Expand Down
6 changes: 1 addition & 5 deletions feature-detects/es5/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"href": "http://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim", "es5sham"],
"async": false,
"authors": ["Ron Waldon (@jokeyrhyme)"],
"knownBugs": [],
"tags": []
"tags": ["es5"]
}
!*/
/* DOC
Expand All @@ -19,8 +17,6 @@ Check if browser implements ECMAScript 5 Object per specification.
*/
define(['Modernizr'], function (Modernizr) {
// es5object
// test by @jokeyrhyme
Modernizr.addTest('es5object', function () {
return Object.keys &&
Object.create &&
Expand Down
20 changes: 18 additions & 2 deletions feature-detects/es5/strictmode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
/*!
{
"name": "ES5 Strict Mode",
"property": "strictmode",
"caniuse": "sctrict-mode",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "http://www.ecma-international.org/ecma-262/5.1/"
}],
"authors": ["@kangax"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser implements ECMAScript 5 Object strict mode.
*/
define(['Modernizr'], function( Modernizr ) {
// strict mode
// test by @kangax
Modernizr.addTest('strictmode', (function(){ "use strict"; return !this; })());
});
6 changes: 1 addition & 5 deletions feature-detects/es5/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"href": "http://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"async": false,
"authors": ["Ron Waldon (@jokeyrhyme)"],
"knownBugs": [],
"tags": []
"tags": ["es5"]
}
!*/
/* DOC
Expand All @@ -19,8 +17,6 @@ Check if browser implements ECMAScript 5 String per specification.
*/
define(['Modernizr'], function (Modernizr) {
// es5string
// test by @jokeyrhyme
Modernizr.addTest('es5string', function () {
return String.prototype && String.prototype.trim;
});
Expand Down
19 changes: 15 additions & 4 deletions feature-detects/es6/contains.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
define(['Modernizr'], function( Modernizr ) {
// ES6: String.prototype.contains
// By Robert Kowalski
/*!
{
"name": "ES5 String.prototype.contains",
"property": "contains",
"authors": ["Robert Kowalski"],
"tags": ["es6"]
}
!*/
/* DOC
Check if browser implements ECMAScript 6 `String.prototype.contains` per specification.
*/
define(['Modernizr', 'is'], function( Modernizr, is ) {
Modernizr.addTest('contains', is(String.prototype.contains, 'function'));
});
});
36 changes: 28 additions & 8 deletions feature-detects/event/deviceorientation-motion.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
define(['Modernizr'], function( Modernizr ) {
//By Shi Chuan
//Part of Device Access aspect of HTML5, same category as geolocation
//W3C Editor's Draft at http://dev.w3.org/geo/api/spec-source-orientation.html
//Implementation by iOS Safari at http://goo.gl/fhce3 and http://goo.gl/rLKz8
/*!
{
"name": "Device Orientation and Motion Events",
"property": ["devicemotion", "deviceorientation"],
"caniuse": "deviceorientation",
"notes": [{
"name": "W3C Editor's Draft",
"href": "http://dev.w3.org/geo/api/spec-source-orientation.html"
},{
"name": "Implementation by iOS Safari (Orientation)",
"href": "http://goo.gl/fhce3"
},{
"name": "Implementation by iOS Safari (Motion)",
"href": "http://goo.gl/rLKz8"
}],
"authors": ["Shi Chuan"],
"tags": ["event"]
}
!*/
/* DOC
//test for Device Motion Event support, returns boolean value true/false
Modernizr.addTest('devicemotion', 'DeviceMotionEvent' in window);
Part of Device Access aspect of HTML5, same category as geolocation.
`devicemotion` tests for Device Motion Event support, returns boolean value true/false.
//test for Device Orientation Event support, returns boolean value true/false
`deviceorientation` tests for Device Orientation Event support, returns boolean value true/false
*/
define(['Modernizr'], function( Modernizr ) {
Modernizr.addTest('devicemotion', 'DeviceMotionEvent' in window);
Modernizr.addTest('deviceorientation', 'DeviceOrientationEvent' in window);
});
31 changes: 22 additions & 9 deletions feature-detects/file/api.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
/*!
{
"name": "File API",
"property": "filereader",
"caniuse": "fileapi",
"notes": [{
"name": "W3C Working Draft",
"href": "http://www.w3.org/TR/FileAPI/"
}],
"tags": ["file"],
"knownBugs": ["Will fail in Safari 5 due to its lack of support for the standards defined FileReader object"]
}
!*/
/* DOC
`filereader` tests for the File API specification
Tests for objects specific to the File API W3C specification without
being redundant (don't bother testing for Blob since it is assumed
to be the File object's prototype.)
*/
define(['Modernizr'], function( Modernizr ) {
/**
* file tests for the File API specification
* Tests for objects specific to the File API W3C specification without
* being redundant (don't bother testing for Blob since it is assumed
* to be the File object's prototype.
*
* Will fail in Safari 5 due to its lack of support for the standards
* defined FileReader object
*/
Modernizr.addTest('filereader', !!(window.File && window.FileList && window.FileReader));
});
22 changes: 14 additions & 8 deletions feature-detects/file/filesystem.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
/*!
{
"name": "Filesystem API",
"property": "filesystem",
"caniuse": "filesystem",
"notes": [{
"name": "W3 Draft",
"href": "dev.w3.org/2009/dap/file-system/file-dir-sys.html"
}],
"authors": ["Eric Bidelman (@ebidel)"],
"tags": ["file"],
"knownBugs": ["The API will be present in Chrome incognito, but will throw an exception. See crbug.com/93417"]
}
!*/
define(['Modernizr', 'prefixed'], function( Modernizr, prefixed ) {
// Filesystem API
// dev.w3.org/2009/dap/file-system/file-dir-sys.html

// The API will be present in Chrome incognito, but will throw an exception.
// See crbug.com/93417
//
// By Eric Bidelman (@ebidel)

Modernizr.addTest('filesystem', !!prefixed('requestFileSystem', window));
});
3 changes: 1 addition & 2 deletions feature-detects/forms/capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
{
"name": "input[capture] Attribute",
"property": "capture",
"caniuse" : "capture",
"tags": ["video", "image", "sound", "media", "attribute"],
"tags": ["video", "image", "audio", "media", "attribute"],
"notes": [{
"name": "W3C draft: HTML Media Capture",
"href": "http://www.w3.org/TR/html-media-capture/"
Expand Down
18 changes: 13 additions & 5 deletions feature-detects/forms/fileinput.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
/*!
{
"name": "input[file] Attribute",
"property": "fileinput",
"caniuse" : "forms",
"tags": ["file", "forms", "input"]
}
!*/
/* DOC
// Detects whether input type="file" is available on the platform
// E.g. iOS < 6 and some android version don't support this
Detects whether input type="file" is available on the platform
// It's useful if you want to hide the upload feature of your app on devices that
// don't support it (iphone, ipad, etc).
E.g. iOS < 6 and some android version don't support this
*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
Modernizr.addTest('fileinput', function() {
if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) {
return false;
Expand Down
16 changes: 14 additions & 2 deletions feature-detects/forms/formattribute.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
/*!
{
"name": "input[form] Attribute",
"property": "formattribute",
"tags": ["attribute", "forms", "input"]
}
!*/
/* DOC
Detects whether input form="form_id" is available on the platform
E.g. IE 10 (and below), don't support this
*/
define(['Modernizr', 'createElement', 'docElement'], function( Modernizr, createElement, docElement ) {
// Detects whether input form="form_id" is available on the platform
// E.g. IE 10 (and below), don't support this

Modernizr.addTest('formattribute', function() {
var form = createElement('form');
var input = createElement('input');
Expand Down

0 comments on commit 44eddf9

Please sign in to comment.