assets/js/dist/commons.min.js in jekyll-theme-chirpy-6.2.3 vs assets/js/dist/commons.min.js in jekyll-theme-chirpy-6.3.0

- old
+ new

@@ -1,4 +1,4 @@ /*! - * Chirpy v6.2.3 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/ + * Chirpy v6.3.0 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/ */ -!function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function r(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var l=$(".mode-toggle");var s=$("body"),u="sidebar-display",c=function(){function t(){e(this,t)}return r(t,null,[{key:"toggle",value:function(){!1===t.isExpanded?s.attr(u,""):s.removeAttr(u),t.isExpanded=!t.isExpanded}}]),t}();n(c,"isExpanded",!1);var f=$("#sidebar-trigger"),d=$("#search-trigger"),p=$("#search-cancel"),b=$("#main-wrapper>.container>.row"),m=$("#topbar-title"),v=$("search"),y=$("#search-result-wrapper"),g=$("#search-results"),h=$("#search-input"),C=$("#search-hints"),w=$("html,body"),k="loaded",A="unloaded",S="input-focus",T="d-flex",j=function(){function t(){e(this,t)}return r(t,null,[{key:"on",value:function(){t.offset=window.scrollY,w.scrollTop(0)}},{key:"off",value:function(){w.scrollTop(t.offset)}}]),t}();n(j,"offset",0),n(j,"resultVisible",!1);var E,O,x=function(){function t(){e(this,t)}return r(t,null,[{key:"on",value:function(){f.addClass(A),m.addClass(A),d.addClass(A),v.addClass(T),p.addClass(k)}},{key:"off",value:function(){p.removeClass(k),v.removeClass(T),f.removeClass(A),m.removeClass(A),d.removeClass(A)}}]),t}(),P=function(){function t(){e(this,t)}return r(t,null,[{key:"on",value:function(){j.resultVisible||(j.on(),y.removeClass(A),b.addClass(A),j.resultVisible=!0)}},{key:"off",value:function(){j.resultVisible&&(g.empty(),C.hasClass(A)&&C.removeClass(A),y.addClass(A),b.removeClass(A),j.off(),h.val(""),j.resultVisible=!1)}}]),t}();function V(){return p.hasClass(k)}E=$(window),O=$("#back-to-top"),E.on("scroll",(function(){E.scrollTop()>50?O.fadeIn():O.fadeOut()})),O.on("click",(function(){E.scrollTop(0)})),o(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(e){return new bootstrap.Tooltip(e)})),0!==l.length&&l.off().on("click",(function(e){var t=$(e.target),r=t.prop("tagName")==="button".toUpperCase()?t:t.parent();modeToggle.flipMode(),r.trigger("blur")})),$("#sidebar-trigger").on("click",c.toggle),$("#mask").on("click",c.toggle),d.on("click",(function(){x.on(),P.on(),h.trigger("focus")})),p.on("click",(function(){x.off(),P.off()})),h.on("focus",(function(){v.addClass(S)})),h.on("focusout",(function(){v.removeClass(S)})),h.on("input",(function(){""===h.val()?V()?C.removeClass(A):P.off():(P.on(),V()&&C.addClass(A))}))}(); +!function(){"use strict";const e=$(".mode-toggle");function s(e,s,o){return(s=function(e){var s=function(e,s){if("object"!=typeof e||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var t=o.call(e,s||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:String(s)}(s))in e?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o,e}const o=$("body"),t="sidebar-display";class r{static toggle(){!1===r.isExpanded?o.attr(t,""):o.removeAttr(t),r.isExpanded=!r.isExpanded}}s(r,"isExpanded",!1);const a=$("#sidebar-trigger"),l=$("#search-trigger"),i=$("#search-cancel"),n=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),d=$("search"),f=$("#search-result-wrapper"),u=$("#search-results"),p=$("#search-input"),g=$("#search-hints"),m=$("html,body"),b="loaded",v="unloaded",C="input-focus",h="d-flex";class y{static on(){y.offset=window.scrollY,m.scrollTop(0)}static off(){m.scrollTop(y.offset)}}s(y,"offset",0),s(y,"resultVisible",!1);class w{static on(){a.addClass(v),c.addClass(v),l.addClass(v),d.addClass(h),i.addClass(b)}static off(){i.removeClass(b),d.removeClass(h),a.removeClass(v),c.removeClass(v),l.removeClass(v)}}class k{static on(){y.resultVisible||(y.on(),f.removeClass(v),n.addClass(v),y.resultVisible=!0)}static off(){y.resultVisible&&(u.empty(),g.hasClass(v)&&g.removeClass(v),f.addClass(v),n.removeClass(v),y.off(),p.val(""),y.resultVisible=!1)}}function T(){return i.hasClass(b)}!function(){const e=$(window),s=$("#back-to-top");e.on("scroll",(()=>{e.scrollTop()>50?s.fadeIn():s.fadeOut()})),s.on("click",(()=>{e.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((e=>new bootstrap.Tooltip(e))),0!==e.length&&e.off().on("click",(e=>{const s=$(e.target);let o=s.prop("tagName")==="button".toUpperCase()?s:s.parent();modeToggle.flipMode(),o.trigger("blur")})),$("#sidebar-trigger").on("click",r.toggle),$("#mask").on("click",r.toggle),l.on("click",(function(){w.on(),k.on(),p.trigger("focus")})),i.on("click",(function(){w.off(),k.off()})),p.on("focus",(function(){d.addClass(C)})),p.on("focusout",(function(){d.removeClass(C)})),p.on("input",(()=>{""===p.val()?T()?g.removeClass(v):k.off():(k.on(),T()&&g.addClass(v))}))}();