mirror of
https://github.com/ViViDboarder/Vivid-Casper.git
synced 2024-11-14 09:16:31 +00:00
1 line
10 KiB
Plaintext
1 line
10 KiB
Plaintext
{"version":3,"sources":["jquery.fitvids.js","infinite-scroll.js"],"names":["$","fn","fitVids","options","head","div","settings","customSelector","ignore","document","getElementById","getElementsByTagName","createElement","innerHTML","appendChild","childNodes","extend","this","each","selectors","push","ignoreList","$allVideos","find","join","not","aspectRatio","videoName","$this","parents","length","tagName","toLowerCase","parent","css","isNaN","attr","parseInt","height","width","_count","wrap","removeAttr","window","jQuery","Zepto","feedElement","buffer","ticking","loading","lastScrollY","lastWindowHeight","lastDocumentHeight","nextElement","querySelector","onPageLoad","status","removeEventListener","onScroll","onResize","response","querySelectorAll","forEach","item","importNode","resNextElement","href","documentElement","scrollHeight","onUpdate","xhr","XMLHttpRequest","responseType","addEventListener","open","send","requestTick","requestAnimationFrame","scrollY","innerHeight","passive"],"mappings":"CAYA,SAAAA,gBAIAA,EAAAC,GAAAC,QAAA,SAAAC,GACA,IAOAC,EAEAC,EATAC,EAAA,CACAC,eAAA,KACAC,OAAA,MAgBA,OAbAC,SAAAC,eAAA,oBAEAN,EAAAK,SAAAL,MAAAK,SAAAE,qBAAA,QAAA,IAEAN,EAAAI,SAAAG,cAAA,QACAC,UAAA,oUACAT,EAAAU,YAAAT,EAAAU,WAAA,KAGAZ,GACAH,EAAAgB,OAAAV,EAAAH,GAGAc,KAAAC,KAAA,WACA,IAAAC,EAAA,CACA,kCACA,6BACA,sCACA,oDACA,SACA,SAGAb,EAAAC,gBACAY,EAAAC,KAAAd,EAAAC,gBAGA,IAAAc,EAAA,iBAEAf,EAAAE,SACAa,EAAAA,EAAA,KAAAf,EAAAE,QAGAc,EAAAtB,EAAAiB,MAAAM,KAAAJ,EAAAK,KAAA,OAEAF,GADAA,EAAAA,EAAAG,IAAA,kBACAA,IAAAJ,IAEAH,KAAA,WACA,IAYAQ,EAEAC,EAdAC,EAAA5B,EAAAiB,MACA,EAAAW,EAA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AAA,SAAAE,IAIAP,EAAA3C,EAAA0D,gBAAAC,aAEAnB,EADAD,GAAA,EAIA,SAAAqB,IAEA,IAYAC,EAZArB,IAKAC,EAAAC,GAAAC,EAAAL,EACAC,GAAA,GAIAC,GAAA,GAEAqB,EAAA,IAAA3B,EAAA4B,gBACAC,aAAA,WAEAF,EAAAG,iBAAA,OAAAlB,GAEAe,EAAAI,KAAA,MAAArB,EAAAa,MACAI,EAAAK,KAAA,QAGA,SAAAC,IACA5B,GAAAL,EAAAkC,sBAAAR,GACArB,GAAA,EAGA,SAAAU,IACAR,EAAAP,EAAAmC,QACAF,IAGA,SAAAjB,IACAR,EAAAR,EAAAoC,YACA3B,EAAA3C,EAAA0D,gBAAAC,aACAQ,KAtFAvB,IAKAP,EAAArC,EAAA6C,cAAA,iBAQAL,EADAD,IAFAD,EAAA,KAKAG,EAAAP,EAAAmC,QACA3B,EAAAR,EAAAoC,YACA3B,EAAA3C,EAAA0D,gBAAAC,aAwEAzB,EAAA8B,iBAAA,SAAAf,EAAA,CAAAsB,SAAA,IACArC,EAAA8B,iBAAA,SAAAd,GAEAiB,KA/FA,CAgGAjC,OAAAlC","file":"casper.js","sourcesContent":["/*jshint browser:true */\r\n/*!\r\n* FitVids 1.3\r\n*\r\n*\r\n* Copyright 2017, Chris Coyier + Dave Rupert + Ghost Foundation\r\n* This is an unofficial release, ported by John O'Nolan\r\n* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/\r\n* Released under the MIT license\r\n*\r\n*/\r\n\r\n;(function( $ ){\r\n\r\n 'use strict';\r\n\r\n $.fn.fitVids = function( options ) {\r\n var settings = {\r\n customSelector: null,\r\n ignore: null\r\n };\r\n\r\n if(!document.getElementById('fit-vids-style')) {\r\n // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js\r\n var head = document.head || document.getElementsByTagName('head')[0];\r\n var css = '.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%;}';\r\n var div = document.createElement(\"div\");\r\n div.innerHTML = '<p>x</p><style id=\"fit-vids-style\">' + css + '</style>';\r\n head.appendChild(div.childNodes[1]);\r\n }\r\n\r\n if ( options ) {\r\n $.extend( settings, options );\r\n }\r\n\r\n return this.each(function(){\r\n var selectors = [\r\n 'iframe[src*=\"player.vimeo.com\"]',\r\n 'iframe[src*=\"youtube.com\"]',\r\n 'iframe[src*=\"youtube-nocookie.com\"]',\r\n 'iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]',\r\n 'object',\r\n 'embed'\r\n ];\r\n\r\n if (settings.customSelector) {\r\n selectors.push(settings.customSelector);\r\n }\r\n\r\n var ignoreList = '.fitvidsignore';\r\n\r\n if(settings.ignore) {\r\n ignoreList = ignoreList + ', ' + settings.ignore;\r\n }\r\n\r\n var $allVideos = $(this).find(selectors.join(','));\r\n $allVideos = $allVideos.not('object object'); // SwfObj conflict patch\r\n $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.\r\n\r\n $allVideos.each(function(){\r\n var $this = $(this);\r\n if($this.parents(ignoreList).length > 0) {\r\n return; // Disable FitVids on this video.\r\n }\r\n if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }\r\n if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))\r\n {\r\n $this.attr('height', 9);\r\n $this.attr('width', 16);\r\n }\r\n var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),\r\n width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),\r\n aspectRatio = height / width;\r\n if(!$this.attr('name')){\r\n var videoName = 'fitvid' + $.fn.fitVids._count;\r\n $this.attr('name', videoName);\r\n $.fn.fitVids._count++;\r\n }\r\n $this.wrap('<div class=\"fluid-width-video-container\"><div class=\"fluid-width-video-wrapper\"></div></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');\r\n $this.removeAttr('height').removeAttr('width');\r\n });\r\n });\r\n };\r\n\r\n // Internal counter for unique video names.\r\n $.fn.fitVids._count = 0;\r\n\r\n// Works with either jQuery or Zepto\r\n})( window.jQuery || window.Zepto );\r\n","/* eslint-env browser */\r\n\r\n/**\r\n * Infinite Scroll\r\n * Used on all pages where there is a list of posts (homepage, tag index, etc).\r\n *\r\n * When the page is scrolled to 300px from the bottom, the next page of posts\r\n * is fetched by following the the <link rel=\"next\" href=\"...\"> that is output\r\n * by {{ghost_head}}.\r\n *\r\n * The individual post items are extracted from the fetched pages by looking for\r\n * a wrapper element with the class \"post-card\". Any found elements are appended\r\n * to the element with the class \"post-feed\" in the currently viewed page.\r\n */\r\n\r\n(function (window, document) {\r\n // next link element\r\n var nextElement = document.querySelector('link[rel=next]');\r\n if (!nextElement) {\r\n return;\r\n }\r\n\r\n // post feed element\r\n var feedElement = document.querySelector('.post-feed');\r\n if (!feedElement) {\r\n return;\r\n }\r\n\r\n var buffer = 300;\r\n\r\n var ticking = false;\r\n var loading = false;\r\n\r\n var lastScrollY = window.scrollY;\r\n var lastWindowHeight = window.innerHeight;\r\n var lastDocumentHeight = document.documentElement.scrollHeight;\r\n\r\n function onPageLoad() {\r\n if (this.status === 404) {\r\n window.removeEventListener('scroll', onScroll);\r\n window.removeEventListener('resize', onResize);\r\n return;\r\n }\r\n\r\n // append contents\r\n var postElements = this.response.querySelectorAll('article.post-card');\r\n postElements.forEach(function (item) {\r\n // document.importNode is important, without it the item's owner\r\n // document will be different which can break resizing of\r\n // `object-fit: cover` images in Safari\r\n feedElement.appendChild(document.importNode(item, true));\r\n });\r\n\r\n // set next link\r\n var resNextElement = this.response.querySelector('link[rel=next]');\r\n if (resNextElement) {\r\n nextElement.href = resNextElement.href;\r\n } else {\r\n window.removeEventListener('scroll', onScroll);\r\n window.removeEventListener('resize', onResize);\r\n }\r\n\r\n // sync status\r\n lastDocumentHeight = document.documentElement.scrollHeight;\r\n ticking = false;\r\n loading = false;\r\n }\r\n\r\n function onUpdate() {\r\n // return if already loading\r\n if (loading) {\r\n return;\r\n }\r\n\r\n // return if not scroll to the bottom\r\n if (lastScrollY + lastWindowHeight <= lastDocumentHeight - buffer) {\r\n ticking = false;\r\n return;\r\n }\r\n\r\n loading = true;\r\n\r\n var xhr = new window.XMLHttpRequest();\r\n xhr.responseType = 'document';\r\n\r\n xhr.addEventListener('load', onPageLoad);\r\n\r\n xhr.open('GET', nextElement.href);\r\n xhr.send(null);\r\n }\r\n\r\n function requestTick() {\r\n ticking || window.requestAnimationFrame(onUpdate);\r\n ticking = true;\r\n }\r\n\r\n function onScroll() {\r\n lastScrollY = window.scrollY;\r\n requestTick();\r\n }\r\n\r\n function onResize() {\r\n lastWindowHeight = window.innerHeight;\r\n lastDocumentHeight = document.documentElement.scrollHeight;\r\n requestTick();\r\n }\r\n\r\n window.addEventListener('scroll', onScroll, {passive: true});\r\n window.addEventListener('resize', onResize);\r\n\r\n requestTick();\r\n})(window, document);\r\n"]} |