functionsetCookie(name,value,days){varexpires="";if(days){vardate=newDate;date.setTime(date.getTime()+24*days*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/; samesite=lax"}functiongetCookie(name){for(varnameEQ=name+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(varc=ca[i];""==c.charAt(0);)c=c.substring(1,c.length);if(0==c.indexOf(nameEQ))returnc.substring(nameEQ.length,c.length)}returnnull}functioncapitalizeFirstLetter(string){returnstring.charAt(0).toUpperCase()+string.slice(1)}$(document).ready((function(){varpluginLayout=getCookie("pluginLayout");null==pluginLayout&&(pluginLayout="module",setCookie("pluginLayout","module")),console.log(pluginLayout),$("#moduleContainer").hide(),$("#dataContainer").hide(),$("#"+pluginLayout+"Container").show(),$("#plugin"+capitalizeFirstLetter(pluginLayout)+"Button").addClass("activeButton")})),$(".moduleDelete").on("click",(function(){var_this=$(this),message_delete="<?php echo helper::translate('Confirmer la désinstallation du module'); ?>";returncore.confirm(message_delete,(function(){$(location).attr("href",_this.attr("href"))}))})),$(".dataDelete").on("click",(function(){var_this=$(this),message_unlink="<?php echo helper::translate('Confirmer la dissociation du module de cette page'); ?>";returncore.confirm(message_unlink,(function(){$(location).attr("href",_this.attr("href"))}))})),$("#pluginModuleButton").on("click",(function(){$("#dataContainer").hide(),$("#moduleContainer").show(),$("#pluginModuleButton").addClass("activeButton"),$("#pluginDataButton").removeClass("activeButton"),setCookie("pluginLayout","module")})),$("#pluginDataButton").on("click",(function(){$("#moduleContainer").hide(),$("#dataContainer").show(),$("#pluginModuleButton").removeClass("activeButton"),$("#pluginDataButton").addClass("activeButton"),setCookie("pluginLayout","data")}));