From aaf3df1c84534c0dfe4961dfc5b7925b250b23ed Mon Sep 17 00:00:00 2001 From: Eduardo Gomez Date: Sat, 10 Oct 2020 17:01:31 +0200 Subject: [PATCH] Generate assets for production --- assets/js/app.js | 2 +- assets/js/helpers.js | 2 +- assets/js/home.js | 2 +- assets/js/page.js | 2 +- assets/js/post.js | 2 +- src/js/helpers.js | 4 +++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 5232057..b77f92a 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1 +1 @@ -(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;t0){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((function(){C.blur(),y.removeClass("opened"),E()})),C.keyup((function(){if(C.val().length>0&&L){var e=L.search(C.val()).filter((function(e){if(e.score<=.5)return e})),t="";if(e.length>0){for(var n=0,o=e.length;n

').concat(e[n].item.title,'

').concat(Object(h.formatDate)(e[n].item.published_at),"
");T.hide(),O.html(t),O.show()}else O.html(""),O.hide(),T.show()}else O.html(""),O.hide(),T.hide()})),S.change((function(){S.is(":checked")?(a()("html").attr("data-theme","dark"),localStorage.setItem("theme","dark")):(a()("html").attr("data-theme","light"),localStorage.setItem("theme","light"))})),S.hover((function(){V(!0)}),(function(){V(!1)})),M.click((function(){R(a()(this).parent())})),a()(window).click((function(e){A&&p&&!p.contains(e.target)&&(A=!1,B())})),a()(document).keyup((function(e){"Escape"===e.key&&y.hasClass("opened")&&k.click()})),I?(a()("html").attr("data-theme",I),"dark"===I&&S.attr("checked",!0)):Object(h.isDarkMode)()&&S.attr("checked",!0),o.length>0)&&new s.a(o[0],{tolerance:{down:10,up:20},offset:15,onUnpin:function(){if(!Object(h.isMobile)()&&D){var e=D[0];e&&e.state.isVisible&&e.hide()}}}).init();if(w.length>0){var z=new r.d(".js-recent-slider",{type:"slider",rewind:!1,perView:4,swipeThreshold:!1,dragThreshold:!1,gap:0,direction:Object(h.isRTL)()?"rtl":"ltr",breakpoints:{1024:{perView:3,swipeThreshold:80,dragThreshold:120},768:{perView:2,swipeThreshold:80,dragThreshold:120,peek:{before:0,after:115}},568:{perView:1,swipeThreshold:80,dragThreshold:120,peek:{before:0,after:115}}}});z.on("mount.after",(function(){Object(l.a)(".js-recent-article-title",50)})),z.mount({Swipe:r.c,Breakpoints:r.a})}if("undefined"!=typeof disableFadeAnimation&&disableFadeAnimation?a()("[data-aos]").addClass("no-aos-animation"):u.a.init({once:!0,startEvent:"DOMContentLoaded"}),b.length>0){var N=document.getElementById("secondary-navigation-template");D=Object(c.a)(".js-open-secondary-menu",{content:N.innerHTML,allowHTML:!0,arrow:!0,trigger:"click",interactive:!0,onShow:function(){V(!0)},onHidden:function(){V(!1)}})}Object(c.a)(".js-tooltip"),Object(l.a)(".js-article-card-title",100),Object(l.a)(".js-article-card-title-no-image",250),e=Object(h.getParameterByName)("action"),t=Object(h.getParameterByName)("stripe"),"subscribe"===e&&P("subscribe"),"signup"===e&&(window.location="".concat(ghostHost,"/signup/?action=checkout")),"checkout"===e&&P("signup"),"signin"===e&&P("signin"),"success"===t&&P("checkout"),"undefined"!=typeof ghostSearchApiKey?H(ghostHost,ghostSearchApiKey):(j.css("visibility","hidden"),k.remove(),y.remove())}))}},[[13,0,1]]]); \ No newline at end of file +(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;t1&&t.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;t0){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((function(){C.blur(),y.removeClass("opened"),E()})),C.keyup((function(){if(C.val().length>0&&L){var e=L.search(C.val()).filter((function(e){if(e.score<=.5)return e})),t="";if(e.length>0){for(var n=0,o=e.length;n

').concat(e[n].item.title,'

').concat(Object(h.formatDate)(e[n].item.published_at),"
");T.hide(),O.html(t),O.show()}else O.html(""),O.hide(),T.show()}else O.html(""),O.hide(),T.hide()})),S.change((function(){S.is(":checked")?(a()("html").attr("data-theme","dark"),localStorage.setItem("theme","dark")):(a()("html").attr("data-theme","light"),localStorage.setItem("theme","light"))})),S.hover((function(){V(!0)}),(function(){V(!1)})),M.click((function(){R(a()(this).parent())})),a()(window).click((function(e){A&&p&&!p.contains(e.target)&&(A=!1,B())})),a()(document).keyup((function(e){"Escape"===e.key&&y.hasClass("opened")&&k.click()})),I?(a()("html").attr("data-theme",I),"dark"===I&&S.attr("checked",!0)):Object(h.isDarkMode)()&&S.attr("checked",!0),o.length>0)&&new s.a(o[0],{tolerance:{down:10,up:20},offset:15,onUnpin:function(){if(!Object(h.isMobile)()&&D){var e=D[0];e&&e.state.isVisible&&e.hide()}}}).init();if(w.length>0){var z=new r.d(".js-recent-slider",{type:"slider",rewind:!1,perView:4,swipeThreshold:!1,dragThreshold:!1,gap:0,direction:Object(h.isRTL)()?"rtl":"ltr",breakpoints:{1024:{perView:3,swipeThreshold:80,dragThreshold:120},768:{perView:2,swipeThreshold:80,dragThreshold:120,peek:{before:0,after:115}},568:{perView:1,swipeThreshold:80,dragThreshold:120,peek:{before:0,after:115}}}});z.on("mount.after",(function(){Object(l.a)(".js-recent-article-title",50)})),z.mount({Swipe:r.c,Breakpoints:r.a})}if("undefined"!=typeof disableFadeAnimation&&disableFadeAnimation?a()("[data-aos]").addClass("no-aos-animation"):u.a.init({once:!0,startEvent:"DOMContentLoaded"}),b.length>0){var N=document.getElementById("secondary-navigation-template");D=Object(c.a)(".js-open-secondary-menu",{content:N.innerHTML,allowHTML:!0,arrow:!0,trigger:"click",interactive:!0,onShow:function(){V(!0)},onHidden:function(){V(!1)}})}Object(c.a)(".js-tooltip"),Object(l.a)(".js-article-card-title",100),Object(l.a)(".js-article-card-title-no-image",250),e=Object(h.getParameterByName)("action"),t=Object(h.getParameterByName)("stripe"),"subscribe"===e&&P("subscribe"),"signup"===e&&(window.location="".concat(ghostHost,"/signup/?action=checkout")),"checkout"===e&&P("signup"),"signin"===e&&P("signin"),"success"===t&&P("checkout"),"undefined"!=typeof ghostSearchApiKey?H(ghostHost,ghostSearchApiKey):(j.css("visibility","hidden"),k.remove(),y.remove())}))}},[[13,0,1]]]); \ No newline at end of file diff --git a/assets/js/helpers.js b/assets/js/helpers.js index ae5c3ee..e7c2d81 100644 --- a/assets/js/helpers.js +++ b/assets/js/helpers.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(t,n,e){"use strict";e.r(n),e.d(n,"isRTL",(function(){return o})),e.d(n,"isMobile",(function(){return a})),e.d(n,"isDarkMode",(function(){return i})),e.d(n,"formatDate",(function(){return r})),e.d(n,"getParameterByName",(function(){return c})),e.d(n,"adjustImageGallery",(function(){return u})),e.d(n,"managePostImages",(function(){return s})),e.d(n,"makeImagesZoomable",(function(){return d}));var o=function(){var t=document.querySelector("html");return["ar","he","fa"].includes(t.getAttribute("lang"))},a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(t,")")).matches},i=function(){var t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return t&&t.matches},r=function(t){return t?new Date(t).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},c=function(t,n){n||(n=window.location.href),t=t.replace(/[\[\]]/g,"\\$&");var e=new RegExp("[?&]".concat(t,"(=([^&#]*)|&|#|$)")).exec(n);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null},u=function(){for(var t=document.querySelectorAll(".kg-gallery-image img"),n=0,e=t.length;n0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(t,")")).matches},i=function(){var t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return t&&t.matches},r=function(t){return t?new Date(t).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},c=function(t,n){n||(n=window.location.href),t=t.replace(/[\[\]]/g,"\\$&");var e=new RegExp("[?&]".concat(t,"(=([^&#]*)|&|#|$)")).exec(n);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null},u=function(){for(var t=document.querySelectorAll(".kg-gallery-image img"),n=0,e=t.length;n1&&n.last().hide()}),10)}))}},12:function(t,n,e){e(1),e(22),e(27),e(29),e(31),e(33),e(35),t.exports=e(37)},22:function(t,n){},27:function(t,n){},29:function(t,n){},31:function(t,n){},33:function(t,n){},35:function(t,n){},37:function(t,n){}},[[12,0,1]]]); \ No newline at end of file diff --git a/assets/js/home.js b/assets/js/home.js index 03e1b3c..5eb3cef 100644 --- a/assets/js/home.js +++ b/assets/js/home.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{1:function(e,t,n){"use strict";n.r(t),n.d(t,"isRTL",(function(){return r})),n.d(t,"isMobile",(function(){return i})),n.d(t,"isDarkMode",(function(){return a})),n.d(t,"formatDate",(function(){return o})),n.d(t,"getParameterByName",(function(){return s})),n.d(t,"adjustImageGallery",(function(){return u})),n.d(t,"managePostImages",(function(){return d})),n.d(t,"makeImagesZoomable",(function(){return c}));var r=function(){var e=document.querySelector("html");return["ar","he","fa"].includes(e.getAttribute("lang"))},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(e,")")).matches},a=function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return e&&e.matches},o=function(e){return e?new Date(e).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},s=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},u=function(){for(var e=document.querySelectorAll(".kg-gallery-image img"),t=0,n=e.length;t0){var t=e.find(".js-featured-slide").length,n=new o.d(".js-featured-slider",{type:"slider",rewind:!1,gap:0,swipeThreshold:!1,dragThreshold:!1,direction:Object(s.isRTL)()?"rtl":"ltr",breakpoints:{768:{swipeThreshold:1!==t&&80,dragThreshold:1!==t&&120}}});1===t&&e.find(".js-featured-slider-controls").remove(),n.on("mount.after",(function(){Object(a.a)(".js-featured-article-title",200)})),n.mount({Controls:o.b,Swipe:o.c,Breakpoints:o.a,ArrowDisabler:function(e,n){var r="js-featured-slider-controls",i="js-featured-slider-previous",a="js-featured-slider-next";return{mount:function(){e.settings.rewind||1===t||e.on(["mount.after","run"],(function(){var t=!0,o=!1,s=void 0;try{for(var u,d=n.Controls.items[Symbol.iterator]();!(t=(u=d.next()).done);t=!0){var c=u.value;if(c.className.includes(r)){var l=c.querySelector(".".concat(i));l&&(0===e.index?l.setAttribute("disabled",""):l.removeAttribute("disabled"));var f=c.querySelector(".".concat(a));if(f)(e.settings.bound?e.index+(e.settings.perView-1):e.index)===n.Sizes.length-1?f.setAttribute("disabled",""):f.removeAttribute("disabled")}}}catch(e){o=!0,s=e}finally{try{t||null==d.return||d.return()}finally{if(o)throw s}}}))}}}}),setTimeout((function(){window.dispatchEvent(new Event("resize"))}),350)}Object(a.a)(".js-featured-article-title",200)}))}},[[16,0,1]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{1:function(e,t,n){"use strict";n.r(t),n.d(t,"isRTL",(function(){return r})),n.d(t,"isMobile",(function(){return i})),n.d(t,"isDarkMode",(function(){return a})),n.d(t,"formatDate",(function(){return o})),n.d(t,"getParameterByName",(function(){return s})),n.d(t,"adjustImageGallery",(function(){return u})),n.d(t,"managePostImages",(function(){return d})),n.d(t,"makeImagesZoomable",(function(){return c}));var r=function(){var e=document.querySelector("html");return["ar","he","fa"].includes(e.getAttribute("lang"))},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(e,")")).matches},a=function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return e&&e.matches},o=function(e){return e?new Date(e).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},s=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},u=function(){for(var e=document.querySelectorAll(".kg-gallery-image img"),t=0,n=e.length;t1&&t.last().hide()}),10)}))}},16:function(e,t,n){e.exports=n(17)},17:function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),a=n(3),o=n(2),s=n(1);i()(document).ready((function(){var e=i()(".js-featured-slider");if(e.length>0){var t=e.find(".js-featured-slide").length,n=new o.d(".js-featured-slider",{type:"slider",rewind:!1,gap:0,swipeThreshold:!1,dragThreshold:!1,direction:Object(s.isRTL)()?"rtl":"ltr",breakpoints:{768:{swipeThreshold:1!==t&&80,dragThreshold:1!==t&&120}}});1===t&&e.find(".js-featured-slider-controls").remove(),n.on("mount.after",(function(){Object(a.a)(".js-featured-article-title",200)})),n.mount({Controls:o.b,Swipe:o.c,Breakpoints:o.a,ArrowDisabler:function(e,n){var r="js-featured-slider-controls",i="js-featured-slider-previous",a="js-featured-slider-next";return{mount:function(){e.settings.rewind||1===t||e.on(["mount.after","run"],(function(){var t=!0,o=!1,s=void 0;try{for(var u,d=n.Controls.items[Symbol.iterator]();!(t=(u=d.next()).done);t=!0){var c=u.value;if(c.className.includes(r)){var l=c.querySelector(".".concat(i));l&&(0===e.index?l.setAttribute("disabled",""):l.removeAttribute("disabled"));var f=c.querySelector(".".concat(a));if(f)(e.settings.bound?e.index+(e.settings.perView-1):e.index)===n.Sizes.length-1?f.setAttribute("disabled",""):f.removeAttribute("disabled")}}}catch(e){o=!0,s=e}finally{try{t||null==d.return||d.return()}finally{if(o)throw s}}}))}}}}),setTimeout((function(){window.dispatchEvent(new Event("resize"))}),350)}Object(a.a)(".js-featured-article-title",200)}))}},[[16,0,1]]]); \ No newline at end of file diff --git a/assets/js/page.js b/assets/js/page.js index 08428e8..c974283 100644 --- a/assets/js/page.js +++ b/assets/js/page.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{1:function(e,t,n){"use strict";n.r(t),n.d(t,"isRTL",(function(){return a})),n.d(t,"isMobile",(function(){return o})),n.d(t,"isDarkMode",(function(){return r})),n.d(t,"formatDate",(function(){return i})),n.d(t,"getParameterByName",(function(){return c})),n.d(t,"adjustImageGallery",(function(){return u})),n.d(t,"managePostImages",(function(){return s})),n.d(t,"makeImagesZoomable",(function(){return m}));var a=function(){var e=document.querySelector("html");return["ar","he","fa"].includes(e.getAttribute("lang"))},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(e,")")).matches},r=function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return e&&e.matches},i=function(e){return e?new Date(e).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},c=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},u=function(){for(var e=document.querySelectorAll(".kg-gallery-image img"),t=0,n=e.length;t0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(e,")")).matches},r=function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return e&&e.matches},i=function(e){return e?new Date(e).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},c=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},u=function(){for(var e=document.querySelectorAll(".kg-gallery-image img"),t=0,n=e.length;t1&&t.last().hide()}),10)}))}},20:function(e,t,n){e.exports=n(21)},21:function(e,t,n){"use strict";n.r(t);var a=n(0),o=n.n(a),r=n(5),i=n.n(r),c=n(4),u=n(1);o()(document).ready((function(){i()(".js-post-content"),Object(u.adjustImageGallery)(),Object(u.managePostImages)(o.a),Object(u.makeImagesZoomable)(o.a,c.a)}))}},[[20,0,1]]]); \ No newline at end of file diff --git a/assets/js/post.js b/assets/js/post.js index b36225c..e87abd8 100644 --- a/assets/js/post.js +++ b/assets/js/post.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{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 r})),n.d(t,"formatDate",(function(){return i})),n.d(t,"getParameterByName",(function(){return s})),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},r=function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return e&&e.matches},i=function(e){return e?new Date(e).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},s=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;t0){var i=new l.d(".js-recommended-slider",{type:"slider",rewind:!1,perView:3,swipeThreshold:!1,dragThreshold:!1,gap:0,direction:Object(d.isRTL)()?"rtl":"ltr",breakpoints:{1023:{type:"carousel",perView:2,swipeThreshold:80,dragThreshold:120},720:{type:"carousel",perView:2,swipeThreshold:80,dragThreshold:120},568:{type:"carousel",perView:1,swipeThreshold:80,dragThreshold:120}}});i.on("mount.after",(function(){Object(c.a)(".js-article-card-title",100),Object(c.a)(".js-article-card-title-no-image",250)})),i.on("length.change",(function(e){1===e&&(i.update({type:"slider"}),o.find(".js-controls").remove())})),i.mount({Controls:l.b,Swipe:l.c,Breakpoints:l.a,Length:function(e,t,n){return{mount:function(){n.emit("length.change",t.Sizes.length)}}}})}Object(c.a)(".js-article-card-title",100),Object(c.a)(".js-article-card-title-no-image",250),e.click((function(){a()("html, body").animate({scrollTop:0},500)})),t.click((function(){t.parent().hide(),n.fadeIn("slow")})),Object(d.managePostImages)(a.a),Object(d.makeImagesZoomable)(a.a,r.a),window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",y,{passive:!0})})),a()(window).on("load",(function(){m=a()(".js-progress"),T(),O(),k(),setTimeout((function(){m.parent().css("opacity",1)}),300)}))}},[[18,0,1]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{1:function(e,t,n){"use strict";n.r(t),n.d(t,"isRTL",(function(){return a})),n.d(t,"isMobile",(function(){return o})),n.d(t,"isDarkMode",(function(){return r})),n.d(t,"formatDate",(function(){return i})),n.d(t,"getParameterByName",(function(){return s})),n.d(t,"adjustImageGallery",(function(){return c})),n.d(t,"managePostImages",(function(){return l})),n.d(t,"makeImagesZoomable",(function(){return d}));var a=function(){var e=document.querySelector("html");return["ar","he","fa"].includes(e.getAttribute("lang"))},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"768px";return window.matchMedia("(max-width: ".concat(e,")")).matches},r=function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");return e&&e.matches},i=function(e){return e?new Date(e).toLocaleDateString(document.documentElement.lang,{year:"numeric",month:"long",day:"numeric"}):""},s=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;t1&&t.last().hide()}),10)}))}},18:function(e,t,n){e.exports=n(19)},19:function(e,t,n){"use strict";n.r(t);var a=n(0),o=n.n(a),r=n(4),i=n(5),s=n.n(i),c=n(3),l=n(2),d=n(1),u=null,m=null,f=window.pageYOffset,h=0,p=0,g=0,w=!1,b=function(){f=window.pageYOffset,v()},j=function(e){Object(d.isMobile)("1023px")?(o()("body").addClass("share-menu-displayed"),setTimeout((function(){u.removeAttr("data-aos")}),e)):o()("body").removeClass("share-menu-displayed")},y=function(){T(),j(100),setTimeout((function(){O(),v()}),200)},v=function(){w||requestAnimationFrame(k),w=!0},k=function(){var e=p-h,t=Math.ceil(f/e*100);t<=100&&x(t),w=!1},T=function(){h=window.innerHeight,p=o()(document).height()},O=function(){var e=m.parent().width(),t=e/2,n=Object(d.isMobile)()?2:3;m.parent().attr("viewBox","0 0 ".concat(e," ").concat(e)),m.attr("stroke-width",n),m.attr("r",t-(n-1)),m.attr("cx",t),m.attr("cy",t),g=2*t*Math.PI,m[0].style.strokeDasharray="".concat(g," ").concat(g),m[0].style.strokeDashoffset=g},x=function(e){if(e<=100){var t=g-e/100*g;m[0].style.strokeDashoffset=t}};o()(document).ready((function(){u=o()(".js-aos-wrapper");var e=o()(".js-scrolltop"),t=o()(".js-load-comments"),n=o()(".js-comments-iframe"),a=o()(".js-recommended-slider");if(s()(".js-post-content"),Object(d.adjustImageGallery)(),j(1e3),a.length>0){var i=new l.d(".js-recommended-slider",{type:"slider",rewind:!1,perView:3,swipeThreshold:!1,dragThreshold:!1,gap:0,direction:Object(d.isRTL)()?"rtl":"ltr",breakpoints:{1023:{type:"carousel",perView:2,swipeThreshold:80,dragThreshold:120},720:{type:"carousel",perView:2,swipeThreshold:80,dragThreshold:120},568:{type:"carousel",perView:1,swipeThreshold:80,dragThreshold:120}}});i.on("mount.after",(function(){Object(c.a)(".js-article-card-title",100),Object(c.a)(".js-article-card-title-no-image",250)})),i.on("length.change",(function(e){1===e&&(i.update({type:"slider"}),a.find(".js-controls").remove())})),i.mount({Controls:l.b,Swipe:l.c,Breakpoints:l.a,Length:function(e,t,n){return{mount:function(){n.emit("length.change",t.Sizes.length)}}}})}Object(c.a)(".js-article-card-title",100),Object(c.a)(".js-article-card-title-no-image",250),e.click((function(){o()("html, body").animate({scrollTop:0},500)})),t.click((function(){t.parent().hide(),n.fadeIn("slow")})),Object(d.managePostImages)(o.a),Object(d.makeImagesZoomable)(o.a,r.a),window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",y,{passive:!0})})),o()(window).on("load",(function(){m=o()(".js-progress"),T(),O(),k(),setTimeout((function(){m.parent().css("opacity",1)}),300)}))}},[[18,0,1]]]); \ No newline at end of file diff --git a/src/js/helpers.js b/src/js/helpers.js index 52722af..40a38a5 100644 --- a/src/js/helpers.js +++ b/src/js/helpers.js @@ -80,7 +80,9 @@ export const makeImagesZoomable = ($, mediumZoom) => { zoom.on('opened', () => { setTimeout(() => { const $mediumZoomImages = $('.medium-zoom-image--opened') - $mediumZoomImages.last().hide() + if ($mediumZoomImages.length > 1) { + $mediumZoomImages.last().hide() + } }, 10) }) }