Merge branch '4403'

This commit is contained in:
Deltacms 2023-01-07 17:53:22 +01:00
commit 02432c9236
3 changed files with 41 additions and 46 deletions

View File

@ -2112,15 +2112,7 @@ class common {
public function showScript() {
// Lexique
include('./core/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_core.php');
?><script>
var textUpdating = <?php echo '"'.$text['core_js'][0].'"'; ?>;
var textSelectFile = <?php echo '"'.$text['core_js'][1].'"'; ?>;
var textLogout = <?php echo '"'.$text['core_js'][2].'"'; ?>;
var textCheckMail = <?php echo '"'.$text['core_js'][3].'"'; ?>;
var textPageDelete = <?php echo '"'.$text['core_js'][4].'"'; ?>;
var textConfirmYes = <?php echo '"'.$text['core_js'][5].'"'; ?>;
var textConfirmNo = <?php echo '"'.$text['core_js'][6].'"'; ?>;
</script><?php
?><script>var textUpdating = <?php echo '"'.$text['core_js'][0].'"'; ?>; var textSelectFile = <?php echo '"'.$text['core_js'][1].'"'; ?>; var textLogout = <?php echo '"'.$text['core_js'][2].'"'; ?>; var textCheckMail = <?php echo '"'.$text['core_js'][3].'"'; ?>; var textPageDelete = <?php echo '"'.$text['core_js'][4].'"'; ?>; var textConfirmYes = <?php echo '"'.$text['core_js'][5].'"'; ?>; var textConfirmNo = <?php echo '"'.$text['core_js'][6].'"'; ?>; </script><?php
ob_start();
require 'core/core.js.php';
$coreScript = ob_get_clean();

View File

@ -440,6 +440,9 @@ class theme extends common {
// Bannière animée avec swiper
if( $this->getInput('themeHeaderFeature') === 'swiper' ){
$swiperContent = $this->swiperContent('header');
$headerHeight = 'unset';
} else {
$headerHeight = $this->getInput('themeHeaderHeight');
}
// $featureContent = str_replace(helper::baseUrl(false,false), './', $featureContent);
// Si une image est positionnée, l'arrière en transparent.
@ -448,7 +451,7 @@ class theme extends common {
'font' => $this->getInput('themeHeaderFont'),
'fontSize' => $this->getInput('themeHeaderFontSize'),
'fontWeight' => $this->getInput('themeHeaderFontWeight'),
'heightSelect' => $this->getInput('themeHeaderHeight'),
'heightSelect' => $headerHeight,
'wide' => $this->getInput('themeHeaderWide'),
'image' => $this->getInput('themeHeaderImage'),
'imagePosition' => $this->getInput('themeHeaderImagePosition'),
@ -965,42 +968,9 @@ class theme extends common {
// Adaptation du css au client pour l'option de défilement vertical
if( $effect === 'vertical'){
$size = getimagesize($imageFile[0]);
$swiperContent .= '<script>
$.wrapper = function(){
var heightImg = '. $size[1] . ',
widthImg = '. $size[0] .',
heightMod ,
widthMod,
widthSiteInt,
wclient,
widthSite;
widthSite = "'. $this->getData(['theme', 'site', 'width' ]) . '";
wclient = document.body.clientWidth;
switch ( widthSite )
{
case "750px":
widthMod = 750;
break;
case "960px":
widthMod = 960;
break;
case "1170px":
widthMod = 1170;
break;
default:
widthMod = wclient;
}
if( wclient < widthMod) widthMod = wclient;
heightMod = heightImg * ( widthMod / widthImg );
$("#headerSwiper .swiper-wrapper").css("width", widthMod);
$("#headerSwiper .swiper-wrapper").css("height", heightMod);
}
$.wrapper();
$(window).resize(function(){
$.wrapper();
});
</script>';
}
$swiperContent .= '<script>var verticalBannerHeightImg = '. $size[1]. '; var verticalBannerWidthImg = '.$size[0]. '; var verticalBannerWidthSite = "'. $this->getData(['theme', 'site', 'width' ]).'"; </script>';
$swiperContent .= '<script src="'.helper::baseUrl(false).'core/vendor/swiper/swiperEffectVertical.js"></script>';
}
$swiperContent .= '<div id="headerSwiper"><div class="swiper mySwiper"><div class="swiper-wrapper">';
foreach($imageFile as $value ) {
$swiperContent .= '<div class="swiper-slide"><img src="'.$value.'" /></div>';

View File

@ -0,0 +1,33 @@
/* Script pour bannière animée avec effet de défilement vertical */
/* Adapte la largeur et la hauteur des images de la bannière à la taille de la fenêtre client */
$(document).ready(function(){
$.wrapper = function(){
var heightMod ,
widthMod,
wclient;
wclient = document.body.clientWidth;
switch ( verticalBannerWidthSite )
{
case "750px":
widthMod = 750;
break;
case "960px":
widthMod = 960;
break;
case "1170px":
widthMod = 1170;
break;
default:
widthMod = wclient;
}
if( wclient < widthMod) widthMod = wclient;
heightMod = verticalBannerHeightImg * ( widthMod / verticalBannerWidthImg );
$("#headerSwiper .swiper-wrapper").css("width", widthMod);
$("#headerSwiper .swiper-wrapper").css("height", heightMod);
}
$.wrapper();
$(window).resize(function(){
$.wrapper();
});
});