modernizr-rails 2.6.3 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/modernizr/rails/version.rb +1 -1
- data/vendor/assets/javascripts/modernizr.js +230 -217
- metadata +2 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Modernizr v2.
|
2
|
+
* Modernizr v2.7.0
|
3
3
|
* www.modernizr.com
|
4
4
|
*
|
5
5
|
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
window.Modernizr = (function( window, document, undefined ) {
|
26
26
|
|
27
|
-
var version = '2.
|
27
|
+
var version = '2.7.0',
|
28
28
|
|
29
29
|
Modernizr = {},
|
30
30
|
|
@@ -1004,35 +1004,40 @@ window.Modernizr = (function( window, document, undefined ) {
|
|
1004
1004
|
modElem = inputElem = null;
|
1005
1005
|
|
1006
1006
|
/*>>shiv*/
|
1007
|
-
|
1007
|
+
/**
|
1008
|
+
* @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
1009
|
+
*/
|
1008
1010
|
;(function(window, document) {
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1011
|
+
/*jshint evil:true */
|
1012
|
+
/** version */
|
1013
|
+
var version = '3.7.0';
|
1012
1014
|
|
1013
|
-
|
1014
|
-
|
1015
|
+
/** Preset options */
|
1016
|
+
var options = window.html5 || {};
|
1015
1017
|
|
1016
|
-
|
1017
|
-
|
1018
|
+
/** Used to skip problem elements */
|
1019
|
+
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
1018
1020
|
|
1019
|
-
|
1020
|
-
|
1021
|
+
/** Not all elements can be cloned in IE **/
|
1022
|
+
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
1021
1023
|
|
1022
|
-
|
1023
|
-
|
1024
|
+
/** Detect whether the browser supports default html5 styles */
|
1025
|
+
var supportsHtml5Styles;
|
1024
1026
|
|
1025
|
-
|
1026
|
-
|
1027
|
+
/** Name of the expando, to work with multiple documents or to re-shiv one document */
|
1028
|
+
var expando = '_html5shiv';
|
1027
1029
|
|
1028
|
-
|
1029
|
-
|
1030
|
+
/** The id for the the documents expando */
|
1031
|
+
var expanID = 0;
|
1030
1032
|
|
1031
|
-
|
1032
|
-
|
1033
|
+
/** Cached data for each document */
|
1034
|
+
var expandoData = {};
|
1033
1035
|
|
1034
|
-
|
1035
|
-
|
1036
|
+
/** Detect whether the browser supports unknown elements */
|
1037
|
+
var supportsUnknownElements;
|
1038
|
+
|
1039
|
+
(function() {
|
1040
|
+
try {
|
1036
1041
|
var a = document.createElement('a');
|
1037
1042
|
a.innerHTML = '<xyz></xyz>';
|
1038
1043
|
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
|
@@ -1048,248 +1053,256 @@ window.Modernizr = (function( window, document, undefined ) {
|
|
1048
1053
|
typeof frag.createElement == 'undefined'
|
1049
1054
|
);
|
1050
1055
|
}());
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1056
|
+
} catch(e) {
|
1057
|
+
// assign a false positive if detection fails => unable to shiv
|
1058
|
+
supportsHtml5Styles = true;
|
1059
|
+
supportsUnknownElements = true;
|
1060
|
+
}
|
1055
1061
|
|
1056
|
-
|
1062
|
+
}());
|
1057
1063
|
|
1058
|
-
|
1064
|
+
/*--------------------------------------------------------------------------*/
|
1059
1065
|
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1066
|
+
/**
|
1067
|
+
* Creates a style sheet with the given CSS text and adds it to the document.
|
1068
|
+
* @private
|
1069
|
+
* @param {Document} ownerDocument The document.
|
1070
|
+
* @param {String} cssText The CSS text.
|
1071
|
+
* @returns {StyleSheet} The style element.
|
1072
|
+
*/
|
1073
|
+
function addStyleSheet(ownerDocument, cssText) {
|
1074
|
+
var p = ownerDocument.createElement('p'),
|
1075
|
+
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
1070
1076
|
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1077
|
+
p.innerHTML = 'x<style>' + cssText + '</style>';
|
1078
|
+
return parent.insertBefore(p.lastChild, parent.firstChild);
|
1079
|
+
}
|
1074
1080
|
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1081
|
+
/**
|
1082
|
+
* Returns the value of `html5.elements` as an array.
|
1083
|
+
* @private
|
1084
|
+
* @returns {Array} An array of shived element node names.
|
1085
|
+
*/
|
1086
|
+
function getElements() {
|
1087
|
+
var elements = html5.elements;
|
1088
|
+
return typeof elements == 'string' ? elements.split(' ') : elements;
|
1089
|
+
}
|
1084
1090
|
|
1085
1091
|
/**
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1092
|
+
* Returns the data associated to the given document
|
1093
|
+
* @private
|
1094
|
+
* @param {Document} ownerDocument The document.
|
1095
|
+
* @returns {Object} An object of data.
|
1096
|
+
*/
|
1097
|
+
function getExpandoData(ownerDocument) {
|
1098
|
+
var data = expandoData[ownerDocument[expando]];
|
1099
|
+
if (!data) {
|
1094
1100
|
data = {};
|
1095
1101
|
expanID++;
|
1096
1102
|
ownerDocument[expando] = expanID;
|
1097
1103
|
expandoData[expanID] = data;
|
1104
|
+
}
|
1105
|
+
return data;
|
1098
1106
|
}
|
1099
|
-
return data;
|
1100
|
-
}
|
1101
1107
|
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1108
|
+
/**
|
1109
|
+
* returns a shived element for the given nodeName and document
|
1110
|
+
* @memberOf html5
|
1111
|
+
* @param {String} nodeName name of the element
|
1112
|
+
* @param {Document} ownerDocument The context document.
|
1113
|
+
* @returns {Object} The shived element.
|
1114
|
+
*/
|
1115
|
+
function createElement(nodeName, ownerDocument, data){
|
1116
|
+
if (!ownerDocument) {
|
1111
1117
|
ownerDocument = document;
|
1112
|
-
|
1113
|
-
|
1118
|
+
}
|
1119
|
+
if(supportsUnknownElements){
|
1114
1120
|
return ownerDocument.createElement(nodeName);
|
1115
|
-
|
1116
|
-
|
1121
|
+
}
|
1122
|
+
if (!data) {
|
1117
1123
|
data = getExpandoData(ownerDocument);
|
1118
|
-
|
1119
|
-
|
1124
|
+
}
|
1125
|
+
var node;
|
1120
1126
|
|
1121
|
-
|
1127
|
+
if (data.cache[nodeName]) {
|
1122
1128
|
node = data.cache[nodeName].cloneNode();
|
1123
|
-
|
1129
|
+
} else if (saveClones.test(nodeName)) {
|
1124
1130
|
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
1125
|
-
|
1131
|
+
} else {
|
1126
1132
|
node = data.createElem(nodeName);
|
1127
|
-
|
1133
|
+
}
|
1128
1134
|
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1135
|
+
// Avoid adding some elements to fragments in IE < 9 because
|
1136
|
+
// * Attributes like `name` or `type` cannot be set/changed once an element
|
1137
|
+
// is inserted into a document/fragment
|
1138
|
+
// * Link elements with `src` attributes that are inaccessible, as with
|
1139
|
+
// a 403 response, will cause the tab/window to crash
|
1140
|
+
// * Script elements appended to fragments will execute when their `src`
|
1141
|
+
// or `text` property is set
|
1142
|
+
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
|
1143
|
+
}
|
1138
1144
|
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1145
|
+
/**
|
1146
|
+
* returns a shived DocumentFragment for the given document
|
1147
|
+
* @memberOf html5
|
1148
|
+
* @param {Document} ownerDocument The context document.
|
1149
|
+
* @returns {Object} The shived DocumentFragment.
|
1150
|
+
*/
|
1151
|
+
function createDocumentFragment(ownerDocument, data){
|
1152
|
+
if (!ownerDocument) {
|
1147
1153
|
ownerDocument = document;
|
1148
|
-
|
1149
|
-
|
1154
|
+
}
|
1155
|
+
if(supportsUnknownElements){
|
1150
1156
|
return ownerDocument.createDocumentFragment();
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1157
|
+
}
|
1158
|
+
data = data || getExpandoData(ownerDocument);
|
1159
|
+
var clone = data.frag.cloneNode(),
|
1160
|
+
i = 0,
|
1161
|
+
elems = getElements(),
|
1162
|
+
l = elems.length;
|
1163
|
+
for(;i<l;i++){
|
1158
1164
|
clone.createElement(elems[i]);
|
1165
|
+
}
|
1166
|
+
return clone;
|
1159
1167
|
}
|
1160
|
-
return clone;
|
1161
|
-
}
|
1162
1168
|
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1169
|
+
/**
|
1170
|
+
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
|
1171
|
+
* @private
|
1172
|
+
* @param {Document|DocumentFragment} ownerDocument The document.
|
1173
|
+
* @param {Object} data of the document.
|
1174
|
+
*/
|
1175
|
+
function shivMethods(ownerDocument, data) {
|
1176
|
+
if (!data.cache) {
|
1171
1177
|
data.cache = {};
|
1172
1178
|
data.createElem = ownerDocument.createElement;
|
1173
1179
|
data.createFrag = ownerDocument.createDocumentFragment;
|
1174
1180
|
data.frag = data.createFrag();
|
1175
|
-
}
|
1176
|
-
|
1177
|
-
|
1178
|
-
ownerDocument.createElement = function(nodeName) {
|
1179
|
-
//abort shiv
|
1180
|
-
if (!html5.shivMethods) {
|
1181
|
-
return data.createElem(nodeName);
|
1182
1181
|
}
|
1183
|
-
return createElement(nodeName, ownerDocument, data);
|
1184
|
-
};
|
1185
|
-
|
1186
|
-
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
1187
|
-
'var n=f.cloneNode(),c=n.createElement;' +
|
1188
|
-
'h.shivMethods&&(' +
|
1189
|
-
// unroll the `createElement` calls
|
1190
|
-
getElements().join().replace(/\w+/g, function(nodeName) {
|
1191
|
-
data.createElem(nodeName);
|
1192
|
-
data.frag.createElement(nodeName);
|
1193
|
-
return 'c("' + nodeName + '")';
|
1194
|
-
}) +
|
1195
|
-
');return n}'
|
1196
|
-
)(html5, data.frag);
|
1197
|
-
}
|
1198
1182
|
|
1199
|
-
/*--------------------------------------------------------------------------*/
|
1200
1183
|
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
'
|
1217
|
-
|
1218
|
-
'
|
1219
|
-
|
1220
|
-
}
|
1221
|
-
if (!supportsUnknownElements) {
|
1222
|
-
shivMethods(ownerDocument, data);
|
1184
|
+
ownerDocument.createElement = function(nodeName) {
|
1185
|
+
//abort shiv
|
1186
|
+
if (!html5.shivMethods) {
|
1187
|
+
return data.createElem(nodeName);
|
1188
|
+
}
|
1189
|
+
return createElement(nodeName, ownerDocument, data);
|
1190
|
+
};
|
1191
|
+
|
1192
|
+
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
1193
|
+
'var n=f.cloneNode(),c=n.createElement;' +
|
1194
|
+
'h.shivMethods&&(' +
|
1195
|
+
// unroll the `createElement` calls
|
1196
|
+
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
|
1197
|
+
data.createElem(nodeName);
|
1198
|
+
data.frag.createElement(nodeName);
|
1199
|
+
return 'c("' + nodeName + '")';
|
1200
|
+
}) +
|
1201
|
+
');return n}'
|
1202
|
+
)(html5, data.frag);
|
1223
1203
|
}
|
1224
|
-
return ownerDocument;
|
1225
|
-
}
|
1226
|
-
|
1227
|
-
/*--------------------------------------------------------------------------*/
|
1228
1204
|
|
1229
|
-
|
1230
|
-
* The `html5` object is exposed so that more elements can be shived and
|
1231
|
-
* existing shiving can be detected on iframes.
|
1232
|
-
* @type Object
|
1233
|
-
* @example
|
1234
|
-
*
|
1235
|
-
* // options can be changed before the script is included
|
1236
|
-
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
1237
|
-
*/
|
1238
|
-
var html5 = {
|
1205
|
+
/*--------------------------------------------------------------------------*/
|
1239
1206
|
|
1240
1207
|
/**
|
1241
|
-
*
|
1208
|
+
* Shivs the given document.
|
1242
1209
|
* @memberOf html5
|
1243
|
-
* @
|
1210
|
+
* @param {Document} ownerDocument The document to shiv.
|
1211
|
+
* @returns {Document} The shived document.
|
1244
1212
|
*/
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1213
|
+
function shivDocument(ownerDocument) {
|
1214
|
+
if (!ownerDocument) {
|
1215
|
+
ownerDocument = document;
|
1216
|
+
}
|
1217
|
+
var data = getExpandoData(ownerDocument);
|
1218
|
+
|
1219
|
+
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
1220
|
+
data.hasCSS = !!addStyleSheet(ownerDocument,
|
1221
|
+
// corrects block display not defined in IE6/7/8/9
|
1222
|
+
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
|
1223
|
+
// adds styling not present in IE6/7/8/9
|
1224
|
+
'mark{background:#FF0;color:#000}' +
|
1225
|
+
// hides non-rendered elements
|
1226
|
+
'template{display:none}'
|
1227
|
+
);
|
1228
|
+
}
|
1229
|
+
if (!supportsUnknownElements) {
|
1230
|
+
shivMethods(ownerDocument, data);
|
1231
|
+
}
|
1232
|
+
return ownerDocument;
|
1233
|
+
}
|
1253
1234
|
|
1254
|
-
|
1255
|
-
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
1256
|
-
* @memberOf html5
|
1257
|
-
* @type boolean
|
1258
|
-
*/
|
1259
|
-
'supportsUnknownElements': supportsUnknownElements,
|
1235
|
+
/*--------------------------------------------------------------------------*/
|
1260
1236
|
|
1261
1237
|
/**
|
1262
|
-
*
|
1263
|
-
*
|
1264
|
-
* @
|
1265
|
-
* @
|
1238
|
+
* The `html5` object is exposed so that more elements can be shived and
|
1239
|
+
* existing shiving can be detected on iframes.
|
1240
|
+
* @type Object
|
1241
|
+
* @example
|
1242
|
+
*
|
1243
|
+
* // options can be changed before the script is included
|
1244
|
+
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
1266
1245
|
*/
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1246
|
+
var html5 = {
|
1247
|
+
|
1248
|
+
/**
|
1249
|
+
* An array or space separated string of node names of the elements to shiv.
|
1250
|
+
* @memberOf html5
|
1251
|
+
* @type Array|String
|
1252
|
+
*/
|
1253
|
+
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
|
1254
|
+
|
1255
|
+
/**
|
1256
|
+
* current version of html5shiv
|
1257
|
+
*/
|
1258
|
+
'version': version,
|
1259
|
+
|
1260
|
+
/**
|
1261
|
+
* A flag to indicate that the HTML5 style sheet should be inserted.
|
1262
|
+
* @memberOf html5
|
1263
|
+
* @type Boolean
|
1264
|
+
*/
|
1265
|
+
'shivCSS': (options.shivCSS !== false),
|
1266
|
+
|
1267
|
+
/**
|
1268
|
+
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
1269
|
+
* @memberOf html5
|
1270
|
+
* @type boolean
|
1271
|
+
*/
|
1272
|
+
'supportsUnknownElements': supportsUnknownElements,
|
1273
|
+
|
1274
|
+
/**
|
1275
|
+
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
|
1276
|
+
* methods should be overwritten.
|
1277
|
+
* @memberOf html5
|
1278
|
+
* @type Boolean
|
1279
|
+
*/
|
1280
|
+
'shivMethods': (options.shivMethods !== false),
|
1281
|
+
|
1282
|
+
/**
|
1283
|
+
* A string to describe the type of `html5` object ("default" or "default print").
|
1284
|
+
* @memberOf html5
|
1285
|
+
* @type String
|
1286
|
+
*/
|
1287
|
+
'type': 'default',
|
1288
|
+
|
1289
|
+
// shivs the document according to the specified `html5` object options
|
1290
|
+
'shivDocument': shivDocument,
|
1291
|
+
|
1292
|
+
//creates a shived element
|
1293
|
+
createElement: createElement,
|
1294
|
+
|
1295
|
+
//creates a shived documentFragment
|
1296
|
+
createDocumentFragment: createDocumentFragment
|
1297
|
+
};
|
1285
1298
|
|
1286
|
-
|
1299
|
+
/*--------------------------------------------------------------------------*/
|
1287
1300
|
|
1288
|
-
|
1289
|
-
|
1301
|
+
// expose html5
|
1302
|
+
window.html5 = html5;
|
1290
1303
|
|
1291
|
-
|
1292
|
-
|
1304
|
+
// shiv the document
|
1305
|
+
shivDocument(document);
|
1293
1306
|
|
1294
1307
|
}(this, document));
|
1295
1308
|
/*>>shiv*/
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modernizr-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|