compass-aurora 0.9.5 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/aurora.rb +3 -2
- data/templates/parmesan/manifest.rb +1 -1
- data/templates/project/manifest.rb +1 -1
- data/templates/shared/aurora.info.erb +5 -2
- data/templates/shared/modernizr-2.5.3.js +726 -0
- data/templates/shared/template.php.erb +5 -7
- data/templates/singularity/manifest.rb +1 -1
- data/templates/susy/manifest.rb +1 -1
- metadata +4 -5
- data/templates/shared/modernizr.js +0 -1118
@@ -30,13 +30,11 @@ function <%= project_name %>_preprocess_maintenance_page(&$vars, $hook) {
|
|
30
30
|
* The name of the template being rendered ("html" in this case.)
|
31
31
|
*/
|
32
32
|
function <%= project_name %>_preprocess_html(&$vars) {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
drupal_add_js(drupal_get_path('theme', '<%= project_name %>') . '/<%= project_js %>/loader.js');
|
39
|
-
}
|
33
|
+
// Be sure replace this with a custom Modernizr build!
|
34
|
+
drupal_add_js(drupal_get_path('theme', '<%= project_name %>') . '/<%= project_js %>/modernizr-2.5.3.js', array('force header' => true));
|
35
|
+
|
36
|
+
// yep/nope for conditional JS loading!
|
37
|
+
drupal_add_js(drupal_get_path('theme', '<%= project_name %>') . '/<%= project_js %>/loader.js');
|
40
38
|
}
|
41
39
|
|
42
40
|
/**
|
@@ -35,7 +35,7 @@ file '../shared/_print.scss', :like => :stylesheet, :to => '_print.scss'
|
|
35
35
|
# JavaScript
|
36
36
|
file '../shared/hammer.js', :like => :javascript, :to => 'hammer.js'
|
37
37
|
file '../shared/loader.js', :like => :javascript, :to => 'loader.js'
|
38
|
-
file '../shared/modernizr.js', :like => :javascript, :to => 'modernizr.js'
|
38
|
+
file '../shared/modernizr-2.5.3.js', :like => :javascript, :to => 'modernizr-2.5.3.js'
|
39
39
|
|
40
40
|
# Behaviors
|
41
41
|
file 'behaviors/box-sizing/boxsizing.htc'
|
data/templates/susy/manifest.rb
CHANGED
@@ -35,7 +35,7 @@ file '../shared/_print.scss', :like => :stylesheet, :to => '_print.scss'
|
|
35
35
|
# JavaScript
|
36
36
|
file '../shared/hammer.js', :like => :javascript, :to => 'hammer.js'
|
37
37
|
file '../shared/loader.js', :like => :javascript, :to => 'loader.js'
|
38
|
-
file '../shared/modernizr.js', :like => :javascript, :to => 'modernizr.js'
|
38
|
+
file '../shared/modernizr-2.5.3.js', :like => :javascript, :to => 'modernizr-2.5.3.js'
|
39
39
|
|
40
40
|
help %Q{
|
41
41
|
Please contact Sam Richard with questions:
|
metadata
CHANGED
@@ -3,10 +3,9 @@ name: compass-aurora
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
+
- 1
|
6
7
|
- 0
|
7
|
-
|
8
|
-
- 5
|
9
|
-
version: 0.9.5
|
8
|
+
version: "1.0"
|
10
9
|
platform: ruby
|
11
10
|
authors:
|
12
11
|
- Sam Richard
|
@@ -14,7 +13,7 @@ autorequire:
|
|
14
13
|
bindir: bin
|
15
14
|
cert_chain: []
|
16
15
|
|
17
|
-
date: 2012-11-
|
16
|
+
date: 2012-11-09 00:00:00 -05:00
|
18
17
|
default_executable:
|
19
18
|
dependencies:
|
20
19
|
- !ruby/object:Gem::Dependency
|
@@ -113,7 +112,7 @@ files:
|
|
113
112
|
- templates/shared/config.rb.erb
|
114
113
|
- templates/shared/hammer.js
|
115
114
|
- templates/shared/loader.js
|
116
|
-
- templates/shared/modernizr.js
|
115
|
+
- templates/shared/modernizr-2.5.3.js
|
117
116
|
- templates/shared/README-Sass.md
|
118
117
|
- templates/shared/style.scss
|
119
118
|
- templates/shared/template.php.erb
|
@@ -1,1118 +0,0 @@
|
|
1
|
-
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
|
2
|
-
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-css_boxsizing-css_calc-css_filters-css_remunit-css_vhunit-css_vmaxunit-css_vminunit-css_vwunit-event_deviceorientation_motion-file_api-forms_fileinput-forms_formattribute-file_filesystem-forms_placeholder-forms_speechinput-forms_validation-getusermedia-notification-load
|
3
|
-
*/
|
4
|
-
;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
window.Modernizr = (function( window, document, undefined ) {
|
9
|
-
|
10
|
-
var version = '2.6.2',
|
11
|
-
|
12
|
-
Modernizr = {},
|
13
|
-
|
14
|
-
enableClasses = true,
|
15
|
-
|
16
|
-
docElement = document.documentElement,
|
17
|
-
|
18
|
-
mod = 'modernizr',
|
19
|
-
modElem = document.createElement(mod),
|
20
|
-
mStyle = modElem.style,
|
21
|
-
|
22
|
-
inputElem = document.createElement('input') ,
|
23
|
-
|
24
|
-
smile = ':)',
|
25
|
-
|
26
|
-
toString = {}.toString,
|
27
|
-
|
28
|
-
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
omPrefixes = 'Webkit Moz O ms',
|
33
|
-
|
34
|
-
cssomPrefixes = omPrefixes.split(' '),
|
35
|
-
|
36
|
-
domPrefixes = omPrefixes.toLowerCase().split(' '),
|
37
|
-
|
38
|
-
ns = {'svg': 'http://www.w3.org/2000/svg'},
|
39
|
-
|
40
|
-
tests = {},
|
41
|
-
inputs = {},
|
42
|
-
attrs = {},
|
43
|
-
|
44
|
-
classes = [],
|
45
|
-
|
46
|
-
slice = classes.slice,
|
47
|
-
|
48
|
-
featureName,
|
49
|
-
|
50
|
-
|
51
|
-
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
|
52
|
-
|
53
|
-
var style, ret, node, docOverflow,
|
54
|
-
div = document.createElement('div'),
|
55
|
-
body = document.body,
|
56
|
-
fakeBody = body || document.createElement('body');
|
57
|
-
|
58
|
-
if ( parseInt(nodes, 10) ) {
|
59
|
-
while ( nodes-- ) {
|
60
|
-
node = document.createElement('div');
|
61
|
-
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
|
62
|
-
div.appendChild(node);
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
|
67
|
-
div.id = mod;
|
68
|
-
(body ? div : fakeBody).innerHTML += style;
|
69
|
-
fakeBody.appendChild(div);
|
70
|
-
if ( !body ) {
|
71
|
-
fakeBody.style.background = '';
|
72
|
-
fakeBody.style.overflow = 'hidden';
|
73
|
-
docOverflow = docElement.style.overflow;
|
74
|
-
docElement.style.overflow = 'hidden';
|
75
|
-
docElement.appendChild(fakeBody);
|
76
|
-
}
|
77
|
-
|
78
|
-
ret = callback(div, rule);
|
79
|
-
if ( !body ) {
|
80
|
-
fakeBody.parentNode.removeChild(fakeBody);
|
81
|
-
docElement.style.overflow = docOverflow;
|
82
|
-
} else {
|
83
|
-
div.parentNode.removeChild(div);
|
84
|
-
}
|
85
|
-
|
86
|
-
return !!ret;
|
87
|
-
|
88
|
-
},
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
isEventSupported = (function() {
|
93
|
-
|
94
|
-
var TAGNAMES = {
|
95
|
-
'select': 'input', 'change': 'input',
|
96
|
-
'submit': 'form', 'reset': 'form',
|
97
|
-
'error': 'img', 'load': 'img', 'abort': 'img'
|
98
|
-
};
|
99
|
-
|
100
|
-
function isEventSupported( eventName, element ) {
|
101
|
-
|
102
|
-
element = element || document.createElement(TAGNAMES[eventName] || 'div');
|
103
|
-
eventName = 'on' + eventName;
|
104
|
-
|
105
|
-
var isSupported = eventName in element;
|
106
|
-
|
107
|
-
if ( !isSupported ) {
|
108
|
-
if ( !element.setAttribute ) {
|
109
|
-
element = document.createElement('div');
|
110
|
-
}
|
111
|
-
if ( element.setAttribute && element.removeAttribute ) {
|
112
|
-
element.setAttribute(eventName, '');
|
113
|
-
isSupported = is(element[eventName], 'function');
|
114
|
-
|
115
|
-
if ( !is(element[eventName], 'undefined') ) {
|
116
|
-
element[eventName] = undefined;
|
117
|
-
}
|
118
|
-
element.removeAttribute(eventName);
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
|
-
element = null;
|
123
|
-
return isSupported;
|
124
|
-
}
|
125
|
-
return isEventSupported;
|
126
|
-
})(),
|
127
|
-
|
128
|
-
|
129
|
-
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
|
130
|
-
|
131
|
-
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
|
132
|
-
hasOwnProp = function (object, property) {
|
133
|
-
return _hasOwnProperty.call(object, property);
|
134
|
-
};
|
135
|
-
}
|
136
|
-
else {
|
137
|
-
hasOwnProp = function (object, property) {
|
138
|
-
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
|
139
|
-
};
|
140
|
-
}
|
141
|
-
|
142
|
-
|
143
|
-
if (!Function.prototype.bind) {
|
144
|
-
Function.prototype.bind = function bind(that) {
|
145
|
-
|
146
|
-
var target = this;
|
147
|
-
|
148
|
-
if (typeof target != "function") {
|
149
|
-
throw new TypeError();
|
150
|
-
}
|
151
|
-
|
152
|
-
var args = slice.call(arguments, 1),
|
153
|
-
bound = function () {
|
154
|
-
|
155
|
-
if (this instanceof bound) {
|
156
|
-
|
157
|
-
var F = function(){};
|
158
|
-
F.prototype = target.prototype;
|
159
|
-
var self = new F();
|
160
|
-
|
161
|
-
var result = target.apply(
|
162
|
-
self,
|
163
|
-
args.concat(slice.call(arguments))
|
164
|
-
);
|
165
|
-
if (Object(result) === result) {
|
166
|
-
return result;
|
167
|
-
}
|
168
|
-
return self;
|
169
|
-
|
170
|
-
} else {
|
171
|
-
|
172
|
-
return target.apply(
|
173
|
-
that,
|
174
|
-
args.concat(slice.call(arguments))
|
175
|
-
);
|
176
|
-
|
177
|
-
}
|
178
|
-
|
179
|
-
};
|
180
|
-
|
181
|
-
return bound;
|
182
|
-
};
|
183
|
-
}
|
184
|
-
|
185
|
-
function setCss( str ) {
|
186
|
-
mStyle.cssText = str;
|
187
|
-
}
|
188
|
-
|
189
|
-
function setCssAll( str1, str2 ) {
|
190
|
-
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
|
191
|
-
}
|
192
|
-
|
193
|
-
function is( obj, type ) {
|
194
|
-
return typeof obj === type;
|
195
|
-
}
|
196
|
-
|
197
|
-
function contains( str, substr ) {
|
198
|
-
return !!~('' + str).indexOf(substr);
|
199
|
-
}
|
200
|
-
|
201
|
-
function testProps( props, prefixed ) {
|
202
|
-
for ( var i in props ) {
|
203
|
-
var prop = props[i];
|
204
|
-
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
|
205
|
-
return prefixed == 'pfx' ? prop : true;
|
206
|
-
}
|
207
|
-
}
|
208
|
-
return false;
|
209
|
-
}
|
210
|
-
|
211
|
-
function testDOMProps( props, obj, elem ) {
|
212
|
-
for ( var i in props ) {
|
213
|
-
var item = obj[props[i]];
|
214
|
-
if ( item !== undefined) {
|
215
|
-
|
216
|
-
if (elem === false) return props[i];
|
217
|
-
|
218
|
-
if (is(item, 'function')){
|
219
|
-
return item.bind(elem || obj);
|
220
|
-
}
|
221
|
-
|
222
|
-
return item;
|
223
|
-
}
|
224
|
-
}
|
225
|
-
return false;
|
226
|
-
}
|
227
|
-
|
228
|
-
function testPropsAll( prop, prefixed, elem ) {
|
229
|
-
|
230
|
-
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
|
231
|
-
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
|
232
|
-
|
233
|
-
if(is(prefixed, "string") || is(prefixed, "undefined")) {
|
234
|
-
return testProps(props, prefixed);
|
235
|
-
|
236
|
-
} else {
|
237
|
-
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
|
238
|
-
return testDOMProps(props, prefixed, elem);
|
239
|
-
}
|
240
|
-
} tests['flexbox'] = function() {
|
241
|
-
return testPropsAll('flexWrap');
|
242
|
-
};
|
243
|
-
|
244
|
-
|
245
|
-
tests['flexboxlegacy'] = function() {
|
246
|
-
return testPropsAll('boxDirection');
|
247
|
-
};
|
248
|
-
|
249
|
-
|
250
|
-
tests['canvas'] = function() {
|
251
|
-
var elem = document.createElement('canvas');
|
252
|
-
return !!(elem.getContext && elem.getContext('2d'));
|
253
|
-
};
|
254
|
-
|
255
|
-
tests['canvastext'] = function() {
|
256
|
-
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
|
257
|
-
};
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
tests['webgl'] = function() {
|
262
|
-
return !!window.WebGLRenderingContext;
|
263
|
-
};
|
264
|
-
|
265
|
-
|
266
|
-
tests['touch'] = function() {
|
267
|
-
var bool;
|
268
|
-
|
269
|
-
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
|
270
|
-
bool = true;
|
271
|
-
} else {
|
272
|
-
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
|
273
|
-
bool = node.offsetTop === 9;
|
274
|
-
});
|
275
|
-
}
|
276
|
-
|
277
|
-
return bool;
|
278
|
-
};
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
tests['geolocation'] = function() {
|
283
|
-
return 'geolocation' in navigator;
|
284
|
-
};
|
285
|
-
|
286
|
-
|
287
|
-
tests['postmessage'] = function() {
|
288
|
-
return !!window.postMessage;
|
289
|
-
};
|
290
|
-
|
291
|
-
|
292
|
-
tests['websqldatabase'] = function() {
|
293
|
-
return !!window.openDatabase;
|
294
|
-
};
|
295
|
-
|
296
|
-
tests['indexedDB'] = function() {
|
297
|
-
return !!testPropsAll("indexedDB", window);
|
298
|
-
};
|
299
|
-
|
300
|
-
tests['hashchange'] = function() {
|
301
|
-
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
|
302
|
-
};
|
303
|
-
|
304
|
-
tests['history'] = function() {
|
305
|
-
return !!(window.history && history.pushState);
|
306
|
-
};
|
307
|
-
|
308
|
-
tests['draganddrop'] = function() {
|
309
|
-
var div = document.createElement('div');
|
310
|
-
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
|
311
|
-
};
|
312
|
-
|
313
|
-
tests['websockets'] = function() {
|
314
|
-
return 'WebSocket' in window || 'MozWebSocket' in window;
|
315
|
-
};
|
316
|
-
|
317
|
-
|
318
|
-
tests['rgba'] = function() {
|
319
|
-
setCss('background-color:rgba(150,255,150,.5)');
|
320
|
-
|
321
|
-
return contains(mStyle.backgroundColor, 'rgba');
|
322
|
-
};
|
323
|
-
|
324
|
-
tests['hsla'] = function() {
|
325
|
-
setCss('background-color:hsla(120,40%,100%,.5)');
|
326
|
-
|
327
|
-
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
|
328
|
-
};
|
329
|
-
|
330
|
-
tests['multiplebgs'] = function() {
|
331
|
-
setCss('background:url(https://),url(https://),red url(https://)');
|
332
|
-
|
333
|
-
return (/(url\s*\(.*?){3}/).test(mStyle.background);
|
334
|
-
}; tests['backgroundsize'] = function() {
|
335
|
-
return testPropsAll('backgroundSize');
|
336
|
-
};
|
337
|
-
|
338
|
-
tests['borderimage'] = function() {
|
339
|
-
return testPropsAll('borderImage');
|
340
|
-
};
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
tests['borderradius'] = function() {
|
345
|
-
return testPropsAll('borderRadius');
|
346
|
-
};
|
347
|
-
|
348
|
-
tests['boxshadow'] = function() {
|
349
|
-
return testPropsAll('boxShadow');
|
350
|
-
};
|
351
|
-
|
352
|
-
tests['textshadow'] = function() {
|
353
|
-
return document.createElement('div').style.textShadow === '';
|
354
|
-
};
|
355
|
-
|
356
|
-
|
357
|
-
tests['opacity'] = function() {
|
358
|
-
setCssAll('opacity:.55');
|
359
|
-
|
360
|
-
return (/^0.55$/).test(mStyle.opacity);
|
361
|
-
};
|
362
|
-
|
363
|
-
|
364
|
-
tests['cssanimations'] = function() {
|
365
|
-
return testPropsAll('animationName');
|
366
|
-
};
|
367
|
-
|
368
|
-
|
369
|
-
tests['csscolumns'] = function() {
|
370
|
-
return testPropsAll('columnCount');
|
371
|
-
};
|
372
|
-
|
373
|
-
|
374
|
-
tests['cssgradients'] = function() {
|
375
|
-
var str1 = 'background-image:',
|
376
|
-
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
|
377
|
-
str3 = 'linear-gradient(left top,#9f9, white);';
|
378
|
-
|
379
|
-
setCss(
|
380
|
-
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
|
381
|
-
prefixes.join(str3 + str1)).slice(0, -str1.length)
|
382
|
-
);
|
383
|
-
|
384
|
-
return contains(mStyle.backgroundImage, 'gradient');
|
385
|
-
};
|
386
|
-
|
387
|
-
|
388
|
-
tests['cssreflections'] = function() {
|
389
|
-
return testPropsAll('boxReflect');
|
390
|
-
};
|
391
|
-
|
392
|
-
|
393
|
-
tests['csstransforms'] = function() {
|
394
|
-
return !!testPropsAll('transform');
|
395
|
-
};
|
396
|
-
|
397
|
-
|
398
|
-
tests['csstransforms3d'] = function() {
|
399
|
-
|
400
|
-
var ret = !!testPropsAll('perspective');
|
401
|
-
|
402
|
-
if ( ret && 'webkitPerspective' in docElement.style ) {
|
403
|
-
|
404
|
-
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
|
405
|
-
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
|
406
|
-
});
|
407
|
-
}
|
408
|
-
return ret;
|
409
|
-
};
|
410
|
-
|
411
|
-
|
412
|
-
tests['csstransitions'] = function() {
|
413
|
-
return testPropsAll('transition');
|
414
|
-
};
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
tests['fontface'] = function() {
|
419
|
-
var bool;
|
420
|
-
|
421
|
-
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
|
422
|
-
var style = document.getElementById('smodernizr'),
|
423
|
-
sheet = style.sheet || style.styleSheet,
|
424
|
-
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
|
425
|
-
|
426
|
-
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
|
427
|
-
});
|
428
|
-
|
429
|
-
return bool;
|
430
|
-
};
|
431
|
-
|
432
|
-
tests['generatedcontent'] = function() {
|
433
|
-
var bool;
|
434
|
-
|
435
|
-
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
|
436
|
-
bool = node.offsetHeight >= 3;
|
437
|
-
});
|
438
|
-
|
439
|
-
return bool;
|
440
|
-
};
|
441
|
-
tests['video'] = function() {
|
442
|
-
var elem = document.createElement('video'),
|
443
|
-
bool = false;
|
444
|
-
|
445
|
-
try {
|
446
|
-
if ( bool = !!elem.canPlayType ) {
|
447
|
-
bool = new Boolean(bool);
|
448
|
-
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
|
449
|
-
|
450
|
-
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
|
451
|
-
|
452
|
-
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
|
453
|
-
}
|
454
|
-
|
455
|
-
} catch(e) { }
|
456
|
-
|
457
|
-
return bool;
|
458
|
-
};
|
459
|
-
|
460
|
-
tests['audio'] = function() {
|
461
|
-
var elem = document.createElement('audio'),
|
462
|
-
bool = false;
|
463
|
-
|
464
|
-
try {
|
465
|
-
if ( bool = !!elem.canPlayType ) {
|
466
|
-
bool = new Boolean(bool);
|
467
|
-
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
|
468
|
-
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
|
469
|
-
|
470
|
-
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
|
471
|
-
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
|
472
|
-
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
|
473
|
-
}
|
474
|
-
} catch(e) { }
|
475
|
-
|
476
|
-
return bool;
|
477
|
-
};
|
478
|
-
|
479
|
-
|
480
|
-
tests['localstorage'] = function() {
|
481
|
-
try {
|
482
|
-
localStorage.setItem(mod, mod);
|
483
|
-
localStorage.removeItem(mod);
|
484
|
-
return true;
|
485
|
-
} catch(e) {
|
486
|
-
return false;
|
487
|
-
}
|
488
|
-
};
|
489
|
-
|
490
|
-
tests['sessionstorage'] = function() {
|
491
|
-
try {
|
492
|
-
sessionStorage.setItem(mod, mod);
|
493
|
-
sessionStorage.removeItem(mod);
|
494
|
-
return true;
|
495
|
-
} catch(e) {
|
496
|
-
return false;
|
497
|
-
}
|
498
|
-
};
|
499
|
-
|
500
|
-
|
501
|
-
tests['webworkers'] = function() {
|
502
|
-
return !!window.Worker;
|
503
|
-
};
|
504
|
-
|
505
|
-
|
506
|
-
tests['applicationcache'] = function() {
|
507
|
-
return !!window.applicationCache;
|
508
|
-
};
|
509
|
-
|
510
|
-
|
511
|
-
tests['svg'] = function() {
|
512
|
-
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
|
513
|
-
};
|
514
|
-
|
515
|
-
tests['inlinesvg'] = function() {
|
516
|
-
var div = document.createElement('div');
|
517
|
-
div.innerHTML = '<svg/>';
|
518
|
-
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
|
519
|
-
};
|
520
|
-
|
521
|
-
tests['smil'] = function() {
|
522
|
-
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
|
523
|
-
};
|
524
|
-
|
525
|
-
|
526
|
-
tests['svgclippaths'] = function() {
|
527
|
-
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
|
528
|
-
};
|
529
|
-
|
530
|
-
function webforms() {
|
531
|
-
Modernizr['input'] = (function( props ) {
|
532
|
-
for ( var i = 0, len = props.length; i < len; i++ ) {
|
533
|
-
attrs[ props[i] ] = !!(props[i] in inputElem);
|
534
|
-
}
|
535
|
-
if (attrs.list){
|
536
|
-
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
|
537
|
-
}
|
538
|
-
return attrs;
|
539
|
-
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
|
540
|
-
Modernizr['inputtypes'] = (function(props) {
|
541
|
-
|
542
|
-
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
|
543
|
-
|
544
|
-
inputElem.setAttribute('type', inputElemType = props[i]);
|
545
|
-
bool = inputElem.type !== 'text';
|
546
|
-
|
547
|
-
if ( bool ) {
|
548
|
-
|
549
|
-
inputElem.value = smile;
|
550
|
-
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
|
551
|
-
|
552
|
-
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
|
553
|
-
|
554
|
-
docElement.appendChild(inputElem);
|
555
|
-
defaultView = document.defaultView;
|
556
|
-
|
557
|
-
bool = defaultView.getComputedStyle &&
|
558
|
-
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
|
559
|
-
(inputElem.offsetHeight !== 0);
|
560
|
-
|
561
|
-
docElement.removeChild(inputElem);
|
562
|
-
|
563
|
-
} else if ( /^(search|tel)$/.test(inputElemType) ){
|
564
|
-
} else if ( /^(url|email)$/.test(inputElemType) ) {
|
565
|
-
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
|
566
|
-
|
567
|
-
} else {
|
568
|
-
bool = inputElem.value != smile;
|
569
|
-
}
|
570
|
-
}
|
571
|
-
|
572
|
-
inputs[ props[i] ] = !!bool;
|
573
|
-
}
|
574
|
-
return inputs;
|
575
|
-
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
|
576
|
-
}
|
577
|
-
for ( var feature in tests ) {
|
578
|
-
if ( hasOwnProp(tests, feature) ) {
|
579
|
-
featureName = feature.toLowerCase();
|
580
|
-
Modernizr[featureName] = tests[feature]();
|
581
|
-
|
582
|
-
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
|
583
|
-
}
|
584
|
-
}
|
585
|
-
|
586
|
-
Modernizr.input || webforms();
|
587
|
-
|
588
|
-
|
589
|
-
Modernizr.addTest = function ( feature, test ) {
|
590
|
-
if ( typeof feature == 'object' ) {
|
591
|
-
for ( var key in feature ) {
|
592
|
-
if ( hasOwnProp( feature, key ) ) {
|
593
|
-
Modernizr.addTest( key, feature[ key ] );
|
594
|
-
}
|
595
|
-
}
|
596
|
-
} else {
|
597
|
-
|
598
|
-
feature = feature.toLowerCase();
|
599
|
-
|
600
|
-
if ( Modernizr[feature] !== undefined ) {
|
601
|
-
return Modernizr;
|
602
|
-
}
|
603
|
-
|
604
|
-
test = typeof test == 'function' ? test() : test;
|
605
|
-
|
606
|
-
if (typeof enableClasses !== "undefined" && enableClasses) {
|
607
|
-
docElement.className += ' ' + (test ? '' : 'no-') + feature;
|
608
|
-
}
|
609
|
-
Modernizr[feature] = test;
|
610
|
-
|
611
|
-
}
|
612
|
-
|
613
|
-
return Modernizr;
|
614
|
-
};
|
615
|
-
|
616
|
-
|
617
|
-
setCss('');
|
618
|
-
modElem = inputElem = null;
|
619
|
-
|
620
|
-
;(function(window, document) {
|
621
|
-
var options = window.html5 || {};
|
622
|
-
|
623
|
-
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
624
|
-
|
625
|
-
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;
|
626
|
-
|
627
|
-
var supportsHtml5Styles;
|
628
|
-
|
629
|
-
var expando = '_html5shiv';
|
630
|
-
|
631
|
-
var expanID = 0;
|
632
|
-
|
633
|
-
var expandoData = {};
|
634
|
-
|
635
|
-
var supportsUnknownElements;
|
636
|
-
|
637
|
-
(function() {
|
638
|
-
try {
|
639
|
-
var a = document.createElement('a');
|
640
|
-
a.innerHTML = '<xyz></xyz>';
|
641
|
-
supportsHtml5Styles = ('hidden' in a);
|
642
|
-
|
643
|
-
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
644
|
-
(document.createElement)('a');
|
645
|
-
var frag = document.createDocumentFragment();
|
646
|
-
return (
|
647
|
-
typeof frag.cloneNode == 'undefined' ||
|
648
|
-
typeof frag.createDocumentFragment == 'undefined' ||
|
649
|
-
typeof frag.createElement == 'undefined'
|
650
|
-
);
|
651
|
-
}());
|
652
|
-
} catch(e) {
|
653
|
-
supportsHtml5Styles = true;
|
654
|
-
supportsUnknownElements = true;
|
655
|
-
}
|
656
|
-
|
657
|
-
}()); function addStyleSheet(ownerDocument, cssText) {
|
658
|
-
var p = ownerDocument.createElement('p'),
|
659
|
-
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
660
|
-
|
661
|
-
p.innerHTML = 'x<style>' + cssText + '</style>';
|
662
|
-
return parent.insertBefore(p.lastChild, parent.firstChild);
|
663
|
-
}
|
664
|
-
|
665
|
-
function getElements() {
|
666
|
-
var elements = html5.elements;
|
667
|
-
return typeof elements == 'string' ? elements.split(' ') : elements;
|
668
|
-
}
|
669
|
-
|
670
|
-
function getExpandoData(ownerDocument) {
|
671
|
-
var data = expandoData[ownerDocument[expando]];
|
672
|
-
if (!data) {
|
673
|
-
data = {};
|
674
|
-
expanID++;
|
675
|
-
ownerDocument[expando] = expanID;
|
676
|
-
expandoData[expanID] = data;
|
677
|
-
}
|
678
|
-
return data;
|
679
|
-
}
|
680
|
-
|
681
|
-
function createElement(nodeName, ownerDocument, data){
|
682
|
-
if (!ownerDocument) {
|
683
|
-
ownerDocument = document;
|
684
|
-
}
|
685
|
-
if(supportsUnknownElements){
|
686
|
-
return ownerDocument.createElement(nodeName);
|
687
|
-
}
|
688
|
-
if (!data) {
|
689
|
-
data = getExpandoData(ownerDocument);
|
690
|
-
}
|
691
|
-
var node;
|
692
|
-
|
693
|
-
if (data.cache[nodeName]) {
|
694
|
-
node = data.cache[nodeName].cloneNode();
|
695
|
-
} else if (saveClones.test(nodeName)) {
|
696
|
-
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
697
|
-
} else {
|
698
|
-
node = data.createElem(nodeName);
|
699
|
-
}
|
700
|
-
|
701
|
-
return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
|
702
|
-
}
|
703
|
-
|
704
|
-
function createDocumentFragment(ownerDocument, data){
|
705
|
-
if (!ownerDocument) {
|
706
|
-
ownerDocument = document;
|
707
|
-
}
|
708
|
-
if(supportsUnknownElements){
|
709
|
-
return ownerDocument.createDocumentFragment();
|
710
|
-
}
|
711
|
-
data = data || getExpandoData(ownerDocument);
|
712
|
-
var clone = data.frag.cloneNode(),
|
713
|
-
i = 0,
|
714
|
-
elems = getElements(),
|
715
|
-
l = elems.length;
|
716
|
-
for(;i<l;i++){
|
717
|
-
clone.createElement(elems[i]);
|
718
|
-
}
|
719
|
-
return clone;
|
720
|
-
}
|
721
|
-
|
722
|
-
function shivMethods(ownerDocument, data) {
|
723
|
-
if (!data.cache) {
|
724
|
-
data.cache = {};
|
725
|
-
data.createElem = ownerDocument.createElement;
|
726
|
-
data.createFrag = ownerDocument.createDocumentFragment;
|
727
|
-
data.frag = data.createFrag();
|
728
|
-
}
|
729
|
-
|
730
|
-
|
731
|
-
ownerDocument.createElement = function(nodeName) {
|
732
|
-
if (!html5.shivMethods) {
|
733
|
-
return data.createElem(nodeName);
|
734
|
-
}
|
735
|
-
return createElement(nodeName, ownerDocument, data);
|
736
|
-
};
|
737
|
-
|
738
|
-
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
739
|
-
'var n=f.cloneNode(),c=n.createElement;' +
|
740
|
-
'h.shivMethods&&(' +
|
741
|
-
getElements().join().replace(/\w+/g, function(nodeName) {
|
742
|
-
data.createElem(nodeName);
|
743
|
-
data.frag.createElement(nodeName);
|
744
|
-
return 'c("' + nodeName + '")';
|
745
|
-
}) +
|
746
|
-
');return n}'
|
747
|
-
)(html5, data.frag);
|
748
|
-
} function shivDocument(ownerDocument) {
|
749
|
-
if (!ownerDocument) {
|
750
|
-
ownerDocument = document;
|
751
|
-
}
|
752
|
-
var data = getExpandoData(ownerDocument);
|
753
|
-
|
754
|
-
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
755
|
-
data.hasCSS = !!addStyleSheet(ownerDocument,
|
756
|
-
'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
|
757
|
-
'mark{background:#FF0;color:#000}'
|
758
|
-
);
|
759
|
-
}
|
760
|
-
if (!supportsUnknownElements) {
|
761
|
-
shivMethods(ownerDocument, data);
|
762
|
-
}
|
763
|
-
return ownerDocument;
|
764
|
-
} var html5 = {
|
765
|
-
|
766
|
-
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video',
|
767
|
-
|
768
|
-
'shivCSS': (options.shivCSS !== false),
|
769
|
-
|
770
|
-
'supportsUnknownElements': supportsUnknownElements,
|
771
|
-
|
772
|
-
'shivMethods': (options.shivMethods !== false),
|
773
|
-
|
774
|
-
'type': 'default',
|
775
|
-
|
776
|
-
'shivDocument': shivDocument,
|
777
|
-
|
778
|
-
createElement: createElement,
|
779
|
-
|
780
|
-
createDocumentFragment: createDocumentFragment
|
781
|
-
}; window.html5 = html5;
|
782
|
-
|
783
|
-
shivDocument(document);
|
784
|
-
|
785
|
-
}(this, document));
|
786
|
-
|
787
|
-
Modernizr._version = version;
|
788
|
-
|
789
|
-
Modernizr._prefixes = prefixes;
|
790
|
-
Modernizr._domPrefixes = domPrefixes;
|
791
|
-
Modernizr._cssomPrefixes = cssomPrefixes;
|
792
|
-
|
793
|
-
|
794
|
-
Modernizr.hasEvent = isEventSupported;
|
795
|
-
|
796
|
-
Modernizr.testProp = function(prop){
|
797
|
-
return testProps([prop]);
|
798
|
-
};
|
799
|
-
|
800
|
-
Modernizr.testAllProps = testPropsAll;
|
801
|
-
|
802
|
-
|
803
|
-
Modernizr.testStyles = injectElementWithStyles;
|
804
|
-
Modernizr.prefixed = function(prop, obj, elem){
|
805
|
-
if(!obj) {
|
806
|
-
return testPropsAll(prop, 'pfx');
|
807
|
-
} else {
|
808
|
-
return testPropsAll(prop, obj, elem);
|
809
|
-
}
|
810
|
-
};
|
811
|
-
|
812
|
-
|
813
|
-
docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
|
814
|
-
|
815
|
-
(enableClasses ? ' js ' + classes.join(' ') : '');
|
816
|
-
|
817
|
-
return Modernizr;
|
818
|
-
|
819
|
-
})(this, this.document);
|
820
|
-
/*yepnope1.5.4|WTFPL*/
|
821
|
-
(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}})(this,document);
|
822
|
-
Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));};
|
823
|
-
// Method of allowing calculated values for length units, i.e. width: calc(100%-3em) http://caniuse.com/#search=calc
|
824
|
-
// By @calvein
|
825
|
-
|
826
|
-
Modernizr.addTest('csscalc', function() {
|
827
|
-
var prop = 'width:';
|
828
|
-
var value = 'calc(10px);';
|
829
|
-
var el = document.createElement('div');
|
830
|
-
|
831
|
-
el.style.cssText = prop + Modernizr._prefixes.join(value + prop);
|
832
|
-
|
833
|
-
return !!el.style.length;
|
834
|
-
});
|
835
|
-
|
836
|
-
// developer.mozilla.org/en/CSS/box-sizing
|
837
|
-
// github.com/Modernizr/Modernizr/issues/248
|
838
|
-
|
839
|
-
Modernizr.addTest("boxsizing",function(){
|
840
|
-
return Modernizr.testAllProps("boxSizing") && (document.documentMode === undefined || document.documentMode > 7);
|
841
|
-
});
|
842
|
-
|
843
|
-
|
844
|
-
// https://github.com/Modernizr/Modernizr/issues/615
|
845
|
-
// documentMode is needed for false positives in oldIE, please see issue above
|
846
|
-
Modernizr.addTest('cssfilters', function() {
|
847
|
-
var el = document.createElement('div');
|
848
|
-
el.style.cssText = Modernizr._prefixes.join('filter' + ':blur(2px); ');
|
849
|
-
return !!el.style.length && ((document.documentMode === undefined || document.documentMode > 9));
|
850
|
-
});
|
851
|
-
// test by github.com/nsfmc
|
852
|
-
|
853
|
-
// "The 'rem' unit ('root em') is relative to the computed
|
854
|
-
// value of the 'font-size' value of the root element."
|
855
|
-
// http://www.w3.org/TR/css3-values/#relative0
|
856
|
-
// you can test by checking if the prop was ditched
|
857
|
-
|
858
|
-
// http://snook.ca/archives/html_and_css/font-size-with-rem
|
859
|
-
|
860
|
-
Modernizr.addTest('cssremunit', function(){
|
861
|
-
|
862
|
-
var div = document.createElement('div');
|
863
|
-
try {
|
864
|
-
div.style.fontSize = '3rem';
|
865
|
-
} catch(er){}
|
866
|
-
return (/rem/).test(div.style.fontSize);
|
867
|
-
|
868
|
-
});
|
869
|
-
// https://github.com/Modernizr/Modernizr/issues/572
|
870
|
-
// Similar to http://jsfiddle.net/FWeinb/etnYC/
|
871
|
-
Modernizr.addTest('cssvhunit', function() {
|
872
|
-
var bool;
|
873
|
-
Modernizr.testStyles("#modernizr { height: 50vh; }", function(elem, rule) {
|
874
|
-
var height = parseInt(window.innerHeight/2,10),
|
875
|
-
compStyle = parseInt((window.getComputedStyle ?
|
876
|
-
getComputedStyle(elem, null) :
|
877
|
-
elem.currentStyle)["height"],10);
|
878
|
-
|
879
|
-
bool= (compStyle == height);
|
880
|
-
});
|
881
|
-
return bool;
|
882
|
-
});// https://github.com/Modernizr/Modernizr/issues/572
|
883
|
-
// http://jsfiddle.net/glsee/JDsWQ/4/
|
884
|
-
Modernizr.addTest('cssvmaxunit', function(){
|
885
|
-
var bool;
|
886
|
-
Modernizr.testStyles("#modernizr { width: 50vmax; }", function(elem, rule) {
|
887
|
-
var one_vw = window.innerWidth/100,
|
888
|
-
one_vh = window.innerHeight/100,
|
889
|
-
compWidth = parseInt((window.getComputedStyle ?
|
890
|
-
getComputedStyle(elem, null) :
|
891
|
-
elem.currentStyle)['width'],10);
|
892
|
-
bool = ( parseInt(Math.max(one_vw, one_vh)*50,10) == compWidth );
|
893
|
-
});
|
894
|
-
return bool;
|
895
|
-
});// https://github.com/Modernizr/Modernizr/issues/572
|
896
|
-
// http://jsfiddle.net/glsee/JRmdq/8/
|
897
|
-
Modernizr.addTest('cssvminunit', function(){
|
898
|
-
var bool;
|
899
|
-
Modernizr.testStyles("#modernizr { width: 50vmin; }", function(elem, rule) {
|
900
|
-
var one_vw = window.innerWidth/100,
|
901
|
-
one_vh = window.innerHeight/100,
|
902
|
-
compWidth = parseInt((window.getComputedStyle ?
|
903
|
-
getComputedStyle(elem, null) :
|
904
|
-
elem.currentStyle)['width'],10);
|
905
|
-
bool = ( parseInt(Math.min(one_vw, one_vh)*50,10) == compWidth );
|
906
|
-
});
|
907
|
-
return bool;
|
908
|
-
});
|
909
|
-
// https://github.com/Modernizr/Modernizr/issues/572
|
910
|
-
// http://jsfiddle.net/FWeinb/etnYC/
|
911
|
-
Modernizr.addTest('cssvwunit', function(){
|
912
|
-
var bool;
|
913
|
-
Modernizr.testStyles("#modernizr { width: 50vw; }", function(elem, rule) {
|
914
|
-
var width = parseInt(window.innerWidth/2,10),
|
915
|
-
compStyle = parseInt((window.getComputedStyle ?
|
916
|
-
getComputedStyle(elem, null) :
|
917
|
-
elem.currentStyle)["width"],10);
|
918
|
-
|
919
|
-
bool= (compStyle == width);
|
920
|
-
});
|
921
|
-
return bool;
|
922
|
-
});
|
923
|
-
//By Shi Chuan
|
924
|
-
//Part of Device Access aspect of HTML5, same category as geolocation
|
925
|
-
//W3C Editor's Draft at http://dev.w3.org/geo/api/spec-source-orientation.html
|
926
|
-
//Implementation by iOS Safari at http://goo.gl/fhce3 and http://goo.gl/rLKz8
|
927
|
-
|
928
|
-
|
929
|
-
//test for Device Motion Event support, returns boolean value true/false
|
930
|
-
Modernizr.addTest('devicemotion', ('DeviceMotionEvent' in window) );
|
931
|
-
|
932
|
-
//test for Device Orientation Event support, returns boolean value true/false
|
933
|
-
Modernizr.addTest('deviceorientation', ('DeviceOrientationEvent' in window) );
|
934
|
-
/**
|
935
|
-
* file tests for the File API specification
|
936
|
-
* Tests for objects specific to the File API W3C specification without
|
937
|
-
* being redundant (don't bother testing for Blob since it is assumed
|
938
|
-
* to be the File object's prototype.
|
939
|
-
*
|
940
|
-
* Will fail in Safari 5 due to its lack of support for the standards
|
941
|
-
* defined FileReader object
|
942
|
-
*/
|
943
|
-
Modernizr.addTest('filereader', function () {
|
944
|
-
return !!(window.File && window.FileList && window.FileReader);
|
945
|
-
});
|
946
|
-
|
947
|
-
|
948
|
-
// Detects whether input type="file" is available on the platform
|
949
|
-
// E.g. iOS < 6 and some android version don't support this
|
950
|
-
|
951
|
-
// It's useful if you want to hide the upload feature of your app on devices that
|
952
|
-
// don't support it (iphone, ipad, etc).
|
953
|
-
|
954
|
-
Modernizr.addTest('fileinput', function() {
|
955
|
-
var elem = document.createElement('input');
|
956
|
-
elem.type = 'file';
|
957
|
-
return !elem.disabled;
|
958
|
-
});
|
959
|
-
// Detects whether input form="form_id" is available on the platform
|
960
|
-
// E.g. IE 10 (and below), don't support this
|
961
|
-
Modernizr.addTest("formattribute", function() {
|
962
|
-
var form = document.createElement("form"),
|
963
|
-
input = document.createElement("input"),
|
964
|
-
div = document.createElement("div"),
|
965
|
-
id = "formtest"+(new Date().getTime()),
|
966
|
-
attr,
|
967
|
-
bool = false;
|
968
|
-
|
969
|
-
form.id = id;
|
970
|
-
|
971
|
-
//IE6/7 confuses the form idl attribute and the form content attribute
|
972
|
-
if(document.createAttribute){
|
973
|
-
attr = document.createAttribute("form");
|
974
|
-
attr.nodeValue = id;
|
975
|
-
input.setAttributeNode(attr);
|
976
|
-
div.appendChild(form);
|
977
|
-
div.appendChild(input);
|
978
|
-
|
979
|
-
document.documentElement.appendChild(div);
|
980
|
-
|
981
|
-
bool = form.elements.length === 1 && input.form == form;
|
982
|
-
|
983
|
-
div.parentNode.removeChild(div);
|
984
|
-
}
|
985
|
-
|
986
|
-
return bool;
|
987
|
-
});// Filesystem API
|
988
|
-
// dev.w3.org/2009/dap/file-system/file-dir-sys.html
|
989
|
-
|
990
|
-
// The API will be present in Chrome incognito, but will throw an exception.
|
991
|
-
// See crbug.com/93417
|
992
|
-
//
|
993
|
-
// By Eric Bidelman (@ebidel)
|
994
|
-
|
995
|
-
Modernizr.addTest('filesystem', !!Modernizr.prefixed('requestFileSystem', window));// testing for placeholder attribute in inputs and textareas
|
996
|
-
// re-using Modernizr.input if available
|
997
|
-
|
998
|
-
Modernizr.addTest('placeholder', function(){
|
999
|
-
|
1000
|
-
return !!( 'placeholder' in ( Modernizr.input || document.createElement('input') ) &&
|
1001
|
-
'placeholder' in ( Modernizr.textarea || document.createElement('textarea') )
|
1002
|
-
);
|
1003
|
-
|
1004
|
-
});
|
1005
|
-
// speech input for inputs
|
1006
|
-
// by @alrra
|
1007
|
-
|
1008
|
-
|
1009
|
-
// `webkitSpeech` in elem
|
1010
|
-
// doesn`t work correctly in all versions of Chromium based browsers.
|
1011
|
-
// It can return false even if they have support for speech i.imgur.com/2Y40n.png
|
1012
|
-
// Testing with 'onwebkitspeechchange' seems to fix this problem
|
1013
|
-
|
1014
|
-
// this detect only checks the webkit version because
|
1015
|
-
// the speech attribute is likely to be deprecated in favor of a JavaScript API.
|
1016
|
-
// http://lists.w3.org/Archives/Public/public-webapps/2011OctDec/att-1696/speechapi.html
|
1017
|
-
|
1018
|
-
// FIXME: add support for detecting the new spec'd behavior
|
1019
|
-
|
1020
|
-
Modernizr.addTest('speechinput', function(){
|
1021
|
-
var elem = document.createElement('input');
|
1022
|
-
return 'speech' in elem || 'onwebkitspeechchange' in elem;
|
1023
|
-
});// This implementation only tests support for interactive form validation.
|
1024
|
-
// To check validation for a specific type or a specific other constraint,
|
1025
|
-
// the test can be combined:
|
1026
|
-
// - Modernizr.inputtypes.numer && Modernizr.formvalidation (browser supports rangeOverflow, typeMismatch etc. for type=number)
|
1027
|
-
// - Modernizr.input.required && Modernizr.formvalidation (browser supports valueMissing)
|
1028
|
-
//
|
1029
|
-
(function(document, Modernizr){
|
1030
|
-
|
1031
|
-
|
1032
|
-
Modernizr.formvalidationapi = false;
|
1033
|
-
Modernizr.formvalidationmessage = false;
|
1034
|
-
|
1035
|
-
Modernizr.addTest('formvalidation', function(){
|
1036
|
-
var form = document.createElement('form');
|
1037
|
-
if ( !('checkValidity' in form) ) {
|
1038
|
-
return false;
|
1039
|
-
}
|
1040
|
-
var body = document.body,
|
1041
|
-
|
1042
|
-
html = document.documentElement,
|
1043
|
-
|
1044
|
-
bodyFaked = false,
|
1045
|
-
|
1046
|
-
invaildFired = false,
|
1047
|
-
|
1048
|
-
input;
|
1049
|
-
|
1050
|
-
Modernizr.formvalidationapi = true;
|
1051
|
-
|
1052
|
-
// Prevent form from being submitted
|
1053
|
-
form.onsubmit = function(e) {
|
1054
|
-
//Opera does not validate form, if submit is prevented
|
1055
|
-
if ( !window.opera ) {
|
1056
|
-
e.preventDefault();
|
1057
|
-
}
|
1058
|
-
e.stopPropagation();
|
1059
|
-
};
|
1060
|
-
|
1061
|
-
// Calling form.submit() doesn't trigger interactive validation,
|
1062
|
-
// use a submit button instead
|
1063
|
-
//older opera browsers need a name attribute
|
1064
|
-
form.innerHTML = '<input name="modTest" required><button></button>';
|
1065
|
-
|
1066
|
-
// FF4 doesn't trigger "invalid" event if form is not in the DOM tree
|
1067
|
-
// Chrome throws error if invalid input is not visible when submitting
|
1068
|
-
form.style.position = 'absolute';
|
1069
|
-
form.style.top = '-99999em';
|
1070
|
-
|
1071
|
-
// We might in <head> in which case we need to create body manually
|
1072
|
-
if ( !body ) {
|
1073
|
-
bodyFaked = true;
|
1074
|
-
body = document.createElement('body');
|
1075
|
-
//avoid crashing IE8, if background image is used
|
1076
|
-
body.style.background = "";
|
1077
|
-
html.appendChild(body);
|
1078
|
-
}
|
1079
|
-
|
1080
|
-
body.appendChild(form);
|
1081
|
-
|
1082
|
-
input = form.getElementsByTagName('input')[0];
|
1083
|
-
|
1084
|
-
// Record whether "invalid" event is fired
|
1085
|
-
input.oninvalid = function(e) {
|
1086
|
-
invaildFired = true;
|
1087
|
-
e.preventDefault();
|
1088
|
-
e.stopPropagation();
|
1089
|
-
};
|
1090
|
-
|
1091
|
-
//Opera does not fully support the validationMessage property
|
1092
|
-
Modernizr.formvalidationmessage = !!input.validationMessage;
|
1093
|
-
|
1094
|
-
// Submit form by clicking submit button
|
1095
|
-
form.getElementsByTagName('button')[0].click();
|
1096
|
-
|
1097
|
-
// Don't forget to clean up
|
1098
|
-
body.removeChild(form);
|
1099
|
-
bodyFaked && html.removeChild(body);
|
1100
|
-
|
1101
|
-
return invaildFired;
|
1102
|
-
});
|
1103
|
-
|
1104
|
-
|
1105
|
-
})(document, window.Modernizr);// getUserMedia
|
1106
|
-
// http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html
|
1107
|
-
// By Eric Bidelman
|
1108
|
-
|
1109
|
-
Modernizr.addTest('getusermedia', !!Modernizr.prefixed('getUserMedia', navigator));// Notifications
|
1110
|
-
// By Theodoor van Donge
|
1111
|
-
|
1112
|
-
// window.webkitNotifications is only used by Chrome
|
1113
|
-
// http://www.html5rocks.com/en/tutorials/notifications/quick/
|
1114
|
-
|
1115
|
-
// window.Notification only exist in the draft specs
|
1116
|
-
// http://dev.w3.org/2006/webapi/WebNotifications/publish/Notifications.html#idl-if-Notification
|
1117
|
-
|
1118
|
-
Modernizr.addTest('notification', !!Modernizr.prefixed('Notifications', window));;
|