Vivid-Casper/assets/built/casper.js

2 lines
42 KiB
JavaScript
Raw Normal View History

!function(a){"use strict";a.fn.fitVids=function(e){var n={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("div");i.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(i.childNodes[1])}return e&&a.extend(n,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"];n.customSelector&&e.push(n.customSelector);var i=".fitvidsignore";n.ignore&&(i=i+", "+n.ignore);var t=a(this).find(e.join(","));(t=(t=t.not("object object")).not(i)).each(function(){var e=a(this);if(!(0<e.parents(i).length||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var t=("object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height())/(isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10));if(!e.attr("name")){var n="fitvid"+a.fn.fitVids._count;e.attr("name",n),a.fn.fitVids._count++}e.wrap('<div class="fluid-width-video-container"><div class="fluid-width-video-wrapper"></div></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*t+"%"),e.removeAttr("height").removeAttr("width")}})})},a.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e,t){t.addEventListener("DOMContentLoaded",function(){t.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=n.querySelector("link[rel=next]");if(i){var a=n.querySelector(".post-feed");if(a){var r=300,o=!1,s=!1,l=t.scrollY,d=t.innerHeight,c=n.documentElement.scrollHeight;t.addEventListener("scroll",m,{passive:!0}),t.addEventListener("resize",f),u()}}function p(){if(404===this.status)return t.removeEventListener("scroll",m),void t.removeEventListener("resize",f);this.response.querySelectorAll(".post-card").forEach(function(e){a.appendChild(n.importNode(e,!0))});var e=this.response.querySelector("link[rel=next]");e?i.href=e.href:(t.removeEventListener("scroll",m),t.removeEventListener("resize",f)),c=n.documentElement.scrollHeight,s=o=!1}function e(){if(!s)if(l+d<=c-r)o=!1;else{s=!0;var e=new t.XMLHttpRequest;e.responseType="document",e.addEventListener("load",p),e.open("GET",i.href),e.send(null)}}function u(){o||t.requestAnimationFrame(e),o=!0}function m(){l=t.scrollY,u()}function f(){d=t.innerHeight,c=n.documentElement.scrollHeight,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=[];
//# sourceMappingURL=casper.js.map