[9.2.10] Réglages de la bannière

This commit is contained in:
fredtempez 2019-11-09 15:36:14 +01:00
parent 5e16985b31
commit 5bd619f95a
5 changed files with 37 additions and 43 deletions

View File

@ -4,6 +4,8 @@
- Modifications préparatoires à la version 10 :
- Lors de l'installation, stockage de l'url de base dans l'éventualité de la restauration d'un backup et de son installation dans une autre arborescence.
- Modification des clés identifiant les légendes du module Gallery : suppression du point de séparation du nom de fichier de l'extension.
- Corrections :
- Thème ; bannière : problème empêchant la bannière d'être cliquable lorsque la hauteur responsive de la bannière était sélectionnée.
## version 9.2.09
- Corrections :

View File

@ -58,7 +58,11 @@
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
): ?>
<div class="container">
<span><?php echo $this->getData(['config', 'title']); ?></span>
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
</div> <!--fin container -->
<?php else: ?>
<div class="container">
<span id="themeHeaderTitle">&nbsp;</span>
</div> <!--fin container -->
<?php endif; ?>
<?php
@ -101,7 +105,13 @@
// Affiche toujours le titre de la bannière pour l'édition du thème
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
): ?>
<div class="container"><span><?php echo $this->getData(['config', 'title']); ?></span></div>
<div class="container">
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
</div>
<?php else: ?>
<div class="container">
<span id="themeHeaderTitle">&nbsp;</span>
</div> <!--fin container -->
<?php endif; ?>
</header>
<?php

View File

@ -118,7 +118,6 @@ class theme extends common {
'2.4vmax' => 'Très grande (240%)'
];
public static $headerHeights = [
'none' => 'Responsive',
'100px' => 'Très petite (100px) ',
'150px' => 'Petite (150px)',
'200px' => 'Moyenne (200px)',
@ -215,10 +214,11 @@ class theme extends common {
'100%' => 'Fluide (100%)'
];
public static $headerWide = [
'cover' => 'Responsive (cover)',
'contain' => 'Responsive (contain)',
'auto auto' => 'Automatique',
'100% 100%' => 'Image étirée'
'100% 100%' => 'Image étirée (100% 100%)',
'100% auto' => 'Responsive (100% auto)',
'cover' => 'Responsive (cover)',
'contain' => 'Responsive (contain)'
];
public static $footerTemplate = [
'1' => 'Une seule colonne',

View File

@ -19,13 +19,6 @@
*/
$("input, select").on("change", function() {
// Récupérer la taille de l'image
var tmpImg = new Image();
var url = "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
tmpImg.src= url;
var themeHeaderHeight = $("#themeHeaderHeight").val();
var themeHeaderImage = $("#themeHeaderImage").val();
// Import des polices de caractères
var headerFont = $("#themeHeaderFont").val();
@ -34,40 +27,30 @@ $("input, select").on("change", function() {
// Couleurs, image, alignement et hauteur de la bannière
css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";";
if (themeHeaderImage) {
if ($("#themeHeaderImage").val()) {
// Une image est sélectionnée
css += "background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/" + themeHeaderImage + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";";
css += "background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/" + $("#themeHeaderImage").val() + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";";
css += "background-size:" + $("#themeHeaderImageContainer").val() + ";";
if (themeHeaderHeight === "none") {
// Position responsive
css += "height: 0; padding-top:" + (tmpImg.height / tmpImg.width ) * 100 + "%}";
} else {
// Positions standards
css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + themeHeaderHeight + "}";
}
// Pas d'image sélectionnée
} else {
// Désactiver l'option responsive
css += "background-image:none;";
$("header .container").show();
$("themeHeaderTextHide").prop("false");
if (themeHeaderHeight === "none") {
$("#themeHeaderHeight option:eq(2)").prop("selected", true);
css += "line-height: 150px;height: 150px}";
} else {
css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + themeHeaderHeight + "}";
}
//$("header .container").show();
}
css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "}";
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
css += "header span{color:" + $("#themeHeaderTextColor").val() + ";font-family:'" + headerFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeHeaderFontWeight").val() + ";font-size:" + $("#themeHeaderFontSize").val() + ";text-transform:" + $("#themeHeaderTextTransform").val() + "}";
// Cache le titre de la bannière
if($("#themeHeaderTextHide").is(":checked")) {
$("header .container").hide();
$("header #themeHeaderTitle").hide();
}
else {
$("header .container").show();
$("header #themeHeaderTitle").show();
}
// Marge
if($("#themeHeaderMargin").is(":checked")) {
if(<?php echo json_encode($this->getData(['theme', 'menu', 'position']) === 'site-first'); ?>) {
@ -119,6 +102,8 @@ $("input, select").on("change", function() {
.appendTo("head");
}).trigger("change");
/**
$("#themeHeaderHeight").on("change", function() {
if($(this).val() === 'none') {
$("#themeHeaderTextHide").prop("disabled", true);
@ -127,6 +112,7 @@ $("#themeHeaderHeight").on("change", function() {
$("#themeHeaderTextHide").prop("disabled", false);
}
}).trigger("change");
*/
// Affiche / Cache les options de l'image du fond

View File

@ -70,20 +70,21 @@
<div class="col4">
<?php echo template::select('themeHeaderImageContainer', $module::$headerWide, [
'label' => 'Adaptation',
'selected' => $this->getData(['theme', 'header', 'imageContainer']),
'help' => 'Responsive (cover) : rogne une image trop grande sans la déformer -
Responsive (contain) : agrandit une image trop petite sans la déformer.
<br><br>Pour une bannière full responsive, sélectionnez aussi Hauteur -> Responsive.
<br>Dans ce cas le titre est indisponible.'
'selected' => $this->getData(['theme', 'header', 'imageContainer'])
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="col6">
<?php echo template::checkbox('themeHeaderTextHide', true, 'Cacher le titre du site', [
'checked' => $this->getData(['theme', 'header', 'textHide'])
]); ?>
</div>
<div id="themeHeaderShow" class="col6">
<?php echo template::checkbox('themeHeaderlinkHome', true, 'Bannière cliquable', [
'checked' => $this->getData(['theme', 'header', 'linkHome'])
]); ?>
</div>
</div>
</div>
</div>
@ -114,11 +115,6 @@
</div>
</div>
<div id="themeHeaderShow" class="displayNone">
<?php echo template::checkbox('themeHeaderlinkHome', true, 'Bannière cliquable', [
'checked' => $this->getData(['theme', 'header', 'linkHome'])
]); ?>
</div>
<div id="themeHeaderPositionOptions" class="displayNone">
<?php echo template::checkbox('themeHeaderMargin', true, 'Aligner la bannière avec le contenu', [
'checked' => $this->getData(['theme', 'header', 'margin'])