Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: static/js/respond.min.js

Issue 29335113: Issue 2675 - Implemented responsive header for web.eyeo.com (Closed)
Patch Set: Minor code style and variable scope cleanup Created Feb. 29, 2016, 5:03 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
2 * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
3 * */
4
5 !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.docum entElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.cre ateElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top :-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHT ML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefo re(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)} (this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update =function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c) {b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=fun ction(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!== c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyStat e&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\ {[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\} ]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,fi ndStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\ ([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\ s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&nu ll!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesS upported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q= j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.get ElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d =k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:ab solute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.backgrou nd="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k .insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b ),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){va r c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s [s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a. setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w .minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1 ?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||! (z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]) )}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n [C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("st yle"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibli ng),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.pus h(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.med ia),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){retur n a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for (var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findSty les)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(v ar p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp. $2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw) &&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(R egExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.h ref,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0) })}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c. rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet .rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test( e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.subs tring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.upda te=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attac hEvent&&a.attachEvent("onresize",b)}}(this);
OLDNEW

Powered by Google App Engine
This is Rietveld