weblinc-modernizr-rails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +6 -0
- data/lib/weblinc/modernizr/rails/engine.rb +8 -0
- data/lib/weblinc/modernizr/rails/version.rb +7 -0
- data/lib/weblinc/modernizr/rails.rb +2 -0
- data/vendor/assets/javascripts/weblinc-modernizr-rails/modernizr.js +317 -0
- metadata +52 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2a6e6375c84b7270834efda61a992c23bac5a27b
|
4
|
+
data.tar.gz: 81dcea5c602acb02205a1e59d9160bc31b58a4f0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: de1d65b3f92c70e7ec20bc76d3b139f07608187162001acf88acf9365a8b77864650961095ccf15420ff352d7b4526e22d4cb16f3ae1569f3661b475394a7ca9
|
7
|
+
data.tar.gz: 13881994177f106ff7723d41e8326e790b7626ef0629ec27b5be80ae22631e949653f7362b4985a84d652b73529cfb7100405671fa0494f69aea950d1f1f773d
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Chris Cressman, WebLinc
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
weblinc-modernizr-rails
|
2
|
+
================================================================================
|
3
|
+
|
4
|
+
A custom build of the [Modernizr](http://modernizr.com/) JavaScript library
|
5
|
+
packaged for the Rails asset pipeline for use in the
|
6
|
+
[WebLinc](http://www.weblinc.com/) platform.
|
@@ -0,0 +1,317 @@
|
|
1
|
+
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
|
2
|
+
* Build: http://modernizr.com/download/#-cssanimations-csstransitions-touch-mq-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes-cssclassprefix:modernizr!
|
3
|
+
*/
|
4
|
+
;
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
window.Modernizr = (function( window, document, undefined ) {
|
9
|
+
|
10
|
+
var version = '2.8.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 ,
|
23
|
+
|
24
|
+
|
25
|
+
toString = {}.toString,
|
26
|
+
|
27
|
+
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
omPrefixes = 'Webkit Moz O ms',
|
32
|
+
|
33
|
+
cssomPrefixes = omPrefixes.split(' '),
|
34
|
+
|
35
|
+
domPrefixes = omPrefixes.toLowerCase().split(' '),
|
36
|
+
|
37
|
+
|
38
|
+
tests = {},
|
39
|
+
inputs = {},
|
40
|
+
attrs = {},
|
41
|
+
|
42
|
+
classes = [],
|
43
|
+
|
44
|
+
slice = classes.slice,
|
45
|
+
|
46
|
+
featureName,
|
47
|
+
|
48
|
+
|
49
|
+
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
|
50
|
+
|
51
|
+
var style, ret, node, docOverflow,
|
52
|
+
div = document.createElement('div'),
|
53
|
+
body = document.body,
|
54
|
+
fakeBody = body || document.createElement('body');
|
55
|
+
|
56
|
+
if ( parseInt(nodes, 10) ) {
|
57
|
+
while ( nodes-- ) {
|
58
|
+
node = document.createElement('div');
|
59
|
+
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
|
60
|
+
div.appendChild(node);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
|
65
|
+
div.id = mod;
|
66
|
+
(body ? div : fakeBody).innerHTML += style;
|
67
|
+
fakeBody.appendChild(div);
|
68
|
+
if ( !body ) {
|
69
|
+
fakeBody.style.background = '';
|
70
|
+
fakeBody.style.overflow = 'hidden';
|
71
|
+
docOverflow = docElement.style.overflow;
|
72
|
+
docElement.style.overflow = 'hidden';
|
73
|
+
docElement.appendChild(fakeBody);
|
74
|
+
}
|
75
|
+
|
76
|
+
ret = callback(div, rule);
|
77
|
+
if ( !body ) {
|
78
|
+
fakeBody.parentNode.removeChild(fakeBody);
|
79
|
+
docElement.style.overflow = docOverflow;
|
80
|
+
} else {
|
81
|
+
div.parentNode.removeChild(div);
|
82
|
+
}
|
83
|
+
|
84
|
+
return !!ret;
|
85
|
+
|
86
|
+
},
|
87
|
+
|
88
|
+
testMediaQuery = function( mq ) {
|
89
|
+
|
90
|
+
var matchMedia = window.matchMedia || window.msMatchMedia;
|
91
|
+
if ( matchMedia ) {
|
92
|
+
return matchMedia(mq) && matchMedia(mq).matches || false;
|
93
|
+
}
|
94
|
+
|
95
|
+
var bool;
|
96
|
+
|
97
|
+
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
|
98
|
+
bool = (window.getComputedStyle ?
|
99
|
+
getComputedStyle(node, null) :
|
100
|
+
node.currentStyle)['position'] == 'absolute';
|
101
|
+
});
|
102
|
+
|
103
|
+
return bool;
|
104
|
+
|
105
|
+
},
|
106
|
+
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
|
107
|
+
|
108
|
+
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
|
109
|
+
hasOwnProp = function (object, property) {
|
110
|
+
return _hasOwnProperty.call(object, property);
|
111
|
+
};
|
112
|
+
}
|
113
|
+
else {
|
114
|
+
hasOwnProp = function (object, property) {
|
115
|
+
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
|
116
|
+
};
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
if (!Function.prototype.bind) {
|
121
|
+
Function.prototype.bind = function bind(that) {
|
122
|
+
|
123
|
+
var target = this;
|
124
|
+
|
125
|
+
if (typeof target != "function") {
|
126
|
+
throw new TypeError();
|
127
|
+
}
|
128
|
+
|
129
|
+
var args = slice.call(arguments, 1),
|
130
|
+
bound = function () {
|
131
|
+
|
132
|
+
if (this instanceof bound) {
|
133
|
+
|
134
|
+
var F = function(){};
|
135
|
+
F.prototype = target.prototype;
|
136
|
+
var self = new F();
|
137
|
+
|
138
|
+
var result = target.apply(
|
139
|
+
self,
|
140
|
+
args.concat(slice.call(arguments))
|
141
|
+
);
|
142
|
+
if (Object(result) === result) {
|
143
|
+
return result;
|
144
|
+
}
|
145
|
+
return self;
|
146
|
+
|
147
|
+
} else {
|
148
|
+
|
149
|
+
return target.apply(
|
150
|
+
that,
|
151
|
+
args.concat(slice.call(arguments))
|
152
|
+
);
|
153
|
+
|
154
|
+
}
|
155
|
+
|
156
|
+
};
|
157
|
+
|
158
|
+
return bound;
|
159
|
+
};
|
160
|
+
}
|
161
|
+
|
162
|
+
function setCss( str ) {
|
163
|
+
mStyle.cssText = str;
|
164
|
+
}
|
165
|
+
|
166
|
+
function setCssAll( str1, str2 ) {
|
167
|
+
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
|
168
|
+
}
|
169
|
+
|
170
|
+
function is( obj, type ) {
|
171
|
+
return typeof obj === type;
|
172
|
+
}
|
173
|
+
|
174
|
+
function contains( str, substr ) {
|
175
|
+
return !!~('' + str).indexOf(substr);
|
176
|
+
}
|
177
|
+
|
178
|
+
function testProps( props, prefixed ) {
|
179
|
+
for ( var i in props ) {
|
180
|
+
var prop = props[i];
|
181
|
+
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
|
182
|
+
return prefixed == 'pfx' ? prop : true;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
|
188
|
+
function testDOMProps( props, obj, elem ) {
|
189
|
+
for ( var i in props ) {
|
190
|
+
var item = obj[props[i]];
|
191
|
+
if ( item !== undefined) {
|
192
|
+
|
193
|
+
if (elem === false) return props[i];
|
194
|
+
|
195
|
+
if (is(item, 'function')){
|
196
|
+
return item.bind(elem || obj);
|
197
|
+
}
|
198
|
+
|
199
|
+
return item;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
return false;
|
203
|
+
}
|
204
|
+
|
205
|
+
function testPropsAll( prop, prefixed, elem ) {
|
206
|
+
|
207
|
+
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
|
208
|
+
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
|
209
|
+
|
210
|
+
if(is(prefixed, "string") || is(prefixed, "undefined")) {
|
211
|
+
return testProps(props, prefixed);
|
212
|
+
|
213
|
+
} else {
|
214
|
+
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
|
215
|
+
return testDOMProps(props, prefixed, elem);
|
216
|
+
}
|
217
|
+
} tests['touch'] = function() {
|
218
|
+
var bool;
|
219
|
+
|
220
|
+
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
|
221
|
+
bool = true;
|
222
|
+
} else {
|
223
|
+
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
|
224
|
+
bool = node.offsetTop === 9;
|
225
|
+
});
|
226
|
+
}
|
227
|
+
|
228
|
+
return bool;
|
229
|
+
};
|
230
|
+
tests['cssanimations'] = function() {
|
231
|
+
return testPropsAll('animationName');
|
232
|
+
};
|
233
|
+
|
234
|
+
|
235
|
+
tests['csstransitions'] = function() {
|
236
|
+
return testPropsAll('transition');
|
237
|
+
};
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
for ( var feature in tests ) {
|
242
|
+
if ( hasOwnProp(tests, feature) ) {
|
243
|
+
featureName = feature.toLowerCase();
|
244
|
+
Modernizr[featureName] = tests[feature]();
|
245
|
+
|
246
|
+
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
|
247
|
+
}
|
248
|
+
}
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
Modernizr.addTest = function ( feature, test ) {
|
253
|
+
if ( typeof feature == 'object' ) {
|
254
|
+
for ( var key in feature ) {
|
255
|
+
if ( hasOwnProp( feature, key ) ) {
|
256
|
+
Modernizr.addTest( key, feature[ key ] );
|
257
|
+
}
|
258
|
+
}
|
259
|
+
} else {
|
260
|
+
|
261
|
+
feature = feature.toLowerCase();
|
262
|
+
|
263
|
+
if ( Modernizr[feature] !== undefined ) {
|
264
|
+
return Modernizr;
|
265
|
+
}
|
266
|
+
|
267
|
+
test = typeof test == 'function' ? test() : test;
|
268
|
+
|
269
|
+
if (typeof enableClasses !== "undefined" && enableClasses) {
|
270
|
+
docElement.className+=" modernizr-" + (test ? '' : 'no-') + feature;
|
271
|
+
}
|
272
|
+
Modernizr[feature] = test;
|
273
|
+
|
274
|
+
}
|
275
|
+
|
276
|
+
return Modernizr;
|
277
|
+
};
|
278
|
+
|
279
|
+
|
280
|
+
setCss('');
|
281
|
+
modElem = inputElem = null;
|
282
|
+
|
283
|
+
|
284
|
+
Modernizr._version = version;
|
285
|
+
|
286
|
+
Modernizr._prefixes = prefixes;
|
287
|
+
Modernizr._domPrefixes = domPrefixes;
|
288
|
+
Modernizr._cssomPrefixes = cssomPrefixes;
|
289
|
+
|
290
|
+
Modernizr.mq = testMediaQuery;
|
291
|
+
|
292
|
+
|
293
|
+
Modernizr.testProp = function(prop){
|
294
|
+
return testProps([prop]);
|
295
|
+
};
|
296
|
+
|
297
|
+
Modernizr.testAllProps = testPropsAll;
|
298
|
+
|
299
|
+
|
300
|
+
Modernizr.testStyles = injectElementWithStyles;
|
301
|
+
Modernizr.prefixed = function(prop, obj, elem){
|
302
|
+
if(!obj) {
|
303
|
+
return testPropsAll(prop, 'pfx');
|
304
|
+
} else {
|
305
|
+
return testPropsAll(prop, obj, elem);
|
306
|
+
}
|
307
|
+
};
|
308
|
+
|
309
|
+
|
310
|
+
docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
|
311
|
+
|
312
|
+
(enableClasses ? " modernizr-js modernizr-"+classes.join(" modernizr-") : '');
|
313
|
+
|
314
|
+
return Modernizr;
|
315
|
+
|
316
|
+
})(this, this.document);
|
317
|
+
;
|
metadata
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: weblinc-modernizr-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Cressman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-09-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A custom build of the Modernizr JavaScript library packaged for the Rails
|
14
|
+
asset pipeline for use in the WebLinc platform.
|
15
|
+
email:
|
16
|
+
- ccressman@weblinc.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- LICENSE
|
22
|
+
- README.md
|
23
|
+
- lib/weblinc/modernizr/rails.rb
|
24
|
+
- lib/weblinc/modernizr/rails/engine.rb
|
25
|
+
- lib/weblinc/modernizr/rails/version.rb
|
26
|
+
- vendor/assets/javascripts/weblinc-modernizr-rails/modernizr.js
|
27
|
+
homepage: https://github.com/weblinc/weblinc-modernizr-rails
|
28
|
+
licenses:
|
29
|
+
- MIT
|
30
|
+
metadata: {}
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
requirements: []
|
46
|
+
rubyforge_project:
|
47
|
+
rubygems_version: 2.4.8
|
48
|
+
signing_key:
|
49
|
+
specification_version: 4
|
50
|
+
summary: A custom build of the Modernizr JavaScript library packaged for the Rails
|
51
|
+
asset pipeline for use in the WebLinc platform.
|
52
|
+
test_files: []
|