Minification

This commit is contained in:
Fred Tempez 2022-10-01 16:44:23 +02:00
parent eea0234792
commit ae916975ee
21 changed files with 33 additions and 1760 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,50 +9,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$(document).ready((function(){$("#configBackupForm").submit((function(e){e.preventDefault();var url="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup",message_success="<?php echo helper::translate('Sauvegarde générée avec succès.'); ?>",message_error="<?php echo helper::translate('Erreur : sauvegarde non générée !'); ?>",message_title="<?php echo helper::translate('Sauvegarder'); ?>";$.ajax({type:"POST",url:url,data:$("form").serialize(),success:function(data){$("body, .button").css("cursor","default"),core.alert(message_success)},error:function(data){$("body, .button").css("cursor","default"),core.alert(message_error)},complete:function(){$("#configBackupSubmit").removeClass("disabled").prop("disabled",!1),$("#configBackupSubmit").removeClass("uniqueSubmission").prop("uniqueSubmission",!1),$("#configBackupSubmit span").removeClass("zwiico-spin animate-spin"),$("#configBackupSubmit span").addClass("zwiico-check zwiico-margin-right").text(message_title)}})})),$("#configBackupSubmit").on("click",(function(){if($("input[name=configBackupOption]").is(":checked")){var message_warning="<?php echo helper::translate('La sauvegarde des fichiers peut prendre du temps. Continuer ?'); ?>";return core.confirm(message_warning,(function(){$("body, .button").css("cursor","wait"),$("form#configBackupForm").submit()}))}}))}));
$(document).ready(function () {
$("#configBackupForm").submit(function (e) {
//$("#configBackupSubmit").addClass("disabled").prop("disabled", true);
e.preventDefault();
var url = "<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup";
var message_success = "<?php echo helper::translate('Sauvegarde générée avec succès.'); ?>";
var message_error = "<?php echo helper::translate('Erreur : sauvegarde non générée !'); ?>";
var message_title = "<?php echo helper::translate('Sauvegarder'); ?>";
$.ajax({
type: "POST",
url: url,
data: $("form").serialize(),
success: function (data) {
$('body, .button').css('cursor', 'default');
core.alert(message_success);
},
error: function (data) {
$('body, .button').css('cursor', 'default');
core.alert(message_error);
},
complete: function () {
$("#configBackupSubmit").removeClass("disabled").prop("disabled", false);
$("#configBackupSubmit").removeClass("uniqueSubmission").prop("uniqueSubmission", false);
$("#configBackupSubmit span").removeClass("zwiico-spin animate-spin");
$("#configBackupSubmit span").addClass("zwiico-check zwiico-margin-right").text(message_title);
}
});
});
/**
* Confirmation de sauvegarde complète
*/
$("#configBackupSubmit").on("click", function () {
if ($("input[name=configBackupOption]").is(':checked')) {
var message_warning = "<?php echo helper::translate('La sauvegarde des fichiers peut prendre du temps. Continuer ?'); ?>";
return core.confirm(message_warning, function () {
//$(location).attr("href", _this.attr("href"));
$('body, .button').css('cursor', 'wait');
$('form#configBackupForm').submit();
});
}
});
});

File diff suppressed because one or more lines are too long

View File

@ -9,14 +9,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$(document).ready((function(){$("#configRestoreSubmit").click((function(event){$("body, .button").css("cursor","wait")}))}));
$( document).ready(function() {
/**
* Aspect de la souris
*/
$("#configRestoreSubmit").click(function(event) {
$('body, .button').css('cursor', 'wait');
});
});

View File

@ -10,28 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("#installId").on("change keydown keyup",(function(event){var userId=$(this).val();if(8!==event.keyCode&&37!==event.keyCode&&39!==event.keyCode&&46!==event.keyCode&&window.getSelection().toString()!==userId){var searchReplace={"á":"a","à":"a","â":"a","ä":"a","ã":"a","å":"a","ç":"c","é":"e","è":"e","ê":"e","ë":"e","í":"i","ì":"i","î":"i","ï":"i","ñ":"n","ó":"o","ò":"o","ô":"o","ö":"o","õ":"o","ú":"u","ù":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Á":"A","À":"A","Â":"A","Ä":"A","Ã":"A","Å":"A","Ç":"C","É":"E","È":"E","Ê":"E","Ë":"E","Í":"I","Ì":"I","Î":"I","Ï":"I","Ñ":"N","Ó":"O","Ò":"O","Ô":"O","Ö":"O","Õ":"O","Ú":"U","Ù":"U","Û":"U","Ü":"U","Ý":"Y","Ÿ":"Y","'":"-",'"':"-"," ":"-"};userId=(userId=userId.replace(/[áàâäãåçéèêëíìîïñóòôöõúùûüýÿ'" ]/gi,(function(match){return searchReplace[match]}))).replace(/[^a-z0-9-]/gi,""),$(this).val(userId)}}));
/**
* Affichage de l'id en simulant FILTER_ID
*/
$("#installId").on("change keydown keyup", function(event) {
var userId = $(this).val();
if(
event.keyCode !== 8 // BACKSPACE
&& event.keyCode !== 37 // LEFT
&& event.keyCode !== 39 // RIGHT
&& event.keyCode !== 46 // DELETE
&& window.getSelection().toString() !== userId // Texte sélectionné
) {
var searchReplace = {
"á": "a", "à": "a", "â": "a", "ä": "a", "ã": "a", "å": "a", "ç": "c", "é": "e", "è": "e", "ê": "e", "ë": "e", "í": "i", "ì": "i", "î": "i", "ï": "i", "ñ": "n", "ó": "o", "ò": "o", "ô": "o", "ö": "o", "õ": "o", "ú": "u", "ù": "u", "û": "u", "ü": "u", "ý": "y", "ÿ": "y",
"Á": "A", "À": "A", "Â": "A", "Ä": "A", "Ã": "A", "Å": "A", "Ç": "C", "É": "E", "È": "E", "Ê": "E", "Ë": "E", "Í": "I", "Ì": "I", "Î": "I", "Ï": "I", "Ñ": "N", "Ó": "O", "Ò": "O", "Ô": "O", "Ö": "O", "Õ": "O", "Ú": "U", "Ù": "U", "Û": "U", "Ü": "U", "Ý": "Y", "Ÿ": "Y",
"'": "-", "\"": "-", " ": "-"
};
userId = userId.replace(/[áàâäãåçéèêëíìîïñóòôöõúùûüýÿ'" ]/ig, function(match) {
return searchReplace[match];
});
userId = userId.replace(/[^a-z0-9-]/ig, "");
$(this).val(userId);
}
});

