Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Miroslav Kratochvil
jekyll-theme-lcsb-default
Commits
17f2aa22
Verified
Commit
17f2aa22
authored
Apr 15, 2020
by
Laurent Heirendt
✈
Browse files
change text for result of banner selection
parent
8dc05bea
Changes
2
Hide whitespace changes
Inline
Side-by-side
_includes/policy.html
View file @
17f2aa22
<p>
<a
href=
"privacyPolicy"
>
Privacy Policy
</a>
(
<span
id=
"gdpr-result-text"
></span>
<a
href=
"javascript: showCookieBanner();"
>
change
</a>
)
</p>
assets/js/gdpr.js
View file @
17f2aa22
...
...
@@ -38,6 +38,15 @@ function loadMatomo() {
g
.
async
=
true
;
g
.
src
=
u
+
'
matomo.js
'
;
s
.
parentNode
.
insertBefore
(
g
,
s
);
setResultText
(
true
);
}
}
function
setResultText
(
acceptCookies
){
if
(
acceptCookies
==
true
)
{
$
(
'
#gdpr-result-text
'
).
html
(
'
All cookies are accepted
'
);
}
else
{
$
(
'
#gdpr-result-text
'
).
html
(
'
Only necessary cookies are accepted
'
);
}
}
...
...
@@ -63,6 +72,7 @@ function clearCookies() {
Cookies
.
set
(
name
,
0
,
{
expires
:
-
1
,
path
:
'
/
'
});
}
}
setResultText
(
false
);
}
$
(
document
).
ready
(
function
()
{
...
...
@@ -74,7 +84,13 @@ $( document ).ready(function() {
jQuery
(
'
.lap-cookies-accept
'
).
addClass
(
'
disabled
'
);
jQuery
(
'
.lap-cookies-refuse
'
).
removeClass
(
'
disabled
'
);
jQuery
(
this
).
blur
();
loadMatomo
();
// if the lap_cookie_agree is already set to one, do not load matomo again
lapCookieAgree
=
getCookie
(
'
lap_cookie_agree
'
);
if
(
lapCookieAgree
!=
'
1
'
){
loadMatomo
();
}
setResultText
(
true
);
});
/* refuse */
...
...
@@ -86,6 +102,7 @@ $( document ).ready(function() {
jQuery
(
'
.lap-cookies-refuse
'
).
addClass
(
'
disabled
'
);
jQuery
(
'
.lap-cookies-accept
'
).
removeClass
(
'
disabled
'
);
jQuery
(
this
).
blur
();
setResultText
(
false
);
});
/* default mechanism */
...
...
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