liebling/assets/js/app.js

1 line
6.8 KiB
JavaScript
Raw Normal View History

2020-10-10 14:41:43 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1:function(e,t,n){"use strict";n.r(t),n.d(t,"isRTL",(function(){return o})),n.d(t,"isMobile",(function(){return a})),n.d(t,"isDarkMode",(function(){return i})),n.d(t,"formatDate",(function(){return s})),n.d(t,"getParameterByName",(function(){return r})),n.d(t,"adjustImageGallery",(function(){return c})),n.d(t,"managePostImages",(function(){return l})),n.d(t,"makeImagesZoomable",(function(){return d}));var o=function(){var e=document.querySelector("html");return["ar","he","fa"].includes(e.getAttribute("lang"))},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(e,")")).matches},i=function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return e&&e.matches},s=function(e){return e?new Date(e).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},r=function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]".concat(e,"(=([^&#]*)|&|#|$)")).exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},c=function(){for(var e=document.querySelectorAll(".kg-gallery-image img"),t=0,n=e.length;t<n;t++){var o=e[t].closest(".kg-gallery-image"),a=e[t].attributes.width.value/e[t].attributes.height.value;o.style.flex="".concat(a," 1 0%")}},l=function(e){e(".js-post-content").find("img").each((function(){e(this).closest("figure").hasClass("kg-bookmark-card")||e(this).parent().is("a")||e(this).addClass("js-zoomable");var t=e(this).parent().find("figcaption");t?e(this).attr("alt",t.text()):e(this).attr("alt","")}))},d=function(e,t){t(".js-zoomable").on("opened",(function(){setTimeout((function(){e(".medium-zoom-image--opened").last().hide()}),10)}))}},13:function(e,t,n){e.exports=n(14)},14:function(e,t,n){"use strict";n.r(t);var o=n(0),a=n.n(o),i=n(8),s=n.n(i),r=n(2),c=n(6),l=n(3),d=n(10),u=n.n(d),m=n(11),h=n(1);a()(document).ready((function(){Object(h.isRTL)()&&a()("html").attr("dir","rtl").addClass("rtl");var e,t,n=a()("body"),o=a()(".js-header"),i=a()(".js-open-menu"),d=a()(".js-close-menu"),f=a()(".js-menu"),g=a()(".js-toggle-submenu"),p=a()(".js-submenu-option")[0],v=a()(".js-submenu"),w=a()(".js-recent-slider"),b=a()(".js-open-secondary-menu"),j=a()(".js-open-search"),k=a()(".js-close-search"),y=a()(".js-search"),C=a()(".js-input-search"),O=a()(".js-search-results"),T=a()(".js-no-results"),S=a()(".js-toggle-darkmode"),M=a()(".js-notification-close"),x=a()(".js-main-nav"),_=a()(".js-main-nav-left"),I=localStorage.getItem("theme"),L=null,A=!1,D=null,B=function(){o.removeClass("submenu-is-active"),g.removeClass("active"),v.removeClass("opened").addClass("closed")},E=function(){n.toggleClass("no-scroll-y")},H=function(e,t){var n=new GhostContentAPI({url:e,key:t,version:"v2"}),o=[],a={shouldSort:!0,ignoreLocation:!0,findAllMatches:!0,includeScore:!0,minMatchCharLength:2,keys:["title","custom_excerpt","tags.name"]};n.posts.browse({limit:"all",include:"tags",fields:"id, title, url, published_at, custom_excerpt"}).then((function(e){for(var t=0,n=e.length;t<n;t++)o.push(e[t]);L=new m.a(o,a)})).catch((function(e){console.log(e)}))},P=function(e){var t=a()('.js-alert[data-notification="'.concat(e,'"]'));t.addClass("opened"),setTimeout((function(){R(t)}),5e3)},R=function(e){e.removeClass("opened");var t=window.location.toString();if(t.indexOf("?")>0){var n=t.substring(0,t.indexOf("?"));window.history.replaceState({},document.title,n)}},V=function(e){Object(h.isMobile)()||(e?(x.addClass("toggle-overflow"),_.addClass("toggle-overflow")):(x.removeClass("toggle-overflow"),_.removeClass("toggle-overflow")))};(i.click((function(){o.addClass("mobile-menu-opened"),f.addClass("opened"),E()})),d.click((function(){o.removeClass("mobile-menu-opened"),f.removeClass("opened"),E()})),g.click((function(){(A=!A)?(o.addClass("submenu-is-active"),g.addClass("active"),v.removeClass("closed").addClass("opened")):B()})),j.click((function(){y.addClass("opened"),setTimeout((function(){C.focus()}),400),E()})),k.click(