View File

@ -1,72 +1 @@
/** function step(i,data){var errors=["<?php echo helper::translate('Préparation de la mise à jour'); ?>","<?php echo helper::translate('Téléchargement et validation de l'archive'); ?>","<?php echo helper::translate('Installation'); ?>","<?php echo helper::translate('Configuration'); ?>"];$(".installUpdateProgressText").hide(),$(".installUpdateProgressText[data-id="+i+"]").show(),$.ajax({type:"POST",url:"<?php echo helper::baseUrl(false); ?>?install/steps",data:{step:i,data:data},success:function(result){setTimeout((function(){!0===result.success?4===i?($("#installUpdateSuccess").show(),$("#installUpdateEnd").removeClass("disabled"),$("#installUpdateProgress").hide()):step(i+1,result.data):($("#installUpdateErrorStep").text(errors[i]),$("#installUpdateError").show(),$("#installUpdateEnd").removeClass("disabled"),$("#installUpdateProgress").hide(),console.error(result),$("#installUpdateErrorMessage").text(result.replace(/<[^p].*?>/g,"")))}),2e3)},error:function(xhr){$("#installUpdateErrorStep").text(errors[1]),$("#installUpdateError").show(),$("#installUpdateEnd").removeClass("disabled"),$("#installUpdateProgress").hide(),console.error(xhr.responseText),$("#installUpdateErrorMessage").text(xhr.responseText.replace(/<[^p].*?>/g,""))}})}$(window).on("load",step(1,null));
* Exécution des différentes étapes de mise à jour
*/
function step(i, data) {
// tableau des erreurs
var errors = [
"<?php echo helper::translate('Préparation de la mise à jour'); ?>",
"<?php echo helper::translate('Téléchargement et validation de l\'archive'); ?>",
"<?php echo helper::translate('Installation'); ?>",
"<?php echo helper::translate('Configuration'); ?>"
];
// Affiche le texte de progression
$(".installUpdateProgressText").hide();
$(".installUpdateProgressText[data-id=" + i + "]").show();
// Requête ajax
$.ajax({
type: "POST",
url: "<?php echo helper::baseUrl(false); ?>?install/steps", // Ignore la réécriture d'URL
data: {
step: i,
data: data
},
// Succès de la requête
success: function(result) {
setTimeout(function() {
// Succès
if(result.success === true) {
// Fin de la mise à jour
if(i === 4) {
// Affiche le message de succès
$("#installUpdateSuccess").show();
// Déverrouille le bouton "Terminer"
$("#installUpdateEnd").removeClass("disabled");
// Cache le texte de progression
$("#installUpdateProgress").hide();
}
// Prochaine étape
else {
step(i + 1, result.data);
}
}
// Échec
else {
// Affiche le message d'erreur
$("#installUpdateErrorStep").text(errors[i]);
$("#installUpdateError").show();
// Déverrouille le bouton "Terminer"
$("#installUpdateEnd").removeClass("disabled");
// Cache le texte de progression
$("#installUpdateProgress").hide();
// Affiche le résultat dans la console
console.error(result);
$("#installUpdateErrorMessage").text(result.replace( /<[^p].*?>/g, '' ));
}
}, 2000);
},
// Échec de la requête
error: function(xhr) {
// Affiche le message d'erreur
$("#installUpdateErrorStep").text(errors[1]);
$("#installUpdateError").show();
// Déverrouille le bouton "Terminer"
$("#installUpdateEnd").removeClass("disabled");
// Cache le texte de progression
$("#installUpdateProgress").hide();
// Affiche l'erreur dans la console
console.error(xhr.responseText);
$("#installUpdateErrorMessage").text(xhr.responseText.replace( /<[^p].*?>/g, '' ));
}
});
}
$(window).on("load", step(1, null));

