2018-04-02 08:29:19 +02:00
|
|
|
/**
|
|
|
|
* This file is part of Zwii.
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*
|
|
|
|
* @author Rémi Jean <remi.jean@outlook.com>
|
|
|
|
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
|
|
|
* @license GNU General Public License, version 3
|
2019-05-13 20:38:07 +02:00
|
|
|
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
2021-12-18 10:25:33 +01:00
|
|
|
* @copyright Copyright (C) 2018-2022, Frédéric Tempez
|
2020-09-01 20:48:40 +02:00
|
|
|
* @link http://zwiicms.fr/
|
2018-04-02 08:29:19 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Aperçu en direct
|
|
|
|
*/
|
|
|
|
$("input, select").on("change", function() {
|
2019-03-19 06:59:28 +01:00
|
|
|
// Import des polices de caractères
|
2022-02-04 16:26:39 +01:00
|
|
|
var footerFont = $("#themeFooterFont :selected").val();
|
|
|
|
var footerFontText = $("#themeFooterFont :selected").text();
|
2022-02-17 15:23:18 +01:00
|
|
|
var css = "@import url('https://fonts.cdnfonts.com/css/" + footerFont + "');";
|
2018-04-02 08:29:19 +02:00
|
|
|
// Couleurs du pied de page
|
|
|
|
var colors = core.colorVariants($("#themeFooterBackgroundColor").val());
|
|
|
|
var textColor = $("#themeFooterTextColor").val();
|
2021-10-03 17:26:05 +02:00
|
|
|
var css = "footer {background-color:" + colors.normal + ";color:" + textColor + "}";
|
2018-04-02 08:29:19 +02:00
|
|
|
css += "footer a{color:" + textColor + "}";
|
2020-03-16 08:59:10 +01:00
|
|
|
// Couleur de l'éditeur
|
|
|
|
css += ".editorWysiwyg{background-color:" + colors.normal + " !important; color:" + textColor + " !important;}";
|
2018-04-02 08:29:19 +02:00
|
|
|
// Hauteur du pied de page
|
2019-07-15 12:27:41 +02:00
|
|
|
//css += "#footersiteLeft, #footersiteCenter, #footersiteRight, #footerbodyLeft, #footerbodyCenter, #footerbodyRight {margin:" + $("#themeFooterHeight").val() + " 0}";
|
2021-10-03 17:26:05 +02:00
|
|
|
css += "footer #footersite > div{margin:" + $("#themeFooterHeight").val() + " 0}";
|
|
|
|
css += "footer #footerbody > div{margin:" + $("#themeFooterHeight").val() + " 0}";
|
2018-04-02 08:29:19 +02:00
|
|
|
// Alignement du contenu
|
|
|
|
css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}";
|
2020-02-02 12:02:44 +01:00
|
|
|
css += "#footerText > p {text-align:" + $("#themeFooterTextAlign").val() + "}";
|
2018-04-02 08:29:19 +02:00
|
|
|
css += "#footerCopyright{text-align:" + $("#themeFooterCopyrightAlign").val() + "}";
|
2019-03-19 06:59:28 +01:00
|
|
|
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
|
2022-02-04 16:26:39 +01:00
|
|
|
css += "footer span, #footerText > p {color:" + $("#themeFooterTextColor").val() + ";font-family:'" + footerFontText + "',sans-serif;font-weight:" + $("#themeFooterFontWeight").val() + ";font-size:" + $("#themeFooterFontSize").val() + ";text-transform:" + $("#themeFooterTextTransform").val() + "}";
|
2018-04-02 08:29:19 +02:00
|
|
|
// Marge
|
|
|
|
if($("#themeFooterMargin").is(":checked")) {
|
2019-11-12 19:01:53 +01:00
|
|
|
css += 'footer{padding: 0 20px;}';
|
2018-04-02 08:29:19 +02:00
|
|
|
}
|
|
|
|
else {
|
2019-11-12 18:52:16 +01:00
|
|
|
css += 'footer{padding:0}';
|
2018-04-02 08:29:19 +02:00
|
|
|
}
|
|
|
|
// Ajout du css au DOM
|
|
|
|
$("#themePreview").remove();
|
|
|
|
$("<style>")
|
|
|
|
.attr("type", "text/css")
|
|
|
|
.attr("id", "themePreview")
|
|
|
|
.text(css)
|
2019-03-20 20:05:03 +01:00
|
|
|
.appendTo("footer");
|
2018-04-02 08:29:19 +02:00
|
|
|
// Position du pied de page
|
|
|
|
switch($("#themeFooterPosition").val()) {
|
|
|
|
case 'hide':
|
|
|
|
$("footer").hide();
|
|
|
|
break;
|
|
|
|
case 'site':
|
|
|
|
$("footer").show().appendTo("#site");
|
2019-06-27 20:52:30 +02:00
|
|
|
$("footer > div:first-child").removeAttr("class");
|
|
|
|
$("footer > div:first-child").addClass("container");
|
2018-04-02 08:29:19 +02:00
|
|
|
break;
|
|
|
|
case 'body':
|
|
|
|
$("footer").show().appendTo("body");
|
2019-06-27 20:52:30 +02:00
|
|
|
$("footer > div:first-child").removeAttr("class");
|
|
|
|
$("footer > div:first-child").addClass("container-large");
|
2018-04-02 08:29:19 +02:00
|
|
|
break;
|
|
|
|
}
|
2019-06-27 20:52:30 +02:00
|
|
|
// Réduire la marge du paragraphe de la zone de texte enrichie
|
2020-02-02 12:02:44 +01:00
|
|
|
$("#footerText > p").css("margin-top","0");
|
|
|
|
$("#footerText > p").css("margin-bottom","0");
|
2018-04-02 08:29:19 +02:00
|
|
|
});
|
2018-09-23 18:55:08 +02:00
|
|
|
|
2019-06-19 21:37:16 +02:00
|
|
|
|
|
|
|
|
2019-01-19 23:37:36 +01:00
|
|
|
// Position dans les blocs
|
2018-09-23 18:55:08 +02:00
|
|
|
// Bloc texte personnalisé
|
2019-06-19 21:37:16 +02:00
|
|
|
$(".themeFooterContent").on("change",function() {
|
2019-07-15 18:35:25 +02:00
|
|
|
// Position site ou body
|
2021-10-03 17:26:05 +02:00
|
|
|
var footerPosition = $("#themeFooterPosition").val();
|
2018-09-23 18:55:08 +02:00
|
|
|
switch($("#themeFooterTextPosition").val()) {
|
2019-06-18 20:08:04 +02:00
|
|
|
case "hide":
|
2018-09-23 18:55:08 +02:00
|
|
|
$("#footerText").hide();
|
|
|
|
break;
|
2019-07-15 18:35:25 +02:00
|
|
|
default:
|
|
|
|
// Choix de la position du bloc
|
|
|
|
textPosition = $("#themeFooterTextPosition").val();
|
|
|
|
textPosition = textPosition.substr(0,1).toUpperCase()+textPosition.substr(1);
|
|
|
|
$("#footerText").show().appendTo("#footer" + footerPosition + textPosition);
|
2021-10-03 17:26:05 +02:00
|
|
|
break;
|
2018-09-23 18:55:08 +02:00
|
|
|
}
|
|
|
|
switch($("#themeFooterSocialsPosition").val()) {
|
|
|
|
case 'hide':
|
|
|
|
$("#footerSocials").hide();
|
2021-10-03 17:26:05 +02:00
|
|
|
break;
|
2019-07-15 18:35:25 +02:00
|
|
|
default:
|
|
|
|
// Choix de la position du bloc
|
|
|
|
socialsPosition = $("#themeFooterSocialsPosition").val();
|
|
|
|
socialsPosition = socialsPosition.substr(0,1).toUpperCase()+socialsPosition.substr(1);
|
|
|
|
$("#footerSocials").show().appendTo("#footer" + footerPosition + socialsPosition);
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
}
|
2019-06-22 08:23:09 +02:00
|
|
|
switch($("#themeFooterCopyrightPosition").val()) {
|
2018-09-23 18:55:08 +02:00
|
|
|
case 'hide':
|
|
|
|
$("#footerCopyright").hide();
|
2021-10-03 17:26:05 +02:00
|
|
|
break;
|
2019-07-15 18:35:25 +02:00
|
|
|
default:
|
|
|
|
// Choix de la position du bloc
|
|
|
|
copyrightPosition = $("#themeFooterCopyrightPosition").val();
|
|
|
|
copyrightPosition = copyrightPosition.substr(0,1).toUpperCase()+copyrightPosition.substr(1);
|
|
|
|
$("#footerCopyright").show().appendTo("#footer" + footerPosition + copyrightPosition);
|
2021-10-03 17:26:05 +02:00
|
|
|
break;
|
2018-09-23 18:55:08 +02:00
|
|
|
}
|
2019-07-15 18:35:25 +02:00
|
|
|
|
2021-10-03 17:26:05 +02:00
|
|
|
|
2018-09-23 18:55:08 +02:00
|
|
|
}).trigger("change");
|
2019-06-22 08:23:09 +02:00
|
|
|
|
2019-06-19 21:37:16 +02:00
|
|
|
// Fin Position dans les blocs
|
2018-09-23 18:55:08 +02:00
|
|
|
|
2021-10-03 17:26:05 +02:00
|
|
|
// Modification dynamique de la mise en page
|
2019-06-18 20:08:04 +02:00
|
|
|
$("#themeFooterTemplate").on("change",function() {
|
|
|
|
// Nettoyage des sélecteurs des contenus
|
2019-06-19 09:35:19 +02:00
|
|
|
var newOptions = {
|
2021-10-03 17:26:05 +02:00
|
|
|
4: {'hide' : 'Masqué', 'left' : 'En haut', 'center' : 'Au milieu', 'right' : 'En bas'} ,
|
2019-06-27 16:21:43 +02:00
|
|
|
3: {'hide': 'Masqué', 'left': 'A gauche', 'center': 'Au centre', 'right': 'A droite'} ,
|
|
|
|
2: {'hide': 'Masqué', 'left': 'A gauche', 'right': 'A droite'} ,
|
2021-10-03 17:26:05 +02:00
|
|
|
1: {'hide': 'Masqué', 'center': 'Affiché'}
|
|
|
|
};
|
2019-06-19 21:37:16 +02:00
|
|
|
var $el = $(".themeFooterContent");
|
2021-10-03 17:26:05 +02:00
|
|
|
$el.empty();
|
2019-06-18 20:08:04 +02:00
|
|
|
// Eléments des position de contenus
|
|
|
|
$.each(newOptions[$("#themeFooterTemplate").val()], function(key,value) {
|
|
|
|
$el.append($("<option></option>")
|
|
|
|
.attr("value", key).text(value));
|
|
|
|
});
|
2019-06-19 21:37:16 +02:00
|
|
|
var position = $("#themeFooterPosition").val();
|
2021-10-03 17:26:05 +02:00
|
|
|
// Masquer les contenus
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerCopyright").hide();
|
|
|
|
$("#footerText").hide();
|
|
|
|
$("#footerSocials").hide();
|
2019-07-15 11:54:04 +02:00
|
|
|
// Dimension des blocs
|
2019-06-18 20:08:04 +02:00
|
|
|
switch($("#themeFooterTemplate").val()) {
|
|
|
|
case "1":
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footer" + position + "Left").css("display","none");
|
2019-06-24 20:12:41 +02:00
|
|
|
$("#footer" + position + "Center").removeAttr('class').addClass("col12").css("display","");
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footer" + position + "Right").css("display","none");
|
2021-10-03 17:26:05 +02:00
|
|
|
break;
|
|
|
|
case "2":
|
2019-06-24 20:12:41 +02:00
|
|
|
$("#footer" + position + "Left").removeAttr('class').addClass('col6').css("display","");
|
|
|
|
$("#footer" + position + "Center").css("display","none").removeAttr('class');
|
|
|
|
$("#footer" + position + "Right").removeAttr('class').addClass('col6').css("display","");
|
2019-06-18 20:08:04 +02:00
|
|
|
break;
|
2021-10-03 17:26:05 +02:00
|
|
|
case "3":
|
2019-06-24 20:12:41 +02:00
|
|
|
$("#footer" + position + "Left").removeAttr('class').addClass('col4').css("display","");
|
|
|
|
$("#footer" + position + "Center").removeAttr('class').addClass('col4').css("display","");
|
|
|
|
$("#footer" + position + "Right").removeAttr('class').addClass('col4').css("display","");
|
2019-06-18 20:08:04 +02:00
|
|
|
break;
|
2019-06-22 19:44:13 +02:00
|
|
|
case "4":
|
2019-06-24 20:12:41 +02:00
|
|
|
$("#footer" + position + "Left").removeAttr('class').addClass('col12').css("display","");
|
|
|
|
$("#footer" + position + "Center").removeAttr('class').addClass('col12').css("display","");
|
|
|
|
$("#footer" + position + "Right").removeAttr('class').addClass('col12').css("display","");
|
2019-06-22 19:44:13 +02:00
|
|
|
break;
|
|
|
|
|
2021-10-03 17:26:05 +02:00
|
|
|
}
|
2019-06-18 20:08:04 +02:00
|
|
|
});
|
|
|
|
|
2018-09-23 18:55:08 +02:00
|
|
|
|
2019-06-19 21:49:21 +02:00
|
|
|
// Désactivation des sélections multiples
|
|
|
|
$("#themeFooterSocialsPosition").on("change", function() {
|
2021-10-03 17:26:05 +02:00
|
|
|
if ($(this).prop('selectedIndex') >= 1 ) {
|
2019-06-19 21:49:21 +02:00
|
|
|
if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
|
|
|
$("#themeFooterTextPosition").prop('selectedIndex',0);
|
2021-10-03 17:26:05 +02:00
|
|
|
$("#footerText").hide();
|
2019-06-19 21:49:21 +02:00
|
|
|
}
|
2021-10-03 17:26:05 +02:00
|
|
|
if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
2019-06-19 21:49:21 +02:00
|
|
|
$("#themeFooterCopyrightPosition").prop('selectedIndex',0);
|
|
|
|
$("#footerCopyright").hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
$("#themeFooterTextPosition").on("change", function() {
|
|
|
|
if ($(this).prop('selectedIndex') >= 1 ) {
|
|
|
|
if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
|
|
|
$("#themeFooterSocialsPosition").prop('selectedIndex',0);
|
|
|
|
$("#footerSocials").hide();
|
|
|
|
}
|
2021-10-03 17:26:05 +02:00
|
|
|
if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
2019-06-19 21:49:21 +02:00
|
|
|
$("#themeFooterCopyrightPosition").prop('selectedIndex',0);
|
|
|
|
$("#footerCopyright").hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
|
|
|
$("#themeFooterCopyrightPosition").on("change", function() {
|
|
|
|
if ($(this).prop('selectedIndex') >= 1 ) {
|
|
|
|
if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
|
|
|
$("#themeFooterTextPosition").prop('selectedIndex',0);
|
|
|
|
$("#footerText").hide();
|
|
|
|
}
|
2021-10-03 17:26:05 +02:00
|
|
|
if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
2019-06-19 21:49:21 +02:00
|
|
|
$("#themeFooterSocialsPosition").prop('selectedIndex',0);
|
2021-10-03 17:26:05 +02:00
|
|
|
$("#footerSocials").hide();
|
2019-06-19 21:49:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
2020-02-02 19:14:57 +01:00
|
|
|
// Affiche / Cache les options du footer fixe
|
|
|
|
$("#themeFooterPosition").on("change", function() {
|
|
|
|
if($(this).val() === 'body') {
|
2021-10-03 17:26:05 +02:00
|
|
|
$("#themeFooterPositionFixed").slideDown();
|
2020-02-02 19:14:57 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#themeFooterPositionFixed").slideUp(function() {
|
2020-02-04 13:17:38 +01:00
|
|
|
$("#themeFooterFixed").prop("checked", false).trigger("change");
|
2020-02-02 19:14:57 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
2019-06-19 21:49:21 +02:00
|
|
|
|
2018-04-02 08:29:19 +02:00
|
|
|
// Lien de connexion
|
|
|
|
$("#themeFooterLoginLink").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
|
|
|
$("#footerLoginLink").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#footerLoginLink").hide();
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
2021-10-03 17:26:05 +02:00
|
|
|
|
2019-05-02 13:21:48 +02:00
|
|
|
// Numéro de version
|
|
|
|
$("#themefooterDisplayVersion").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
2019-06-22 19:44:13 +02:00
|
|
|
$("#footerDisplayVersion").show();
|
2019-05-02 13:21:48 +02:00
|
|
|
}
|
|
|
|
else {
|
2019-06-22 19:44:13 +02:00
|
|
|
$("#footerDisplayVersion").hide();
|
2019-05-02 13:21:48 +02:00
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
|
|
|
// Numéro de version
|
|
|
|
$("#themefooterDisplayCopyright").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
|
|
|
$("#footerDisplayCopyright").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#footerDisplayCopyright").hide();
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
|
|
|
// Site Map
|
|
|
|
$("#themefooterDisplaySiteMap").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
|
|
|
$("#footerDisplaySiteMap").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#footerDisplaySiteMap").hide();
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
2019-07-12 10:04:01 +02:00
|
|
|
// Rechercher
|
|
|
|
$("#themeFooterDisplaySearch").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
|
|
|
$("#footerDisplaySearch").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#footerDisplaySearch").hide();
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
2019-01-19 23:37:36 +01:00
|
|
|
|
2021-10-03 17:26:05 +02:00
|
|
|
// Mentions légales
|
|
|
|
$("#themeFooterDisplayLegal").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
|
|
|
$("#footerDisplayLegal").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#footerDisplayLegal").hide();
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
|
|
|
|
|
|
|
// Pages spéciales : activation si une page est sélectionnée
|
|
|
|
$("#configLegalPageId").on("change", function() {
|
|
|
|
if ( $("#configLegalPageId option:selected").text() === 'Aucune') {
|
|
|
|
$("#themeFooterDisplayLegal").prop('checked', false);
|
|
|
|
$("#themeFooterDisplayLegal").prop( "disabled", true );
|
|
|
|
$("#footerDisplayLegal").hide();
|
|
|
|
} else {
|
|
|
|
$("#themeFooterDisplayLegal").prop( "disabled", false );
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
$("#configSearchPageId").on("change", function() {
|
|
|
|
if ( $("#configSearchPageId option:selected").text() === 'Aucune') {
|
|
|
|
$("#themeFooterDisplaySearch").prop('checked', false);
|
|
|
|
$("#themeFooterDisplaySearch").prop( "disabled", true );
|
|
|
|
$("#footerDisplaySearch").hide();
|
|
|
|
} else {
|
|
|
|
$("#themeFooterDisplaySearch").prop( "disabled", false );
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
|
|
|
|
2019-11-12 08:41:19 +01:00
|
|
|
/*
|
2018-04-02 08:29:19 +02:00
|
|
|
// Affiche / Cache les options de la position
|
|
|
|
$("#themeFooterPosition").on("change", function() {
|
|
|
|
if($(this).val() === 'site') {
|
|
|
|
$("#themeFooterPositionOptions").slideDown();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#themeFooterPositionOptions").slideUp(function() {
|
|
|
|
$("#themeFooterMargin").prop("checked", false).trigger("change");
|
|
|
|
});
|
|
|
|
}
|
2019-05-02 13:21:48 +02:00
|
|
|
}).trigger("change");
|
2019-11-12 08:41:19 +01:00
|
|
|
*/
|