// On referencie toutes les sections // gestion automatique au chargement de la page si id_user dans url "/users/.+/:id_user:" function autofill_remove(){var e={id_user:"",username:"",code:"",disable_input:!0} null==found_remove[searchindex_remove]?(section.remove.input.search.num.innerHTML=0,searchindex_remove=0):(e={id_user:found_remove[searchindex_remove].id_user,username:found_remove[searchindex_remove].username,code:found_remove[searchindex_remove].code,disable_input:!1},section.remove.input.search.num.innerHTML=searchindex_remove+1),section.remove.input.search.id.value=e.id_user,section.remove.input.username.value=e.username,section.remove.input.code.value=e.code,section.remove.input.submit.disabled=e.disable_input}function autofill_edit(){var e={id_user:"",code:"",username:"",firstname:"",lastname:"",mail:"",disable_input:!0} null==found_edit[searchindex_edit]?(section.edit.input.search.num.innerHTML=0,searchindex_edit=0):(e={id_user:found_edit[searchindex_edit].id_user,code:found_edit[searchindex_edit].code,username:found_edit[searchindex_edit].username,firstname:found_edit[searchindex_edit].firstname,lastname:found_edit[searchindex_edit].lastname,mail:found_edit[searchindex_edit].mail,disable_input:!1},section.edit.input.search.num.innerHTML=searchindex_edit+1),section.edit.input.search.id.value=e.id_user,section.edit.input.code.value=e.code,section.edit.input.username.value=e.username,section.edit.input.firstname.value=e.firstname,section.edit.input.lastname.value=e.lastname,section.edit.input.mail.value=e.mail,section.edit.input.submit.disabled=e.disable_input}var section={view:{text:'#CONTAINER > section[data-sublink="view"] ',element:document.querySelector('#CONTAINER > section[data-sublink="view"]'),searchbar:document.querySelector('#CONTAINER > section[data-sublink="view"] > .searchbar')},create:{text:'#CONTAINER > section[data-sublink="create"] ',element:document.querySelector('#CONTAINER > section[data-sublink="create"]')},remove:{text:'#CONTAINER > section[data-sublink="remove"] ',element:document.querySelector('#CONTAINER > section[data-sublink="remove"]')},edit:{text:'#CONTAINER > section[data-sublink="edit"] ',element:document.querySelector('#CONTAINER > section[data-sublink="edit"]')},groups:{text:'#CONTAINER > section[data-sublink="groups"] ',element:document.querySelector('#CONTAINER > section[data-sublink="groups"]'),searchbar:document.querySelector('#CONTAINER > section[data-sublink="groups"] > .searchbar')}} if(null!=section.view.element){pageManager.vars.length>1&&!isNaN(pageManager.vars[1])&&(document.location="#"+pageManager.vars[1],null!=document.getElementById(pageManager.vars[1])&&document.getElementById(pageManager.vars[1]).addClass("selected")),section.view.link={edit:document.querySelectorAll(section.view.text+".link_edit[data-user]"),remove:document.querySelectorAll(section.view.text+".link_remove[data-user]")},section.view.group={rem:document.querySelectorAll(section.view.text+".rem-group[data-user][data-group]"),add:document.querySelectorAll(section.view.text+".add-group[data-user]")},section.view.searchbar.addEventListener("keyup",function(e){var t={path:"userDefault/search",keywords:section.view.searchbar.value} api.send(t,function(e){if(0==e.ModuleError&&(console.log(e.users.length),0==e.ModuleError)){for(var t=[],r=0;r article.inline-box[id]"),r=0;r-1?i[r].remClass("hidden"):i[r].addClass("hidden")}})},!1) for(var i=0;i=2&&!isNaN(pageManager.vars[1])&&api.send({path:"userDefault/getById",id_user:pageManager.vars[1]},function(e){0==e.ModuleError&&(found_edit=[e.user],searchindex_edit=0,autofill_edit(),found_remove=[e.user],searchindex_remove=0,autofill_remove())}),null!=section.groups.element){section.groups.link={remove:document.querySelectorAll(section.groups.text+".link_remove[data-cluster]"),edit:document.querySelectorAll(section.groups.text+".link_edit[data-cluster]")},section.groups.group={rem:document.querySelectorAll(section.groups.text+".rem-member[data-cluster][data-member]"),add:document.querySelectorAll(section.groups.text+".add-member[data-cluster]")},section.groups.searchbar.addEventListener("keyup",function(e){var t={path:"clusterDefault/search",keywords:section.groups.searchbar.value,class:0} api.send(t,function(e){if(0==e.ModuleError){for(var t=[],r=0;r article.inline-box[id]"),r=0;r-1?i[r].remClass("hidden"):i[r].addClass("hidden")}})},!1) var i for(i=0;i