Skip to content

Commit

Permalink
Update: Remove checl if cookie punch is installed and add settings fo…
Browse files Browse the repository at this point in the history
…r slipstream
  • Loading branch information
jonnitto committed Feb 7, 2024
1 parent 7a96a61 commit 0304374
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Configuration/Settings.GeoMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ Carbon:
GeoMap:
defaultCountry: CH # ISO-Code from country
defaultPinColor: '#009fe3' # Hex-Color
slipstream:
css: true
js: true
mjs: true
23 changes: 15 additions & 8 deletions Resources/Private/Fusion/Presentation/Map.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,36 @@ prototype(Carbon.GeoMap:Presentation.Map) < prototype(Neos.Fusion:Component) {

coordinates = null

// https://github.com/sandstorm/Sandstorm.CookiePunch is installed
_sandstormCookiePunchIsInstalled = ${Configuration.setting('Neos.Neos.fusion.autoInclude')['Sandstorm.CookiePunch']}
dataNeverBlock = ${!!this._sandstormCookiePunchIsInstalled}
center = ${Carbon.Array.check(this.coordinates) ? Carbon.GeoMap.centerFromCoordinates(this.coordinates) : null}
slipstream = Neos.Fusion:DataStructure {
css = ${Configuration.setting('Carbon.GeoMap.slipstream.css')}
js = ${Configuration.setting('Carbon.GeoMap.slipstream.js')}
mjs = ${Configuration.setting('Carbon.GeoMap.slipstream.mjs')}
}

renderer = afx`
<div
class={Carbon.String.merge("carbon-geomap", props.class, props.additionalClass)}
data-center={Json.stringify(props.center)}
data-zoom={props.zoom}
>
<link @if.set={props.css} rel="stylesheet" href={props.css} data-slipstream />
<link
@if.set={props.css}
rel="stylesheet"
href={props.css}
data-slipstream={props.slipstream.css}
/>
<script
@if.set={props.js}
src={props.js}
data-never-block={props.dataNeverBlock}
data-slipstream defer
data-slipstream={props.slipstream.js}
defer
></script>
<script
@if.set={props.mjs}
src={props.mjs}
data-never-block={props.dataNeverBlock}
data-slipstream defer
data-slipstream={props.slipstream.mjs}
defer
type="module"
></script>
<div
Expand Down

0 comments on commit 0304374

Please sign in to comment.