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
|
|
|
|
* @link http://zwiicms.com/
|
2018-09-23 18:55:08 +02:00
|
|
|
* @Author 23/9/18 Frédéric Tempez <frederic.tempez@outlook.com>
|
2018-04-02 08:29:19 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Aperçu en direct
|
|
|
|
*/
|
|
|
|
$("input, select").on("change", function() {
|
|
|
|
// 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
|
|
|
|
css += "footer .container > div{margin:" + $("#themeFooterHeight").val() + " 0}";
|
2018-09-24 18:59:45 +02:00
|
|
|
css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 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() + "}";
|
|
|
|
// 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)
|
|
|
|
.appendTo("head");
|
|
|
|
// 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
|
|
|
|
|
|
|
// Position dans les blocs FT
|
2018-09-27 06:53:33 +02:00
|
|
|
|
2018-09-23 18:55:08 +02:00
|
|
|
// Bloc texte personnalisé
|
2018-09-27 06:53:33 +02:00
|
|
|
|
|
|
|
$("#themeFooterForm").on("change",function() {
|
2018-09-23 18:55:08 +02:00
|
|
|
switch($("#themeFooterTextPosition").val()) {
|
|
|
|
case 'hide':
|
|
|
|
$("#footerText").hide();
|
|
|
|
break;
|
|
|
|
case 'left':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerText").show().appendTo("#footerbodyLeft");
|
|
|
|
$("#footerText").show().appendTo("#footersiteLeft");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'center':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerText").show().appendTo("#footerbodyCenter");
|
|
|
|
$("#footerText").show().appendTo("#footersiteCenter");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'right':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerText").show().appendTo("#footerbodyRight");
|
|
|
|
$("#footerText").show().appendTo("#footersiteRight");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
switch($("#themeFooterSocialsPosition").val()) {
|
|
|
|
case 'hide':
|
|
|
|
$("#footerSocials").hide();
|
|
|
|
break;
|
|
|
|
case 'left':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerSocials").show().appendTo("#footerbodyLeft");
|
|
|
|
$("#footerSocials").show().appendTo("#footersiteLeft");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'center':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerSocials").show().appendTo("#footerbodyCenter");
|
|
|
|
$("#footerSocials").show().appendTo("#footersiteCenter");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'right':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerSocials").show().appendTo("#footerbodyRight");
|
|
|
|
$("#footerSocials").show().appendTo("#footersiteRight");
|
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':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerCopyright").show().appendTo("#footerbodyLeft");
|
|
|
|
$("#footerCopyright").show().appendTo("#footersiteLeft");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'center':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerCopyright").show().appendTo("#footerbodyCenter");
|
|
|
|
$("#footerCopyright").show().appendTo("#footersiteCenter");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
case 'right':
|
2018-12-30 00:49:38 +01:00
|
|
|
$("#footerCopyright").show().appendTo("#footerbodyRight");
|
|
|
|
$("#footerCopyright").show().appendTo("#footersiteRight");
|
2018-09-23 18:55:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}).trigger("change");
|
|
|
|
|
2018-09-27 06:55:23 +02:00
|
|
|
|
2018-09-23 18:55:08 +02:00
|
|
|
// Fin Position dans les blocs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
// Aperçu du texte
|
|
|
|
$("#themeFooterText").on("change keydown keyup", function() {
|
|
|
|
$("#footerText").html($(this).val());
|
|
|
|
});
|
|
|
|
// 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");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}).trigger("change");
|