From 77781aa817023f53e76fa8550877afdaf2e4e0e1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 10 Feb 2022 09:10:21 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20du=20formulaire=20de=20font?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/view/fontAdd/fontAdd.js.php | 41 +++++++++++++++++++ core/module/theme/view/fontAdd/fontAdd.php | 11 ++++- core/module/theme/view/header/header.js.php | 16 ++++---- 3 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 core/module/theme/view/fontAdd/fontAdd.js.php diff --git a/core/module/theme/view/fontAdd/fontAdd.js.php b/core/module/theme/view/fontAdd/fontAdd.js.php new file mode 100644 index 00000000..dd53c7cf --- /dev/null +++ b/core/module/theme/view/fontAdd/fontAdd.js.php @@ -0,0 +1,41 @@ +/** + * 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 Frédéric Tempez + * @copyright Copyright (C) 2018-2022, Frédéric Tempez + * @license GNU General Public License, version 3 + * @link http://zwiicms.fr/ + */ + + +/** + * Option par défaut du sélecteur de mode + */ + $(document).ready(function(){ + $('input[name=fontAddFontImported]').prop('checked', true); + $('#fontAddFileWrapper').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); + } + $('#fontAddFileWrapper').hide(); +}); + +$("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); + } + $('#fontAddFileWrapper').show(); +}); diff --git a/core/module/theme/view/fontAdd/fontAdd.php b/core/module/theme/view/fontAdd/fontAdd.php index 62747c7d..5b86dbdb 100644 --- a/core/module/theme/view/fontAdd/fontAdd.php +++ b/core/module/theme/view/fontAdd/fontAdd.php @@ -20,8 +20,15 @@

Identité de la fonte

-
- Police utilisée en ligne se connecter sur https://www.cdnfonts.com/ pour récupérer les informations nécessaires.
Sinon, précisez le nom du fichier de fonte au format WOFF. +
+ 'Police utilisée en ligne, se connecter sur cdnFonts pour récupérer les informations nécessaires.' + ]); ?> +
+
+ '
Sélectionnez un fichier de fonte au format WOFF.' + ]); ?>
diff --git a/core/module/theme/view/header/header.js.php b/core/module/theme/view/header/header.js.php index e048c4a7..03ef71df 100644 --- a/core/module/theme/view/header/header.js.php +++ b/core/module/theme/view/header/header.js.php @@ -21,14 +21,14 @@ * Aperçu en direct */ $("input, select").on("change", function() { - + var css = ""; // Contenu perso if ($("#themeHeaderFeature").val() == "feature") { - + css = "header{min-height: " + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "; overflow:hidden; background-position:top; background-repeat: no-repeat; line-height:1.15; background-color:unset; background-image:unset; text-align:unset;}"; - + $("#featureContent").appendTo("header").show(); $("#themeHeaderTitle").hide(); @@ -36,7 +36,7 @@ $("input, select").on("change", function() { $("#themeHeaderHeight option:eq(0)").text("Hauteur du contenu personnalisé"); } - + // Couleurs, image, alignement et hauteur de la bannière if ($("#themeHeaderFeature").val() == "wallpaper") { @@ -95,10 +95,10 @@ $("input, select").on("change", function() { css += "background-image:none;"; } css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "}"; - + // Taille, couleur, épaisseur et capitalisation du titre de la bannière - css += "header span{font-family:'" + headerFontText + "',sans-serif;font-weight:" + $("#themeHeaderFontWeight").val() + ";font-size:" + $("#themeHeaderFontSize").val() + ";text-transform:" + $("#themeHeaderTextTransform").val() + ";color:" + $("#themeHeaderTextColor").val() + "}"; + css += "header span{font-family:'" + headerFontText + "',sans-serif;font-weight:" + $("#themeHeaderFontWeight").val() + ";font-size:" + $("#themeHeaderFontSize").val() + ";text-transform:" + $("#themeHeaderTextTransform").val() + ";color:" + $("#themeHeaderTextColor").val() + "}"; // Cache le titre de la bannière if($("#themeHeaderTextHide").is(":checked")) { @@ -169,9 +169,9 @@ $("input, select").on("change", function() { // Marge dans le site if( $("#themeHeaderMargin").is(":checked") && $("#themeHeaderPosition").val() === "site" - ) { + ) { css += 'header{margin:20px 20px 0 20px !important;}'; - /*} else { + /*} else { css += 'header{margin:0 !important;}';*/ }