1import{addFlash}from"./flash.js";import"./admin_traduction_tab.js";import"./admin_traduction_auto.js";(function(){const i=document.querySelector(".content");document.querySelectorAll(".pagination a").forEach(e=>{e.addEventListener("click",function(){let t=e.getAttribute("data-page");document.getElementById("admin_search_pilote_page")!==null&&(document.getElementById("admin_search_pilote_page").value=t,document.querySelector("[name=admin_search_pilote]").submit()),document.getElementById("admin_search_equipe_page")!==null&&(document.getElementById("admin_search_equipe_page").value=t,document.querySelector("[name=admin_search_equipe]").submit()),document.getElementById("admin_search_grand_prix_page")!==null&&(document.getElementById("admin_search_grand_prix_page").value=t,document.querySelector("[name=admin_search_grand_prix]").submit()),document.getElementById("admin_search_sport_annee_page")!==null&&(document.getElementById("admin_search_sport_annee_page").value=t,document.querySelector("[name=admin_search_sport_annee]").submit()),document.getElementById("admin_search_calendrier_page")!==null&&(document.getElementById("admin_search_calendrier_page").value=t,document.querySelector("[name=admin_search_calendrier]").submit()),document.getElementById("admin_search_championnat_page")!==null&&(document.getElementById("admin_search_championnat_page").value=t,document.querySelector("[name=admin_search_championnat]").submit())})});const t=function(){document.getElementById("admin_search_pilote_page")!==null&&(document.getElementById("admin_search_pilote_page").value=1),document.getElementById("admin_search_equipe_page")!==null&&(document.getElementById("admin_search_equipe_page").value=1),document.getElementById("admin_search_grand_prix_page")!==null&&(document.getElementById("admin_search_grand_prix_page").value=1),document.getElementById("admin_search_sport_annee_page")!==null&&(document.getElementById("admin_search_sport_annee_page").value=1),document.getElementById("admin_search_calendrier_page")!==null&&(document.getElementById("admin_search_calendrier_page").value=1)};document.querySelectorAll("select").forEach(e=>{e.addEventListener("change",t)}),document.querySelectorAll("input").forEach(e=>{e.addEventListener("change",t)});var e,s=document.querySelectorAll("#admin_sport_calendrier_circuit option"),o=document.querySelectorAll("#admin_sport_calendrier_grand_prix option");if(document.getElementById("admin_sport_calendrier_pays")!==null&&(document.getElementById("admin_sport_calendrier_pays").addEventListener("change",function(){let e=this.value;
1s.forEach(t=>{e===""||t.value===""||t.classList.contains("nat-"+e)?t.style.display="block":t.style.display="none"}),o.forEach(t=>{e===""||t.value===""||t.classList.contains("nat-"+e)?t.style.display="block":t.style.display="none"})}),document.getElementById("admin_sport_calendrier_pays").dispatchEvent(new Event("change"))),document.querySelectorAll(".change-visibility").forEach(e=>{e.addEventListener("click",function(){let n=e.getAttribute("data-href"),s=e.classList.contains("icon-eye"),t=new XMLHttpRequest;t.open("GET",n),t.onload=function(){if(t.status===200&&t.responseText!==""){let n=JSON.parse(t.responseText);n.status==="ok"?(s?(e.classList.add("icon-eye-blocked"),e.classList.remove("icon-eye"),e.setAttribute("title","invisible")):(e.classList.add("icon-eye"),e.classList.remove("icon-eye-blocked"),e.setAttribute("title","visible")),addFlash(n.reason,"success")):addFlash(n.reason,"error")}},t.send()})}),document.querySelectorAll(".cache-control").forEach(e=>{e.addEventListener("click",function(){let n=e.getAttribute("data-href"),t=new XMLHttpRequest;t.open("GET",n),t.onload=function(){if(t.status===200&&t.responseText!==""){let n=JSON.parse(t.responseText);n.status==="ok"?(e.classList.remove("red"),e.setAttribute("title","recharger cache"),addFlash(n.reason,"success")):addFlash(n.reason,"error")}},t.send()})}),document.querySelectorAll(".img-thumb").forEach(e=>{e.addEventListener("click",function(){if(e.clientWidth!==200){e.getAttribute("width")===0[0]&&e.setAttribute("width",e.clientWidth),e.getAttribute("height")===0[0]&&e.setAttribute("height",e.clientHeight),e.classList.contains("limited")&&(e.style.maxWidth="200px",e.style.maxHeight="200px");let t=200*e.clientHeight/e.clientWidth;e.animate([{width:"200px",height:"200px"}],{duration:1e3})}else e.style.width=e.getAttribute("width")+"px",e.style.height=e.getAttribute("height")+"px",e.classList.contains("limited")&&(e.style.maxWidth="70px",e.style.maxHeight="70px")})}),document.querySelectorAll(".buttons .delete").forEach(e=>{e.addEventListener("click",function(){let t=e.getAttribute("data-href");if(confirm("Etes vous sûr de vouloir supprimer cette donnée ?")){let n=new XMLHttpRequest;n.open("GET",t),n.onload=function(){if(n.status===200&&n.responseText!==""){let t=JSON.parse(n.responseText);t.status==="ok"?(e.parentElement.parentElement.remove(),addFlash(t.reason,"success")):addFlash(t.reason,"error")}else addFlash("Une erreur s'est produite lors de la suppresion, merci de contacter Yffic à ce sujet","error")},n.send()}})}),document.getElementById("admin_sport_pilote_annee_marque")){const t=document.getElementById("admin_sport_pilote_annee_marque");e=!1;const n=function(){e=!0;let t=this.getAttribute("data-link");if(t){let i=this.getAttribute("data-relation"),a="",o=0,n=this.parentElement.parentElement;this.getAttribute("name")==="admin_sport_pilote_annee[marque]"&&(t+="?marque="+this.value,a='<option value="">Type châssis</option>',o=n.getAttribute("data-chassis")),this.getAttribute("name")==="fiche_type"&&(t+="?marque="+n.querySelector("#admin_sport_pilote_annee_marque").value+"&chassis="+this.value,a='<option value="">Année</option>',o=n.getAttribute("data-annee")),this.getAttribute("name")==="fiche_annee"&&(t+="?marque="+n.querySelector("#admin_sport_pilote_annee_marque").value+"&chassis="+n.querySelector(".chassis").value+"&annee="+this.value,a='<option value="">Moto</option>',o=n.getAttribute("data-id"));const s=new XMLHttpRequest;s.open("GET",t),s.onload=function(){if(s.status===200&&s.responseText!==""){document.getElementById(i).innerHTML=a;let n=!1,t=JSON.parse(s.responseText);Object.keys(t.list).forEach(function(e){o>0&&o===e?(document.getElementById(i).insertAdjacentHTML("beforeend",'<option value="'+e+'" selected>'+t.list[e]+"</option>"),n=!0):document.getElementById(i).insertAdjacentHTML("beforeend",'<option value="'+e+'">'+t.list[e]+"</option>")}),n&&document.getElementById(i).dispatchEvent(new Event("change")),e=!1}},s.send()}},s=function(){confirm("Etes-vous sûr de vouloir supprimer cette ligne ?")&&this.parentElement.parentElement.remove()},o=function(){let e=parseInt(t.value);e>0&&(document.querySelector('#admin_sport_pilote_annee_marque option[value="'+e+'"]').selected=!0,document.getElementById("admin_sport_pilote_annee_marque").dispatchEvent(new Event("change")))};
1document.querySelectorAll(".moto select").forEach(e=>{e.addEventListener("change",n)}),document.querySelectorAll(".moto .buttons .icon-minus-circle").forEach(e=>{e.addEventListener("click",s)}),document.querySelector(".moto").getAttribute("data-marque")&&(t.value=document.querySelector(".moto").getAttribute("data-marque"),o())}if(document.getElementsByClassName("page")[0].classList.contains("jodit")){const e=["bold","underline","italic","strikethrough","|","ul","ol","|","outdent","indent","|","font","fontsize","brush","paragraph","|","align","undo","redo","cut","hr","eraser","copyformat","|","image","video","table","link","source"];let n,t=document.querySelectorAll("#textarea-upload .lang");t.forEach(t=>{new Jodit(t.querySelector("textarea"),{buttons:e,enableDragAndDropFileToEditor:!0,height:300,uploader:{prepareData:function(e){e.append("type","jodit")},url:document.getElementById("textarea-upload").getAttribute("data-url")}})})}if(document.getElementsByName("admin_categorie").length>0){const e=function(){const e=parseInt(document.getElementById("admin_categorie_iscatref").value);document.getElementById("categorie-parent").style.display=e===0?"block":"none"};document.getElementById("admin_categorie_iscatref").addEventListener("change",e),e()}if(document.getElementsByClassName("page")[0].classList.contains("jodit")){const e=["bold","underline","italic","strikethrough","|","ul","ol","|","outdent","indent","|","font","fontsize","brush","paragraph","|","align","undo","redo","cut","hr","eraser","copyformat","|","image","video","table","link","source"];let t;document.getElementById("admin_pilote_history")!==null&&(t=new Jodit("#admin_pilote_history",{buttons:e,imageDefaultWidth:600,enableDragAndDropFileToEditor:!0,height:window.innerHeight-150,uploader:{prepareData:function(e){e.append("type","jodit")},url:document.getElementById("textarea-upload").getAttribute("data-url")}}))}let n=document.getElementById("add-another-collection-widget-class-point");if(n){const e=function(){confirm("Etes-vous sûr de vouloir supprimer cette ligne ?")&&this.parentElement.parentElement.remove()};let t=0;n.addEventListener("click",function(){let t=document.getElementById("class-point-fields-list"),n=t.getAttribute("data-widget-counter")||t.children.length,s=t.getAttribute("data-prototype");s=s.replace(/__name__/g,n),n++,t.setAttribute("data-widget-counter",n);let o=document.createElement("div");o.innerHTML=s,t.insertAdjacentElement("beforeend",o.firstChild),t.lastElementChild.innerHTML+=`<div class="adjust buttons proposition"> 2<em class="icon-minus-circle" title="supprimer cette ligne"></em> 3</div>`;let i=t.querySelector(".row:last-child");i.querySelector(".position").value=n,document.querySelectorAll("#class-point-fields-list .buttons .icon-minus-circle").forEach(t=>{t.removeEventListener("click",e),t.addEventListener("click",e)})}),document.querySelectorAll("#class-point-fields-list .buttons .icon-minus-circle").forEach(t=>{t.addEventListener("click",e)})}})()
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.