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
b56040bc
Verified
Commit
b56040bc
authored
Apr 15, 2020
by
Laurent Heirendt
✈
Browse files
fix loading vars from config
parent
e956f5b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
_includes/head.html
View file @
b56040bc
...
...
@@ -19,6 +19,12 @@
{%- include css-imports.html -%}
{% if site.siteID > 0 %}
<script>
var
settings
=
[];
settings
.
expires
=
"
{{ site.cookies_expire }}
"
;
settings
.
matomoURL
=
"
{{ site.analyticsurl }}
"
;
settings
.
siteID
=
"
{{ site.siteID }}
"
;
</script>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/js-cookie@rc/dist/js.cookie.min.js"
></script>
<script
src=
"{{ '/assets/js/gdpr.js' | relative_url }}"
></script>
...
...
assets/js/gdpr.js
View file @
b56040bc
/* Matomo global variable
note: most code has been inspired from:
https://edps.europa.eu/sites/edp/modules/features/edpsweb_cookies/js/cookies-popup.js
*/
var
_paq
=
window
.
_paq
||
_paq
||
[];
var
settings
=
[];
settings
.
expires
=
"
{{ site.cookies_expire }}
"
;
settings
.
matomoURL
=
"
{{ site.analyticsurl }}
"
;
settings
.
siteID
=
"
{{ site.siteID }}
"
;
/*
getCookie: retrieve a cookie that has been set.
inspired from https://www.w3schools.com/js/js_cookies.asp
*/
...
...
@@ -31,6 +24,7 @@ function getCookie(cname) {
/* loadMatomo: load the tracking code of the matomo instance */
function
loadMatomo
()
{
if
(
settings
.
siteID
>
0
)
{
var
_paq
=
window
.
_paq
||
_paq
||
[];
var
u
=
settings
.
matomoURL
;
_paq
.
push
([
'
setSiteId
'
,
settings
.
siteID
]);
_paq
.
push
([
'
setTrackerUrl
'
,
u
+
'
matomo.php
'
]);
...
...
@@ -58,7 +52,6 @@ function showCookieBanner() {
function
hideCookieBanner
()
{
var
popup
=
jQuery
(
'
#lap-cookies-banner
'
);
popup
.
hide
();
console
.
log
(
'
removed the banner
'
);
}
/* clearCookies: clear all cookies */
...
...
@@ -73,7 +66,6 @@ function clearCookies() {
}
$
(
document
).
ready
(
function
()
{
/* accept */
$
(
'
.lap-cookies-accept
'
).
click
(
function
(
e
)
{
e
.
preventDefault
(
true
);
...
...
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