-
Notifications
You must be signed in to change notification settings - Fork 358
Expand file tree
/
Copy pathcss.min.js
More file actions
1 lines (1 loc) · 1.48 KB
/
css.min.js
File metadata and controls
1 lines (1 loc) · 1.48 KB
1
define(function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0];var t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0;var n=false;var r=true;if(t[1]||t[7])n=parseInt(t[1])<6||parseInt(t[7])<=9;else if(t[2]||t[8])r=false;else if(t[4])n=parseInt(t[4])<18;var a={};a.pluginBuilder="./css-builder";var o,i;var s=function(){o=document.createElement("style");e.appendChild(o);i=o.styleSheet||o.sheet};var l=0;var f=[];var u;var c=function(e){i.addImport(e);o.onload=function(){d()};l++;if(l==31){s();l=0}};var d=function(){u();var e=f.shift();if(!e){u=null;return}u=e[1];c(e[0])};var v=function(e,t){if(!i||!i.addImport)s();if(i&&i.addImport){if(u){f.push([e,t])}else{c(e);u=t}}else{o.textContent='@import "'+e+'";';var n=setInterval(function(){try{o.sheet.cssRules;clearInterval(n);t()}catch(e){}},10)}};var h=function(t,n){var a=document.createElement("link");a.type="text/css";a.rel="stylesheet";if(r)a.onload=function(){a.onload=function(){};setTimeout(n,7)};else var o=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==a.href){clearInterval(o);return n()}}},10);a.href=t;a.onerror=function(e){this.remove();n.error(e)};e.appendChild(a)};a.normalize=function(e,t){return t(/(\?|\.css$)/.test(e)?e:e+".css")};a.load=function(e,t,r,a){(n?v:h)(t.toUrl(e),r)};return a});