PageSourceSearch

https://www.moernach.fr/wp-content/plugins/maz-loader/media/public/js/mazloader.js?ver=1.5.0

js moernach.fr collected 2026-10-02 21:12:39 UTC 5,176 bytes, 1 lines download raw bytes

1var MZLDR_Front_Helper=function(){function e(){}return e.onReady=function(e){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",e):e()},e.prototype.emitEvent=function(e,t,o){if(e){var n=new CustomEvent(e);return t.dispatchEvent(n,{detail:o,cancelable:!0}),n}},e}(),MZLDR_Item=function(){function e(e){this.loader=e,this.id=this.loader.getAttribute("data-loader-id"),this.settings=JSON.parse(this.loader.getAttribute("data-settings")),this.appearance=JSON.parse(this.loader.getAttribute("data-appearance")),this.minimum_loading_time=parseFloat(this.settings.minimum_loading_time),this.duration=parseFloat(this.settings.duration),this.delay=parseFloat(this.settings.delay),this.disable_page_scroll=!!this.appearance.hasOwnProperty("disable_page_scroll")&&this.appearance.disable_page_scroll,this.disable_page_scroll=!0===this.disable_page_scroll,this.frontHelper=window.MAZLoader.FrontHelper}var t=e.prototype;return t.init=function(){var e=this;this.disable_page_scroll&&this.addBodyClass(),setTimeout(function(){e.emitEvent("beforeOpen"),e.onShow(),(new MZLDR_Preload_Images).runPreloader(function(){e.onHide()})},this.delay),this.addLoaderLoadedClassToBody()},t.onShow=function(){this.loader.classList.contains("is-hidden")&&this.loader.classList.remove("is-hidden"),0<this.delay&&this.loader.classList.remove("is-hidden"),this.emitEvent("afterOpen")},t.onHide=function(){var e=this;setTimeout(function(){e.emitEvent("beforeClose"),e.disable_page_scroll&&e.removeBodyClass(),e.emitEvent("afterClose")},this.getLoadingTime())},t.addBodyClass=function(){document.body.classList.contains("mzldr-overflow-hidden")||document.body.classList.add("mzldr-overflow-hidden")},t.removeBodyClass=function(){document.body.classList.contains("mzldr-overflow-hidden")&&document.body.classList.remove("mzldr-overflow-hidden")},t.addLoaderLoadedClassToBody=function(){var e=this;this.loader.addEventListener("beforeClose",function(){document.body.classList.add("mazloader-loaded")}),this.loader.addEventListener("afterClose",function(){e.display_transition||e.loader.classList.add("is-hidden")})},t.emitEvent=function(e,t){if(e)return t=t||{},this.frontHelper.emitEvent(e,this.loader,t)},t.getLoader=function(){return this.loader},t.closeLoader=function(){this.loader.classList.add("is-hidden")},t.getLoadingTime=function(){return this.minimum_loading_time+this.duration},e}(),MZLDR_Preload_Images=function(){function e(){this.images=document.querySelectorAll("img"),this.loadedCounter=0,this.toBeLoadedNumber=this.images.length}var t=e.prototype;return t.runPreloader=function(e){this.preloadImages(function(){e&&e()})},t.preloadImages=function(o){var n=this;if(!this.toBeLoadedNumber)return o(),!1;this.images.forEach(function(e){if(e.closest(".mazloader-item"))return n.loadedCounter++,void(n.loadedCounter==n.toBeLoadedNumber&&o());var t=e.getAttribute("src")||!1;if(!t||null==t||"undefined"==t)return n.loadedCounter++,void(n.loadedCounter==n.toBeLoadedNumber&&o());n.preloadImage(t,function(){n.loadedCounter++,n.loadedCounter==n.toBeLoadedNumber&&(console.log(1),o())})})},t.preloadImage=function(e,t){var o;function n(){o&&(clearTimeout(o),o=null),t()}function i(){this.onload=this.onabort=this.onerror=function(){},n()}var r,a=new Image;return a.onerror=a.onabort=i,a.onload=function(){n()},a.src=e,o=setTimeout((r=a,function(){i.call(r)}),2e3),a},e}(),MZLDR=function(){function e(){this.mazloader_items={},this.globalEventsRun=!1,this.preInit()}var t=e.prototype;return t.preInit=function(){this.mazloader_items=document.querySelectorAll(".mazloader-items .mazloader-item"),window.MAZLoader=window.MAZLoader||[],window.MAZLoader.FrontHelper=new MZLDR_Front_Helper,this.globalEventsRun=!1,this.init()},t.init=function(){window.MAZLoader.FrontHelper.emitEvent("MAZLoaderInit",document,this.mazloader_items),this.runLoaders()},t.runLoaders=function(){var t=this;this.mazloader_items.length&&(window.MAZLoader.FrontHelper.emitEvent("MAZLoaderBeforeOpen",document,this.mazloader_items),this.mazloader_items.forEach(function(e){t.globalEventsRun||window.MAZLoader.FrontHelper.emitEvent("MAZLoaderAfterOpen",document,t.mazloader_items),new MZLDR_Item(e).init(),t.globalEventsRun||(window.MAZLoader.FrontHelper.emitEvent("MAZLoaderBeforeClose",document,t.mazloader_items),t.globalEventsRun=!0)}),window.MAZLoader.FrontHelper.emitEvent("MAZLoaderAfterClose",document,this.mazloader_items))},e}();MZLDR_Front_Helper.onReady(function(){new MZLDR}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),function(){if("function"==typeof window.CustomEvent)return;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}e.prototype=window.Event.prototype,window.CustomEvent=e}(),function(){if("function"==typeof NodeList.prototype.forEach)return;NodeList.prototype.forEach=Array.prototype.forEach}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.