View File

@ -10,89 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
function setCookie(name,value,days){var expires="";if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/; samesite=lax"}function getCookie(name){for(var nameEQ=name+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];" "==c.charAt(0);)c=c.substring(1,c.length);if(0==c.indexOf(nameEQ))return c.substring(nameEQ.length,c.length)}return null}function capitalizeFirstLetter(string){return string.charAt(0).toUpperCase()+string.slice(1)}$(document).ready((function(){var pluginLayout=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'); ?>";return core.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'); ?>";return core.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")}));
$(document).ready(function () {
var pluginLayout = getCookie("pluginLayout");
if (pluginLayout == null) {
pluginLayout = "module";
setCookie("pluginLayout", "module");
}
console.log(pluginLayout);
$("#moduleContainer").hide();
$("#dataContainer").hide();
$("#" + pluginLayout + "Container").show();
$("#plugin" + capitalizeFirstLetter(pluginLayout) + "Button").addClass("activeButton");
});
/**
* Confirmation de suppression
*/
$(".moduleDelete").on("click", function() {
var _this = $(this);
var message_delete = "<?php echo helper::translate('Confirmer la désinstallation du module'); ?>";
return core.confirm(message_delete, function() {
$(location).attr("href", _this.attr("href"));
});
});
/**
* Confirmation de suppression
*/
$(".dataDelete").on("click", function() {
var _this = $(this);
var message_unlink = "<?php echo helper::translate('Confirmer la dissociation du module de cette page'); ?>";
return core.confirm(message_unlink, function() {
$(location).attr("href", _this.attr("href"));
});
});
// Sélecteur de fonctions
$("#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");
});
// Fonctions
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
// Define function to capitalize the first letter of a string
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

View File

