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>
|
|
|
|
* @copyright Copyright (C) 2018-2019, Frédéric Tempez
|
2018-04-02 08:29:19 +02:00
|
|
|
* @link http://zwiicms.com/
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Aperçu en direct
|
|
|
|
*/
|
|
|
|
$("input, select").on("change", function() {
|
2019-03-19 06:59:28 +01:00
|
|
|
// Import des polices de caractères
|
|
|
|
var footerFont = $("#themeFooterFont").val();
|
|
|
|
var css = "@import url('https://fonts.googleapis.com/css?family=" + footerFont + "');";
|
2018-04-02 08:29:19 +02:00
|
|
|
// Couleurs du pied de page
|
|
|
|
var colors = core.colorVariants($("#themeFooterBackgroundColor").val());
|
|
|
|
var textColor = $("#themeFooterTextColor").val();
|
|
|
|
var css = "footer{background-color:" + colors.normal + ";color:" + textColor + "}";
|
|
|
|
css += "footer a{color:" + textColor + "}";
|
|
|
|
// Hauteur du pied de page
|
2019-06-19 21:37:16 +02:00
|
|
|
css += "footer .container > div{margin:" + $("#themeFooterHeight").val() + " 0}";
|
2019-03-05 14:14:40 +01:00
|
|
|
//css += "footer .container > div{padding:0}";
|
2019-06-19 21:37:16 +02:00
|
|
|
css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}";
|
2019-03-05 14:14:40 +01:00
|
|
|
//css += "footer .container-large > div{padding:0}";
|
2018-04-02 08:29:19 +02:00
|
|
|
// Alignement du contenu
|
|
|
|
css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}";
|
|
|
|
css += "#footerText{text-align:" + $("#themeFooterTextAlign").val() + "}";
|
|
|
|
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
|
|
|
|
css += "footer span{color:" + $("#themeFooterTextColor").val() + ";font-family:'" + footerFont.replace(/\+/g, " ") + "',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")) {
|
|
|
|
css += 'footer{margin:0 20px 20px}';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
css += 'footer{margin:0}';
|
|
|
|
}
|
|
|
|
// 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");
|
|
|
|
break;
|
|
|
|
case 'body':
|
|
|
|
$("footer").show().appendTo("body");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
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-06-19 21:42:10 +02:00
|
|
|
var position = $("#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-06-18 20:08:04 +02:00
|
|
|
case "left":
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerText").show().appendTo("#footer" + position + "Left");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
2019-06-18 20:08:04 +02:00
|
|
|
case "center":
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerText").show().appendTo("#footer" + position + "Center");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
2019-06-18 20:08:04 +02:00
|
|
|
case "right":
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerText").show().appendTo("#footer" + position + "Right");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
switch($("#themeFooterSocialsPosition").val()) {
|
|
|
|
case 'hide':
|
|
|
|
$("#footerSocials").hide();
|
|
|
|
break;
|
|
|
|
case 'left':
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerSocials").show().appendTo("#footer" + position + "Left");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'center':
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerSocials").show().appendTo("#footer" + position + "Center");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'right':
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerSocials").show().appendTo("#footer" + position + "Right");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
}
|
2018-09-27 06:55:23 +02:00
|
|
|
switch($("#themeFooterCopyrightPosition").val()) {
|
2018-09-23 18:55:08 +02:00
|
|
|
case 'hide':
|
|
|
|
$("#footerCopyright").hide();
|
|
|
|
break;
|
|
|
|
case 'left':
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerCopyright").show().appendTo("#footer" + position + "Left");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'center':
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerCopyright").show().appendTo("#footer" + position + "Center");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'right':
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footerCopyright").show().appendTo("#footer" + position + "Right");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
2019-06-19 21:37:16 +02:00
|
|
|
// Fin Position dans les blocs
|
2018-09-23 18:55:08 +02:00
|
|
|
|
2019-06-19 21:37:16 +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 = {
|
|
|
|
3: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'center': 'Bloc Central', 'right': 'Bloc Droite'} ,
|
|
|
|
2: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'right': 'Bloc Droite'} ,
|
|
|
|
1: {'hide': 'Masqué', 'center': 'Affiché'}
|
|
|
|
};
|
2019-06-19 21:37:16 +02:00
|
|
|
var $el = $(".themeFooterContent");
|
2019-06-18 20:08:04 +02:00
|
|
|
$el.empty();
|
|
|
|
// 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();
|
|
|
|
// Masquer le contenus
|
|
|
|
$("#footerCopyright").hide();
|
|
|
|
$("#footerText").hide();
|
|
|
|
$("#footerSocials").hide();
|
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");
|
|
|
|
$("#footer" + position + "Center").css("display","");
|
|
|
|
$("#footer" + position + "Right").css("display","none");
|
2019-06-18 20:08:04 +02:00
|
|
|
// Dimension du bloc
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footer" + position + "Center").removeAttr('class');
|
|
|
|
$("#footer" + position + "Center").addClass("col12");
|
2019-06-18 20:08:04 +02:00
|
|
|
break;
|
2019-06-19 21:37:16 +02:00
|
|
|
case "2":
|
|
|
|
$("#footer" + position + "Left").css("display","");
|
|
|
|
$("#footer" + position + "Center").css("display","none");
|
|
|
|
$("#footer" + position + "Right").css("display","");
|
2019-06-18 20:08:04 +02:00
|
|
|
// Dimension de blocs
|
2019-06-19 21:37:16 +02:00
|
|
|
$("#footer" + position + "Left").removeAttr('class');
|
|
|
|
$("#footer" + position + "Right").removeAttr('class');
|
|
|
|
$("#footer" + position + "Left").addClass('col6');
|
|
|
|
$("#footer" + position + "Right").addClass('col6');
|
2019-06-18 20:08:04 +02:00
|
|
|
break;
|
2019-06-19 21:37:16 +02:00
|
|
|
case "3":
|
|
|
|
$("#footer" + position + "Left").css("display","");
|
|
|
|
$("#footer" + position + "Center").css("display","");
|
|
|
|
$("#footer" + position + "Right").css("display","");
|
|
|
|
// Dimension de blocs
|
|
|
|
$("#footer" + position + "Left").removeAttr('class');
|
|
|
|
$("#footer" + position + "Right").removeAttr('class');
|
|
|
|
$("#footer" + position + "center").removeAttr('class');
|
|
|
|
$("#footer" + position + "Left").addClass('col4');
|
|
|
|
$("#footer" + position + "Center").addClass('col4');
|
|
|
|
$("#footer" + position + "Right").addClass('col4');
|
2019-06-18 20:08:04 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
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() {
|
|
|
|
if ($(this).prop('selectedIndex') >= 1 ) {
|
|
|
|
if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
|
|
|
$("#themeFooterTextPosition").prop('selectedIndex',0);
|
|
|
|
$("#footerText").hide();
|
|
|
|
}
|
|
|
|
if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
|
|
|
$("#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();
|
|
|
|
}
|
|
|
|
if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
|
|
|
$("#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();
|
|
|
|
}
|
|
|
|
if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
|
|
|
|
$("#themeFooterSocialsPosition").prop('selectedIndex',0);
|
|
|
|
$("#footerSocials").hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}).trigger("change");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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");
|
2019-05-02 13:21:48 +02:00
|
|
|
|
|
|
|
// Numéro de version
|
|
|
|
$("#themefooterDisplayVersion").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
|
|
|
$("#footerDisplayVersion").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#footerDisplayVersion").hide();
|
|
|
|
}
|
|
|
|
}).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-01-19 23:37:36 +01:00
|
|
|
|
2019-04-09 10:21:01 +02:00
|
|
|
// Numéro de version
|
2019-04-09 10:05:38 +02:00
|
|
|
$("#themefooterDisplayVersion").on("change", function() {
|
|
|
|
if($(this).is(":checked")) {
|
|
|
|
$("#footerDisplayVersion").show();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#footerDisplayVersion").hide();
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
|
|
|
|
2018-04-02 08:29:19 +02:00
|
|
|
// Aperçu du texte
|
|
|
|
$("#themeFooterText").on("change keydown keyup", function() {
|
|
|
|
$("#footerText").html($(this).val());
|
|
|
|
});
|
2019-01-19 23:37:36 +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");
|