liebling/assets/js/post.js

1 line
17 KiB
JavaScript
Raw Normal View History

2019-03-03 18:32:36 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{2:function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i=function(e){return"IMG"===e.tagName},r=function(e){return e&&1===e.nodeType},s=function(e){return".svg"===(e.currentSrc||e.src).substr(-4).toLowerCase()},a=function(e){try{return Array.isArray(e)?e.filter(i):function(e){return NodeList.prototype.isPrototypeOf(e)}(e)?[].slice.call(e).filter(i):r(e)?[e].filter(i):"string"==typeof e?[].slice.call(document.querySelectorAll(e)).filter(i):[]}catch(e){throw new TypeError("The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom")}},c=function(e,t){var o=n({bubbles:!1,cancelable:!1,detail:void 0},t);if("function"==typeof window.CustomEvent)return new CustomEvent(e,o);var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,o.bubbles,o.cancelable,o.detail),i},l=window.Promise||function(e){function t(){}e(t,t)};!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}"),t.a=function e(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];var n=t.reduce(function(e,t){return[].concat(e,a(t))},[]);return n.filter(function(e){return-1===f.indexOf(e)}).forEach(function(e){f.push(e),e.classList.add("medium-zoom-image")}),p.forEach(function(e){var t=e.type,o=e.listener,i=e.options;n.forEach(function(e){e.addEventListener(t,o,i)})}),b},d=function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).target,t=function(){var e=Math.min,t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},o=void 0,i=void 0;if(v.container)if(v.container instanceof Object)o=(t=n({},t,v.container)).width-t.left-t.right-2*v.margin,i=t.height-t.top-t.bottom-2*v.margin;else{var a=(r(v.container)?v.container:document.querySelector(v.container)).getBoundingClientRect(),c=a.width,l=a.height,d=a.left,u=a.top;t=n({},t,{width:c,height:l,left:d,top:u})}o=o||t.width-2*v.margin,i=i||t.height-2*v.margin;var m=y.zoomedHd||y.original,f=s(m)?o:m.naturalWidth||o,p=s(m)?i:m.naturalHeight||i,h=m.getBoundingClientRect(),g=h.top,w=h.left,b=h.width,z=h.height,k=e(f,o)/b,E=e(p,i)/z,C=e(k,E),S="scale("+C+") translate3d("+((o-b)/2-w+v.margin+t.left)/C+"px, "+((i-z)/2-g+v.margin+t.top)/C+"px, 0)";y.zoomed.style.transform=S,y.zoomedHd&&(y.zoomedHd.style.transform=S)};return new l(function(o){if(e&&-1===f.indexOf(e))o(b);else if(y.zoomed)o(b);else{if(e)y.original=e;else{if(!(0<f.length))return void o(b);var n=f;y.original=n[0]}if(y.original.dispatchEvent(c("medium-zoom:open",{detail:{zoom:b}})),g=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,h=!0,y.zoomed=function(e){var t=e.getBoundingClientRect(),o=t.top,n=t.left,i=t.width,r=t.height,s=e.cloneNode(),a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,c=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return s.removeAttribute("id"),s.style.position="absolute",s.style.top=o+a+"px",s.style.left=n+c+"px",s.style.width=i+"px",s.styl