Commit d7c8a128 authored by gerd's avatar gerd

Merge branch 'dev' of https://dev.quiqqer.com/quiqqer/package-bricks into dev

parents 92e69d09 0539e0ec
......@@ -589,9 +589,14 @@ define('package/quiqqer/bricks/bin/Controls/Slider/PromosliderWallpaper', [
}
var self = this,
Background = Slide.getElement('.quiqqer-bricks-promoslider-wallpaper-image'),
display = Background.getStyle('display'),
image = Slide.get('data-image');
Background = Slide.getElement('.quiqqer-bricks-promoslider-wallpaper-image');
if (!Background) {
Background = new Element('div');
}
var display = Background.getStyle('display'),
image = Slide.get('data-image');
if (display !== 'none') {
return;
......
......@@ -672,6 +672,21 @@
<setting name="preventLoadMap" type="checkbox">
<locale group="quiqqer/bricks" var="brick.control.simplegooglemaps.settings.preventLoadMap"/>
</setting>
<setting name="template" type="select">
<locale group="quiqqer/bricks"
var="brick.control.simplegooglemaps.settings.template"/>
<option value="standard">
<locale group="quiqqer/bricks"
var="brick.control.simplegooglemaps.settings.template.standard"/>
</option>
<option value="nextToEachOther">
<locale group="quiqqer/bricks"
var="brick.control.simplegooglemaps.settings.template.nextToEachOther"/>
</option>
</setting>
<setting name="place">
<locale group="quiqqer/bricks" var="brick.control.simplegooglemaps.settings.place"/>
</setting>
......
......@@ -1257,6 +1257,19 @@ M&ouml;chten Sie die Bausteine aus der Bausteinzone entfernen?</p>]]></de>
<de><![CDATA[Das automatische Laden von Google Maps verhindern. Der Benutzer muss sie manuell aktivieren.]]></de>
<en><![CDATA[Prevent auto-load Google Maps. User must activate it manually.]]></en>
</locale>
<locale name="brick.control.simplegooglemaps.settings.template">
<de><![CDATA[Template]]></de>
<en><![CDATA[Template]]></en>
</locale>
<locale name="brick.control.simplegooglemaps.settings.template.standard">
<de><![CDATA[Standard (Inhalt über der Karte)]]></de>
<en><![CDATA[Template (content above the map)]]></en>
</locale>
<locale name="brick.control.simplegooglemaps.settings.template.nextToEachOther">
<de><![CDATA[Nebeneinander (Text neben der Karte)]]></de>
<en><![CDATA[Next to each other (content next to the map)]]></en>
</locale>
<locale name="brick.control.simplegooglemaps.settings.place">
<de><![CDATA[Google Place]]></de>
<en><![CDATA[Google Place]]></en>
......
.simpleGoogleMap-nextToEachOther {
display: flex;
}
.simpleGoogleMap-nextToEachOther-mapContainer,
.simpleGoogleMap-nextToEachOther-contentContainer {
width: 100%;
}
.simpleGoogleMap-nextToEachOther-contentContainer {
margin-left: 1em;
}
.simpleGoogleMap-nextToEachOther-contentContainer p:last-child {
margin-bottom: 0;
}
.simpleGoogleMap-wrapper {
background-position: center;
background-size: cover;
height: 100%;
}
.simpleGoogleMap {
align-items: stretch;
display: flex;
height: 100%;
justify-content: center;
min-height: 300px;
position: relative;
}
.simpleGoogleMap-iframe {
background: none;
border: none;
display: block;
height: auto;
position: relative;
width: 100%;
}
.btn-active-map {
align-self: center;
background: none;
border-color: #333;
color: #333;
font-size: 1.2rem;
margin-left: 1em;
margin-right: 1em;
}
.btn-active-map:hover,
.btn-active-map:active {
background: #33333311;
color: #333;
}
@media screen and (max-width: 767px) {
.simpleGoogleMap-nextToEachOther {
display: block;
}
.simpleGoogleMap-nextToEachOther-mapContainer {
margin-bottom: 1em;
}
.simpleGoogleMap-nextToEachOther-contentContainer {
margin-left: 0;
}
}
\ No newline at end of file
{if $this->getAttribute('showTitle') && $this->getAttribute('frontendTitle')}
<header class="control-header">
<h1>{$this->getAttribute('frontendTitle')}</h1>
</header>
{/if}
<div class="simpleGoogleMap-nextToEachOther">
<div class="simpleGoogleMap-nextToEachOther-mapContainer">
<div class="simpleGoogleMap-wrapper">
<div class="simpleGoogleMap">
{if !$preventLoadMap}
<iframe class="simpleGoogleMap-iframe" src="{$url}"></iframe>
{/if}
</div>
</div>
</div>
{if $this->getAttribute('content') != ""}
<div class="simpleGoogleMap-nextToEachOther-contentContainer">
{$this->getAttribute('content')}
</div>
{/if}
</div>
\ No newline at end of file
......@@ -25,14 +25,11 @@ class SimpleGoogleMaps extends QUI\Control
// default options
$this->setAttributes([
'title' => '',
'preventLoadMap' => false
'preventLoadMap' => false,
'template' => 'standard'
]);
parent::__construct($attributes);
$this->addCSSFile(
dirname(__FILE__) . '/SimpleGoogleMaps.css'
);
}
/**
......@@ -59,8 +56,8 @@ class SimpleGoogleMaps extends QUI\Control
'q' => "{$brickPlace},{$brickZip},{$brickStreet},{$brickCity}"
]);
// prevent load map
$url = 'https://www.google.com/maps/embed/v1/place?' . $query . "&zoom=" . $zoom;
if ($preventLoadMap) {
$imgUrl = URL_OPT_DIR . 'quiqqer/bricks/bin/images/SimpleGoogleMapsBackground1.png';
......@@ -71,12 +68,26 @@ class SimpleGoogleMaps extends QUI\Control
]);
}
// template
switch ($this->getAttribute('template')) {
case 'nextToEachOther':
$template = dirname(__FILE__) . '/SimpleGoogleMaps.NextToEachOther.html';
$css = dirname(__FILE__) . '/SimpleGoogleMaps.NextToEachOther.css';
break;
case 'default':
default:
$template = dirname(__FILE__) . '/SimpleGoogleMaps.Standard.html';
$css = dirname(__FILE__) . '/SimpleGoogleMaps.Standard.css';
}
$Engine->assign([
'this' => $this,
'url' => $url,
'preventLoadMap' => $preventLoadMap
]);
return $Engine->fetch(dirname(__FILE__) . '/SimpleGoogleMaps.html');
$this->addCSSFile($css);
return $Engine->fetch($template);
}
}
......@@ -22,7 +22,7 @@
data-href="{$slide.url}"
data-newTab="{$slide.newTab}"
>
<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>{/if}
{if $slide.image && $this->getAttribute('image-as-wallpaper')}
<div class="quiqqer-bricks-promoslider-slide-image quiqqer-bricks-promoslider-slide-image__cover"
style="background-image: url('{image image=$slide.image onlysrc=1 width=1900}')"
......@@ -52,7 +52,7 @@
{/if}
</div>
</div>
</a>
{if $slide.url}</a>{/if}
</div>
{/foreach}
<div class="quiqqer-bricks-promoslider-slide-desktop-dots"></div>
......@@ -71,7 +71,7 @@
data-newTab="{$slide.newTab}"
role="option"
>
<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>{/if}
{if $slide.image && $this->getAttribute('image-as-wallpaper')}
<div class="quiqqer-bricks-promoslider-slide-mobile-image quiqqer-bricks-promoslider-slide-image__cover"
style="background-image: url('{image image=$slide.image onlysrc=1 width=1900}')"
......@@ -99,7 +99,7 @@
</div>
{/if}
</div>
</a>
{if $slide.url}</a>{/if}
</div>
{/foreach}
......
......@@ -3,9 +3,7 @@
<ul class="hide-on-mobile">
{foreach $desktopSlides as $key => $slide}
<li data-image="{image image=$slide.image onlysrc=1}" data-href="{$slide.url}" data-newTab="{$slide.newTab}">
{if $slide.url}
<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>
{/if}
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>{/if}
{assign var=extraClass value=""}
{if isset($slide.pos) && $slide.pos == 'quiqqer-bricks-promoslider-slide-right'}
......@@ -36,10 +34,7 @@
</div>
{/if}
&nbsp;
{if $slide.url}
</a>
{/if}
{if $slide.url}</a>{/if}
</li>
{/foreach}
</ul>
......@@ -49,7 +44,7 @@
<ul class="hide-on-desktop">
{foreach $mobileSlides as $key => $slide}
<li data-image="{image image=$slide.image onlysrc=1}" data-href="{$slide.url}" data-newTab="{$slide.newTab}">
<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>{/if}
{assign var=extraClass value=""}
{if isset($slide.pos) && $slide.pos == 'quiqqer-bricks-promoslider-slide-right'}
......@@ -78,10 +73,8 @@
{/if}
</div>
</div>
{/if}
&nbsp;
</a>
{/if}&nbsp;
{if $slide.url}</a>{/if}
</li>
{/foreach}
</ul>
......
......@@ -3,7 +3,7 @@
<ul class="hide-on-mobile">
{foreach $desktopSlides as $key => $slide}
<li data-image="{image image=$slide.image onlysrc=1}" data-href="{$slide.url}" data-newTab="{$slide.newTab}">
<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>{/if}
<div class="quiqqer-bricks-promoslider-wallpaper-image" style="display: none">&nbsp;</div>
<div class="grid-container">
......@@ -21,16 +21,12 @@
{if $key === 0}
<noscript>
{if $slide.url}
<a href="{$slide.url}" {if $slide.newTab}target="_blank"{/if}>
{/if}
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab}target="_blank"{/if}>{/if}
{image image=$slide.image class="quiqqer-bricks-promoslider-wallpaper2Content-noScriptImage"}
{if $slide.url}
</a>
{/if}
{if $slide.url}</a>{/if}
</noscript>
{/if}
</a>
{if $slide.url}</a>{/if}
</li>
{/foreach}
</ul>
......@@ -40,7 +36,7 @@
<ul class="hide-on-desktop">
{foreach $mobileSlides as $key => $slide}
<li data-image="{image image=$slide.image onlysrc=1}" data-href="{$slide.url}" data-newTab="{$slide.newTab}">
<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab} target="_blank" {/if}>{/if}
<div class="quiqqer-bricks-promoslider-wallpaper-image" style="display: none">&nbsp;</div>
<div class="grid-container">
......@@ -58,16 +54,12 @@
{if $key === 0}
<noscript>
{if $slide.url}
<a href="{$slide.url}" {if $slide.newTab}target="_blank"{/if}>
{/if}
{if $slide.url}<a href="{$slide.url}" {if $slide.newTab}target="_blank"{/if}>{/if}
{image image=$slide.image class="quiqqer-bricks-promoslider-wallpaper2Content-noScriptImage"}
{if $slide.url}
</a>
{/if}
{if $slide.url}</a>{/if}
</noscript>
{/if}
</a>
{if $slide.url}</a>{/if}
</li>
{/foreach}
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment