From 7654446466743ff6d4d5b4f54bb348be63b8edee Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 2 Sep 2023 21:17:52 +0200 Subject: [PATCH] =?UTF-8?q?Supprimer=20l'aper=C3=A7u=20du=20th=C3=A8me=20d?= =?UTF-8?q?u=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/view/site/site.js.php | 86 +------------------------ core/module/theme/view/site/site.php | 76 ++++++++-------------- 2 files changed, 27 insertions(+), 135 deletions(-) diff --git a/core/module/theme/view/site/site.js.php b/core/module/theme/view/site/site.js.php index 06c35f30..81df8070 100644 --- a/core/module/theme/view/site/site.js.php +++ b/core/module/theme/view/site/site.js.php @@ -26,88 +26,4 @@ $("input, select").on("change",function() { $("#themeSiteMarginWrapper").show(); } - - /** - * Aperçu dans la boîte - */ - - // Import des polices de caractères pour l'aperçu en temps réel - var titleFont = $("#themeTitleFont :selected").val(); - var titleFontText = $("#themeTitleFont :selected").text(); - var textFont = $("#themeTextFont :selected").val(); - var textFontText = $("#themeTextFont :selected").text(); - // Couleurs des boutons - var colors = core.colorVariants($("#themeButtonBackgroundColor").val()); - var css = ".button.buttonSubmitPreview{background-color:" + colors.normal + ";}"; - css += ".button.buttonSubmitPreview:hover{background-color:" + colors.darken + "}"; - css += ".button.buttonSubmitPreview{color:" + colors.text + ";}"; - - // Couleurs des liens - var colors = core.colorVariants($("#themeTextLinkColor").val()); - css += "a.urlPreview{color:" + colors.normal + "}"; - css += "a.urlPreview:hover{color:" + colors.darken + "}"; - // Couleur, polices, épaisseur et capitalisation de caractères des titres - css += ".headerPreview,.headerPreview{color:" + $("#themeTitleTextColor").val() + ";font-family:'" + titleFontText + "',sans-serif;font-weight:" + $("#themeTitleFontWeight").val() + ";text-transform:" + $("#themeTitleTextTransform").val() + "}"; - // Police de caractères - // Police + couleur - css += ".textPreview,.urlPreview{color:" + $("#themeTextTextColor").val() + ";font-family:'" + textFontText + "',sans-serif; font-size:" + $("#themeTextFontSize").val() + ";}"; - // Couleur des liens - //css += "a.preview,.buttonSubmitPreview{font-family:'" + textFont.replace(/\+/g, " ") + "',sans-serif}"; - - // Taille du texte - // Couleur du texte - css += "p.preview{color:" + $("#themeTextTextColor").val() + "}"; - - /** - * Aperçu réel - */ - - // Taille du site - if ($("#themeSiteWidth").val() === "750px") { - css += ".button, button{font-size:0.8em;}"; - } else { - css += ".button, button{font-size:1em;}"; - } - // Largeur - var margin = $("#themeSiteMargin").is(":checked") ? 0 : '20px' ; - css += ".container{max-width:" + $("#themeSiteWidth").val() + "}"; - if ($("#themeSiteWidth").val() === "100%") { - css += "#site{margin: 0px auto;} body{margin:0 auto;} #bar{margin:0 auto;} body > header{margin:0 auto;} body > nav {margin: 0 auto;} body > footer {margin:0 auto;}"; - } else { - css += "#site{margin: " + margin + " auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} "; - } - // Couleur du site, arrondi sur les coins du site et ombre sur les bords du site - //css += "#site{background-color:" + $("#themeSiteBackgroundColor").val() + ";border-radius:" + $("#themeSiteRadius").val() + ";box-shadow:" + $("#themeSiteShadow").val() + " #212223}"; - - css += "#site{border-radius:" + $("#themeSiteRadius").val() + ";box-shadow:" + $("#themeSiteShadow").val() + " #212223}"; - - // Couleur ou image de fond - var backgroundImage = "getData(['theme','body','image'])); ?>"; - var backgroundcolor = "getdata(['theme','body','backgroundColor'])); ?>"; - if(backgroundImage ) { - css += "div.bodybackground{background-image:url(" + window.location.origin + window.location.pathname + '/site/file/source/' + backgroundImage + ");background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}"; - css += "div.bodybackground{background-color:rgba(0,0,0,0);}"; - } - else { - css += "div.bodybackground{background-image:none}"; - } - css += 'div.bodybackground {background-color:' + backgroundcolor + ';color:' + $("#themeBodyToTopColor").val() + ';}'; - - css += "div.bgPreview{padding: 5px;background-color:" + $("#themeSiteBackgroundColor").val() + ";}"; - - // Les blocs - - var colors = core.colorVariants($("#themeBlockBackgroundColor").val()); - css += ".block.preview {padding: 20px 20px 10px;margin: 20px 0; word-wrap: break-word;border-radius: 2px;border: 1px solid " + $("#themeBlockBorderColor").val() + ";}.block.preview h4.preview {background: " + colors.normal + ";color:" + colors.text + ";margin: -20px -20px 10px -20px; padding: 10px;}"; - - /** - * Injection dans le DOM - */ - // Ajout du css au DOM - $("#themePreview").remove(); - $("