@ -9,51 +9,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("input, select").on("change",(function(){var titleFont=$("#adminFontTitle").val(),textFont=$("#adminFontText").val(),css="@import url('https://fonts.cdnfonts.com/css/"+titleFont+"');",css="@import url('https://fonts.cdnfonts.com/css/"+textFont+"');",colors,css="#site{background-color:"+(colors=core.colorVariants($("#adminBackgroundColor").val())).normal+";}",colors,colors,colors,colors;css+="body, .row > div {font:"+$("#adminFontTextSize").val()+" '"+textFont+"', sans-serif;}",css+="body h1, h2, h3, h4, h5, h6 {font-family:'"+titleFont+"', sans-serif; color:"+$("#adminColorTitle").val()+";}",css+="body:not(.editorWysiwyg),span .zwiico-help {color:"+$("#adminColorText").val()+";}",css+="input[type='checkbox']:checked + label::before,.speechBubble{ background-color:"+(colors=core.colorVariants($("#adminColorButton").val())).normal+"; color:"+$("#adminColorButtonText").val()+";}",css+=".speechBubble::before {border-color:"+colors.normal+" transparent transparent transparent;}",css+=".button {background-color:"+colors.normal+";color:"+colors.text+";}.button:hover {background-color:"+colors.darken+";color:"+colors.text+";}.button:active {background-color:"+colors.veryDarken+";color:"+colors.text+";}",css+=".button.buttonGrey {background-color: "+(colors=core.colorVariants($("#adminColorGrey").val())).normal+";color:"+colors.text+";}.button.buttonGrey:hover {background-color:"+colors.darken+";color:"+colors.text+"}.button.buttonGrey:active {background-color:"+colors.veryDarken+";color:"+colors.text+";}",css+=".button.buttonRed {background-color: "+(colors=core.colorVariants($("#adminColorRed").val())).normal+";color:"+colors.text+";}.button.buttonRed:hover {background-color:"+colors.darken+";color:"+colors.text+"}.button.buttonRed:active {background-color:"+colors.veryDarken+";color:"+colors.text+"}",css+=".button.buttonGreen, button[type=submit] {background-color: "+(colors=core.colorVariants($("#adminColorGreen").val())).normal+";color: ;color:"+colors.text+"}.button.buttonGreen:hover, button[type=submit]:hover {background-color: "+colors.darken+";color:"+colors.text+";}.button.buttonGreen:active, button[type=submit]:active {background-color:"+colors.veryDarken+";color:"+colors.text+"}";var colors=core.colorVariants($("#adminBackGroundBlockColor").val());css+=".block {border: 1px solid "+$("#adminBorderBlockColor").val()+";}.block h4 {background-color: "+colors.normal+";color:"+colors.text+";}",css+="input[type=email],input[type=text],input[type=password],select:not(#barSelectPage),textarea:not(.editorWysiwyg),.inputFile{background-color: "+colors.normal+";color:"+colors.text+";border: 1px solid "+$("#adminBorderBlockColor").val()+";}",$("#themePreview").remove(),$("<style>").attr("type","text/css").attr("id","themePreview").text(css).appendTo("head")})),$("#configAdminReset").on("click",(function(){var _this=$(this);return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine le thème de l'administration ?",(function(){$(location).attr("href",_this.attr("href"))}))}));
/**
* Aperçu en direct
*/
$("input, select").on("change", function () {
var titleFont = $("#adminFontTitle").val();
var textFont = $("#adminFontText").val();
var css = "@import url('https://fonts.cdnfonts.com/css/" + titleFont + "');";
var css = "@import url('https://fonts.cdnfonts.com/css/" + textFont + "');";
var colors = core.colorVariants($("#adminBackgroundColor").val());
var css = "#site{background-color:" + colors.normal + ";}";
css += "body, .row > div {font:" + $("#adminFontTextSize").val() + " '" + textFont + "', sans-serif;}";
css += "body h1, h2, h3, h4, h5, h6 {font-family:'" + titleFont + "', sans-serif; color:" + $("#adminColorTitle").val() + ";}";
css += "body:not(.editorWysiwyg),span .zwiico-help {color:" + $("#adminColorText").val() + ";}";
var colors = core.colorVariants($("#adminColorButton").val());
css += "input[type='checkbox']:checked + label::before,.speechBubble{ background-color:" + colors.normal + "; color:" + $("#adminColorButtonText").val() + ";}";
css += ".speechBubble::before {border-color:" + colors.normal + " transparent transparent transparent;}";
css += ".button {background-color:" + colors.normal + ";color:" + colors.text + ";}.button:hover {background-color:" + colors.darken + ";color:" + colors.text + ";}.button:active {background-color:" + colors.veryDarken + ";color:" + colors.text + ";}";
var colors = core.colorVariants($("#adminColorGrey").val());
css += ".button.buttonGrey {background-color: " + colors.normal + ";color:" + colors.text + ";}.button.buttonGrey:hover {background-color:" + colors.darken + ";color:" + colors.text + "}.button.buttonGrey:active {background-color:" + colors.veryDarken + ";color:" + colors.text + ";}";
var colors = core.colorVariants($("#adminColorRed").val());
css += ".button.buttonRed {background-color: " + colors.normal + ";color:" + colors.text + ";}.button.buttonRed:hover {background-color:" + colors.darken + ";color:" + colors.text + "}.button.buttonRed:active {background-color:" + colors.veryDarken + ";color:" + colors.text + "}";
var colors = core.colorVariants($("#adminColorGreen").val());
css += ".button.buttonGreen, button[type=submit] {background-color: " + colors.normal + ";color: " + ";color:" + colors.text + "}.button.buttonGreen:hover, button[type=submit]:hover {background-color: " + colors.darken + ";color:" + colors.text + ";}.button.buttonGreen:active, button[type=submit]:active {background-color:" + colors.veryDarken + ";color:" + colors.text + "}";
var colors = core.colorVariants($("#adminBackGroundBlockColor").val());
css += ".block {border: 1px solid " + $("#adminBorderBlockColor").val() + ";}.block h4 {background-color: " + colors.normal + ";color:" + colors.text + ";}";
css += "input[type=email],input[type=text],input[type=password],select:not(#barSelectPage),textarea:not(.editorWysiwyg),.inputFile{background-color: " + colors.normal + ";color:" + colors.text + ";border: 1px solid " + $("#adminBorderBlockColor").val() + ";}";
// Ajout du css au DOM
$("#themePreview").remove();
$("<style>")
.attr("type", "text/css")
.attr("id", "themePreview")
.text(css)
.appendTo("head");
});
/**
* Confirmation de réinitialisation
*/
$("#configAdminReset").on("click", function () {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine le thème de l\'administration ?", function () {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -10,26 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("#themeAdvancedCss").on("change keydown keyup",(function(){$("#themePreview").remove(),$("<style>").attr("type","text/css").attr("id","themePreview").text($(this).val()).appendTo("head")})),$("#themeAdvancedReset").on("click",(function(){var _this=$(this);return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine la personnalisation avancée ?",(function(){$(location).attr("href",_this.attr("href"))}))}));
/**
* Aperçu en direct
*/
$("#themeAdvancedCss").on("change keydown keyup", function () {
// Ajout du css au DOM
$("#themePreview").remove();
$("<style>")
.attr("type", "text/css")
.attr("id", "themePreview")
.text($(this).val())
.appendTo("head");
});
/**
* Confirmation de réinitialisation
*/
$("#themeAdvancedReset").on("click", function () {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine la personnalisation avancée ?", function () {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -10,55 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$(document).ready((function(){$("#backToTop").css("display","show")})),$("input, select").on("change",(function(){var themeBodyImageSize=$("#themeBodyImageSize").val();"cover"!==themeBodyImageSize&&"contain"!==themeBodyImageSize||$("#themeBodyImageAttachment").val("fixed");var css="html{background-color:"+$("#themeBodyBackgroundColor").val()+"}",themeBodyImage=$("#themeBodyImage").val();themeBodyImage?(css+="html{background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/"+themeBodyImage+"');background-repeat:"+$("#themeBodyImageRepeat").val()+";background-position:"+$("#themeBodyImagePosition").val()+";background-attachment:"+$("#themeBodyImageAttachment").val()+";background-size:"+$("#themeBodyImageSize").val()+"}",css+="html{background-color:rgba(0,0,0,0);}"):css+="html{background-image:none}",css+="#backToTop {background-color:"+$("#themeBodyToTopBackground").val()+";color:"+$("#themeBodyToTopColor").val()+";}",$("#themePreview").remove(),$("<style>").attr("type","text/css").attr("id","themePreview").text(css).appendTo("head")})),$("#themeBodyImage").on("change",(function(){$(this).val()?$("#themeBodyImageOptions").slideDown():$("#themeBodyImageOptions").slideUp()})).trigger("change");
/**
* Affichage de l'icone de remontée et permettre l'aperçu.
*/
$(document).ready(function () {
$("#backToTop").css("display", "show");
});
/**
* Aperçu en direct
*/
$("input, select").on("change", function () {
// Option fixe pour contain et cover
var themeBodyImageSize = $("#themeBodyImageSize").val();
if (themeBodyImageSize === "cover" ||
themeBodyImageSize === "contain") {
$("#themeBodyImageAttachment").val("fixed");
}
// Couleur du fond
var css = "html{background-color:" + $("#themeBodyBackgroundColor").val() + "}";
// Image du fond
var themeBodyImage = $("#themeBodyImage").val();
if (themeBodyImage) {
css += "html{background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/" + themeBodyImage + "');background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}";
css += "html{background-color:rgba(0,0,0,0);}";
}
else {
css += "html{background-image:none}";
}
css += '#backToTop {background-color:' + $("#themeBodyToTopBackground").val() + ';color:' + $("#themeBodyToTopColor").val() + ';}';
// Ajout du css au DOM
$("#themePreview").remove();
$("<style>")
.attr("type", "text/css")
.attr("id", "themePreview")
.text(css)
.appendTo("head");
});
// Affiche / Cache les options de l'image du fond
$("#themeBodyImage").on("change", function () {
if ($(this).val()) {
$("#themeBodyImageOptions").slideDown();
}
else {
$("#themeBodyImageOptions").slideUp();
}
}).trigger("change");

View File

@ -8,27 +8,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("input[name=fontAddFontImported]").on("click",(function(){$("input[name=fontAddFontImported]").is(":checked")?$("input[name=fontAddFontFile]").prop("checked",!1):$("input[name=fontAddFontFile]").prop("checked",!0),$("#containerFontAddFile").hide(),$("#containerFontAddUrl").show()})),$("input[name=fontAddFontFile]").on("click",(function(){$("input[name=fontAddFontFile]").is(":checked")?$("input[name=fontAddFontImported]").prop("checked",!1):$("input[name=fontAddFontImported]").prop("checked",!0),$("#containerFontAddFile").show(),$("#containerFontAddUrl").hide()}));
/**
* Mode téléchargement en ligne de la fonte ou installation locale
*/
$("input[name=fontAddFontImported]").on("click", function() {
if( $('input[name=fontAddFontImported]').is(':checked') ){
$('input[name=fontAddFontFile]').prop('checked', false);
} else {
$('input[name=fontAddFontFile]').prop('checked', true);
}
$('#containerFontAddFile').hide();
$('#containerFontAddUrl').show();
});
$("input[name=fontAddFontFile]").on("click", function() {
if( $('input[name=fontAddFontFile]').is(':checked') ){
$('input[name=fontAddFontImported]').prop('checked', false);
} else {
$('input[name=fontAddFontImported]').prop('checked', true);
}
$('#containerFontAddFile').show();
$('#containerFontAddUrl').hide();
});

View File

@ -8,52 +8,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$(document).ready((function(){$("input[name=fontEditFontImported]").is(":checked")&&($("#containerfontEditFile").hide(),$("#containerfontEditUrl").show(),$("#fontEditFontFileWrapper").hide(),$("input[name=fontEditFontImported]").attr("disabled","disabled")),$("input[name=fontEditFontFile]").is(":checked")&&($("#containerfontEditFile").show(),$("#containerfontEditUrl").hide(),$("#fontEditFontImportedWrapper").hide(),$("input[name=fontEditFontFile]").attr("disabled","disabled"))}));
/**
* Option par défaut du sélecteur de mode
*/
$(document).ready(function () {
if ($('input[name=fontEditFontImported]').is(':checked')) {
$('#containerfontEditFile').hide();
$('#containerfontEditUrl').show();
$('#fontEditFontFileWrapper').hide();
$('input[name=fontEditFontImported]').attr('disabled', 'disabled');
}
if ($('input[name=fontEditFontFile]').is(':checked')) {
$('#containerfontEditFile').show();
$('#containerfontEditUrl').hide();
$('#fontEditFontImportedWrapper').hide();
$('input[name=fontEditFontFile]').attr('disabled', 'disabled');
}
});
/**
* Mode téléchargement en ligne de la fonte ou installation locale
$("input, select").on("change", function() {
if( $('input[name=fontEditFontImported]').is(':checked') ){
$('input[name=fontEditFontFile]').prop('checked', false);
$('#containerfontEditFile').hide();
$('#containerfontEditUrl').show();
} else {
}
if( $('input[name=fontEditFontFile]').is(':checked') ){
$('input[name=fontEditFontImported]').prop('checked', false);
$('#containerfontEditFile').show();
$('#containerfontEditUrl').hide();
} else {
$('input[name=fontEditFontImported]').prop('checked', true);
}
});
*/

View File

@ -8,14 +8,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$(".themeFontDelete").on("click",(function(){var _this=$(this);return core.confirm("Êtes-vous sûr de vouloir supprimer cette fonte ?",(function(){$(location).attr("href",_this.attr("href"))}))}));
/**
* Confirmation de suppression
*/
$(".themeFontDelete").on("click", function () {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cette fonte ?", function () {
$(location).attr("href", _this.attr("href"));
});
});

File diff suppressed because one or more lines are too long

View File

@ -10,67 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("<a>").addClass("themeOverlay").attr({id:"themeOverlayBody",href:"<?php echo helper::baseUrl(); ?>theme/body"}).appendTo("body"),$("<a>").addClass("themeOverlay").attr({id:"themeOverlayHeader",href:"<?php echo helper::baseUrl(); ?>theme/header"}).appendTo("header"),$("<a>").addClass("themeOverlay").attr({id:"themeOverlayMenu",href:"<?php echo helper::baseUrl(); ?>theme/menu"}).appendTo("nav"),$("<a>").addClass("themeOverlay").attr({id:"themeOverlaySite",href:"<?php echo helper::baseUrl(); ?>theme/site"}).appendTo("#site"),$("<a>").addClass("themeOverlay themeOverlayHideBackground").attr({id:"themeOverlaySection",href:"<?php echo helper::baseUrl(); ?>theme/site"}).appendTo("section"),$("<a>").addClass("themeOverlay").attr({id:"themeOverlayFooter",href:"<?php echo helper::baseUrl(); ?>theme/footer"}).appendTo("footer"),$("#themeShowAll").on("click",(function(){$("header.displayNone, nav.displayNone, footer.displayNone").slideToggle()})),$("section").on("mouseover",(function(){$("#themeOverlaySite:not(.themeOverlayTriggerHover)").addClass("themeOverlayTriggerHover")})).on("mouseleave",(function(){$("#themeOverlaySite.themeOverlayTriggerHover").removeClass("themeOverlayTriggerHover")}));
/**
* Ajout des overlays
*/
$("<a>")
.addClass("themeOverlay")
.attr({
"id": "themeOverlayBody",
"href": "<?php echo helper::baseUrl(); ?>theme/body"
})
.appendTo("body");
$("<a>")
.addClass("themeOverlay")
.attr({
"id": "themeOverlayHeader",
"href": "<?php echo helper::baseUrl(); ?>theme/header"
})
.appendTo("header");
$("<a>")
.addClass("themeOverlay")
.attr({
"id": "themeOverlayMenu",
"href": "<?php echo helper::baseUrl(); ?>theme/menu"
})
.appendTo("nav");
$("<a>")
.addClass("themeOverlay")
.attr({
"id": "themeOverlaySite",
"href": "<?php echo helper::baseUrl(); ?>theme/site"
})
.appendTo("#site");
$("<a>")
.addClass("themeOverlay themeOverlayHideBackground")
.attr({
"id": "themeOverlaySection",
"href": "<?php echo helper::baseUrl(); ?>theme/site"
})
.appendTo("section");
$("<a>")
.addClass("themeOverlay")
.attr({
"id": "themeOverlayFooter",
"href": "<?php echo helper::baseUrl(); ?>theme/footer"
})
.appendTo("footer");
/**
* Affiche les zones cachées
*/
$("#themeShowAll").on("click", function () {
$("header.displayNone, nav.displayNone, footer.displayNone").slideToggle();
});
/**
* Simule un survole du site lors du survole de la section
*/
$("section")
.on("mouseover", function () {
$("#themeOverlaySite:not(.themeOverlayTriggerHover)").addClass("themeOverlayTriggerHover");
})
.on("mouseleave", function () {
$("#themeOverlaySite.themeOverlayTriggerHover").removeClass("themeOverlayTriggerHover");
});

View File

@ -10,13 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("#configManageReset").on("click",(function(){var _this=$(this);return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine le thème du site ?",(function(){$(location).attr("href",_this.attr("href"))}))}));
/**
* Confirmation de réinitialisation
*/
$("#configManageReset").on("click", function () {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir réinitialiser à son état d'origine le thème du site ?", function () {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,90 +1,13 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2022, Frédéric Tempez * @copyright Copyright (C) 2018-2022, Frédéric Tempez
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
function setCookie(name,value,days){var expires="";if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/; samesite=lax"}function getCookie(name){for(var nameEQ=name+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];" "==c.charAt(0);)c=c.substring(1,c.length);if(0==c.indexOf(nameEQ))return c.substring(nameEQ.length,c.length)}return null}function capitalizeFirstLetter(string){return string.charAt(0).toUpperCase()+string.slice(1)}$(document).ready((function(){var translateLayout=getCookie("translateLayout");null==translateLayout&&(translateLayout="ui",setCookie("translateLayout","ui")),$("#contentContainer").hide(),$("#uiContainer").hide(),$("#"+translateLayout+"Container").show(),$("#translate"+capitalizeFirstLetter(translateLayout)+"Button").addClass("activeButton")})),$("#translateUiButton").on("click",(function(){$("#contentContainer").hide(),$("#uiContainer").show(),$(this).addClass("activeButton"),$("#translateContentButton").removeClass("activeButton"),setCookie("translateLayout","ui"),$("#translateButtonAddContent").hide(),$("#translateButtonCopyContent").hide()})),$("#translateContentButton").on("click",(function(){$("#uiContainer").hide(),$("#contentContainer").show(),$(this).addClass("activeButton"),$("#translateUiButton").removeClass("activeButton"),setCookie("translateLayout","content"),$("#translateButtonAddContent").show(),$("#translateButtonCopyContent").show()})),$(".translateDelete").on("click",(function(){var _this=$(this),message_delete="<?php echo helper::translate('Confirmer la suppression de cette traduction du site'); ?>";return core.confirm(message_delete,(function(){$(location).attr("href",_this.attr("href"))}))}));
$(document).ready(function () {
var translateLayout = getCookie("translateLayout");
if (translateLayout == null) {
translateLayout = "ui";
setCookie("translateLayout", "ui");
}
$("#contentContainer").hide();
$("#uiContainer").hide();
$("#" + translateLayout + "Container").show();
$("#translate" + capitalizeFirstLetter(translateLayout) + "Button").addClass("activeButton");
});
// Sélecteur de fonctions
$("#translateUiButton").on("click", function () {
$("#contentContainer").hide();
$("#uiContainer").show();
$(this).addClass("activeButton");
$("#translateContentButton").removeClass("activeButton");
setCookie("translateLayout", "ui");
// Cacher les boutons liés au contenu
$("#translateButtonAddContent").hide();
$("#translateButtonCopyContent").hide();
});
$("#translateContentButton").on("click", function () {
$("#uiContainer").hide();
$("#contentContainer").show();
$(this).addClass("activeButton");
$("#translateUiButton").removeClass("activeButton");
setCookie("translateLayout", "content");
// Afficher les boutons liés au contenu
$("#translateButtonAddContent").show();
$("#translateButtonCopyContent").show();
});
/**
* Confirmation de suppression
*/
$(".translateDelete").on("click", function() {
var _this = $(this);
var message_delete = "<?php echo helper::translate('Confirmer la suppression de cette traduction du site'); ?>";
return core.confirm(message_delete, function() {
$(location).attr("href", _this.attr("href"));
});
});
// Fonctions
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
// Define function to capitalize the first letter of a string
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

View File

@ -10,61 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("#userAddId").on("change keydown keyup",(function(event){var userId=$(this).val();if(8!==event.keyCode&&37!==event.keyCode&&39!==event.keyCode&&46!==event.keyCode&&window.getSelection().toString()!==userId){var searchReplace={"á":"a","à":"a","â":"a","ä":"a","ã":"a","å":"a","ç":"c","é":"e","è":"e","ê":"e","ë":"e","í":"i","ì":"i","î":"i","ï":"i","ñ":"n","ó":"o","ò":"o","ô":"o","ö":"o","õ":"o","ú":"u","ù":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Á":"A","À":"A","Â":"A","Ä":"A","Ã":"A","Å":"A","Ç":"C","É":"E","È":"E","Ê":"E","Ë":"E","Í":"I","Ì":"I","Î":"I","Ï":"I","Ñ":"N","Ó":"O","Ò":"O","Ô":"O","Ö":"O","Õ":"O","Ú":"U","Ù":"U","Û":"U","Ü":"U","Ý":"Y","Ÿ":"Y","'":"-",'"':"-"," ":"-"};userId=(userId=userId.replace(/[áàâäãåçéèêëíìîïñóòôöõúùûüýÿ'" ]/gi,(function(match){return searchReplace[match]}))).replace(/[^a-z0-9-]/gi,""),$(this).val(userId)}})),$("#userAddGroup").on("change",(function(){$(".userAddGroupDescription").hide(),$("#userAddGroupDescription"+$(this).val()).show()})).trigger("change"),$(document).ready((function(){"1"===$("#userAddGroup").val()?$("#userAddMemberFiles").slideDown():$("#userAddMemberFiles").slideUp((function(){$("#userAddtFiles").prop("checked",!1).trigger("change")}))})),$("#userAddGroup").on("change",(function(){"1"===$("#userAddGroup").val()?$("#userAddMemberFiles").slideDown():$("#userAddMemberFiles").slideUp((function(){$("#userAddFiles").prop("checked",!1).trigger("change")}))})).trigger("change");
/**
* Affichage de l'id en simulant FILTER_ID
*/
$("#userAddId").on("change keydown keyup", function(event) {
var userId = $(this).val();
if(
event.keyCode !== 8 // BACKSPACE
&& event.keyCode !== 37 // LEFT
&& event.keyCode !== 39 // RIGHT
&& event.keyCode !== 46 // DELETE
&& window.getSelection().toString() !== userId // Texte sélectionné
) {
var searchReplace = {
"á": "a", "à": "a", "â": "a", "ä": "a", "ã": "a", "å": "a", "ç": "c", "é": "e", "è": "e", "ê": "e", "ë": "e", "í": "i", "ì": "i", "î": "i", "ï": "i", "ñ": "n", "ó": "o", "ò": "o", "ô": "o", "ö": "o", "õ": "o", "ú": "u", "ù": "u", "û": "u", "ü": "u", "ý": "y", "ÿ": "y",
"Á": "A", "À": "A", "Â": "A", "Ä": "A", "Ã": "A", "Å": "A", "Ç": "C", "É": "E", "È": "E", "Ê": "E", "Ë": "E", "Í": "I", "Ì": "I", "Î": "I", "Ï": "I", "Ñ": "N", "Ó": "O", "Ò": "O", "Ô": "O", "Ö": "O", "Õ": "O", "Ú": "U", "Ù": "U", "Û": "U", "Ü": "U", "Ý": "Y", "Ÿ": "Y",
"'": "-", "\"": "-", " ": "-"
};
userId = userId.replace(/[áàâäãåçéèêëíìîïñóòôöõúùûüýÿ'" ]/ig, function(match) {
return searchReplace[match];
});
userId = userId.replace(/[^a-z0-9-]/ig, "");
$(this).val(userId);
}
});
/**
* Droits des groupes
*/
$("#userAddGroup").on("change", function() {
$(".userAddGroupDescription").hide();
$("#userAddGroupDescription" + $(this).val()).show();
}).trigger("change");
/**
* Autorisation d'upload et de download pour un membre
*/
$(document).ready(function(){
if($("#userAddGroup").val() === '1') {
$("#userAddMemberFiles").slideDown();
}
else {
$("#userAddMemberFiles").slideUp(function() {
$("#userAddtFiles").prop("checked", false).trigger("change");
});
}
});
$("#userAddGroup").on("change", function() {
if($("#userAddGroup").val() === '1') {
$("#userAddMemberFiles").slideDown();
}
else {
$("#userAddMemberFiles").slideUp(function() {
$("#userAddFiles").prop("checked", false).trigger("change");
});
}
}).trigger("change");

View File

@ -10,40 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$("#userEditGroup").on("change",(function(){$(".userEditGroupDescription").hide(),$("#userEditGroupDescription"+$(this).val()).show(),$("#userEditGroup option:selected").val()<0?$("#userEditLabelAuth").css("display","none"):$("#userEditLabelAuth").css("display","inline-block")})).trigger("change"),$(document).ready((function(){"1"===$("#userEditGroup").val()?$("#userEditMemberFiles").slideDown():$("#userEditMemberFiles").slideUp((function(){$("#userEditFiles").prop("checked",!1).trigger("change")}))})),$("#userEditGroup").on("change",(function(){"1"===$("#userEditGroup").val()?$("#userEditMemberFiles").slideDown():$("#userEditMemberFiles").slideUp((function(){$("#userEditFiles").prop("checked",!1).trigger("change")}))})).trigger("change");
/**
* Droits des groupes
*/
$("#userEditGroup").on("change", function() {
$(".userEditGroupDescription").hide();
$("#userEditGroupDescription" + $(this).val()).show();
if ($("#userEditGroup option:selected").val() < 0) {
$("#userEditLabelAuth").css("display","none");
} else {
$("#userEditLabelAuth").css("display","inline-block");
}
}).trigger("change");
$(document).ready(function(){
// Membre avec ou sans gestion de fichiers
if($("#userEditGroup").val() === '1') {
$("#userEditMemberFiles").slideDown();
}
else {
$("#userEditMemberFiles").slideUp(function() {
$("#userEditFiles").prop("checked", false).trigger("change");
});
}
});
$("#userEditGroup").on("change", function() {
// Membre avec ou sans gestion de fichiers
if($("#userEditGroup").val() === '1') {
$("#userEditMemberFiles").slideDown();
}
else {
$("#userEditMemberFiles").slideUp(function() {
$("#userEditFiles").prop("checked", false).trigger("change");
});
}
}).trigger("change");

View File

@ -10,14 +10,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$(".userDelete").on("click",(function(){var _this=$(this);return message="<?php echo helper::translate('Confirmer la suppression de cet utilisateur');?>",core.confirm(message,(function(){$(location).attr("href",_this.attr("href"))}))}));
/**
* Confirmation de suppression
*/
$(".userDelete").on("click", function() {
var _this = $(this);
message = "<?php echo helper::translate('Confirmer la suppression de cet utilisateur');?>";
return core.confirm(message, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -8,13 +8,4 @@
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
$(document).ready((function(){$(".zwiico-eye").mouseenter((function(){$("#userLoginPassword").attr("type","text")})),$(".zwiico-eye").mouseleave((function(){$("#userLoginPassword").attr("type","password")}))}));
$(document).ready(function(){
$(".zwiico-eye").mouseenter(function() {
$("#userLoginPassword").attr("type", 'text');
});
$(".zwiico-eye").mouseleave(function() {
$("#userLoginPassword").attr("type", 'password');
});
});