https://www.gemeindeentwicklung.at/typo3conf/ext/gowest_theme/Reso…/Dist/cssrelpreload.js?1596109846
vendor: 3,082 bytes, lines 1-108
1/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */ 2/* This file is meant as a standalone workflow for 3- testing support for link[rel=preload] 4- enabling async CSS loading in browsers that do not support rel=preload 5- applying rel preload css once loaded, whether supported or not. 6*/ 7(function( w ){ 8 "use strict"; 9 // rel=preload support test 10 if( !w.loadCSS ){ 11 w.loadCSS = function(){}; 12 } 13 // define on the loadCSS obj 14 var rp = loadCSS.relpreload = {}; 15 // rel=preload feature support test 16 // runs once and returns a function for compat purposes 17 rp.support = (function(){ 18 var ret; 19 try { 20 ret = w.document.createElement( "link" ).relList.supports( "preload" ); 21 } catch (e) { 22 ret = false; 23 } 24 return function(){ 25 return ret; 26 }; 27 })(); 28 29 // if preload isn't supported, get an asynchronous load by using a non-matching media attribute 30 // then change that media back to its intended value on load 31 rp.bindMediaToggle = function( link ){ 32 // remember existing media attr for ultimate state, or default to 'all' 33 var finalMedia = link.media || "all"; 34 35 function enableStylesheet(){ 36 // unbind listeners 37 if( link.addEventListener ){ 38 link.removeEventListener( "load", enableStylesheet ); 39 } else if( link.attachEvent ){ 40 link.detachEvent( "onload", enableStylesheet ); 41 } 42 link.setAttribute( "onload", null ); 43 link.media = finalMedia; 44 } 45 46 // bind load handlers to enable media 47 if( link.addEventListener ){ 48 link.addEventListener( "load", enableStylesheet ); 49 } else if( link.attachEvent ){ 50 link.attachEvent( "onload", enableStylesheet ); 51 } 52 53 // Set rel and non-applicable media type to start an async request 54 // note: timeout allows this to happen async to let rendering continue in IE 55 setTimeout(function(){ 56 link.rel = "stylesheet"; 57 link.media = "only x"; 58 }); 59 }; 60 61 // loop through link elements in DOM 62 rp.poly = function(){ 63 // double check this to prevent external calls from running 64 if( rp.support() ){ 65 return; 66 } 67 var links = w.document.getElementsByTagName( "link" ); 68 for( var i = 0; i < links.length; i++ ){ 69 var link = links[ i ]; 70 // qualify links to those with rel=preload and as=style attrs 71 if( link.rel === "preload" && link.getAttribute( "as" ) === "style" && !link.getAttribute( "data-loadcss" ) ){ 72 // prevent rerunning on link 73 link.setAttribute( "data-loadcss", true ); 74 // bind listeners to toggle media back 75 rp.bindMediaToggle( link ); 76 } 77 } 78 }; 79 80 // if unsupported, run the polyfill 81 if( !rp.support() ){ 82 // run once at least 83 rp.poly(); 84 85 // rerun poly on an interval until onload 86 var run = w.setInterval( rp.poly, 500 ); 87 if( w.addEventListener ){ 88 w.addEventListener( "load", function(){ 89 rp.poly(); 90 w.clearInterval( run ); 91 } ); 92 } else if( w.attachEvent ){ 93 w.attachEvent( "onload", function(){ 94 rp.poly(); 95 w.clearInterval( run ); 96 } ); 97 } 98 } 99 100 101 // commonjs 102 if( typeof exports !== "undefined" ){ 103 exports.loadCSS = loadCSS; 104 } 105 else { 106 w.loadCSS = loadCSS; 107 } 108}( typeof global !== "undefined" ? global : this ) );
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.