Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Medienreaktor.CookieConsent
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Web Essentials Jira
Web Essentials Jira
Labels
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
packages
Medienreaktor.CookieConsent
Commits
baaaaab4
Commit
baaaaab4
authored
Apr 25, 2018
by
Daniel Kestler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cookie consent settings, translations and loading code for frontend rendering
parent
f578248a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
3 deletions
+90
-3
Configuration/Settings.yaml
Configuration/Settings.yaml
+13
-0
Resources/Private/Fusion/Root.fusion
Resources/Private/Fusion/Root.fusion
+33
-3
Resources/Private/Translations/de/CookieConsent.xlf
Resources/Private/Translations/de/CookieConsent.xlf
+22
-0
Resources/Private/Translations/en/CookieConsent.xlf
Resources/Private/Translations/en/CookieConsent.xlf
+22
-0
No files found.
Configuration/Settings.yaml
View file @
baaaaab4
...
@@ -7,3 +7,16 @@ Medienreaktor:
...
@@ -7,3 +7,16 @@ Medienreaktor:
CookieConsent
:
CookieConsent
:
includeJavaScript
:
true
includeJavaScript
:
true
includeStyles
:
true
includeStyles
:
true
translationsPackage
:
'
Medienreaktor.CookieConsent'
settings
:
type
:
null
position
:
'
bottom'
theme
:
'
block'
palette
:
popup
:
background
:
'
#333'
text
:
'
#fff'
button
:
background
:
'
#fff'
text
:
'
#333'
informationNode
:
null
Resources/Private/Fusion/Root.fusion
View file @
baaaaab4
prototype(Neos.Neos:Page) {
prototype(Neos.Neos:Page) {
head {
head {
cookieConsent = Medienreaktor.CookieConsent
cookieConsent = Medienreaktor.CookieConsent {
cookieConsent {
@position = 'end'
@position = 'end'
}
}
}
}
...
@@ -13,12 +12,13 @@ prototype(Medienreaktor.CookieConsent) < prototype(Neos.Fusion:Array) {
...
@@ -13,12 +12,13 @@ prototype(Medienreaktor.CookieConsent) < prototype(Neos.Fusion:Array) {
attributes {
attributes {
rel = 'stylesheet'
rel = 'stylesheet'
type = 'text/css'
type = 'text/css'
src
= Neos.Fusion:ResourceUri {
href
= Neos.Fusion:ResourceUri {
path = 'resource://Medienreaktor.CookieConsent/Public/Styles/cookieconsent.min.css'
path = 'resource://Medienreaktor.CookieConsent/Public/Styles/cookieconsent.min.css'
}
}
}
}
@if.includeStyles = ${Configuration.setting('Medienreaktor.CookieConsent.includeStyles')}
@if.includeStyles = ${Configuration.setting('Medienreaktor.CookieConsent.includeStyles')}
}
}
javaScript = Neos.Fusion:Tag {
javaScript = Neos.Fusion:Tag {
tagName = 'script'
tagName = 'script'
attributes {
attributes {
...
@@ -29,4 +29,34 @@ prototype(Medienreaktor.CookieConsent) < prototype(Neos.Fusion:Array) {
...
@@ -29,4 +29,34 @@ prototype(Medienreaktor.CookieConsent) < prototype(Neos.Fusion:Array) {
}
}
@if.includeJavaScript = ${Configuration.setting('Medienreaktor.CookieConsent.includeJavaScript')}
@if.includeJavaScript = ${Configuration.setting('Medienreaktor.CookieConsent.includeJavaScript')}
}
}
loadingScript = Neos.Fusion:Value {
@context {
settings = Neos.Fusion:RawArray {
type = ${Configuration.setting('Medienreaktor.CookieConsent.settings.type')}
position = ${Configuration.setting('Medienreaktor.CookieConsent.settings.position')}
theme = ${Configuration.setting('Medienreaktor.CookieConsent.settings.theme')}
palette = ${Configuration.setting('Medienreaktor.CookieConsent.settings.palette')}
content = Neos.Fusion:RawArray {
message = ${Translation.translate('message', null, [], 'CookieConsent', Configuration.setting('Medienreaktor.CookieConsent.translationsPackage'))}
link = ${Translation.translate('link', null, [], 'CookieConsent', Configuration.setting('Medienreaktor.CookieConsent.translationsPackage'))}
allow = ${Translation.translate('allow', null, [], 'CookieConsent', Configuration.setting('Medienreaktor.CookieConsent.translationsPackage'))}
deny = ${Translation.translate('deny', null, [], 'CookieConsent', Configuration.setting('Medienreaktor.CookieConsent.translationsPackage'))}
dismiss = ${Translation.translate('dismiss', null, [], 'CookieConsent', Configuration.setting('Medienreaktor.CookieConsent.translationsPackage'))}
href = Neos.Neos:NodeUri {
node = ${q(site).find(Configuration.setting('Medienreaktor.CookieConsent.informationNode')).get(0)}
@if.hasInformationNode = ${Configuration.setting('Medienreaktor.CookieConsent.informationNode') ? true : false }
}
}
@process.json = ${Json.stringify(value)}
}
}
@process.wrap = ${'<script>window.addEventListener("load", function() { window.cookieconsent.initialise(' + settings + ') });</script>'}
}
@if.inFrontend = ${site.context.inBackend == false}
}
}
Resources/Private/Translations/de/CookieConsent.xlf
0 → 100644
View file @
baaaaab4
<?xml version="1.0"?>
<xliff
version=
"1.2"
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
>
<file
original=
""
product-name=
"Medienreaktor.CookieConsent"
source-language=
"de"
datatype=
"plaintext"
>
<body>
<trans-unit
id=
"message"
>
<source>
Diese Website verwendet Cookies, um optimal gestaltet und fortlaufend verbessert werden zu können. Durch die Nutzung der Webseite stimmen Sie dieser Verwendung von Cookies zu.
</source>
</trans-unit>
<trans-unit
id=
"link"
>
<source>
Mehr erfahren
</source>
</trans-unit>
<trans-unit
id=
"allow"
>
<source>
Cookies zulassen
</source>
</trans-unit>
<trans-unit
id=
"deny"
>
<source>
Cookies ablehnen
</source>
</trans-unit>
<trans-unit
id=
"dismiss"
>
<source>
Okay
</source>
</trans-unit>
</body>
</file>
</xliff>
Resources/Private/Translations/en/CookieConsent.xlf
0 → 100644
View file @
baaaaab4
<?xml version="1.0"?>
<xliff
version=
"1.2"
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
>
<file
original=
""
product-name=
"Medienreaktor.CookieConsent"
source-language=
"en"
datatype=
"plaintext"
>
<body>
<trans-unit
id=
"message"
>
<source>
This website uses cookies to ensure you get the best experience on our website.
</source>
</trans-unit>
<trans-unit
id=
"link"
>
<source>
Learn more
</source>
</trans-unit>
<trans-unit
id=
"allow"
>
<source>
Allow cookies
</source>
</trans-unit>
<trans-unit
id=
"deny"
>
<source>
Decline
</source>
</trans-unit>
<trans-unit
id=
"dismiss"
>
<source>
Okay
</source>
</trans-unit>
</body>
</file>
</xliff>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment