PageSourceSearch

https://www.byensnetvaerk.dk/Files/Templates/Designs/byensnetvaerk/Assets/plugins/modernizr/modernizr.js

js byensnetvaerk.dk collected 2026-10-07 02:35:59 UTC 14,247 bytes, 341 lines download raw bytes

vendor: 5,930 bytes, lines 1-213
1/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
2 * Build: http://modernizr.com/download/#-canvas-canvastext-hashchange-mq-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
3 */
4;
5
6
7
8window.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 = ['&#173;', '<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
107
108    isEventSupported = (function () {
109
110        var TAGNAMES = {
111            'select': 'input', 'change': 'input',
112            'submit': 'form', 'reset': 'form',
113            'error': 'img', 'load': 'img', 'abort': 'img'
114        };
115
116        function isEventSupported(eventName, element) {
117
118            element = element || document.createElement(TAGNAMES[eventName] || 'div');
119            eventName = 'on' + eventName;
120
121            var isSupported = eventName in element;
122
123            if (!isSupported) {
124                if (!element.setAttribute) {
125                    element = document.createElement('div');
126                }
127                if (element.setAttribute && element.removeAttribute) {
128                    element.setAttribute(eventName, '');
129                    isSupported = is(element[eventName], 'function');
130
131                    if (!is(element[eventName], 'undefined')) {
132                        element[eventName] = undefined;
133                    }
134                    element.removeAttribute(eventName);
135                }
136            }
137
138            element = null;
139            return isSupported;
140        }
141        return isEventSupported;
142    })(),
143
144
145    _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
146
147    if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) {
148        hasOwnProp = function (object, property) {
149            return _hasOwnProperty.call(object, property);
150        };
151    }
152    else {
153        hasOwnProp = function (object, property) {
154            return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
155        };
156    }
157
158
159    if (!Function.prototype.bind) {
160        Function.prototype.bind = function bind(that) {
161
162            var target = this;
163
164            if (typeof target != "function") {
165                throw new TypeError();
166            }
167
168            var args = slice.call(arguments, 1),
169                bound = function () {
170
171                    if (this instanceof bound) {
172
173                        var F = function () { };
174                        F.prototype = target.prototype;
175                        var self = new F();
176
177                        var result = target.apply(
178                            self,
179                            args.concat(slice.call(arguments))
180                        );
181                        if (Object(result) === result) {
182                            return result;
183                        }
184                        return self;
185
186                    } else {
187
188                        return target.apply(
189                            that,
190                            args.concat(slice.call(arguments))
191                        );
192
193                    }
194
195                };
196
197            return bound;
198        };
199    }
200
201    function setCss(str) {
202        mStyle.cssText = str;
203    }
204
205    function setCssAll(str1, str2) {
206        return setCss(prefixes.join(str1 + ';') + (str2 || ''));
207    }
208
209    function is(obj, type) {
210        return typeof obj === type;
211    }
212
213    function contains(str, substr) {
vendor: 8,317 bytes, lines 214-341
214        return !!~('' + str).indexOf(substr);
215    }
216
217    function testProps(props, prefixed) {
218        for (var i in props) {
219            var prop = props[i];
220            if (!contains(prop, "-") && mStyle[prop] !== undefined) {
221                return prefixed == 'pfx' ? prop : true;
222            }
223        }
224        return false;
225    }
226
227    function testDOMProps(props, obj, elem) {
228        for (var i in props) {
229            var item = obj[props[i]];
230            if (item !== undefined) {
231
232                if (elem === false) return props[i];
233
234                if (is(item, 'function')) {
235                    return item.bind(elem || obj);
236                }
237
238                return item;
239            }
240        }
241        return false;
242    }
243
244    function testPropsAll(prop, prefixed, elem) {
245
246        var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
247            props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
248
249        if (is(prefixed, "string") || is(prefixed, "undefined")) {
250            return testProps(props, prefixed);
251
252        } else {
253            props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
254            return testDOMProps(props, prefixed, elem);
255        }
256    }
257
258
259
260    tests['canvas'] = function () {
261        var elem = document.createElement('canvas');
262        return !!(elem.getContext && elem.getContext('2d'));
263    };
264
265    tests['canvastext'] = function () {
266        return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
267    }; tests['hashchange'] = function () {
268        return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
269    };
270
271    for (var feature in tests) {
272        if (hasOwnProp(tests, feature)) {
273            featureName = feature.toLowerCase();
274            Modernizr[featureName] = tests[feature]();
275
276            classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
277        }
278    }
279
280
281
282    Modernizr.addTest = function (feature, test) {
283        if (typeof feature == 'object') {
284            for (var key in feature) {
285                if (hasOwnProp(feature, key)) {
286                    Modernizr.addTest(key, feature[key]);
287                }
288            }
289        } else {
290
291            feature = feature.toLowerCase();
292
293            if (Modernizr[feature] !== undefined) {
294                return Modernizr;
295            }
296
297            test = typeof test == 'function' ? test() : test;
298
299            if (typeof enableClasses !== "undefined" && enableClasses) {
300                docElement.className += ' ' + (test ? '' : 'no-') + feature;
301            }
302            Modernizr[feature] = test;
303
304        }
305
306        return Modernizr;
307    };
308
309
310    setCss('');
311    modElem = inputElem = null;
312
313
314    Modernizr._version = version;
315
316    Modernizr._prefixes = prefixes;
317    Modernizr._domPrefixes = domPrefixes;
318    Modernizr._cssomPrefixes = cssomPrefixes;
319
320    Modernizr.mq = testMediaQuery;
321
322    Modernizr.hasEvent = isEventSupported;
323
324    Modernizr.testProp = function (prop) {
325        return testProps([prop]);
326    };
327
328    Modernizr.testAllProps = testPropsAll;
329
330
331    Modernizr.testStyles = injectElementWithStyles; docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
332
333                                                    (enableClasses ? ' js ' + classes.join(' ') : '');
334
335    return Modernizr;
336
337})(this, this.document);
338/*yepnope1.5.4|WTFPL*/
339(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);
340Modernizr.load = function () { yepnope.apply(window, [].slice.call(arguments, 0)); };
341;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.