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 10
/
mediatizr.Sheethub.min.js
4 lines (4 loc) · 2.84 KB
/
mediatizr.Sheethub.min.js
1
2
3
4
/*! Sheethub 0.6.1 (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}());
/*! mediatizr 0.4.3 (https://github.com/pyrsmk/mediatizr) */
!function(){var a,b=window,c=document,d=c.documentElement,e=b.Sheethub,f="mediatizr",g="get",h="node",i=function(){var a,b,c,d,i,j,k,l,m,n=e[g](),o={},p="indexOf",q=function(){var a,b,c,d,f,i;for(a in o)for(d=o[a].split("and"),b=-1;d[++b];)c=d[b].match(/\(\s*(.+?)\s*:\s*(.+?)(px|em)\s*\)/),f=W.px2em(W.getViewportWidth("em"==c[3])),i=c[2],e[g](a)[h]().disabled=c[1][p]("min")?f>i:i>f},r=function(a){for(var b,c,d=0,e=0;-1!=b||-1!=c;)if(b=a[p]("{",d),c=a[p]("}",d),c>b&&-1!=b?(++e,d=b+1):(--e,d=c+1),!e)return c;return-1};m=0;for(a in n)if(!a.match("^"+f))for(d=n[a][g](),l=0;-1!=(i=d[p]("@media",l));)j=r(d.substr(i)),(k=d.substr(i+6,j-4).match(/([\S\s]+?)and([\S\s]+?)\{([\S\s]+)/i))&&(e.add(b=f+ ++m+a,k[3]),c=e[g](b)[h](),c.media=k[1],o[b]=(k[2]+"").toLowerCase(),c.disabled=!0),l=i+j;W.addListener(q),q()};(b.supportMediaQueries=function(){return b.matchMedia?!0:(a=c.createElement("p"),a.id=f,a.style.position="absolute",a.style.top="-99em",d.appendChild(a),e.add(f,"#"+f+"{width:9px}"),e[g](f)[h]().media="only all",9==a.offsetWidth&&!e.remove(f)&&!!d.removeChild(a))}())||(e.ready()?i():e.listen(i))}();