Vivid-Casper/assets/built/casper.js

2 lines
41 KiB
JavaScript
Raw Normal View History

!function(r){"use strict";r.fn.fitVids=function(e){var t,n,a={customSelector:null,ignore:null};return document.getElementById("fit-vids-style")||(t=document.head||document.getElementsByTagName("head")[0],(n=document.createElement("div")).innerHTML='<p>x</p><style id="fit-vids-style">.fluid-width-video-container{flex-grow: 1;width:100%;}.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>',t.appendChild(n.childNodes[1])),e&&r.extend(a,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];a.customSelector&&e.push(a.customSelector);var i=".fitvidsignore";a.ignore&&(i=i+", "+a.ignore);var t=r(this).find(e.join(","));(t=(t=t.not("object object")).not(i)).each(function(){var e,t,n=r(this);0<n.parents(i).length||"embed"===this.tagName.toLowerCase()&&n.parent("object").length||n.parent(".fluid-width-video-wrapper").length||(n.css("height")||n.css("width")||!isNaN(n.attr("height"))&&!isNaN(n.attr("width"))||(n.attr("height",9),n.attr("width",16)),e=("object"===this.tagName.toLowerCase()||n.attr("height")&&!isNaN(parseInt(n.attr("height"),10))?parseInt(n.attr("height"),10):n.height())/(isNaN(parseInt(n.attr("width"),10))?n.width():parseInt(n.attr("width"),10)),n.attr("name")||(t="fitvid"+r.fn.fitVids._count,n.attr("name",t),r.fn.fitVids._count++),n.wrap('<div class="fluid-width-video-container"><div class="fluid-width-video-wrapper"></div></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),n.removeAttr("height").removeAttr("width"))})})},r.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e){e.addEventListener("DOMContentLoaded",function(){e.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),n=e.attributes.width.value/e.attributes.height.value;t.style.flex=n+" 1 0%"})})}((window,document)),function(t,n){var i,a,r,o,s,l,d,c=n.querySelector("link[rel=next]");function p(){if(404===this.status)return t.removeEventListener("scroll",m),void t.removeEventListener("resize",f);this.response.querySelectorAll("article.post-card").forEach(function(e){i.appendChild(n.importNode(e,!0))});var e=this.response.querySelector("link[rel=next]");e?c.href=e.href:(t.removeEventListener("scroll",m),t.removeEventListener("resize",f)),d=n.documentElement.scrollHeight,o=r=!1}function e(){var e;o||(s+l<=d-a?r=!1:(o=!0,(e=new t.XMLHttpRequest).responseType="document",e.addEventListener("load",p),e.open("GET",c.href),e.send(null)))}function u(){r||t.requestAnimationFrame(e),r=!0}function m(){s=t.scrollY,u()}function f(){l=t.innerHeight,d=n.documentElement.scrollHeight,u()}!c||(i=n.querySelector(".post-feed"))&&(o=r=!(a=300),s=t.scrollY,l=t.innerHeight,d=n.documentElement.scrollHeight,t.addEventListener("scroll",m,{passive:!0}),t.addEventListener("resize",f),u())}(window,document);var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var l=/\blang(?:uage)?-(\w+)\b/i,t=0,$=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof o?new o(e.type,$.util.encode(e.content),e.alias):"Array"===$.util.type(e)?e.map($.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e,n){var t=$.util.type(e);switch(n=n||{},t){case"Object":if(n[$.util.objId(e)])return n[$.util.objId(e)];var i={};for(var a in n[$.util.objId(e)]=i,e)e.hasOwnProperty(a)&&(i[a]=$.util.clone(e[a],n));return i;case"Array":if(n[$.util.objId(e)])return n[$.util.objId(e)];i=[];return n[$.uti
//# sourceMappingURL=casper.js.map