This repository has been archived by the owner on Jun 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSheethub.min.js
2 lines (2 loc) · 1.7 KB
/
Sheethub.min.js
1
2
/*! Sheethub 0.6.2 (https://github.com/pyrsmk/Sheethub) */
!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define(c):a[b]=c}(this,"Sheethub",function(){var a,b,c,d=document,e="getElementsByTagName",f=d[e]("head")[0],g="removeChild",h="parentNode",i={},j=!1,k=[],l=0,m=[],n=d[e]("link"),o=d[e]("style"),p=function(){if(!--l){j=!0;for(var a=k.length;a;)k[--a]()}},q=function(a){var b,c,e,i=!1,j=[],k="appendChild",l="styleSheet",m=function(){f[k](b=d.createElement("style")),b[l]||b[k](d.createTextNode(""))},n=function(){for(i=!0,e=j.length;e;)j[--e]()},o={listen:function(a){j.push(a)},ready:function(){return i},set:function(a){"LINK"==b.tagName&&(b[h][g](b),m()),b[l]?b[l].cssText=a:b.firstChild.nodeValue=a,c=a},get:function(){return c},node:function(){return b}},p=function(){f?"object"==typeof a?(b=a,"LINK"==b.tagName?(e=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),e.open("GET",b.href,!0),e.onreadystatechange=function(){4==e.readyState&&(c=e.responseText.replace(/\.\.\//g,""),n())},e.send(null)):c=b[l]?b[l].cssText:b.innerHTML):(m(),"string"==typeof a&&o.set(a),n()):setTimeout(p,250)};return p(),o},r={listen:function(a){k.push(a)},ready:function(){return j},list:function(){return i},has:function(a){return i[a]},add:function(a,b){r.has(a)||(i[a]=new q(b))},get:function(a){return a?r.has(a)?i[a]:void 0:i},remove:function(a){r.has(a)&&(b=i[a].node(),b[h][g](b),delete i[a])}};for(b=-1;c=n[++b];)"stylesheet"==c.rel.toLowerCase()&&(m.push(c),++l);for(b=o.length;b;)m.push(o[--b]);for(b=-1;a=m[++b];)!(c=a.title)&&a.href&&(c="sheet"+Math.round(9e3*Math.random()+1e3)),c&&(r.add(c,a),i[c].ready()?p():i[c].listen(p));return r}());