hacks-guide-minimal-mistake.../assets/js/main.min.js
2013-05-24 10:25:31 -04:00

1 line
No EOL
20 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(e){"use strict";e.fn.fitVids=function(t){var n={customSelector:null};var r=document.createElement("div"),i=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0];r.className="fit-vids-style";r.innerHTML="­<style> .fluid-width-video-wrapper { width: 100%; position: relative; padding: 0; } .fluid-width-video-wrapper iframe, .fluid-width-video-wrapper object, .fluid-width-video-wrapper embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style>";i.parentNode.insertBefore(r,i);if(t){e.extend(n,t)}return this.each(function(){var t=["iframe[src*='player.vimeo.com']","iframe[src*='www.youtube.com']","iframe[src*='www.youtube-nocookie.com']","iframe[src*='www.kickstarter.com']","object","embed"];if(n.customSelector){t.push(n.customSelector)}var r=e(this).find(t.join(","));r.each(function(){var t=e(this);if(this.tagName.toLowerCase()==="embed"&&t.parent("object").length||t.parent(".fluid-width-video-wrapper").length){return}var n=this.tagName.toLowerCase()==="object"||t.attr("height")&&!isNaN(parseInt(t.attr("height"),10))?parseInt(t.attr("height"),10):t.height(),r=!isNaN(parseInt(t.attr("width"),10))?parseInt(t.attr("width"),10):t.width(),i=n/r;if(!t.attr("id")){var s="fitvid"+Math.floor(Math.random()*999999);t.attr("id",s)}t.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",i*100+"%");t.removeAttr("height").removeAttr("width")})})}})(jQuery);(function(e){var t="Close",n="BeforeAppend",r="MarkupParse",i="Open",s="Change",o="mfp",u="."+o,a="mfp-ready",f="mfp-removing",l="mfp-prevent-close";var c,h=function(){},p=!!window.jQuery,d,v=e(window),m,g,y,b,w;var E=function(e,t){c.ev.on(o+e+u,t)},S=function(t,n,r,i){var s=document.createElement("div");s.className="mfp-"+t;if(r){s.innerHTML=r}if(!i){s=e(s);if(n){s.appendTo(n)}}else if(n){n.appendChild(s)}return s},x=function(t,n){c.ev.triggerHandler(o+t,n);if(c.st.callbacks){t=t.charAt(0).toLowerCase()+t.slice(1);if(c.st.callbacks[t]){c.st.callbacks[t].apply(c,e.isArray(n)?n:[n])}}},T=function(){(c.st.focus?c.content.find(c.st.focus).eq(0):c.wrap).focus()},N=function(t){if(t!==w||!c.currTemplate.closeBtn){c.currTemplate.closeBtn=e(c.st.closeMarkup.replace("%title%",c.st.tClose));w=t}return c.currTemplate.closeBtn},C=function(){if(!e.magnificPopup.instance){c=new h;c.init();e.magnificPopup.instance=c}},k=function(t){if(e(t).hasClass(l)){return}var n=c.st.closeOnContentClick;var r=c.st.closeOnBgClick;if(n&&r){return true}else{if(!c.content||e(t).hasClass("mfp-close")||c.preloader&&t===c.preloader[0]){return true}if(t!==c.content[0]&&!e.contains(c.content[0],t)){if(r){return true}}else if(n){return true}}return false};h.prototype={constructor:h,init:function(){var t=navigator.appVersion;c.isIE7=t.indexOf("MSIE 7.")!==-1;c.isIE8=t.indexOf("MSIE 8.")!==-1,c.isLowIE=c.isIE7||c.isIE8;c.isAndroid=/android/gi.test(t);c.isIOS=/iphone|ipad|ipod/gi.test(t);c.probablyMobile=c.isAndroid||c.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent);m=e(document.body);g=e(document);c.popupsCache={}},open:function(t){c.items=t.items.length?t.items:[t.items];if(c.isOpen){c.updateItemHTML();return}var n;c.types=[];b="";c.ev=t.el||g;if(t.isObj){c.index=t.index||0}else{c.index=0;var s=t.items,o;for(n=0;n<s.length;n++){o=s[n];if(o.parsed){o=o.el[0]}if(o===t.el[0]){c.index=n;break}}}if(t.key){if(!c.popupsCache[t.key]){c.popupsCache[t.key]={}}c.currTemplate=c.popupsCache[t.key]}else{c.currTemplate={}}c.st=e.extend(true,{},e.magnificPopup.defaults,t);c.fixedContentPos=c.st.fixedContentPos==="auto"?!c.probablyMobile:c.st.fixedContentPos;if(!c.bgOverlay){c.bgOverlay=S("bg").on("click"+u,function(){c.close()});c.wrap=S("wrap").attr("tabindex",-1).on("click"+u,function(e){if(k(e.target)){c.close()}});c.container=S("container",c.wrap)}c.contentContainer=S("content");if(c.st.preloader){c.preloader=S("preloader",c.container,c.st.tLoading)}var f=e.magnificPopup.modules;for(n=0;n<f.length;n++){var l=f[n];l=l.charAt(0).toUpperCase()+l.slice(1);c["init"+l].call(c)}x("BeforeOpen");if(!c.st.closeBtnInside){c.wrap.append(N())}else{E(r,function(e,t,n,r){n.close_replaceWith=N(r.type)});b+=" mfp-close-btn-in"}if(c.st.alignTop){b+=" mfp-align-top"}if(c.fixedContentPos){c.wrap.css({overflow:c.st.overflowY,overflowX:"hidden",overflowY:c.st.overflowY})}else{c.wrap.css({top:v.scrollTop(),position:"absolute"})}if(c.st.fixedBgPos===false||c.st.fixedBgPos==="auto"&&!c.fixedContentPos){c.bgOverlay.css({height:g.height(),position:"absolute"})}g.on("keyup"+u,function(e){if(e.keyCode===27){c.close()}});v.on("resize"+u,function(){c.updateSize()});if(!c.st.closeOnContentClick){b+=" mfp-auto-cursor"}if(b)c.wrap.addClass(b);var h=c.wH=v.height();var p={};if(c.fixedContentPos){var d=c._getScrollbarSize();if(d){p.paddingRight=d}}if(c.fixedContentPos){if(!c.isIE7){p.overflow="hidden"}else{e("body, html").css("overflow","hidden")}}var y=c.st.mainClass;if(c.isIE7){y+=" mfp-ie7"}if(y){c._addClassToMFP(y)}c.updateItemHTML();x("BuildControls");m.css(p);c.bgOverlay.add(c.wrap).prependTo(document.body);c._lastFocusedEl=document.activeElement;setTimeout(function(){if(c.content){c._addClassToMFP(a);T()}else{c.bgOverlay.addClass(a)}g.on("focusin"+u,function(t){if(t.target!==c.wrap[0]&&!e.contains(c.wrap[0],t.target)){T();return false}})},16);c.isOpen=true;c.updateSize(h);x(i)},close:function(){if(!c.isOpen)return;c.isOpen=false;if(c.st.removalDelay&&!c.isLowIE){c._addClassToMFP(f);setTimeout(function(){c._close()},c.st.removalDelay)}else{c._close()}},_close:function(){x(t);var n=f+" "+a+" ";c.bgOverlay.detach();c.wrap.detach();c.container.empty();if(c.st.mainClass){n+=c.st.mainClass+" "}c._removeClassFromMFP(n);if(c.fixedContentPos){var r={paddingRight:0};if(c.isIE7){e("body, html").css("overflow","auto")}else{r.overflow="visible"}m.css(r)}g.off("keyup"+u+" focusin"+u);c.ev.off(u);c.wrap.attr("class","mfp-wrap").removeAttr("style");c.bgOverlay.attr("class","mfp-bg");c.container.attr("class","mfp-container");if(!c.st.closeBtnInside||c.currTemplate[c.currItem.type]===true){if(c.currTemplate.closeBtn)c.currTemplate.closeBtn.detach()}if(c._lastFocusedEl){e(c._lastFocusedEl).focus()}c.currItem=null;c.content=null;c.currTemplate=null;c.prevHeight=0},updateSize:function(e){if(c.isIOS){var t=document.documentElement.clientWidth/window.innerWidth;var n=window.innerHeight*t;c.wrap.css("height",n);c.wH=n}else{c.wH=e||v.height()}x("Resize")},updateItemHTML:function(){var t=c.items[c.index];c.contentContainer.detach();if(c.content)c.content.detach();if(!t.parsed){t=c.parseEl(c.index)}var n=t.type;x("BeforeChange",[c.currItem?c.currItem.type:"",n]);c.currItem=t;if(!c.currTemplate[n]){var r=c.st[n]?c.st[n].markup:false;x("FirstMarkupParse",r);if(r){c.currTemplate[n]=e(r)}else{c.currTemplate[n]=true}}if(y&&y!==t.type){c.container.removeClass("mfp-"+y+"-holder")}var i=c["get"+n.charAt(0).toUpperCase()+n.slice(1)](t,c.currTemplate[n]);c.appendContent(i,n);t.preloaded=true;x(s,t);y=t.type;c.container.prepend(c.contentContainer);x("AfterChange")},appendContent:function(e,t){c.content=e;if(e){if(c.st.closeBtnInside&&c.currTemplate[t]===true){if(!c.content.find(".mfp-close").length){c.content.append(N())}}else{c.content=e}}else{c.content=""}x(n);c.container.addClass("mfp-"+t+"-holder");c.contentContainer.append(c.content)},parseEl:function(t){var n=c.items[t],r=n.type;if(n.tagName){n={el:e(n)}}else{n={data:n,src:n.src}}if(n.el){var i=c.types;for(var s=0;s<i.length;s++){if(n.el.hasClass("mfp-"+i[s])){r=i[s];break}}n.src=n.el.attr("data-mfp-src");if(!n.src){n.src=n.el.attr("href")}}n.type=r||c.st.type||"inline";n.index=t;n.parsed=true;c.items[t]=n;x("ElementParse",n);return c.items[t]},addGroup:function(e,t){var n=function(n){n.mfpEl=this;c._openClick(n,e,t)};if(!t){t={}}var r="click.magnificPopup";t.mainEl=e;if(t.items){t.isObj=true;e.off(r).on(r,n)}else{t.isObj=false;if(t.delegate){e.off(r).on(r,t.delegate,n)}else{t.items=e;e.off(r).on(r,n)}}},_openClick:function(t,n,r){var i=r.midClick!==undefined?r.midClick:e.magnificPopup.defaults.midClick;if(i||t.which!==2){var s=r.disableOn!==undefined?r.disableOn:e.magnificPopup.defaults.disableOn;if(s){if(e.isFunction(s)){if(!s.call(c)){return true}}else{if(v.width()<s){return true}}}if(t.type)t.preventDefault();r.el=e(t.mfpEl);if(r.delegate){r.items=n.find(r.delegate)}c.open(r)}},updateStatus:function(e,t){if(c.preloader){if(d!==e){c.container.removeClass("mfp-s-"+d)}if(!t&&e==="loading"){t=c.st.tLoading}var n={status:e,text:t};x("UpdateStatus",n);e=n.status;t=n.text;c.preloader.html(t);c.preloader.find("a").click(function(e){e.stopImmediatePropagation()});c.container.addClass("mfp-s-"+e);d=e}},_addClassToMFP:function(e){c.bgOverlay.addClass(e);c.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e);c.wrap.removeClass(e)},_hasScrollBar:function(e){if(document.body.clientHeight>(e||v.height())){return true}return false},_parseMarkup:function(t,n,i){var s;if(i.data){n=e.extend(i.data,n)}x(r,[t,n,i]);e.each(n,function(e,n){if(n===undefined||n===false){return true}s=e.split("_");if(s.length>1){var r=t.find(u+"-"+s[0]);if(r.length>0){var i=s[1];if(i==="replaceWith"){if(r[0]!==n[0]){r.replaceWith(n)}}else if(i==="img"){if(r.is("img")){r.attr("src",n)}else{r.replaceWith('<img src="'+n+'" class="'+r.attr("class")+'" />')}}else{r.attr(s[1],n)}}}else{t.find(u+"-"+e).html(n)}})},_getScrollbarSize:function(){if(c.scrollbarSize===undefined){var e=document.createElement("div");e.id="mfp-sbm";e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";document.body.appendChild(e);c.scrollbarSize=e.offsetWidth-e.clientWidth;document.body.removeChild(e)}return c.scrollbarSize}};e.magnificPopup={instance:null,proto:h.prototype,modules:[],open:function(e,t){C();if(!e)e={};e.isObj=true;e.index=t||0;return this.instance.open(e)},close:function(){return e.magnificPopup.instance.close()},registerModule:function(t,n){if(n.options){e.magnificPopup.defaults[t]=n.options}e.extend(this.proto,n.proto);this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:false,mainClass:"",preloader:true,focus:"",closeOnContentClick:false,closeOnBgClick:true,closeBtnInside:true,alignTop:false,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}};e.fn.magnificPopup=function(t){C();var n=e(this);if(typeof t==="string"){if(t==="open"){var r,i=p?n.data("magnificPopup"):n[0].magnificPopup,s=parseInt(arguments[1],10)||0;if(i.items){r=i.items[s]}else{r=n;if(i.delegate){r=r.find(i.delegate)}r=r.eq(s)}c._openClick({mfpEl:r},n,i)}else{if(c.isOpen)c[t].apply(c,Array.prototype.slice.call(arguments,1))}}else{if(p){n.data("magnificPopup",t)}else{n[0].magnificPopup=t}c.addGroup(n,t)}return n};var L="inline",A,O,M,_=function(){if(M){O.after(M.addClass(A)).detach();M=null}};e.magnificPopup.registerModule(L,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){c.types.push(L);E(t+"."+L,function(){_()})},getInline:function(t,n){_();if(t.src){var r=c.st.inline,i=e(t.src);if(i.length){if(i[0].parentNode!==null){if(!O){A=r.hiddenClass;O=S(A);A="mfp-"+A}M=i.after(O).detach().removeClass(A)}c.updateStatus("ready")}else{c.updateStatus("error",r.tNotFound);i=e("<div>")}t.inlineElement=i;return i}c.updateStatus("ready");c._parseMarkup(n,{},t);return n}}});var D="ajax",P,H=function(){if(P){m.removeClass(P)}};e.magnificPopup.registerModule(D,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){c.types.push(D);P=c.st.ajax.cursor;E(t+"."+D,function(){H();if(c.req){c.req.abort()}})},getAjax:function(t){if(P)m.addClass(P);c.updateStatus("loading");var n=e.extend({url:t.src,success:function(n,r,i){x("ParseAjax",i);c.appendContent(e(i.responseText),D);t.finished=true;H();T();setTimeout(function(){c.wrap.addClass(a)},16);c.updateStatus("ready")},error:function(){H();t.finished=t.loadError=true;c.updateStatus("error",c.st.ajax.tError.replace("%url%",t.src))}},c.st.ajax.settings);c.req=e.ajax(n);return""}}});var B,j=function(t){if(t.data&&t.data.title!==undefined)return t.data.title;var n=c.st.image.titleSrc;if(n){if(e.isFunction(n)){return n.call(c,t)}else if(t.el){return t.el.attr(n)||""}}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure">'+'<div class="mfp-close"></div>'+'<div class="mfp-img"></div>'+'<div class="mfp-bottom-bar">'+'<div class="mfp-title"></div>'+'<div class="mfp-counter"></div>'+"</div>"+"</div>",cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:true,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=c.st.image,n=".image";c.types.push("image");E(i+n,function(){if(c.currItem.type==="image"&&e.cursor){m.addClass(e.cursor)}});E(t+n,function(){if(e.cursor){m.removeClass(e.cursor)}v.off("resize"+u)});E("Resize"+n,c.resizeImage);if(c.isLowIE){E("AfterChange",c.resizeImage)}},resizeImage:function(){var e=c.currItem;if(!e.img)return;if(c.st.image.verticalFit){var t=0;if(c.isLowIE){t=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)}e.img.css("max-height",c.wH-t)}},_onImageHasSize:function(e){if(e.img){e.hasSize=true;if(B){clearInterval(B)}e.isCheckingImgSize=false;x("ImageHasSize",e);if(e.imgHidden){if(c.content)c.content.removeClass("mfp-loading");e.imgHidden=false}}},findImageSize:function(e){var t=0,n=e.img[0],r=function(i){if(B){clearInterval(B)}B=setInterval(function(){if(n.naturalWidth>0){c._onImageHasSize(e);return}if(t>200){clearInterval(B)}t++;if(t===3){r(10)}else if(t===40){r(50)}else if(t===100){r(500)}},i)};r(1)},getImage:function(t,n){var r=0,i=function(){if(t){if(t.img[0].complete){t.img.off(".mfploader");if(t===c.currItem){c._onImageHasSize(t);c.updateStatus("ready")}t.hasSize=true;t.loaded=true}else{r++;if(r<200){setTimeout(i,100)}else{s()}}}},s=function(){if(t){t.img.off(".mfploader");if(t===c.currItem){c._onImageHasSize(t);c.updateStatus("error",o.tError.replace("%url%",t.src))}t.hasSize=true;t.loaded=true;t.loadError=true}},o=c.st.image;var u=n.find(".mfp-img");if(u.length){var a=new Image;a.className="mfp-img";t.img=e(a).on("load.mfploader",i).on("error.mfploader",s);a.src=t.src;if(u.is("img")){t.img=t.img.clone()}}c._parseMarkup(n,{title:j(t),img_replaceWith:t.img},t);c.resizeImage();if(t.hasSize){if(B)clearInterval(B);if(t.loadError){n.addClass("mfp-loading");c.updateStatus("error",o.tError.replace("%url%",t.src))}else{n.removeClass("mfp-loading");c.updateStatus("ready")}return n}c.updateStatus("loading");t.loading=true;if(!t.hasSize){t.imgHidden=true;n.addClass("mfp-loading");c.findImageSize(t)}return n}}});var F="iframe",I="//about:blank",q=function(e){if(c.currTemplate[F]){var t=c.currTemplate[F].find("iframe");if(t.length){if(!e){t[0].src=I}if(c.isIE8){t.css("display",e?"block":"none")}}}};e.magnificPopup.registerModule(F,{options:{markup:'<div class="mfp-iframe-scaler">'+'<div class="mfp-close"></div>'+'<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+"</div>",srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){c.types.push(F);E("BeforeChange",function(e,t,n){if(t!==n){if(t===F){q()}else if(n===F){q(true)}}});E(t+"."+F,q)},getIframe:function(t,n){var r=t.src;var i=c.st.iframe;e.each(i.patterns,function(){if(r.indexOf(this.index)>-1){if(this.id){if(typeof this.id==="string"){r=r.substr(r.lastIndexOf(this.id)+this.id.length,r.length)}else{r=this.id.call(this,r)}}r=this.src.replace("%id%",r);return false}});var s={};if(i.srcAction){s[i.srcAction]=r}c._parseMarkup(n,s,t);c.updateStatus("ready");return n}}});var R=function(e){var t=c.items.length;if(e>t-1){return e-t}else if(e<0){return t+e}return e},U=function(e,t,n){return e.replace("%curr%",t+1).replace("%total%",n)};e.magnificPopup.registerModule("gallery",{options:{enabled:false,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:true,arrows:true,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=c.st.gallery,o=".mfp-gallery",u=Boolean(e.fn.mfpFastClick);c.direction=true;if(!n||!n.enabled)return false;b+=" mfp-gallery";E(i+o,function(){if(n.navigateByImgClick){c.wrap.on("click"+o,".mfp-img",function(){c.next();return false})}g.on("keydown"+o,function(e){if(e.keyCode===37){c.prev()}else if(e.keyCode===39){c.next()}})});E("UpdateStatus"+o,function(e,t){if(t.text){t.text=U(t.text,c.currItem.index,c.items.length)}});E(r+o,function(e,t,r,i){var s=c.items.length;r.counter=s?U(n.tCounter,i.index,s):""});E("BuildControls"+o,function(){if(n.arrows&&!c.arrowLeft){var t=n.arrowMarkup,r=c.arrowLeft=e(t.replace("%title%",n.tPrev).replace("%dir%","left")).addClass(l),i=c.arrowRight=e(t.replace("%title%",n.tNext).replace("%dir%","right")).addClass(l);var s=u?"mfpFastClick":"click";r[s](function(){c.prev()});i[s](function(){c.next()});if(c.isIE7){S("b",r[0],false,true);S("a",r[0],false,true);S("b",i[0],false,true);S("a",i[0],false,true)}c.container.append(r.add(i))}});E(s+o,function(){if(c._preloadTimeout)clearTimeout(c._preloadTimeout);c._preloadTimeout=setTimeout(function(){c.preloadNearbyImages();c._preloadTimeout=null},16)});E(t+o,function(){g.off(o);c.wrap.off("click"+o);if(u){c.arrowLeft.add(c.arrowRight).destroyMfpFastClick()}c.arrowRight=c.arrowLeft=null})},next:function(){c.direction=true;c.index=R(c.index+1);c.updateItemHTML()},prev:function(){c.direction=false;c.index=R(c.index-1);c.updateItemHTML()},goTo:function(e){c.direction=e>=c.index;c.index=e;c.updateItemHTML()},preloadNearbyImages:function(){var e=c.st.gallery.preload,t=Math.min(e[0],c.items.length),n=Math.min(e[1],c.items.length),r;for(r=1;r<=(c.direction?n:t);r++){c._preloadItem(c.index+r)}for(r=1;r<=(c.direction?t:n);r++){c._preloadItem(c.index-r)}},_preloadItem:function(t){t=R(t);if(c.items[t].preloaded){return}var n=c.items[t];if(!n.parsed){n=c.parseEl(t)}x("LazyLoad",n);if(n.type==="image"){n.img=e('<img class="mfp-img" />').on("load.mfploader",function(){n.hasSize=true}).on("error.mfploader",function(){n.hasSize=true;n.loadError=true}).attr("src",n.src)}n.preloaded=true}}});var z="retina";e.magnificPopup.registerModule(z,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=c.st.retina,t=e.ratio;t=!isNaN(t)?t:t();if(t>1){E("ImageHasSize"+"."+z,function(e,n){n.img.css({"max-width":n.img[0].naturalWidth/t,width:"100%"})});E("ElementParse"+"."+z,function(n,r){r.src=e.replaceSrc(r,t)})}}}}});(function(){var t=1e3,n="ontouchstart"in window,r=function(){v.off("touchmove"+s+" touchend"+s)},i="mfpFastClick",s="."+i;e.fn.mfpFastClick=function(i){return e(this).each(function(){var o=e(this),u;if(n){var a,f,l,c,h,p;o.on("touchstart"+s,function(e){c=false;p=1;h=e.originalEvent?e.originalEvent.touches[0]:e.touches[0];f=h.clientX;l=h.clientY;v.on("touchmove"+s,function(e){h=e.originalEvent?e.originalEvent.touches:e.touches;p=h.length;h=h[0];if(Math.abs(h.clientX-f)>10||Math.abs(h.clientY-l)>10){c=true;r()}}).on("touchend"+s,function(e){r();if(c||p>1){return}u=true;e.preventDefault();clearTimeout(a);a=setTimeout(function(){u=false},t);i()})})}o.on("click"+s,function(){if(!u){i()}})})};e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+s+" click"+s);if(n)v.off("touchmove"+s+" touchend"+s)}})()})(window.jQuery||window.Zepto);$(function(){$("article").fitVids()});$(function(){$(".toc h3").click(function(){$("#drawer").toggleClass("hidden")})});$("a[href$='.jpg'],a[href$='.png'],a[href$='.gif']").addClass("image-popup");$(document).ready(function(){$(".image-popup").magnificPopup({type:"image",tLoading:"Loading image #%curr%...",gallery:{enabled:true,navigateByImgClick:true,preload:[0,1]},image:{tError:'<a href="%url%">Image #%curr%</a> could not be loaded.'},removalDelay:300,mainClass:"mfp-fade"})})