toolkit 0.1 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/stylesheets/_toolkit.scss +1 -6
- data/stylesheets/toolkit/_fluid-media.scss +2 -0
- data/stylesheets/toolkit/_pe.scss +115 -0
- data/templates/project/{partials/global/_base.scss → _base.scss} +3 -0
- data/templates/project/manifest.rb +22 -19
- data/templates/respond-to/{partials/global/_base.scss → _base.scss} +3 -0
- data/templates/respond-to/manifest.rb +21 -19
- data/templates/{project/partials/design → shared}/_design.scss +0 -0
- data/templates/{project/partials/global → shared}/_extendables.scss +0 -0
- data/templates/{project/partials/global → shared}/_functions.scss +0 -0
- data/templates/{project/partials/design → shared}/_ie-design.scss +0 -0
- data/templates/{project/partials/layout → shared}/_ie-layout.scss +0 -0
- data/templates/{project/partials/layout → shared}/_layout.scss +0 -0
- data/templates/{project/partials/global → shared}/_mixins.scss +0 -0
- data/templates/{project/partials/design → shared}/_print-design.scss +0 -0
- data/templates/{project/partials/layout → shared}/_print-layout.scss +0 -0
- data/templates/{project/partials/styleguide → shared}/_style-guide.scss +0 -0
- data/templates/{project/partials/global → shared}/_variables.scss +0 -0
- data/templates/{project → shared}/hammer.js +0 -0
- data/templates/{project → shared}/ie.scss +0 -0
- data/templates/{project → shared}/loader.js +0 -0
- data/templates/{project → shared}/modernizr-2.5.3.js +0 -0
- data/templates/{project → shared}/print.scss +0 -0
- data/templates/{project → shared}/style.scss +0 -0
- metadata +22 -40
- data/stylesheets/toolkit/_progressive-enhancement.scss +0 -57
- data/templates/project/embeds.respond.js +0 -37
- data/templates/respond-to/embeds.respond.js +0 -37
- data/templates/respond-to/hammer.js +0 -731
- data/templates/respond-to/ie.scss +0 -28
- data/templates/respond-to/loader.js +0 -4
- data/templates/respond-to/modernizr-2.5.3.js +0 -726
- data/templates/respond-to/partials/design/_design.scss +0 -9
- data/templates/respond-to/partials/design/_ie-design.scss +0 -9
- data/templates/respond-to/partials/design/_print-design.scss +0 -9
- data/templates/respond-to/partials/global/_extendables.scss +0 -6
- data/templates/respond-to/partials/global/_functions.scss +0 -5
- data/templates/respond-to/partials/global/_mixins.scss +0 -5
- data/templates/respond-to/partials/global/_variables.scss +0 -5
- data/templates/respond-to/partials/layout/_ie-layout.scss +0 -9
- data/templates/respond-to/partials/layout/_layout.scss +0 -9
- data/templates/respond-to/partials/layout/_print-layout.scss +0 -9
- data/templates/respond-to/partials/styleguide/_style-guide.scss +0 -10
- data/templates/respond-to/print.scss +0 -28
- data/templates/respond-to/style.scss +0 -27
@@ -1,726 +0,0 @@
|
|
1
|
-
/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
|
2
|
-
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-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-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
|
3
|
-
*/
|
4
|
-
;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
window.Modernizr = (function( window, document, undefined ) {
|
9
|
-
|
10
|
-
var version = '2.5.3',
|
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,
|
54
|
-
div = document.createElement('div'),
|
55
|
-
body = document.body,
|
56
|
-
fakeBody = body ? 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>', 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
|
-
docElement.appendChild(fakeBody);
|
73
|
-
}
|
74
|
-
|
75
|
-
ret = callback(div, rule);
|
76
|
-
!body ? fakeBody.parentNode.removeChild(fakeBody) : div.parentNode.removeChild(div);
|
77
|
-
|
78
|
-
return !!ret;
|
79
|
-
|
80
|
-
},
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
isEventSupported = (function() {
|
85
|
-
|
86
|
-
var TAGNAMES = {
|
87
|
-
'select': 'input', 'change': 'input',
|
88
|
-
'submit': 'form', 'reset': 'form',
|
89
|
-
'error': 'img', 'load': 'img', 'abort': 'img'
|
90
|
-
};
|
91
|
-
|
92
|
-
function isEventSupported( eventName, element ) {
|
93
|
-
|
94
|
-
element = element || document.createElement(TAGNAMES[eventName] || 'div');
|
95
|
-
eventName = 'on' + eventName;
|
96
|
-
|
97
|
-
var isSupported = eventName in element;
|
98
|
-
|
99
|
-
if ( !isSupported ) {
|
100
|
-
if ( !element.setAttribute ) {
|
101
|
-
element = document.createElement('div');
|
102
|
-
}
|
103
|
-
if ( element.setAttribute && element.removeAttribute ) {
|
104
|
-
element.setAttribute(eventName, '');
|
105
|
-
isSupported = is(element[eventName], 'function');
|
106
|
-
|
107
|
-
if ( !is(element[eventName], 'undefined') ) {
|
108
|
-
element[eventName] = undefined;
|
109
|
-
}
|
110
|
-
element.removeAttribute(eventName);
|
111
|
-
}
|
112
|
-
}
|
113
|
-
|
114
|
-
element = null;
|
115
|
-
return isSupported;
|
116
|
-
}
|
117
|
-
return isEventSupported;
|
118
|
-
})(),
|
119
|
-
|
120
|
-
|
121
|
-
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty;
|
122
|
-
|
123
|
-
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
|
124
|
-
hasOwnProperty = function (object, property) {
|
125
|
-
return _hasOwnProperty.call(object, property);
|
126
|
-
};
|
127
|
-
}
|
128
|
-
else {
|
129
|
-
hasOwnProperty = function (object, property) {
|
130
|
-
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
|
131
|
-
};
|
132
|
-
}
|
133
|
-
|
134
|
-
|
135
|
-
if (!Function.prototype.bind) {
|
136
|
-
Function.prototype.bind = function bind(that) {
|
137
|
-
|
138
|
-
var target = this;
|
139
|
-
|
140
|
-
if (typeof target != "function") {
|
141
|
-
throw new TypeError();
|
142
|
-
}
|
143
|
-
|
144
|
-
var args = slice.call(arguments, 1),
|
145
|
-
bound = function () {
|
146
|
-
|
147
|
-
if (this instanceof bound) {
|
148
|
-
|
149
|
-
var F = function(){};
|
150
|
-
F.prototype = target.prototype;
|
151
|
-
var self = new F;
|
152
|
-
|
153
|
-
var result = target.apply(
|
154
|
-
self,
|
155
|
-
args.concat(slice.call(arguments))
|
156
|
-
);
|
157
|
-
if (Object(result) === result) {
|
158
|
-
return result;
|
159
|
-
}
|
160
|
-
return self;
|
161
|
-
|
162
|
-
} else {
|
163
|
-
|
164
|
-
return target.apply(
|
165
|
-
that,
|
166
|
-
args.concat(slice.call(arguments))
|
167
|
-
);
|
168
|
-
|
169
|
-
}
|
170
|
-
|
171
|
-
};
|
172
|
-
|
173
|
-
return bound;
|
174
|
-
};
|
175
|
-
}
|
176
|
-
|
177
|
-
function setCss( str ) {
|
178
|
-
mStyle.cssText = str;
|
179
|
-
}
|
180
|
-
|
181
|
-
function setCssAll( str1, str2 ) {
|
182
|
-
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
|
183
|
-
}
|
184
|
-
|
185
|
-
function is( obj, type ) {
|
186
|
-
return typeof obj === type;
|
187
|
-
}
|
188
|
-
|
189
|
-
function contains( str, substr ) {
|
190
|
-
return !!~('' + str).indexOf(substr);
|
191
|
-
}
|
192
|
-
|
193
|
-
function testProps( props, prefixed ) {
|
194
|
-
for ( var i in props ) {
|
195
|
-
if ( mStyle[ props[i] ] !== undefined ) {
|
196
|
-
return prefixed == 'pfx' ? props[i] : true;
|
197
|
-
}
|
198
|
-
}
|
199
|
-
return false;
|
200
|
-
}
|
201
|
-
|
202
|
-
function testDOMProps( props, obj, elem ) {
|
203
|
-
for ( var i in props ) {
|
204
|
-
var item = obj[props[i]];
|
205
|
-
if ( item !== undefined) {
|
206
|
-
|
207
|
-
if (elem === false) return props[i];
|
208
|
-
|
209
|
-
if (is(item, 'function')){
|
210
|
-
return item.bind(elem || obj);
|
211
|
-
}
|
212
|
-
|
213
|
-
return item;
|
214
|
-
}
|
215
|
-
}
|
216
|
-
return false;
|
217
|
-
}
|
218
|
-
|
219
|
-
function testPropsAll( prop, prefixed, elem ) {
|
220
|
-
|
221
|
-
var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1),
|
222
|
-
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
|
223
|
-
|
224
|
-
if(is(prefixed, "string") || is(prefixed, "undefined")) {
|
225
|
-
return testProps(props, prefixed);
|
226
|
-
|
227
|
-
} else {
|
228
|
-
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
|
229
|
-
return testDOMProps(props, prefixed, elem);
|
230
|
-
}
|
231
|
-
}
|
232
|
-
|
233
|
-
var testBundle = (function( styles, tests ) {
|
234
|
-
var style = styles.join(''),
|
235
|
-
len = tests.length;
|
236
|
-
|
237
|
-
injectElementWithStyles(style, function( node, rule ) {
|
238
|
-
var style = document.styleSheets[document.styleSheets.length - 1],
|
239
|
-
cssText = style ? (style.cssRules && style.cssRules[0] ? style.cssRules[0].cssText : style.cssText || '') : '',
|
240
|
-
children = node.childNodes, hash = {};
|
241
|
-
|
242
|
-
while ( len-- ) {
|
243
|
-
hash[children[len].id] = children[len];
|
244
|
-
}
|
245
|
-
|
246
|
-
Modernizr['touch'] = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch || (hash['touch'] && hash['touch'].offsetTop) === 9;
|
247
|
-
Modernizr['csstransforms3d'] = (hash['csstransforms3d'] && hash['csstransforms3d'].offsetLeft) === 9 && hash['csstransforms3d'].offsetHeight === 3; Modernizr['generatedcontent'] = (hash['generatedcontent'] && hash['generatedcontent'].offsetHeight) >= 1; Modernizr['fontface'] = /src/i.test(cssText) &&
|
248
|
-
cssText.indexOf(rule.split(' ')[0]) === 0; }, len, tests);
|
249
|
-
|
250
|
-
})([
|
251
|
-
'@font-face {font-family:"font";src:url("https://")}' ,['@media (',prefixes.join('touch-enabled),('),mod,')',
|
252
|
-
'{#touch{top:9px;position:absolute}}'].join('') ,['@media (',prefixes.join('transform-3d),('),mod,')',
|
253
|
-
'{#csstransforms3d{left:9px;position:absolute;height:3px;}}'].join('')
|
254
|
-
|
255
|
-
,['#generatedcontent:after{content:"',smile,'";visibility:hidden}'].join('')
|
256
|
-
],
|
257
|
-
[
|
258
|
-
'fontface' ,'touch' ,'csstransforms3d'
|
259
|
-
,'generatedcontent'
|
260
|
-
|
261
|
-
]); tests['flexbox'] = function() {
|
262
|
-
return testPropsAll('flexOrder');
|
263
|
-
};
|
264
|
-
|
265
|
-
|
266
|
-
tests['flexbox-legacy'] = function() {
|
267
|
-
return testPropsAll('boxDirection');
|
268
|
-
};
|
269
|
-
|
270
|
-
|
271
|
-
tests['canvas'] = function() {
|
272
|
-
var elem = document.createElement('canvas');
|
273
|
-
return !!(elem.getContext && elem.getContext('2d'));
|
274
|
-
};
|
275
|
-
|
276
|
-
tests['canvastext'] = function() {
|
277
|
-
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
|
278
|
-
};
|
279
|
-
|
280
|
-
|
281
|
-
tests['webgl'] = function() {
|
282
|
-
try {
|
283
|
-
var canvas = document.createElement('canvas'),
|
284
|
-
ret;
|
285
|
-
ret = !!(window.WebGLRenderingContext && (canvas.getContext('experimental-webgl') || canvas.getContext('webgl')));
|
286
|
-
canvas = undefined;
|
287
|
-
} catch (e){
|
288
|
-
ret = false;
|
289
|
-
}
|
290
|
-
return ret;
|
291
|
-
};
|
292
|
-
|
293
|
-
|
294
|
-
tests['touch'] = function() {
|
295
|
-
return Modernizr['touch'];
|
296
|
-
};
|
297
|
-
|
298
|
-
tests['geolocation'] = function() {
|
299
|
-
return !!navigator.geolocation;
|
300
|
-
};
|
301
|
-
|
302
|
-
tests['postmessage'] = function() {
|
303
|
-
return !!window.postMessage;
|
304
|
-
};
|
305
|
-
|
306
|
-
|
307
|
-
tests['websqldatabase'] = function() {
|
308
|
-
return !!window.openDatabase;
|
309
|
-
};
|
310
|
-
|
311
|
-
tests['indexedDB'] = function() {
|
312
|
-
return !!testPropsAll("indexedDB",window);
|
313
|
-
};
|
314
|
-
|
315
|
-
tests['hashchange'] = function() {
|
316
|
-
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
|
317
|
-
};
|
318
|
-
|
319
|
-
tests['history'] = function() {
|
320
|
-
return !!(window.history && history.pushState);
|
321
|
-
};
|
322
|
-
|
323
|
-
tests['draganddrop'] = function() {
|
324
|
-
var div = document.createElement('div');
|
325
|
-
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
|
326
|
-
};
|
327
|
-
|
328
|
-
tests['websockets'] = function() {
|
329
|
-
for ( var i = -1, len = cssomPrefixes.length; ++i < len; ){
|
330
|
-
if ( window[cssomPrefixes[i] + 'WebSocket'] ){
|
331
|
-
return true;
|
332
|
-
}
|
333
|
-
}
|
334
|
-
return 'WebSocket' in window;
|
335
|
-
};
|
336
|
-
|
337
|
-
|
338
|
-
tests['rgba'] = function() {
|
339
|
-
setCss('background-color:rgba(150,255,150,.5)');
|
340
|
-
|
341
|
-
return contains(mStyle.backgroundColor, 'rgba');
|
342
|
-
};
|
343
|
-
|
344
|
-
tests['hsla'] = function() {
|
345
|
-
setCss('background-color:hsla(120,40%,100%,.5)');
|
346
|
-
|
347
|
-
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
|
348
|
-
};
|
349
|
-
|
350
|
-
tests['multiplebgs'] = function() {
|
351
|
-
setCss('background:url(https://),url(https://),red url(https://)');
|
352
|
-
|
353
|
-
return /(url\s*\(.*?){3}/.test(mStyle.background);
|
354
|
-
};
|
355
|
-
tests['backgroundsize'] = function() {
|
356
|
-
return testPropsAll('backgroundSize');
|
357
|
-
};
|
358
|
-
|
359
|
-
tests['borderimage'] = function() {
|
360
|
-
return testPropsAll('borderImage');
|
361
|
-
};
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
tests['borderradius'] = function() {
|
366
|
-
return testPropsAll('borderRadius');
|
367
|
-
};
|
368
|
-
|
369
|
-
tests['boxshadow'] = function() {
|
370
|
-
return testPropsAll('boxShadow');
|
371
|
-
};
|
372
|
-
|
373
|
-
tests['textshadow'] = function() {
|
374
|
-
return document.createElement('div').style.textShadow === '';
|
375
|
-
};
|
376
|
-
|
377
|
-
|
378
|
-
tests['opacity'] = function() {
|
379
|
-
setCssAll('opacity:.55');
|
380
|
-
|
381
|
-
return /^0.55$/.test(mStyle.opacity);
|
382
|
-
};
|
383
|
-
|
384
|
-
|
385
|
-
tests['cssanimations'] = function() {
|
386
|
-
return testPropsAll('animationName');
|
387
|
-
};
|
388
|
-
|
389
|
-
|
390
|
-
tests['csscolumns'] = function() {
|
391
|
-
return testPropsAll('columnCount');
|
392
|
-
};
|
393
|
-
|
394
|
-
|
395
|
-
tests['cssgradients'] = function() {
|
396
|
-
var str1 = 'background-image:',
|
397
|
-
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
|
398
|
-
str3 = 'linear-gradient(left top,#9f9, white);';
|
399
|
-
|
400
|
-
setCss(
|
401
|
-
(str1 + '-webkit- '.split(' ').join(str2 + str1)
|
402
|
-
+ prefixes.join(str3 + str1)).slice(0, -str1.length)
|
403
|
-
);
|
404
|
-
|
405
|
-
return contains(mStyle.backgroundImage, 'gradient');
|
406
|
-
};
|
407
|
-
|
408
|
-
|
409
|
-
tests['cssreflections'] = function() {
|
410
|
-
return testPropsAll('boxReflect');
|
411
|
-
};
|
412
|
-
|
413
|
-
|
414
|
-
tests['csstransforms'] = function() {
|
415
|
-
return !!testPropsAll('transform');
|
416
|
-
};
|
417
|
-
|
418
|
-
|
419
|
-
tests['csstransforms3d'] = function() {
|
420
|
-
|
421
|
-
var ret = !!testPropsAll('perspective');
|
422
|
-
|
423
|
-
if ( ret && 'webkitPerspective' in docElement.style ) {
|
424
|
-
|
425
|
-
ret = Modernizr['csstransforms3d'];
|
426
|
-
}
|
427
|
-
return ret;
|
428
|
-
};
|
429
|
-
|
430
|
-
|
431
|
-
tests['csstransitions'] = function() {
|
432
|
-
return testPropsAll('transition');
|
433
|
-
};
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
tests['fontface'] = function() {
|
438
|
-
return Modernizr['fontface'];
|
439
|
-
};
|
440
|
-
|
441
|
-
tests['generatedcontent'] = function() {
|
442
|
-
return Modernizr['generatedcontent'];
|
443
|
-
};
|
444
|
-
tests['video'] = function() {
|
445
|
-
var elem = document.createElement('video'),
|
446
|
-
bool = false;
|
447
|
-
|
448
|
-
try {
|
449
|
-
if ( bool = !!elem.canPlayType ) {
|
450
|
-
bool = new Boolean(bool);
|
451
|
-
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
|
452
|
-
|
453
|
-
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
|
454
|
-
|
455
|
-
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
|
456
|
-
}
|
457
|
-
|
458
|
-
} catch(e) { }
|
459
|
-
|
460
|
-
return bool;
|
461
|
-
};
|
462
|
-
|
463
|
-
tests['audio'] = function() {
|
464
|
-
var elem = document.createElement('audio'),
|
465
|
-
bool = false;
|
466
|
-
|
467
|
-
try {
|
468
|
-
if ( bool = !!elem.canPlayType ) {
|
469
|
-
bool = new Boolean(bool);
|
470
|
-
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
|
471
|
-
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
|
472
|
-
|
473
|
-
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
|
474
|
-
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
|
475
|
-
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
|
476
|
-
}
|
477
|
-
} catch(e) { }
|
478
|
-
|
479
|
-
return bool;
|
480
|
-
};
|
481
|
-
|
482
|
-
|
483
|
-
tests['localstorage'] = function() {
|
484
|
-
try {
|
485
|
-
localStorage.setItem(mod, mod);
|
486
|
-
localStorage.removeItem(mod);
|
487
|
-
return true;
|
488
|
-
} catch(e) {
|
489
|
-
return false;
|
490
|
-
}
|
491
|
-
};
|
492
|
-
|
493
|
-
tests['sessionstorage'] = function() {
|
494
|
-
try {
|
495
|
-
sessionStorage.setItem(mod, mod);
|
496
|
-
sessionStorage.removeItem(mod);
|
497
|
-
return true;
|
498
|
-
} catch(e) {
|
499
|
-
return false;
|
500
|
-
}
|
501
|
-
};
|
502
|
-
|
503
|
-
|
504
|
-
tests['webworkers'] = function() {
|
505
|
-
return !!window.Worker;
|
506
|
-
};
|
507
|
-
|
508
|
-
|
509
|
-
tests['applicationcache'] = function() {
|
510
|
-
return !!window.applicationCache;
|
511
|
-
};
|
512
|
-
|
513
|
-
|
514
|
-
tests['svg'] = function() {
|
515
|
-
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
|
516
|
-
};
|
517
|
-
|
518
|
-
tests['inlinesvg'] = function() {
|
519
|
-
var div = document.createElement('div');
|
520
|
-
div.innerHTML = '<svg/>';
|
521
|
-
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
|
522
|
-
};
|
523
|
-
|
524
|
-
tests['smil'] = function() {
|
525
|
-
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
|
526
|
-
};
|
527
|
-
|
528
|
-
|
529
|
-
tests['svgclippaths'] = function() {
|
530
|
-
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
|
531
|
-
};
|
532
|
-
|
533
|
-
function webforms() {
|
534
|
-
Modernizr['input'] = (function( props ) {
|
535
|
-
for ( var i = 0, len = props.length; i < len; i++ ) {
|
536
|
-
attrs[ props[i] ] = !!(props[i] in inputElem);
|
537
|
-
}
|
538
|
-
if (attrs.list){
|
539
|
-
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
|
540
|
-
}
|
541
|
-
return attrs;
|
542
|
-
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
|
543
|
-
Modernizr['inputtypes'] = (function(props) {
|
544
|
-
|
545
|
-
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
|
546
|
-
|
547
|
-
inputElem.setAttribute('type', inputElemType = props[i]);
|
548
|
-
bool = inputElem.type !== 'text';
|
549
|
-
|
550
|
-
if ( bool ) {
|
551
|
-
|
552
|
-
inputElem.value = smile;
|
553
|
-
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
|
554
|
-
|
555
|
-
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
|
556
|
-
|
557
|
-
docElement.appendChild(inputElem);
|
558
|
-
defaultView = document.defaultView;
|
559
|
-
|
560
|
-
bool = defaultView.getComputedStyle &&
|
561
|
-
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
|
562
|
-
(inputElem.offsetHeight !== 0);
|
563
|
-
|
564
|
-
docElement.removeChild(inputElem);
|
565
|
-
|
566
|
-
} else if ( /^(search|tel)$/.test(inputElemType) ){
|
567
|
-
} else if ( /^(url|email)$/.test(inputElemType) ) {
|
568
|
-
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
|
569
|
-
|
570
|
-
} else if ( /^color$/.test(inputElemType) ) {
|
571
|
-
docElement.appendChild(inputElem);
|
572
|
-
docElement.offsetWidth;
|
573
|
-
bool = inputElem.value != smile;
|
574
|
-
docElement.removeChild(inputElem);
|
575
|
-
|
576
|
-
} else {
|
577
|
-
bool = inputElem.value != smile;
|
578
|
-
}
|
579
|
-
}
|
580
|
-
|
581
|
-
inputs[ props[i] ] = !!bool;
|
582
|
-
}
|
583
|
-
return inputs;
|
584
|
-
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
|
585
|
-
}
|
586
|
-
for ( var feature in tests ) {
|
587
|
-
if ( hasOwnProperty(tests, feature) ) {
|
588
|
-
featureName = feature.toLowerCase();
|
589
|
-
Modernizr[featureName] = tests[feature]();
|
590
|
-
|
591
|
-
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
|
592
|
-
}
|
593
|
-
}
|
594
|
-
|
595
|
-
Modernizr.input || webforms(); setCss('');
|
596
|
-
modElem = inputElem = null;
|
597
|
-
|
598
|
-
;(function(window, document) {
|
599
|
-
|
600
|
-
var options = window.html5 || {};
|
601
|
-
|
602
|
-
var reSkip = /^<|^(?:button|form|map|select|textarea)$/i;
|
603
|
-
|
604
|
-
var supportsHtml5Styles;
|
605
|
-
|
606
|
-
var supportsUnknownElements;
|
607
|
-
|
608
|
-
(function() {
|
609
|
-
var a = document.createElement('a');
|
610
|
-
|
611
|
-
a.innerHTML = '<xyz></xyz>';
|
612
|
-
|
613
|
-
supportsHtml5Styles = ('hidden' in a);
|
614
|
-
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
615
|
-
try {
|
616
|
-
(document.createElement)('a');
|
617
|
-
} catch(e) {
|
618
|
-
return true;
|
619
|
-
}
|
620
|
-
var frag = document.createDocumentFragment();
|
621
|
-
return (
|
622
|
-
typeof frag.cloneNode == 'undefined' ||
|
623
|
-
typeof frag.createDocumentFragment == 'undefined' ||
|
624
|
-
typeof frag.createElement == 'undefined'
|
625
|
-
);
|
626
|
-
}());
|
627
|
-
|
628
|
-
}()); function addStyleSheet(ownerDocument, cssText) {
|
629
|
-
var p = ownerDocument.createElement('p'),
|
630
|
-
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
631
|
-
|
632
|
-
p.innerHTML = 'x<style>' + cssText + '</style>';
|
633
|
-
return parent.insertBefore(p.lastChild, parent.firstChild);
|
634
|
-
}
|
635
|
-
|
636
|
-
function getElements() {
|
637
|
-
var elements = html5.elements;
|
638
|
-
return typeof elements == 'string' ? elements.split(' ') : elements;
|
639
|
-
}
|
640
|
-
|
641
|
-
function shivMethods(ownerDocument) {
|
642
|
-
var cache = {},
|
643
|
-
docCreateElement = ownerDocument.createElement,
|
644
|
-
docCreateFragment = ownerDocument.createDocumentFragment,
|
645
|
-
frag = docCreateFragment();
|
646
|
-
|
647
|
-
|
648
|
-
ownerDocument.createElement = function(nodeName) {
|
649
|
-
var node = (cache[nodeName] || (cache[nodeName] = docCreateElement(nodeName))).cloneNode();
|
650
|
-
return html5.shivMethods && node.canHaveChildren && !reSkip.test(nodeName) ? frag.appendChild(node) : node;
|
651
|
-
};
|
652
|
-
|
653
|
-
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
654
|
-
'var n=f.cloneNode(),c=n.createElement;' +
|
655
|
-
'h.shivMethods&&(' +
|
656
|
-
getElements().join().replace(/\w+/g, function(nodeName) {
|
657
|
-
cache[nodeName] = docCreateElement(nodeName);
|
658
|
-
frag.createElement(nodeName);
|
659
|
-
return 'c("' + nodeName + '")';
|
660
|
-
}) +
|
661
|
-
');return n}'
|
662
|
-
)(html5, frag);
|
663
|
-
} function shivDocument(ownerDocument) {
|
664
|
-
var shived;
|
665
|
-
if (ownerDocument.documentShived) {
|
666
|
-
return ownerDocument;
|
667
|
-
}
|
668
|
-
if (html5.shivCSS && !supportsHtml5Styles) {
|
669
|
-
shived = !!addStyleSheet(ownerDocument,
|
670
|
-
'article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
|
671
|
-
'audio{display:none}' +
|
672
|
-
'canvas,video{display:inline-block;*display:inline;*zoom:1}' +
|
673
|
-
'[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}' +
|
674
|
-
'mark{background:#FF0;color:#000}'
|
675
|
-
);
|
676
|
-
}
|
677
|
-
if (!supportsUnknownElements) {
|
678
|
-
shived = !shivMethods(ownerDocument);
|
679
|
-
}
|
680
|
-
if (shived) {
|
681
|
-
ownerDocument.documentShived = shived;
|
682
|
-
}
|
683
|
-
return ownerDocument;
|
684
|
-
} var html5 = {
|
685
|
-
|
686
|
-
'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',
|
687
|
-
|
688
|
-
'shivCSS': !(options.shivCSS === false),
|
689
|
-
|
690
|
-
'shivMethods': !(options.shivMethods === false),
|
691
|
-
|
692
|
-
'type': 'default',
|
693
|
-
'shivDocument': shivDocument
|
694
|
-
}; window.html5 = html5;
|
695
|
-
|
696
|
-
shivDocument(document);
|
697
|
-
|
698
|
-
}(this, document));
|
699
|
-
|
700
|
-
Modernizr._version = version;
|
701
|
-
|
702
|
-
Modernizr._prefixes = prefixes;
|
703
|
-
Modernizr._domPrefixes = domPrefixes;
|
704
|
-
Modernizr._cssomPrefixes = cssomPrefixes;
|
705
|
-
|
706
|
-
|
707
|
-
Modernizr.hasEvent = isEventSupported;
|
708
|
-
|
709
|
-
Modernizr.testProp = function(prop){
|
710
|
-
return testProps([prop]);
|
711
|
-
};
|
712
|
-
|
713
|
-
Modernizr.testAllProps = testPropsAll;
|
714
|
-
|
715
|
-
|
716
|
-
Modernizr.testStyles = injectElementWithStyles; docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
|
717
|
-
|
718
|
-
(enableClasses ? ' js ' + classes.join(' ') : '');
|
719
|
-
|
720
|
-
return Modernizr;
|
721
|
-
|
722
|
-
})(this, this.document);
|
723
|
-
/*yepnope1.5.3|WTFPL*/
|
724
|
-
(function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?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)){a!="img"&&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={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?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),a!="img"&&(r||y[c]===2?(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(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&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&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},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,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(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 j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&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);
|
725
|
-
Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));};
|
726
|
-
;
|