« MediaWiki:Common.js » : différence entre les versions

Page de l’interface de MediaWiki
(Ajout des nouveautés pour la page d'accueil + minification du code)
(Résolution de bugs)
 
(5 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(s){c=function t(e,r,n){return e[r]=n}}function u(t,e,r,o){var i,a,l,c,s=Object.create((e&&e.prototype instanceof p?e:p).prototype);return n(s,"_invoke",{value:(i=t,a=r,l=new L(o||[]),c="suspendedStart",function(t,e){if("executing"===c)throw Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return C()}for(l.method=t,l.arg=e;;){var r=l.delegate;if(r){var n=b(r,l);if(n){if(n===h)continue;return n}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===c)throw c="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);c="executing";var o=f(i,a,l);if("normal"===o.type){if(c=l.done?"completed":"suspendedYield",o.arg===h)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(c="completed",l.method="throw",l.arg=o.arg)}})}),s}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}t.wrap=u;var h={};function p(){}function d(){}function y(){}var m={};c(m,i,function(){return this});var g=Object.getPrototypeOf,v=g&&g(g(k([])));v&&v!==e&&r.call(v,i)&&(m=v);var $=y.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function _(t,e){var o;n(this,"_invoke",{value:function n(i,a){function l(){return new e(function(n,o){!function n(o,i,a,l){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,u=s.value;return u&&"object"==_typeof(u)&&r.call(u,"__await")?e.resolve(u.__await).then(function(t){n("next",t,a,l)},function(t){n("throw",t,a,l)}):e.resolve(u).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,l)})}l(c.arg)}(i,a,n,o)})}return o=o?o.then(l,l):l()}})}function b(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=TypeError("The iterator does not provide a '"+r+"' method")),h;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=y,n($,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:d,configurable:!0}),d.displayName=c(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,l,"GeneratorFunction")),t.prototype=Object.create($),t},t.awrap=function(t){return{__await:t}},w(_.prototype),c(_.prototype,a,function(){return this}),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},w($),c($,l,"Generator"),c($,i,function(){return this}),c($,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return l.type="throw",l.arg=e,n.next=t,r&&(n.method="next",n.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=n,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(l)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),h},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;E(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(s){r(s);return}l.done?e(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,l,"next",t)}function l(t){asyncGeneratorStep(i,n,o,a,l,"throw",t)}a(void 0)})}}function UpdateCounters(t,e){return _UpdateCounters.apply(this,arguments)}function _UpdateCounters(){return(_UpdateCounters=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){var n;return _regeneratorRuntime().wrap(function t(o){for(;;)switch(o.prev=o.next){case 0:return e=document.getElementById(e),o.next=3,new Promise(function(t){var r=setInterval(function(){var n=e.getBoundingClientRect();n.bottom<0||n.top-Math.max(document.documentElement.clientHeight,window.innerHeight)>=0||(clearInterval(r),t())},500)});case 3:n=0;case 4:if(!(n<=r)){o.next=11;break}return e.innerText=n.toLocaleString(navigator.language,{notation:"compact",compactDisplay:"short",maximumFractionDigits:1}),o.next=8,new Promise(function(t){setTimeout(t,10)});case 8:n+=Math.ceil(r/100),o.next=4;break;case 11:case"end":return o.stop()}},t)}))).apply(this,arguments)}function SwitchMainForm(t){let e=document.getElementById("main-form"),r=e.querySelector("input[type='hidden']"),n=e.querySelector("input:not([type='hidden'])"),o=e.querySelector("button");switch(t){case"search":r.value="title",r.name="Sp%C3%A9cial%3ARecherche",n.name="search",n.placeholder="Rechercher",n.removeAttribute("dir"),o.removeAttribute("name"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/></svg>';break;case"new-article":r.value="edit",r.name="action",n.name="title",n.placeholder="Cr\xe9er un article",n.dir="ltr",o.name="create",o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-plus-lg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"/></svg>'}}if(document.documentElement.classList.contains("skin-citizen-dark")&&!("/index.php/Accueil"===window.location.pathname||window.location.href.includes("?title=Accueil"))&&document.querySelectorAll("table").forEach(function(t){""===t.style.backgroundColor||"transparent"===t.style.backgroundColor?t.querySelectorAll("td").forEach(function(t){""===t.style.backgroundColor||"transparent"===t.style.backgroundColor||(t.style.backgroundColor="#212630",t.style.border="2px solid rgb(101 133 209)",t.style.margin="5px")}):t.style.backgroundColor="#212630"}),"/index.php/Accueil"===window.location.pathname||window.location.href.includes("?title=Accueil")){if(!CSS.supports("selector(:has(+ *)")){var t=document.getElementsByClassName("citizen-body-container")[0];t.style.setProperty("display","block","important"),t.style.setProperty("margin","0","important"),t.style.setProperty("padding","0","important"),document.getElementsByClassName("mw-body-header")[0].style.setProperty("display","none","important"),document.getElementsByClassName("mw-body-footer")[0].style.setProperty("display","none","important"),document.getElementById("citizen-body-header-sticky-sentinel").style.setProperty("display","none","important"),document.getElementsByClassName("citizen-footer")[0].style.setProperty("margin-top","0","important"),document.getElementsByClassName("mw-body")[0].style.setProperty("margin-top","-1rem")}fetch("https://wikithionville.fr/api.php?action=query&meta=userinfo|siteinfo&uiprop=rights|editcount|realname&siprop=statistics&format=json").then(function(t){return t.json()}).then(function(t){t.query.userinfo.rights.includes("edit")&&SwitchMainForm("new-article"),document.getElementsByClassName("counters")[0].style.display="flex",UpdateCounters("counter_articles",t.query.statistics.articles),UpdateCounters("counter_pages",t.query.statistics.pages),UpdateCounters("counter_utilisateurs",t.query.statistics.users),t.query.userinfo.editcount>0&&(document.getElementById("ccard_contribperso").style.display="flex",UpdateCounters("counter_contribperso",t.query.userinfo.editcount))}),document.addEventListener("scroll",function(){UpdateScroll()}),UpdateScroll(),addPopCarouselBtns(),initCards()}function UpdateScroll(){var t=window.scrollY+window.innerHeight/3;[].forEach.call(document.getElementsByClassName("panel"),function(e){e.offsetTop<=t&&e.offsetTop+e.clientHeight>t&&(document.getElementById("wiki-home").style.backgroundColor=e.getAttribute("bg"),[].forEach.call(document.querySelectorAll("#progress a"),function(t){t.getAttribute("href")==="#"+e.id?t.classList.add("active"):t.classList.remove("active")}))}),document.getElementById("img-beffroi").style.transform="translate3d(-".concat(Math.min(window.scrollY/document.getElementById("plusdinfo").offsetTop*30,30),"vw, 0, 0)")}function addPopCarouselBtns(){let t=document.querySelector(".home-header #popular ul"),e=document.getElementById("popular-next"),r=document.getElementById("popular-prev");if(!t)return;let n=function(){t.scrollWidth-t.clientWidth>0?(e.style.display="block",r.style.display="block"):(e.style.display="none",r.style.display="none")};e.addEventListener("click",()=>{t.scrollTo({left:Math.min(t.scrollWidth,t.scrollLeft+.8*t.clientWidth),behavior:"smooth"})}),r.addEventListener("click",()=>{t.scrollTo({left:Math.max(0,t.scrollLeft-.8*t.clientWidth),behavior:"smooth"})}),window.addEventListener("resize",n),n(),t.querySelectorAll("li").forEach(t=>{fetch(`https://wikithionville.fr/api.php?action=query&redirects&prop=images&titles=${new URL(t.querySelector("a").href,"https://wikithionville.fr").searchParams.get("title")}`).then(function(t){return t.json()}).then(function(e){let r=e?.query?.pages?.[Object.keys(e?.query?.pages)[0]]?.images?.[0]?.title,n=t.querySelector("img");n.loading="lazy",n.src=`https://wikithionville.fr/index.php?title=Sp%C3%A9cial:Redirection/file/${r}`}),t.addEventListener("click",()=>{t.querySelector("a").click()})})}function initCards(){[].forEach.call(document.getElementsByClassName("card-li"),function(t){let e=t.querySelectorAll(".card-container");t.addEventListener("mousemove",t=>{e.forEach(e=>{let r=e.querySelector(".blob"),n=e.querySelector(".fakeblob"),o=n.getBoundingClientRect();r.animate([{transform:`translate3d(${t.clientX-o.left-o.width/2}px,${t.clientY-o.top-o.height/2}px, 0)`}],{duration:200,fill:"forwards"})})},{passive:!0})})}[].forEach.call(document.getElementsByClassName("text-marquee"),function(t){var e=t.querySelector("*"),r=t.clientWidth-e.scrollWidth,n=Math.max(Math.round(-r/15),1);r<0&&(t.style.animation=n+"s linear infinite alternate paused gardient_slide",e.style.setProperty("--ofw",r+"px"),e.style.animation=n+"s linear infinite alternate paused text_slide")});
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(s){c=function t(e,r,n){return e[r]=n}}function u(t,e,r,o){var i,a,l,c,s=Object.create((e&&e.prototype instanceof p?e:p).prototype);return n(s,"_invoke",{value:(i=t,a=r,l=new L(o||[]),c="suspendedStart",function(t,e){if("executing"===c)throw Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return C()}for(l.method=t,l.arg=e;;){var r=l.delegate;if(r){var n=b(r,l);if(n){if(n===h)continue;return n}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===c)throw c="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);c="executing";var o=f(i,a,l);if("normal"===o.type){if(c=l.done?"completed":"suspendedYield",o.arg===h)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(c="completed",l.method="throw",l.arg=o.arg)}})}),s}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}t.wrap=u;var h={};function p(){}function d(){}function y(){}var m={};c(m,i,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&r.call(g,i)&&(m=g);var $=y.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function _(t,e){var o;n(this,"_invoke",{value:function n(i,a){function l(){return new e(function(n,o){!function n(o,i,a,l){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,u=s.value;return u&&"object"==_typeof(u)&&r.call(u,"__await")?e.resolve(u.__await).then(function(t){n("next",t,a,l)},function(t){n("throw",t,a,l)}):e.resolve(u).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,l)})}l(c.arg)}(i,a,n,o)})}return o=o?o.then(l,l):l()}})}function b(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=TypeError("The iterator does not provide a '"+r+"' method")),h;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=y,n($,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:d,configurable:!0}),d.displayName=c(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,l,"GeneratorFunction")),t.prototype=Object.create($),t},t.awrap=function(t){return{__await:t}},w(_.prototype),c(_.prototype,a,function(){return this}),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},w($),c($,l,"Generator"),c($,i,function(){return this}),c($,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return l.type="throw",l.arg=e,n.next=t,r&&(n.method="next",n.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=n,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(l)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),h},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;E(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(s){r(s);return}l.done?e(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,l,"next",t)}function l(t){asyncGeneratorStep(i,n,o,a,l,"throw",t)}a(void 0)})}}function UpdateCounters(t,e){return _UpdateCounters.apply(this,arguments)}function _UpdateCounters(){return(_UpdateCounters=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){var n;return _regeneratorRuntime().wrap(function t(o){for(;;)switch(o.prev=o.next){case 0:return e=document.getElementById(e),o.next=3,new Promise(function(t){var r=setInterval(function(){var n=e.getBoundingClientRect();n.bottom<0||n.top-Math.max(document.documentElement.clientHeight,window.innerHeight)>=0||(clearInterval(r),t())},500)});case 3:n=0;case 4:if(!(n<=r)){o.next=11;break}return e.innerText=n.toLocaleString(navigator.language,{notation:"compact",compactDisplay:"short",maximumFractionDigits:1}),o.next=8,new Promise(function(t){setTimeout(t,10)});case 8:n+=Math.ceil(r/100),o.next=4;break;case 11:case"end":return o.stop()}},t)}))).apply(this,arguments)}function SwitchMainForm(t){var e=document.getElementById("main-form"),r=e.querySelector("input[type='hidden']"),n=e.querySelector("input:not([type='hidden'])"),o=e.querySelector("button");switch(t){case"search":r.value="title",r.name="Sp%C3%A9cial%3ARecherche",n.name="search",n.placeholder="Rechercher",n.removeAttribute("dir"),o.removeAttribute("name"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/></svg>';break;case"new-article":r.value="edit",r.name="action",n.name="title",n.placeholder="Cr\xe9er un article",n.dir="ltr",o.name="create",o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-plus-lg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"/></svg>'}}if(document.documentElement.classList.contains("skin-citizen-dark")&&!("/index.php/Accueil"===window.location.pathname||window.location.href.includes("?title=Accueil"))&&document.querySelectorAll("table").forEach(function(t){""===t.style.backgroundColor||"transparent"===t.style.backgroundColor?t.querySelectorAll("td").forEach(function(t){""===t.style.backgroundColor||"transparent"===t.style.backgroundColor||(t.style.backgroundColor="#212630",t.style.border="2px solid rgb(101 133 209)",t.style.margin="5px")}):t.style.backgroundColor="#212630"}),"/index.php/Accueil"===window.location.pathname||window.location.href.includes("?title=Accueil")){if(!CSS.supports("selector(:has(+ *)")){var t=document.getElementsByClassName("citizen-body-container")[0];t.style.setProperty("display","block","important"),t.style.setProperty("margin","0","important"),t.style.setProperty("padding","0","important"),document.getElementsByClassName("mw-body-header")[0].style.setProperty("display","none","important"),document.getElementsByClassName("mw-body-footer")[0].style.setProperty("display","none","important"),document.getElementById("citizen-body-header-sticky-sentinel").style.setProperty("display","none","important"),document.getElementsByClassName("citizen-footer")[0].style.setProperty("margin-top","0","important"),document.getElementsByClassName("mw-body")[0].style.setProperty("margin-top","-1rem")}fetch("https://wikithionville.fr/api.php?action=query&meta=userinfo|siteinfo&uiprop=rights|editcount|realname&siprop=statistics&format=json").then(function(t){return t.json()}).then(function(t){t.query.userinfo.rights.includes("edit")&&SwitchMainForm("new-article"),document.getElementsByClassName("counters")[0].style.display="flex",UpdateCounters("counter_articles",t.query.statistics.articles),UpdateCounters("counter_pages",t.query.statistics.pages),UpdateCounters("counter_utilisateurs",t.query.statistics.users),t.query.userinfo.editcount>0&&(document.getElementById("ccard_contribperso").style.display="flex",UpdateCounters("counter_contribperso",t.query.userinfo.editcount))}),document.addEventListener("scroll",function(){UpdateScroll()}),UpdateScroll(),addPopCarouselBtns(),initCards()}function UpdateScroll(){var t=window.scrollY+window.innerHeight/3;[].forEach.call(document.getElementsByClassName("panel"),function(e){e.offsetTop<=t&&e.offsetTop+e.clientHeight>t&&(document.getElementById("wiki-home").style.backgroundColor=e.getAttribute("bg"),[].forEach.call(document.querySelectorAll("#progress a"),function(t){t.getAttribute("href")==="#"+e.id?t.classList.add("active"):t.classList.remove("active")}))}),document.getElementById("img-beffroi").style.transform="translate3d(-".concat(Math.min(window.scrollY/document.getElementById("plusdinfo").offsetTop*30,30),"vw, 0, 0)")}function addPopCarouselBtns(){var t=document.querySelector(".home-header #popular ul"),e=document.getElementById("popular-next"),r=document.getElementById("popular-prev");if(t){var n=function n(){t.scrollWidth-t.clientWidth>0?(e.style.display="block",r.style.display="block"):(e.style.display="none",r.style.display="none")};e.addEventListener("click",function(){t.scrollTo({left:Math.min(t.scrollWidth,t.scrollLeft+.8*t.clientWidth),behavior:"smooth"})}),r.addEventListener("click",function(){t.scrollTo({left:Math.max(0,t.scrollLeft-.8*t.clientWidth),behavior:"smooth"})}),window.addEventListener("resize",n),n(),t.querySelectorAll("li").forEach(function(t){fetch("https://wikithionville.fr/api.php?action=query&format=json&redirects&generator=images&prop=imageinfo&iiprop=url|dimensions&titles=".concat(new URL(t.querySelector("a").href,"https://wikithionville.fr").searchParams.get("title"))).then(function(t){return t.json()}).then(function(e){var r,n,o,i,a,l,c=Object.values(null==e?void 0:null===(r=e.query)||void 0===r?void 0:r.pages),s=c.filter(function(t){return t.imageinfo&&t.imageinfo[0].width*t.imageinfo[0].height>122500&&t.imageinfo[0].url});n=s.length>0?null==s?void 0:null===(o=s[Math.round(Math.random()*((null==s?void 0:s.length)-1))])||void 0===o?void 0:null===(i=o.imageinfo[0])||void 0===i?void 0:i.url:null===(a=c.at(-1))||void 0===a?void 0:null===(l=a.imageinfo[0])||void 0===l?void 0:l.url;var u=t.querySelector("img");u.loading="lazy",u.src=n,u.onerror=function(t){u.src="/home/article_placeholder.svg"}}),t.addEventListener("click",function(){t.querySelector("a").click()})})}}function initCards(){[].forEach.call(document.getElementsByClassName("card-li"),function(t){var e=t.querySelectorAll(".card-container");t.addEventListener("mousemove",function(t){e.forEach(function(e){var r=e.querySelector(".blob"),n=e.querySelector(".fakeblob").getBoundingClientRect();r.animate([{transform:"translate3d(".concat(t.clientX-n.left-n.width/2,"px,").concat(t.clientY-n.top-n.height/2,"px, 0)")}],{duration:200,fill:"forwards"})})},{passive:!0})})}[].forEach.call(document.getElementsByClassName("text-marquee"),function(t){var e=t.querySelector("*"),r=t.clientWidth-e.scrollWidth,n=Math.max(Math.round(-r/15),1);r<0&&(t.style.animation=n+"s linear infinite alternate paused gardient_slide",e.style.setProperty("--ofw",r+"px"),e.style.animation=n+"s linear infinite alternate paused text_slide")});

Dernière version du 16 octobre 2024 à 09:55

"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(s){c=function t(e,r,n){return e[r]=n}}function u(t,e,r,o){var i,a,l,c,s=Object.create((e&&e.prototype instanceof p?e:p).prototype);return n(s,"_invoke",{value:(i=t,a=r,l=new L(o||[]),c="suspendedStart",function(t,e){if("executing"===c)throw Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return C()}for(l.method=t,l.arg=e;;){var r=l.delegate;if(r){var n=b(r,l);if(n){if(n===h)continue;return n}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===c)throw c="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);c="executing";var o=f(i,a,l);if("normal"===o.type){if(c=l.done?"completed":"suspendedYield",o.arg===h)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(c="completed",l.method="throw",l.arg=o.arg)}})}),s}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}t.wrap=u;var h={};function p(){}function d(){}function y(){}var m={};c(m,i,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&r.call(g,i)&&(m=g);var $=y.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function _(t,e){var o;n(this,"_invoke",{value:function n(i,a){function l(){return new e(function(n,o){!function n(o,i,a,l){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,u=s.value;return u&&"object"==_typeof(u)&&r.call(u,"__await")?e.resolve(u.__await).then(function(t){n("next",t,a,l)},function(t){n("throw",t,a,l)}):e.resolve(u).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,l)})}l(c.arg)}(i,a,n,o)})}return o=o?o.then(l,l):l()}})}function b(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=TypeError("The iterator does not provide a '"+r+"' method")),h;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=y,n($,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:d,configurable:!0}),d.displayName=c(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,l,"GeneratorFunction")),t.prototype=Object.create($),t},t.awrap=function(t){return{__await:t}},w(_.prototype),c(_.prototype,a,function(){return this}),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},w($),c($,l,"Generator"),c($,i,function(){return this}),c($,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return l.type="throw",l.arg=e,n.next=t,r&&(n.method="next",n.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=n,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(l)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),h},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;E(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(s){r(s);return}l.done?e(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,l,"next",t)}function l(t){asyncGeneratorStep(i,n,o,a,l,"throw",t)}a(void 0)})}}function UpdateCounters(t,e){return _UpdateCounters.apply(this,arguments)}function _UpdateCounters(){return(_UpdateCounters=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){var n;return _regeneratorRuntime().wrap(function t(o){for(;;)switch(o.prev=o.next){case 0:return e=document.getElementById(e),o.next=3,new Promise(function(t){var r=setInterval(function(){var n=e.getBoundingClientRect();n.bottom<0||n.top-Math.max(document.documentElement.clientHeight,window.innerHeight)>=0||(clearInterval(r),t())},500)});case 3:n=0;case 4:if(!(n<=r)){o.next=11;break}return e.innerText=n.toLocaleString(navigator.language,{notation:"compact",compactDisplay:"short",maximumFractionDigits:1}),o.next=8,new Promise(function(t){setTimeout(t,10)});case 8:n+=Math.ceil(r/100),o.next=4;break;case 11:case"end":return o.stop()}},t)}))).apply(this,arguments)}function SwitchMainForm(t){var e=document.getElementById("main-form"),r=e.querySelector("input[type='hidden']"),n=e.querySelector("input:not([type='hidden'])"),o=e.querySelector("button");switch(t){case"search":r.value="title",r.name="Sp%C3%A9cial%3ARecherche",n.name="search",n.placeholder="Rechercher",n.removeAttribute("dir"),o.removeAttribute("name"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/></svg>';break;case"new-article":r.value="edit",r.name="action",n.name="title",n.placeholder="Cr\xe9er un article",n.dir="ltr",o.name="create",o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-plus-lg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"/></svg>'}}if(document.documentElement.classList.contains("skin-citizen-dark")&&!("/index.php/Accueil"===window.location.pathname||window.location.href.includes("?title=Accueil"))&&document.querySelectorAll("table").forEach(function(t){""===t.style.backgroundColor||"transparent"===t.style.backgroundColor?t.querySelectorAll("td").forEach(function(t){""===t.style.backgroundColor||"transparent"===t.style.backgroundColor||(t.style.backgroundColor="#212630",t.style.border="2px solid rgb(101 133 209)",t.style.margin="5px")}):t.style.backgroundColor="#212630"}),"/index.php/Accueil"===window.location.pathname||window.location.href.includes("?title=Accueil")){if(!CSS.supports("selector(:has(+ *)")){var t=document.getElementsByClassName("citizen-body-container")[0];t.style.setProperty("display","block","important"),t.style.setProperty("margin","0","important"),t.style.setProperty("padding","0","important"),document.getElementsByClassName("mw-body-header")[0].style.setProperty("display","none","important"),document.getElementsByClassName("mw-body-footer")[0].style.setProperty("display","none","important"),document.getElementById("citizen-body-header-sticky-sentinel").style.setProperty("display","none","important"),document.getElementsByClassName("citizen-footer")[0].style.setProperty("margin-top","0","important"),document.getElementsByClassName("mw-body")[0].style.setProperty("margin-top","-1rem")}fetch("https://wikithionville.fr/api.php?action=query&meta=userinfo|siteinfo&uiprop=rights|editcount|realname&siprop=statistics&format=json").then(function(t){return t.json()}).then(function(t){t.query.userinfo.rights.includes("edit")&&SwitchMainForm("new-article"),document.getElementsByClassName("counters")[0].style.display="flex",UpdateCounters("counter_articles",t.query.statistics.articles),UpdateCounters("counter_pages",t.query.statistics.pages),UpdateCounters("counter_utilisateurs",t.query.statistics.users),t.query.userinfo.editcount>0&&(document.getElementById("ccard_contribperso").style.display="flex",UpdateCounters("counter_contribperso",t.query.userinfo.editcount))}),document.addEventListener("scroll",function(){UpdateScroll()}),UpdateScroll(),addPopCarouselBtns(),initCards()}function UpdateScroll(){var t=window.scrollY+window.innerHeight/3;[].forEach.call(document.getElementsByClassName("panel"),function(e){e.offsetTop<=t&&e.offsetTop+e.clientHeight>t&&(document.getElementById("wiki-home").style.backgroundColor=e.getAttribute("bg"),[].forEach.call(document.querySelectorAll("#progress a"),function(t){t.getAttribute("href")==="#"+e.id?t.classList.add("active"):t.classList.remove("active")}))}),document.getElementById("img-beffroi").style.transform="translate3d(-".concat(Math.min(window.scrollY/document.getElementById("plusdinfo").offsetTop*30,30),"vw, 0, 0)")}function addPopCarouselBtns(){var t=document.querySelector(".home-header #popular ul"),e=document.getElementById("popular-next"),r=document.getElementById("popular-prev");if(t){var n=function n(){t.scrollWidth-t.clientWidth>0?(e.style.display="block",r.style.display="block"):(e.style.display="none",r.style.display="none")};e.addEventListener("click",function(){t.scrollTo({left:Math.min(t.scrollWidth,t.scrollLeft+.8*t.clientWidth),behavior:"smooth"})}),r.addEventListener("click",function(){t.scrollTo({left:Math.max(0,t.scrollLeft-.8*t.clientWidth),behavior:"smooth"})}),window.addEventListener("resize",n),n(),t.querySelectorAll("li").forEach(function(t){fetch("https://wikithionville.fr/api.php?action=query&format=json&redirects&generator=images&prop=imageinfo&iiprop=url|dimensions&titles=".concat(new URL(t.querySelector("a").href,"https://wikithionville.fr").searchParams.get("title"))).then(function(t){return t.json()}).then(function(e){var r,n,o,i,a,l,c=Object.values(null==e?void 0:null===(r=e.query)||void 0===r?void 0:r.pages),s=c.filter(function(t){return t.imageinfo&&t.imageinfo[0].width*t.imageinfo[0].height>122500&&t.imageinfo[0].url});n=s.length>0?null==s?void 0:null===(o=s[Math.round(Math.random()*((null==s?void 0:s.length)-1))])||void 0===o?void 0:null===(i=o.imageinfo[0])||void 0===i?void 0:i.url:null===(a=c.at(-1))||void 0===a?void 0:null===(l=a.imageinfo[0])||void 0===l?void 0:l.url;var u=t.querySelector("img");u.loading="lazy",u.src=n,u.onerror=function(t){u.src="/home/article_placeholder.svg"}}),t.addEventListener("click",function(){t.querySelector("a").click()})})}}function initCards(){[].forEach.call(document.getElementsByClassName("card-li"),function(t){var e=t.querySelectorAll(".card-container");t.addEventListener("mousemove",function(t){e.forEach(function(e){var r=e.querySelector(".blob"),n=e.querySelector(".fakeblob").getBoundingClientRect();r.animate([{transform:"translate3d(".concat(t.clientX-n.left-n.width/2,"px,").concat(t.clientY-n.top-n.height/2,"px, 0)")}],{duration:200,fill:"forwards"})})},{passive:!0})})}[].forEach.call(document.getElementsByClassName("text-marquee"),function(t){var e=t.querySelector("*"),r=t.clientWidth-e.scrollWidth,n=Math.max(Math.round(-r/15),1);r<0&&(t.style.animation=n+"s linear infinite alternate paused gardient_slide",e.style.setProperty("--ofw",r+"px"),e.style.animation=n+"s linear infinite alternate paused text_slide")});