Skip to content

Commit

Permalink
Added more metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
stucox committed Jun 2, 2013
1 parent 1b53d20 commit bbebadf
Show file tree
Hide file tree
Showing 10 changed files with 192 additions and 38 deletions.
28 changes: 24 additions & 4 deletions feature-detects/url/data-uri.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
define(['Modernizr', 'addTest'], function( Modernizr, addTest ) {
// data uri test.
// https://github.com/Modernizr/Modernizr/issues/14
/*!
{
"name": "Data URI",
"property": "datauri",
"caniuse": "datauri",
"tags": ["url"],
"async": true,
"notes": [{
"name": "Wikipedia article",
"href": "http://en.wikipedia.org/wiki/Data_URI_scheme"
}],
"warnings": ["Support in Internet Explorer 8 is limited to images and linked resources like CSS files, not HTML files"]
}
!*/
/* DOC
Detects support for data URIs. Provides a subproperty to report support for data URIs over 32kb in size:
// This test is asynchronous. Watch out.
```javascript
Modernizr.datauri // true
Modernizr.datauri.over32kb // false in IE8
```
*/
define(['Modernizr', 'addTest'], function( Modernizr, addTest ) {
// https://github.com/Modernizr/Modernizr/issues/14
Modernizr.addAsyncTest(function() {

// IE7 throw a mixed content warning on HTTPS for this test, so we'll
Expand Down
20 changes: 17 additions & 3 deletions feature-detects/userdata.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
/*!
{
"name": "IE User Data API",
"property": "userdata",
"tags": ["storage"],
"authors": ["@stereobooster"],
"notes": [{
"name": "MSDN Documentation",
"href": "http://msdn.microsoft.com/en-us/library/ms531424(v=vs.85).aspx"
}]
}
!*/
/* DOC
Detects support for IE userData for persisting data, an API similar to localStorage but supported since IE5.
*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
// test if IE userdata supported
// msdn.microsoft.com/en-us/library/ms531424(v=vs.85).aspx
// test by @stereobooster
Modernizr.addTest('userdata', !!createElement('div').addBehavior);
});
21 changes: 18 additions & 3 deletions feature-detects/vibration.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/*!
{
"name": "Vibration API",
"property": "vibrate",
"notes": [{
"name": "MDN documentation",
"href": "https://developer.mozilla.org/en/DOM/window.navigator.mozVibrate"
},{
"name": "W3C spec",
"href": "http://www.w3.org/TR/vibration/"
}]
}
!*/
/* DOC
Detects support for the API that provides access to the vibration mechanism of the hosting device, to provide tactile feedback.
*/
define(['Modernizr', 'prefixed'], function( Modernizr, prefixed ) {
// Vibration API
// http://www.w3.org/TR/vibration/
// https://developer.mozilla.org/en/DOM/window.navigator.mozVibrate
Modernizr.addTest('vibrate', !!prefixed('vibrate', navigator));
});
49 changes: 42 additions & 7 deletions feature-detects/video.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
/*!
{
"name": "HTML5 Video",
"property": "video",
"caniuse": "video",
"tags": ["html5"],
"knownBugs": [
"Without QuickTime, `Modernizr.video.h264` will be `undefined`; http://github.com/Modernizr/Modernizr/issues/546"
],
"polyfills": [{
"name": "html5media",
"href": "https://github.com/etianen/html5media"
},{
"name": "mediaelement.js",
"href": "http://mediaelementjs.com/"
},{
"name": "SublimeVideo",
"href": "http://sublimevideo.net/"
},{
"name": "video.js",
"href": "http://videojs.com/"
},{
"name": "LeanBack Player",
"href": "http://www.leanbackplayer.com/"
},{
"name": "Video For Everybody",
"href": "http://web.archive.org/web/20101205155004/http://camendesign.com/code/video_for_everybody"
}]
}
!*/
/* DOC
Detects support for the video element, as well as testing what types of content it supports.
Subproperties are provided to describe support for `ogg`, `h264` and `webm` formats, e.g.:
```javascript
Modernizr.video // true
Modernizr.video.ogg // 'probably'
```
*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
// This test evaluates support of the video element, as well as
// testing what types of content it supports.
//
// We're using the Boolean constructor here, so that we can extend the value
// e.g. Modernizr.video // true
// Modernizr.video.ogg // 'probably'
//
// Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
// thx to NielsLeenheer and zcorpan

Expand Down
33 changes: 18 additions & 15 deletions feature-detects/video/autoplay.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions feature-detects/web-intents.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
/*!
{
"name": "Web Intents",
"property": "webintents",
"authors": ["Eric Bidelman"],
"notes": [{
"Web Intents project site",
"http://webintents.org/"
}],
"polyfills": [{
"name": "Web Intents JavaScript shim",
"href": "http://webintents.org/#javascriptshim"
}]
}
!*/
/* DOC
Detects native support for the Web Intents APIs for service discovery and inter-application communication.
Chrome added support for this in v19, but [removed it again in v24](http://lists.w3.org/Archives/Public/public-web-intents/2012Nov/0000.html) because of "a number of areas for
development in both the API and specific user experience in Chrome". No other browsers currently support it, however a [JavaScript shim](http://webintents.org/#javascriptshim) is available.
*/
define(['Modernizr', 'prefixed'], function( Modernizr, prefixed ) {
// Tests for the ability to use Web Intents (http://webintents.org).
// By Eric Bidelman
Modernizr.addTest('webintents', !!prefixed('startActivity', navigator));
});
15 changes: 14 additions & 1 deletion feature-detects/webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
"name": "WebGL",
"property": "webgl",
"caniuse": "webgl",
"tags": ["webgl", "graphics"]
"tags": ["webgl", "graphics"],
"polyfills": [{
"name": "jebgl",
"href": "http://code.google.com/p/jebgl/"
},{
"name": "webgl-compat",
"href": "https://github.com/sinisterchipmunk/webgl-compat"
},{
"name": "cwebgl",
"href": "http://code.google.com/p/cwebgl/"
},{
"name": "IEWebGL",
"href": "http://iewebgl.com/"
}]
}
!*/
define(['Modernizr'], function( Modernizr ) {
Expand Down
6 changes: 5 additions & 1 deletion feature-detects/webrtc/getusermedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"notes": [{
"name": "W3C Media Capture and Streams spec",
"href": "http://www.w3.org/TR/mediacapture-streams/"
}]
}],
"polyfills": [
"name": "getUserMedia.js",
"href": "https://github.com/addyosmani/getUserMedia.js"
]
}
!*/
define(['Modernizr', 'prefixed'], function( Modernizr, prefixed ) {
Expand Down
27 changes: 26 additions & 1 deletion feature-detects/websockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,32 @@
"caniuse": "websockets",
"warnings": "This test will reject any old version of WebSockets even if it is not prefixed such as in Safari 5.1",
"notes": "More info about the CLOSING state can be found at the spec: http://www.w3.org/TR/websockets/#the-websocket-interface",
"tags": ["html5"]
"tags": ["html5"],
"polyfills": [{
"name": "SockJS",
"href": "https://github.com/sockjs/sockjs-client"
},{
"name": "socket.io",
"href": "http://socket.io/"
},{
"name": "Kaazing WebSocket Gateway",
"href": "http://kaazing.com/products/kaazing-websocket-gateway.html"
},{
"name": "web-socket-js",
"href": "http://github.com/gimite/web-socket-js/"
},{
"name": "atmosphere jQuery plugin",
"href": "http://jfarcand.wordpress.com/2010/06/15/using-atmospheres-jquery-plug-in-to-build-applicationsupporting-both-websocket-and-comet/"
},{
"name": "Graceful WebSocket jQuery plugin",
"href": "https://github.com/ffdead/jquery-graceful-websocket"
},{
"name": "Portal",
"href": "https://github.com/flowersinthesand/portal"
},{
"name": "DataChannel",
"href": "https://github.com/piranna/DataChannel-polyfill"
}]
}
!*/
define(['Modernizr'], function( Modernizr ) {
Expand Down
6 changes: 5 additions & 1 deletion feature-detects/workers/webworkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
"href": "https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers"
}],
"polyfills": [{
"fakeworker.js": "https://code.google.com/p/fakeworker-js/"
"name": "fakeworker.js",
"href": "https://code.google.com/p/fakeworker-js/"
},{
"name": "web worker api shim",
"href": "http://html5-shims.googlecode.com/svn/trunk/demo/workers.html"
}]
}
!*/
Expand Down

0 comments on commit bbebadf

Please sign in to comment.