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.W.min.js
6 lines (6 loc) · 4.62 KB
/
mediatizr.Sheethub.W.min.js
1
2
3
4
5
6
/*! 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}());
/*! W 1.2.2 (https://github.com/pyrsmk/W) */
!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define(c):a[b]=c}(this,"W",function(){function a(){var a,b,c,d,e=[{width:screen.availWidth,height:screen.availHeight},{width:window.outerWidth,height:window.outerHeight},{width:window.innerWidth,height:window.innerHeight}];if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&"landscape"==m()?(a=screen.height,b=screen.width):(a=screen.width,b=screen.height),k)return{width:a,height:b};for(c=0,d=e.length;d>c;++c)e[c].note=e[c].width>a||e[c].height>b||!e[c].width||!e[c].height?0:e[c].width<a||e[c].height<b?2+(a-e[c].width)+(b-e[c].height):1;return e.sort(function(a,b){return b.note-a.note}),{width:e[0].width,height:e[0].height}}var b,c,d,e,f=window,g=document,h=g.documentElement,i=[],j=!1,k=!1,l=function(){b=g.createElement("div"),b.style.width="1em",h.appendChild(b),e=b.offsetWidth,e=e?e:16,h.removeChild(b)},m=function(){return"orientation"in window?window.orientation?"landscape":"portrait":h.clientWidth>h.clientHeight?"landscape":"portrait"};return l(),f.addEventListener?"onorientationchange"in f?f.addEventListener("orientationchange",function(){j=!0},!1):f.addEventListener("resize",function(){j=!0},!1):f.attachEvent("onresize",function(){j=!0}),c=g.createElement("b"),c.style.position="absolute",c.style.top="-99em",c.innerHTML="W",h.appendChild(c),d=c.offsetHeight,setInterval(function(){if(b=c.offsetHeight,b!=d&&(j=!0),d=b,j&&h.clientWidth){l();for(var a=0,e=i.length;e>a;++a)i[a]();j=!1}},250),{px2em:function(a){return a/e},getViewportWidth:function(){return a().width},getViewportHeight:function(){return a().height},addListener:function(a){return i.push(a),a},setAbsoluteMode:function(a){k=!!a},getOrientation:function(){return m()}}}());
/*! 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))}();