corkboard 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.env.template +1 -0
- data/.gitignore +15 -0
- data/.rspec.template +2 -0
- data/.rvmrc.template +4 -0
- data/.wiprc +0 -0
- data/.yardopts +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +223 -0
- data/app/assets/images/corkboard/.gitkeep +0 -0
- data/corkboard.gemspec +41 -0
- data/lib/corkboard/version.rb +1 -1
- data/script/rails +8 -0
- data/spec/controllers/corkboard/application_controller_spec.rb +7 -0
- data/spec/controllers/corkboard/authorizations_controller_spec.rb +26 -0
- data/spec/controllers/corkboard/board_controller_spec.rb +29 -0
- data/spec/controllers/corkboard/posts_controller_spec.rb +7 -0
- data/spec/corkboard/client_spec.rb +52 -0
- data/spec/corkboard/clients/instagram_spec.rb +30 -0
- data/spec/corkboard/engine_spec.rb +11 -0
- data/spec/corkboard/provider_spec.rb +28 -0
- data/spec/corkboard/providers/instagram_spec.rb +44 -0
- data/spec/corkboard/publishers/mock_spec.rb +12 -0
- data/spec/corkboard/publishers/pusher_spec.rb +12 -0
- data/spec/corkboard/service/config_spec.rb +12 -0
- data/spec/corkboard_spec.rb +136 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +65 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/corkboard.rb +45 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/jasmine.rb +5 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/.gitkeep +0 -0
- data/spec/dummy/db/migrate/20121212222912_create_corkboard_authorizations.corkboard.rb +18 -0
- data/spec/dummy/db/schema.rb +31 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/helpers/corkboard/application_helper_spec.rb +7 -0
- data/spec/javascripts/fixtures/board.html +3 -0
- data/spec/javascripts/helpers/jasmine-jquery.js +340 -0
- data/spec/javascripts/spec.css +3 -0
- data/spec/javascripts/spec.js +5 -0
- data/spec/javascripts/spec_helper.js +41 -0
- data/spec/javascripts/specs/corkboard/app/board_spec.js +68 -0
- data/spec/javascripts/specs/corkboard/base_spec.js +17 -0
- data/spec/javascripts/specs/corkboard/lib/publisher_spec.js +101 -0
- data/spec/javascripts/specs/corkboard/lib/weighted_randomizer_spec.js +23 -0
- data/spec/javascripts/specs/corkboard_spec.js +45 -0
- data/spec/javascripts/support/jasmine.yml +75 -0
- data/spec/javascripts/support/jasmine_config.rb +1 -0
- data/spec/models/corkboard/authorization_spec.rb +7 -0
- data/spec/models/corkboard/post_spec.rb +7 -0
- data/spec/models/corkboard/subscription_spec.rb +7 -0
- data/spec/requests/authorizations_spec.rb +39 -0
- data/spec/requests/board_spec.rb +70 -0
- data/spec/routing/authorizations_routing_spec.rb +25 -0
- data/spec/routing/board_routing_spec.rb +7 -0
- data/spec/routing/posts_routing_spec.rb +15 -0
- data/spec/spec_helper.rb +51 -0
- data/spec/support/helpers/config_helpers.rb +26 -0
- data/spec/support/helpers/controller_helpers.rb +12 -0
- data/spec/support/helpers/post_helpers.rb +119 -0
- data/vendor/assets/javascripts/jquery.masonry-extensions.js +203 -0
- data/vendor/assets/javascripts/jquery.masonry.js +499 -0
- data/vendor/assets/javascripts/modernizr.js +821 -0
- data/vendor/assets/javascripts/pusher.js +48 -0
- metadata +176 -11
@@ -0,0 +1,821 @@
|
|
1
|
+
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
|
2
|
+
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-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_filters-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
|
+
}; tests['canvas'] = function() {
|
243
|
+
var elem = document.createElement('canvas');
|
244
|
+
return !!(elem.getContext && elem.getContext('2d'));
|
245
|
+
};
|
246
|
+
|
247
|
+
tests['canvastext'] = function() {
|
248
|
+
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
|
249
|
+
};
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
tests['webgl'] = function() {
|
254
|
+
return !!window.WebGLRenderingContext;
|
255
|
+
};
|
256
|
+
|
257
|
+
|
258
|
+
tests['touch'] = function() {
|
259
|
+
var bool;
|
260
|
+
|
261
|
+
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
|
262
|
+
bool = true;
|
263
|
+
} else {
|
264
|
+
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
|
265
|
+
bool = node.offsetTop === 9;
|
266
|
+
});
|
267
|
+
}
|
268
|
+
|
269
|
+
return bool;
|
270
|
+
};
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
tests['geolocation'] = function() {
|
275
|
+
return 'geolocation' in navigator;
|
276
|
+
};
|
277
|
+
|
278
|
+
|
279
|
+
tests['postmessage'] = function() {
|
280
|
+
return !!window.postMessage;
|
281
|
+
};
|
282
|
+
|
283
|
+
|
284
|
+
tests['websqldatabase'] = function() {
|
285
|
+
return !!window.openDatabase;
|
286
|
+
};
|
287
|
+
|
288
|
+
tests['indexedDB'] = function() {
|
289
|
+
return !!testPropsAll("indexedDB", window);
|
290
|
+
};
|
291
|
+
|
292
|
+
tests['hashchange'] = function() {
|
293
|
+
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
|
294
|
+
};
|
295
|
+
|
296
|
+
tests['history'] = function() {
|
297
|
+
return !!(window.history && history.pushState);
|
298
|
+
};
|
299
|
+
|
300
|
+
tests['draganddrop'] = function() {
|
301
|
+
var div = document.createElement('div');
|
302
|
+
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
|
303
|
+
};
|
304
|
+
|
305
|
+
tests['websockets'] = function() {
|
306
|
+
return 'WebSocket' in window || 'MozWebSocket' in window;
|
307
|
+
};
|
308
|
+
|
309
|
+
|
310
|
+
tests['rgba'] = function() {
|
311
|
+
setCss('background-color:rgba(150,255,150,.5)');
|
312
|
+
|
313
|
+
return contains(mStyle.backgroundColor, 'rgba');
|
314
|
+
};
|
315
|
+
|
316
|
+
tests['hsla'] = function() {
|
317
|
+
setCss('background-color:hsla(120,40%,100%,.5)');
|
318
|
+
|
319
|
+
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
|
320
|
+
};
|
321
|
+
|
322
|
+
tests['multiplebgs'] = function() {
|
323
|
+
setCss('background:url(https://),url(https://),red url(https://)');
|
324
|
+
|
325
|
+
return (/(url\s*\(.*?){3}/).test(mStyle.background);
|
326
|
+
}; tests['backgroundsize'] = function() {
|
327
|
+
return testPropsAll('backgroundSize');
|
328
|
+
};
|
329
|
+
|
330
|
+
tests['borderimage'] = function() {
|
331
|
+
return testPropsAll('borderImage');
|
332
|
+
};
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
tests['borderradius'] = function() {
|
337
|
+
return testPropsAll('borderRadius');
|
338
|
+
};
|
339
|
+
|
340
|
+
tests['boxshadow'] = function() {
|
341
|
+
return testPropsAll('boxShadow');
|
342
|
+
};
|
343
|
+
|
344
|
+
tests['textshadow'] = function() {
|
345
|
+
return document.createElement('div').style.textShadow === '';
|
346
|
+
};
|
347
|
+
|
348
|
+
|
349
|
+
tests['opacity'] = function() {
|
350
|
+
setCssAll('opacity:.55');
|
351
|
+
|
352
|
+
return (/^0.55$/).test(mStyle.opacity);
|
353
|
+
};
|
354
|
+
|
355
|
+
|
356
|
+
tests['cssanimations'] = function() {
|
357
|
+
return testPropsAll('animationName');
|
358
|
+
};
|
359
|
+
|
360
|
+
|
361
|
+
tests['csscolumns'] = function() {
|
362
|
+
return testPropsAll('columnCount');
|
363
|
+
};
|
364
|
+
|
365
|
+
|
366
|
+
tests['cssgradients'] = function() {
|
367
|
+
var str1 = 'background-image:',
|
368
|
+
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
|
369
|
+
str3 = 'linear-gradient(left top,#9f9, white);';
|
370
|
+
|
371
|
+
setCss(
|
372
|
+
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
|
373
|
+
prefixes.join(str3 + str1)).slice(0, -str1.length)
|
374
|
+
);
|
375
|
+
|
376
|
+
return contains(mStyle.backgroundImage, 'gradient');
|
377
|
+
};
|
378
|
+
|
379
|
+
|
380
|
+
tests['cssreflections'] = function() {
|
381
|
+
return testPropsAll('boxReflect');
|
382
|
+
};
|
383
|
+
|
384
|
+
|
385
|
+
tests['csstransforms'] = function() {
|
386
|
+
return !!testPropsAll('transform');
|
387
|
+
};
|
388
|
+
|
389
|
+
|
390
|
+
tests['csstransforms3d'] = function() {
|
391
|
+
|
392
|
+
var ret = !!testPropsAll('perspective');
|
393
|
+
|
394
|
+
if ( ret && 'webkitPerspective' in docElement.style ) {
|
395
|
+
|
396
|
+
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
|
397
|
+
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
|
398
|
+
});
|
399
|
+
}
|
400
|
+
return ret;
|
401
|
+
};
|
402
|
+
|
403
|
+
|
404
|
+
tests['csstransitions'] = function() {
|
405
|
+
return testPropsAll('transition');
|
406
|
+
};
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
tests['fontface'] = function() {
|
411
|
+
var bool;
|
412
|
+
|
413
|
+
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
|
414
|
+
var style = document.getElementById('smodernizr'),
|
415
|
+
sheet = style.sheet || style.styleSheet,
|
416
|
+
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
|
417
|
+
|
418
|
+
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
|
419
|
+
});
|
420
|
+
|
421
|
+
return bool;
|
422
|
+
};
|
423
|
+
|
424
|
+
tests['generatedcontent'] = function() {
|
425
|
+
var bool;
|
426
|
+
|
427
|
+
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
|
428
|
+
bool = node.offsetHeight >= 3;
|
429
|
+
});
|
430
|
+
|
431
|
+
return bool;
|
432
|
+
};
|
433
|
+
tests['video'] = function() {
|
434
|
+
var elem = document.createElement('video'),
|
435
|
+
bool = false;
|
436
|
+
|
437
|
+
try {
|
438
|
+
if ( bool = !!elem.canPlayType ) {
|
439
|
+
bool = new Boolean(bool);
|
440
|
+
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
|
441
|
+
|
442
|
+
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
|
443
|
+
|
444
|
+
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
|
445
|
+
}
|
446
|
+
|
447
|
+
} catch(e) { }
|
448
|
+
|
449
|
+
return bool;
|
450
|
+
};
|
451
|
+
|
452
|
+
tests['audio'] = function() {
|
453
|
+
var elem = document.createElement('audio'),
|
454
|
+
bool = false;
|
455
|
+
|
456
|
+
try {
|
457
|
+
if ( bool = !!elem.canPlayType ) {
|
458
|
+
bool = new Boolean(bool);
|
459
|
+
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
|
460
|
+
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
|
461
|
+
|
462
|
+
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
|
463
|
+
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
|
464
|
+
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
|
465
|
+
}
|
466
|
+
} catch(e) { }
|
467
|
+
|
468
|
+
return bool;
|
469
|
+
};
|
470
|
+
|
471
|
+
|
472
|
+
tests['localstorage'] = function() {
|
473
|
+
try {
|
474
|
+
localStorage.setItem(mod, mod);
|
475
|
+
localStorage.removeItem(mod);
|
476
|
+
return true;
|
477
|
+
} catch(e) {
|
478
|
+
return false;
|
479
|
+
}
|
480
|
+
};
|
481
|
+
|
482
|
+
tests['sessionstorage'] = function() {
|
483
|
+
try {
|
484
|
+
sessionStorage.setItem(mod, mod);
|
485
|
+
sessionStorage.removeItem(mod);
|
486
|
+
return true;
|
487
|
+
} catch(e) {
|
488
|
+
return false;
|
489
|
+
}
|
490
|
+
};
|
491
|
+
|
492
|
+
|
493
|
+
tests['webworkers'] = function() {
|
494
|
+
return !!window.Worker;
|
495
|
+
};
|
496
|
+
|
497
|
+
|
498
|
+
tests['applicationcache'] = function() {
|
499
|
+
return !!window.applicationCache;
|
500
|
+
};
|
501
|
+
|
502
|
+
|
503
|
+
tests['svg'] = function() {
|
504
|
+
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
|
505
|
+
};
|
506
|
+
|
507
|
+
tests['inlinesvg'] = function() {
|
508
|
+
var div = document.createElement('div');
|
509
|
+
div.innerHTML = '<svg/>';
|
510
|
+
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
|
511
|
+
};
|
512
|
+
|
513
|
+
tests['smil'] = function() {
|
514
|
+
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
|
515
|
+
};
|
516
|
+
|
517
|
+
|
518
|
+
tests['svgclippaths'] = function() {
|
519
|
+
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
|
520
|
+
};
|
521
|
+
|
522
|
+
function webforms() {
|
523
|
+
Modernizr['input'] = (function( props ) {
|
524
|
+
for ( var i = 0, len = props.length; i < len; i++ ) {
|
525
|
+
attrs[ props[i] ] = !!(props[i] in inputElem);
|
526
|
+
}
|
527
|
+
if (attrs.list){
|
528
|
+
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
|
529
|
+
}
|
530
|
+
return attrs;
|
531
|
+
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
|
532
|
+
Modernizr['inputtypes'] = (function(props) {
|
533
|
+
|
534
|
+
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
|
535
|
+
|
536
|
+
inputElem.setAttribute('type', inputElemType = props[i]);
|
537
|
+
bool = inputElem.type !== 'text';
|
538
|
+
|
539
|
+
if ( bool ) {
|
540
|
+
|
541
|
+
inputElem.value = smile;
|
542
|
+
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
|
543
|
+
|
544
|
+
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
|
545
|
+
|
546
|
+
docElement.appendChild(inputElem);
|
547
|
+
defaultView = document.defaultView;
|
548
|
+
|
549
|
+
bool = defaultView.getComputedStyle &&
|
550
|
+
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
|
551
|
+
(inputElem.offsetHeight !== 0);
|
552
|
+
|
553
|
+
docElement.removeChild(inputElem);
|
554
|
+
|
555
|
+
} else if ( /^(search|tel)$/.test(inputElemType) ){
|
556
|
+
} else if ( /^(url|email)$/.test(inputElemType) ) {
|
557
|
+
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
|
558
|
+
|
559
|
+
} else {
|
560
|
+
bool = inputElem.value != smile;
|
561
|
+
}
|
562
|
+
}
|
563
|
+
|
564
|
+
inputs[ props[i] ] = !!bool;
|
565
|
+
}
|
566
|
+
return inputs;
|
567
|
+
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
|
568
|
+
}
|
569
|
+
for ( var feature in tests ) {
|
570
|
+
if ( hasOwnProp(tests, feature) ) {
|
571
|
+
featureName = feature.toLowerCase();
|
572
|
+
Modernizr[featureName] = tests[feature]();
|
573
|
+
|
574
|
+
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
|
575
|
+
}
|
576
|
+
}
|
577
|
+
|
578
|
+
Modernizr.input || webforms();
|
579
|
+
|
580
|
+
|
581
|
+
Modernizr.addTest = function ( feature, test ) {
|
582
|
+
if ( typeof feature == 'object' ) {
|
583
|
+
for ( var key in feature ) {
|
584
|
+
if ( hasOwnProp( feature, key ) ) {
|
585
|
+
Modernizr.addTest( key, feature[ key ] );
|
586
|
+
}
|
587
|
+
}
|
588
|
+
} else {
|
589
|
+
|
590
|
+
feature = feature.toLowerCase();
|
591
|
+
|
592
|
+
if ( Modernizr[feature] !== undefined ) {
|
593
|
+
return Modernizr;
|
594
|
+
}
|
595
|
+
|
596
|
+
test = typeof test == 'function' ? test() : test;
|
597
|
+
|
598
|
+
if (typeof enableClasses !== "undefined" && enableClasses) {
|
599
|
+
docElement.className += ' ' + (test ? '' : 'no-') + feature;
|
600
|
+
}
|
601
|
+
Modernizr[feature] = test;
|
602
|
+
|
603
|
+
}
|
604
|
+
|
605
|
+
return Modernizr;
|
606
|
+
};
|
607
|
+
|
608
|
+
|
609
|
+
setCss('');
|
610
|
+
modElem = inputElem = null;
|
611
|
+
|
612
|
+
;(function(window, document) {
|
613
|
+
var options = window.html5 || {};
|
614
|
+
|
615
|
+
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
616
|
+
|
617
|
+
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;
|
618
|
+
|
619
|
+
var supportsHtml5Styles;
|
620
|
+
|
621
|
+
var expando = '_html5shiv';
|
622
|
+
|
623
|
+
var expanID = 0;
|
624
|
+
|
625
|
+
var expandoData = {};
|
626
|
+
|
627
|
+
var supportsUnknownElements;
|
628
|
+
|
629
|
+
(function() {
|
630
|
+
try {
|
631
|
+
var a = document.createElement('a');
|
632
|
+
a.innerHTML = '<xyz></xyz>';
|
633
|
+
supportsHtml5Styles = ('hidden' in a);
|
634
|
+
|
635
|
+
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
636
|
+
(document.createElement)('a');
|
637
|
+
var frag = document.createDocumentFragment();
|
638
|
+
return (
|
639
|
+
typeof frag.cloneNode == 'undefined' ||
|
640
|
+
typeof frag.createDocumentFragment == 'undefined' ||
|
641
|
+
typeof frag.createElement == 'undefined'
|
642
|
+
);
|
643
|
+
}());
|
644
|
+
} catch(e) {
|
645
|
+
supportsHtml5Styles = true;
|
646
|
+
supportsUnknownElements = true;
|
647
|
+
}
|
648
|
+
|
649
|
+
}()); function addStyleSheet(ownerDocument, cssText) {
|
650
|
+
var p = ownerDocument.createElement('p'),
|
651
|
+
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
652
|
+
|
653
|
+
p.innerHTML = 'x<style>' + cssText + '</style>';
|
654
|
+
return parent.insertBefore(p.lastChild, parent.firstChild);
|
655
|
+
}
|
656
|
+
|
657
|
+
function getElements() {
|
658
|
+
var elements = html5.elements;
|
659
|
+
return typeof elements == 'string' ? elements.split(' ') : elements;
|
660
|
+
}
|
661
|
+
|
662
|
+
function getExpandoData(ownerDocument) {
|
663
|
+
var data = expandoData[ownerDocument[expando]];
|
664
|
+
if (!data) {
|
665
|
+
data = {};
|
666
|
+
expanID++;
|
667
|
+
ownerDocument[expando] = expanID;
|
668
|
+
expandoData[expanID] = data;
|
669
|
+
}
|
670
|
+
return data;
|
671
|
+
}
|
672
|
+
|
673
|
+
function createElement(nodeName, ownerDocument, data){
|
674
|
+
if (!ownerDocument) {
|
675
|
+
ownerDocument = document;
|
676
|
+
}
|
677
|
+
if(supportsUnknownElements){
|
678
|
+
return ownerDocument.createElement(nodeName);
|
679
|
+
}
|
680
|
+
if (!data) {
|
681
|
+
data = getExpandoData(ownerDocument);
|
682
|
+
}
|
683
|
+
var node;
|
684
|
+
|
685
|
+
if (data.cache[nodeName]) {
|
686
|
+
node = data.cache[nodeName].cloneNode();
|
687
|
+
} else if (saveClones.test(nodeName)) {
|
688
|
+
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
689
|
+
} else {
|
690
|
+
node = data.createElem(nodeName);
|
691
|
+
}
|
692
|
+
|
693
|
+
return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
|
694
|
+
}
|
695
|
+
|
696
|
+
function createDocumentFragment(ownerDocument, data){
|
697
|
+
if (!ownerDocument) {
|
698
|
+
ownerDocument = document;
|
699
|
+
}
|
700
|
+
if(supportsUnknownElements){
|
701
|
+
return ownerDocument.createDocumentFragment();
|
702
|
+
}
|
703
|
+
data = data || getExpandoData(ownerDocument);
|
704
|
+
var clone = data.frag.cloneNode(),
|
705
|
+
i = 0,
|
706
|
+
elems = getElements(),
|
707
|
+
l = elems.length;
|
708
|
+
for(;i<l;i++){
|
709
|
+
clone.createElement(elems[i]);
|
710
|
+
}
|
711
|
+
return clone;
|
712
|
+
}
|
713
|
+
|
714
|
+
function shivMethods(ownerDocument, data) {
|
715
|
+
if (!data.cache) {
|
716
|
+
data.cache = {};
|
717
|
+
data.createElem = ownerDocument.createElement;
|
718
|
+
data.createFrag = ownerDocument.createDocumentFragment;
|
719
|
+
data.frag = data.createFrag();
|
720
|
+
}
|
721
|
+
|
722
|
+
|
723
|
+
ownerDocument.createElement = function(nodeName) {
|
724
|
+
if (!html5.shivMethods) {
|
725
|
+
return data.createElem(nodeName);
|
726
|
+
}
|
727
|
+
return createElement(nodeName, ownerDocument, data);
|
728
|
+
};
|
729
|
+
|
730
|
+
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
731
|
+
'var n=f.cloneNode(),c=n.createElement;' +
|
732
|
+
'h.shivMethods&&(' +
|
733
|
+
getElements().join().replace(/\w+/g, function(nodeName) {
|
734
|
+
data.createElem(nodeName);
|
735
|
+
data.frag.createElement(nodeName);
|
736
|
+
return 'c("' + nodeName + '")';
|
737
|
+
}) +
|
738
|
+
');return n}'
|
739
|
+
)(html5, data.frag);
|
740
|
+
} function shivDocument(ownerDocument) {
|
741
|
+
if (!ownerDocument) {
|
742
|
+
ownerDocument = document;
|
743
|
+
}
|
744
|
+
var data = getExpandoData(ownerDocument);
|
745
|
+
|
746
|
+
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
747
|
+
data.hasCSS = !!addStyleSheet(ownerDocument,
|
748
|
+
'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
|
749
|
+
'mark{background:#FF0;color:#000}'
|
750
|
+
);
|
751
|
+
}
|
752
|
+
if (!supportsUnknownElements) {
|
753
|
+
shivMethods(ownerDocument, data);
|
754
|
+
}
|
755
|
+
return ownerDocument;
|
756
|
+
} var html5 = {
|
757
|
+
|
758
|
+
'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',
|
759
|
+
|
760
|
+
'shivCSS': (options.shivCSS !== false),
|
761
|
+
|
762
|
+
'supportsUnknownElements': supportsUnknownElements,
|
763
|
+
|
764
|
+
'shivMethods': (options.shivMethods !== false),
|
765
|
+
|
766
|
+
'type': 'default',
|
767
|
+
|
768
|
+
'shivDocument': shivDocument,
|
769
|
+
|
770
|
+
createElement: createElement,
|
771
|
+
|
772
|
+
createDocumentFragment: createDocumentFragment
|
773
|
+
}; window.html5 = html5;
|
774
|
+
|
775
|
+
shivDocument(document);
|
776
|
+
|
777
|
+
}(this, document));
|
778
|
+
|
779
|
+
Modernizr._version = version;
|
780
|
+
|
781
|
+
Modernizr._prefixes = prefixes;
|
782
|
+
Modernizr._domPrefixes = domPrefixes;
|
783
|
+
Modernizr._cssomPrefixes = cssomPrefixes;
|
784
|
+
|
785
|
+
|
786
|
+
Modernizr.hasEvent = isEventSupported;
|
787
|
+
|
788
|
+
Modernizr.testProp = function(prop){
|
789
|
+
return testProps([prop]);
|
790
|
+
};
|
791
|
+
|
792
|
+
Modernizr.testAllProps = testPropsAll;
|
793
|
+
|
794
|
+
|
795
|
+
Modernizr.testStyles = injectElementWithStyles;
|
796
|
+
Modernizr.prefixed = function(prop, obj, elem){
|
797
|
+
if(!obj) {
|
798
|
+
return testPropsAll(prop, 'pfx');
|
799
|
+
} else {
|
800
|
+
return testPropsAll(prop, obj, elem);
|
801
|
+
}
|
802
|
+
};
|
803
|
+
|
804
|
+
|
805
|
+
docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
|
806
|
+
|
807
|
+
(enableClasses ? ' js ' + classes.join(' ') : '');
|
808
|
+
|
809
|
+
return Modernizr;
|
810
|
+
|
811
|
+
})(this, this.document);
|
812
|
+
/*yepnope1.5.4|WTFPL*/
|
813
|
+
(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);
|
814
|
+
Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));};
|
815
|
+
// https://github.com/Modernizr/Modernizr/issues/615
|
816
|
+
// documentMode is needed for false positives in oldIE, please see issue above
|
817
|
+
Modernizr.addTest('cssfilters', function() {
|
818
|
+
var el = document.createElement('div');
|
819
|
+
el.style.cssText = Modernizr._prefixes.join('filter' + ':blur(2px); ');
|
820
|
+
return !!el.style.length && ((document.documentMode === undefined || document.documentMode > 9));
|
821
|
+
});;
|