j1-template 2022.0.5 → 2022.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_layouts/default.html +0 -57
- data/assets/error_pages/HTTP444.html +4 -4
- data/assets/error_pages/HTTP445.html +3 -3
- data/assets/error_pages/HTTP446.html +110 -0
- data/assets/themes/j1/adapter/js/cookieConsent.js +64 -34
- data/assets/themes/j1/adapter/js/j1.js +114 -210
- data/assets/themes/j1/adapter/js/themer.js +0 -1
- data/assets/themes/j1/adapter/js/translator.js +146 -97
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.css +6 -0
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +2 -6
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +29 -13
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +0 -1
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
- data/assets/themes/j1/modules/translator/js/translator.js +98 -63
- data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +2 -3
- data/lib/starter_web/_data/modules/cookies.yml +30 -0
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -3
- data/lib/starter_web/_data/modules/defaults/cookies.yml +112 -0
- data/lib/starter_web/_data/modules/navigator_menu.yml +10 -1
- data/lib/starter_web/_includes/attributes.asciidoc +6 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/_test_pages/google-translate-tester.1.adoc +0 -2
- data/lib/starter_web/pages/_test_pages/google-translate-tester.4.adoc +0 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/index.html +1 -1
- data/lib/starter_web/pages/public/learn/quickstart.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +1 -1
- data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +2 -12
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +2 -12
- data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +1 -1
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +1 -1
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +1 -1
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cc23d49ab79488234bcc11d52989a1114159fd3d075e1b74db6c8122e430885
|
4
|
+
data.tar.gz: b4e92ca4f3b66f2682a1299ceb0fc9b5a0381f03705936ab1d75e5ec25dc5eb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0e18887bb26c831f49560b3f46dc140a0aa200b871a6b952066361ae6fae306e3591bdeb18c994b49a9e0022533042d1efa6b64d620622c746888f0d8e64af6
|
7
|
+
data.tar.gz: 483b7805c69ffdeb8e2ee16e10b971ded5a801f796facb25965fb05c9b8ff8052a23bae381789e1047a02d02d13fe23792fd2274bfaeff696b1ae2f9ef7309e9
|
data/_layouts/default.html
CHANGED
@@ -74,11 +74,6 @@ layout: compress
|
|
74
74
|
-------------------------------------------------------------------------------- {% endcomment %}
|
75
75
|
{% assign tooltips_options = template_config.bootstrap.tooltips %}
|
76
76
|
{% assign popovers_options = template_config.bootstrap.popovers %}
|
77
|
-
{% assign smoothscroll_options = template_config.smoothScroll %}
|
78
|
-
|
79
|
-
|
80
|
-
{% comment %} tooltips_options: {{ tooltips_options | debug }}{% endcomment %}
|
81
|
-
|
82
77
|
|
83
78
|
{% comment %} Webhooks disabled
|
84
79
|
--------------------------------------------------------------------------------
|
@@ -89,20 +84,12 @@ layout: compress
|
|
89
84
|
{% assign logon_client = data.modules.j1_sign_in_up %}
|
90
85
|
{% assign body_scrollbar = data.j1_config.body.scrollbar %}
|
91
86
|
|
92
|
-
{% if smoothscroll_options.enabled and smoothscroll_options.scrollInPageHashes %}
|
93
|
-
{% assign scroll_inpage_hashes = true %}
|
94
|
-
{% endif %}
|
95
|
-
|
96
87
|
{% comment %} Overload properties from page options
|
97
88
|
-------------------------------------------------------------------------------- {% endcomment %}
|
98
89
|
{% if page.scrollbar %}
|
99
90
|
{% assign body_scrollbar = page.scrollbar %}
|
100
91
|
{% endif %}
|
101
92
|
|
102
|
-
{% if page.scrollInPageHashes != nil %}
|
103
|
-
{% assign scroll_inpage_hashes = page.scrollInPageHashes %}
|
104
|
-
{% endif %}
|
105
|
-
|
106
93
|
{% comment %} main
|
107
94
|
-------------------------------------------------------------------------------- {% endcomment %}
|
108
95
|
<!DOCTYPE {{ site.doctype }}>
|
@@ -259,50 +246,6 @@ layout: compress
|
|
259
246
|
return new bootstrap.Popover(popoverTriggerEl)
|
260
247
|
});
|
261
248
|
{% endif %}
|
262
|
-
|
263
|
-
{% comment %} Update cookie for lastpage
|
264
|
-
---------------------------------------------------------------------------- {% endcomment %}
|
265
|
-
// save the current page to userstate cookie
|
266
|
-
var dependencies_met_page_ready = setInterval (function (options) {
|
267
|
-
if (j1.getState() === 'finished') {
|
268
|
-
var logger = log4javascript.getLogger('j1.layout.default');
|
269
|
-
|
270
|
-
function setLastPage() {
|
271
|
-
var cookie_names = j1.getCookieNames();
|
272
|
-
const user_state_cookie_name = cookie_names.user_session;
|
273
|
-
var user_state = j1.readCookie(user_state_cookie_name);
|
274
|
-
var user_state_last_page = window.location.pathname;
|
275
|
-
user_state.last_page = user_state_last_page;
|
276
|
-
|
277
|
-
j1.writeCookie({
|
278
|
-
name: user_state_cookie_name,
|
279
|
-
data: user_state,
|
280
|
-
samesite: 'Strict'
|
281
|
-
});
|
282
|
-
logger.debug('\n' + 'saved current page to cookie :' + user_state_last_page);
|
283
|
-
}
|
284
|
-
setLastPage();
|
285
|
-
clearInterval(dependencies_met_page_ready);
|
286
|
-
}
|
287
|
-
});
|
288
|
-
|
289
|
-
{% if scroll_inpage_hashes %}
|
290
|
-
// In-page HASH anchor links on click based on Chris Coyier's solution
|
291
|
-
// See: https://css-tricks.com/snippets/jquery/smooth-scrolling/
|
292
|
-
$('a[href^="#"]:not([href="#"])').click(function(e) {
|
293
|
-
if (location.hostname == this.hostname) {
|
294
|
-
var target = $(this.hash);
|
295
|
-
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
|
296
|
-
if (target.length) {
|
297
|
-
$('html, body').animate({
|
298
|
-
scrollTop: target.offset().top - 100 + 'px'
|
299
|
-
}, 200);
|
300
|
-
return false;
|
301
|
-
}
|
302
|
-
}
|
303
|
-
});
|
304
|
-
{% endif %}
|
305
|
-
|
306
249
|
});
|
307
250
|
</script>
|
308
251
|
<!-- [INFO ] [j1.layout.default.html ] [ end page processing ] -->
|
@@ -18,8 +18,8 @@ sitemap: false
|
|
18
18
|
|
19
19
|
{% comment %}
|
20
20
|
# -----------------------------------------------------------------------------
|
21
|
-
# ~/assets/http_error_pages/
|
22
|
-
# Liquid TEMPLATE to generate customized HTML error pages:
|
21
|
+
# ~/assets/http_error_pages/HTTP444.html
|
22
|
+
# Liquid TEMPLATE to generate customized HTML error pages: 444 - Blocked Content
|
23
23
|
#
|
24
24
|
# Product/Info:
|
25
25
|
# https://jekyll.one
|
@@ -65,14 +65,14 @@ sitemap: false
|
|
65
65
|
{% if language == 'en' %}
|
66
66
|
{% assign title = "Blocked Content" %}
|
67
67
|
{% assign back_url_text = "Back Home" %}
|
68
|
-
{% assign reason = "
|
68
|
+
{% assign reason = "Access to the page has been disabled for technical reasons. <br/> Because your privacy settings disabled personalization, this page cannot be presented." %}
|
69
69
|
{% assign contact_issue = "Technical Contact" %}
|
70
70
|
{% endif %}
|
71
71
|
|
72
72
|
{% if language == 'de' %}
|
73
73
|
{% assign title = "Gesperrter Inhalt" %}
|
74
74
|
{% assign back_url_text = "Zurück zur Startseite" %}
|
75
|
-
{% assign reason = "
|
75
|
+
{% assign reason = "Die Anzeige dieser Seite ist aus technischen Gründen gesperrt. <br/>Die Einstellungen zu Ihrer Privatsphäre erlauben keine Personalisierung. Diese Seite kann daher nicht angezeigt werden." %}
|
76
76
|
{% assign contact_issue = "Technischer Kontakt" %}
|
77
77
|
{% endif %}
|
78
78
|
|
@@ -18,8 +18,8 @@ sitemap: false
|
|
18
18
|
|
19
19
|
{% comment %}
|
20
20
|
# -----------------------------------------------------------------------------
|
21
|
-
# ~/assets/http_error_pages/
|
22
|
-
# Liquid TEMPLATE to generate customized HTML error pages: 445 -
|
21
|
+
# ~/assets/http_error_pages/HTTP445.html
|
22
|
+
# Liquid TEMPLATE to generate customized HTML error pages: 445 - Blocked Content
|
23
23
|
#
|
24
24
|
# Product/Info:
|
25
25
|
# https://jekyll.one
|
@@ -65,7 +65,7 @@ sitemap: false
|
|
65
65
|
{% if language == 'en' %}
|
66
66
|
{% assign title = "Site Blocked" %}
|
67
67
|
{% assign back_url_text = "Back Home" %}
|
68
|
-
{% assign reason = "
|
68
|
+
{% assign reason = "Access to the site has been disabled for technical reasons. <br/> Because your cookie settings are disabled for this website, the content cannot be presented." %}
|
69
69
|
{% assign contact_issue = "Technical Contact" %}
|
70
70
|
{% endif %}
|
71
71
|
|
@@ -0,0 +1,110 @@
|
|
1
|
+
---
|
2
|
+
date: 2021-01-01 00:00:00
|
3
|
+
description: >
|
4
|
+
Customized HTML error page
|
5
|
+
|
6
|
+
categories: [ Error page ]
|
7
|
+
tags: [ HTML, 446 ]
|
8
|
+
|
9
|
+
exclude_from_search: true
|
10
|
+
|
11
|
+
regenerate: false
|
12
|
+
permalink: /446.html
|
13
|
+
http_error: 446
|
14
|
+
back_url: "https://jekyll.one/"
|
15
|
+
sitemap: false
|
16
|
+
---
|
17
|
+
{% capture j1_cache %}
|
18
|
+
|
19
|
+
{% comment %}
|
20
|
+
# -----------------------------------------------------------------------------
|
21
|
+
# ~/assets/http_error_pages/HTTP446.html
|
22
|
+
# Liquid TEMPLATE to generate customized HTML error pages: 446 - Blocked Content
|
23
|
+
#
|
24
|
+
# Product/Info:
|
25
|
+
# https://jekyll.one
|
26
|
+
#
|
27
|
+
# Copyright (C) 2021 Juergen Adams
|
28
|
+
# Copyright (C) 2020 Andi Dittrich
|
29
|
+
#
|
30
|
+
# J1 Template is licensed under the MIT License.
|
31
|
+
# See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
|
32
|
+
# HttpErrorPages are licensed under the MIT License.
|
33
|
+
# See: https://github.com/AndiDittrich/HttpErrorPages
|
34
|
+
# -----------------------------------------------------------------------------
|
35
|
+
# NOTE
|
36
|
+
# German translation, see: https://de.wikipedia.org/wiki/HTTP-Statuscode
|
37
|
+
# -----------------------------------------------------------------------------
|
38
|
+
# Test data:
|
39
|
+
# liquid_var: {{ liquid_var | debug }}
|
40
|
+
# config: {{ config | debug }}
|
41
|
+
# -----------------------------------------------------------------------------
|
42
|
+
{% endcomment %}
|
43
|
+
|
44
|
+
{% assign language = site.language %}
|
45
|
+
{% assign webmaster_email = site.webmaster.email %}
|
46
|
+
{% assign copyright_info = site.copyright %}
|
47
|
+
{% assign favicon = site.favicon.image %}
|
48
|
+
{% assign images_dir = site.asciidoc_attributes.imagesdir %}
|
49
|
+
{% assign brand_text = site.brand.text %}
|
50
|
+
{% assign brand_image_source = site.brand.image %}
|
51
|
+
{% assign brand_image_height = site.brand.image_height %}
|
52
|
+
|
53
|
+
{% capture brand_image %}{{images_dir}}/{{brand_image_source}}{% endcapture %}
|
54
|
+
|
55
|
+
{% comment %} language detection
|
56
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
57
|
+
{% if site.language == "en" %}
|
58
|
+
{% assign language = "en" %}
|
59
|
+
{% elsif site.language == "de"%}
|
60
|
+
{% assign language = "de" %}
|
61
|
+
{% else %}
|
62
|
+
{% assign language = "en" %}
|
63
|
+
{% endif %}
|
64
|
+
|
65
|
+
{% if language == 'en' %}
|
66
|
+
{% assign title = "Site Blocked" %}
|
67
|
+
{% assign back_url_text = "Back to J1 Template (Home)" %}
|
68
|
+
{% assign reason = "Access to the site has been blocked for technical reasons. <br> Access to cookies for this site failed. Possibly, a third-party domain tries to access it." %}
|
69
|
+
{% assign contact_issue = "Technical Contact" %}
|
70
|
+
{% endif %}
|
71
|
+
|
72
|
+
{% if language == 'de' %}
|
73
|
+
{% assign title = "Website gesperrt" %}
|
74
|
+
{% assign back_url_text = "Zurück zu J1 Template (Home)" %}
|
75
|
+
{% assign reason = "Diese Webseiten sind aus technischen Gründen nicht verfügbar. <br> Der Zugriff auf Cookies ist für diese Website fehlgeschlagen. Möglicherweise versucht eine Drittanbieter-Domain darauf zuzugreifen." %}
|
76
|
+
{% assign contact_issue = "Technischer Kontakt" %}
|
77
|
+
{% endif %}
|
78
|
+
|
79
|
+
<!DOCTYPE html>
|
80
|
+
<html lang="{{language}}">
|
81
|
+
<head>
|
82
|
+
<!-- [INFO ] [j1.error.pages ] [ Simple HttpErrorPages | MIT License | https://github.com/AndiDittrich/HttpErrorPages ] -->
|
83
|
+
<!-- [INFO ] [j1.error.pages ] [ detected language (site): {{language}} ] -->
|
84
|
+
<meta charset="utf-8" />
|
85
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
86
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
87
|
+
<meta name="robots" content="noindex, nofollow">
|
88
|
+
<link rel="icon" type="image/ico" href="{{favicon}}">
|
89
|
+
<title>{{title}} · {{page.http_error}}</title>
|
90
|
+
<style> .attic { background-image: -webkit-gradient(linear, left top, left bottom, from(#263238), to(#3F51B5));background-image: -webkit-linear-gradient(top, #263238 0%, #3F51B5 100%);background-image: -o-linear-gradient(top, #263238 0%, #3F51B5 100%);background-image: linear-gradient(to bottom, #263238 0%, #3F51B5 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#263238", endColorstr="#3F51B5", GradientType=0); } </style>
|
91
|
+
<style type="text/css">/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{cursor: pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{cursor: pointer ;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}body,html{width:100%;height:100%;background-color:#21232a}body{color:#fff;text-align:center;text-shadow:0 2px 4px rgba(0,0,0,.5);padding:0;min-height:100%;-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,.8);box-shadow:inset 0 0 100px rgba(0,0,0,.8);display:table;font-family:"Open Sans",Arial,sans-serif}h1{font-family:inherit;font-weight:500;line-height:1.1;color:inherit;font-size:36px}h1 small{font-size:68%;font-weight:400;line-height:1;color:#777}a{text-decoration:none;color:#fff;font-size:inherit;border-bottom:dotted 1px #707070}.lead{color:silver;font-size:21px;line-height:1.4}.cover{display:table-cell;vertical-align:middle;padding:0 20px}footer{position:fixed;width:100%;height:40px;left:0;bottom:0;color:#a0a0a0;font-size:14px}</style>
|
92
|
+
</head>
|
93
|
+
<body>
|
94
|
+
<div style="margin-top: 1rem;">
|
95
|
+
<a href="/"><img src="{{brand_image}}" height="{{brand_image_height}}" alt="{{brand_text}}"></a>
|
96
|
+
</div>
|
97
|
+
<div class="cover attic">
|
98
|
+
<h1>{{title}} <small>{{page.http_error}}</small></h1>
|
99
|
+
<p class="lead">{{reason}}</p>
|
100
|
+
<div><a href="{{page.back_url}}" target="blank" rel="noopener">{{back_url_text}}</a></div>
|
101
|
+
</div>
|
102
|
+
<footer>
|
103
|
+
<p>{{copyright_info}} · {{contact_issue}}: <a href="mailto:{{webmaster_email}}?subject={{title}}"> {{webmaster_email}} </a></p>
|
104
|
+
</footer>
|
105
|
+
</body>
|
106
|
+
</html>
|
107
|
+
|
108
|
+
{% endcapture %}
|
109
|
+
{{ j1_cache | strip_empty_lines }}
|
110
|
+
{% assign j1_cache = nil %}
|
@@ -34,6 +34,9 @@ regenerate: true
|
|
34
34
|
|
35
35
|
{% comment %} Set config data
|
36
36
|
-------------------------------------------------------------------------------- {% endcomment %}
|
37
|
+
{% assign cookie_defaults = modules.defaults.cookies.defaults %}
|
38
|
+
{% assign cookie_settings = modules.cookies.settings %}
|
39
|
+
|
37
40
|
{% assign consent_defaults = modules.defaults.cookieconsent.defaults %}
|
38
41
|
{% assign consent_settings = modules.cookieconsent.settings %}
|
39
42
|
{% assign tracking_enabled = template_config.analytics.enabled %}
|
@@ -44,6 +47,7 @@ regenerate: true
|
|
44
47
|
{% comment %} Set config options
|
45
48
|
-------------------------------------------------------------------------------- {% endcomment %}
|
46
49
|
{% assign consent_options = consent_defaults | merge: consent_settings %}
|
50
|
+
{% assign cookie_options = cookie_defaults | merge: cookie_settings %}
|
47
51
|
|
48
52
|
{% assign production = false %}
|
49
53
|
{% if environment == 'prod' or environment == 'production' %}
|
@@ -87,18 +91,21 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
87
91
|
var moduleOptions = {};
|
88
92
|
var _this;
|
89
93
|
var $modal;
|
94
|
+
var cookie_names;
|
90
95
|
var user_cookie;
|
91
96
|
var logger;
|
92
97
|
var url;
|
93
98
|
var baseUrl;
|
94
99
|
var hostname;
|
95
100
|
var domain;
|
101
|
+
var cookie_option_domain;
|
96
102
|
var cookie_domain;
|
97
103
|
var secure;
|
98
104
|
var logText;
|
99
105
|
var cookie_written;
|
100
106
|
var contentLanguage;
|
101
107
|
var navigatorLanguage;
|
108
|
+
var domainAttribute;
|
102
109
|
|
103
110
|
// NOTE: RegEx for tracking_id: ^(G|UA|YT|MO)-[a-zA-Z0-9-]+$
|
104
111
|
// See: https://stackoverflow.com/questions/20411767/how-to-validate-google-analytics-tracking-id-using-a-javascript-function/20412153
|
@@ -120,22 +127,17 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
120
127
|
// -----------------------------------------------------------------------
|
121
128
|
// globals
|
122
129
|
// -----------------------------------------------------------------------
|
123
|
-
_this
|
124
|
-
logger
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
if(domain !== 'localhost') {
|
135
|
-
cookie_domain = '.' + hostname;
|
136
|
-
} else {
|
137
|
-
cookie_domain = hostname;
|
138
|
-
}
|
130
|
+
_this = j1.adapter.cookieConsent;
|
131
|
+
logger = log4javascript.getLogger('j1.adapter.cookieConsent');
|
132
|
+
cookie_names = j1.getCookieNames();
|
133
|
+
url = new liteURL(window.location.href);
|
134
|
+
baseUrl = url.origin;
|
135
|
+
hostname = url.hostname;
|
136
|
+
domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
137
|
+
cookie_option_domain = '{{cookie_options.domain}}';
|
138
|
+
secure = (url.protocol.includes('https')) ? true : false;
|
139
|
+
contentLanguage = '{{site.language}}';
|
140
|
+
navigatorLanguage = navigator.language || navigator.userLanguage;
|
139
141
|
|
140
142
|
// initialize state flag
|
141
143
|
_this.state = 'pending';
|
@@ -169,6 +171,16 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
169
171
|
// initializer
|
170
172
|
// -----------------------------------------------------------------------
|
171
173
|
var dependencies_met_page_ready = setInterval (function (options) {
|
174
|
+
var expires = '{{cookie_options.expires}}';
|
175
|
+
var same_site = '{{cookie_options.same_site}}';
|
176
|
+
|
177
|
+
// set domain used by cookies
|
178
|
+
if (cookie_option_domain == 'auto') {
|
179
|
+
domainAttribute = domain ;
|
180
|
+
} else {
|
181
|
+
domainAttribute = '';
|
182
|
+
}
|
183
|
+
|
172
184
|
if ( j1.getState() === 'finished' ) {
|
173
185
|
_this.setState('started');
|
174
186
|
logger.info('\n' + 'state: ' + _this.getState());
|
@@ -176,8 +188,11 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
176
188
|
|
177
189
|
j1.cookieConsent = new CookieConsent ({
|
178
190
|
contentURL: moduleOptions.contentURL, // dialog content (modals) for all supported languages
|
179
|
-
cookieName:
|
180
|
-
|
191
|
+
cookieName: cookie_names.user_consent, // name of the consent cookie
|
192
|
+
cookieStorageDays: expires, // lifetime of a cookie [0..365], 0: session cookie
|
193
|
+
cookieSameSite: same_site, // restrict consent cookie
|
194
|
+
cookieSecure: secure, // only sent to the server with an encrypted request over HTTPS
|
195
|
+
cookieDomain: domainAttribute, // set domain (hostname|domain)
|
181
196
|
dialogLanguage: moduleOptions.dialogLanguage, // language for the dialog (modal)
|
182
197
|
whitelisted: moduleOptions.whitelisted, // pages NOt dialog is shown
|
183
198
|
reloadPageOnChange: moduleOptions.reloadPageOnChange, // reload if setzings has changed
|
@@ -190,12 +205,9 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
190
205
|
logger.info('\n' + 'state: ' + _this.getState());
|
191
206
|
logger.debug('\n' + 'module initialized successfully');
|
192
207
|
|
193
|
-
//
|
194
|
-
//
|
195
|
-
//
|
196
|
-
// logger.info('\n' + 'call default action');
|
197
|
-
// j1.cookieConsent.showDialog();
|
198
|
-
// });
|
208
|
+
// -------------------------------------------------------------------
|
209
|
+
// NOTE: Click events moved to Navigator (core)
|
210
|
+
// -------------------------------------------------------------------
|
199
211
|
|
200
212
|
clearInterval(dependencies_met_page_ready);
|
201
213
|
}
|
@@ -301,23 +313,27 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
301
313
|
}
|
302
314
|
}
|
303
315
|
|
304
|
-
// Managing providers
|
316
|
+
// Managing providers using personalization OptIn/Out
|
317
|
+
// (Comments|Ads|Translation)
|
305
318
|
//
|
306
319
|
if (!user_consent.analysis || !user_consent.personalization) {
|
307
|
-
// expire consent|state cookies to session
|
308
|
-
j1.expireCookie({ name: cookie_names.user_state });
|
309
|
-
j1.expireCookie({ name: cookie_names.user_consent });
|
310
|
-
j1.expireCookie({ name: cookie_names.user_translate });
|
311
320
|
|
321
|
+
// overload cookie consent settings
|
322
|
+
user_translate.analysis = user_consent.analysis;
|
323
|
+
user_translate.personalization = user_consent.personalization;
|
324
|
+
// disable translation service
|
312
325
|
user_translate.translationEnabled = false;
|
326
|
+
|
313
327
|
cookie_written = j1.writeCookie({
|
314
328
|
name: cookie_names.user_translate,
|
315
329
|
data: user_translate,
|
316
|
-
|
317
|
-
secure: secure,
|
318
|
-
expires: 365
|
330
|
+
secure: secure
|
319
331
|
});
|
320
332
|
|
333
|
+
// expire permanent cookies to session
|
334
|
+
j1.expireCookie({ name: cookie_names.user_state });
|
335
|
+
j1.expireCookie({ name: cookie_names.user_consent });
|
336
|
+
j1.expireCookie({ name: cookie_names.user_translate });
|
321
337
|
}
|
322
338
|
if (moduleOptions.reloadPageOnChange) {
|
323
339
|
// reload current page (skip cache)
|
@@ -331,14 +347,28 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
331
347
|
j1.removeCookie({ name: item, domain: cookie_domain });
|
332
348
|
});
|
333
349
|
|
334
|
-
// Managing providers
|
350
|
+
// Managing providers using personalization OptIn/Out
|
351
|
+
// (Comments|Ads|Translation)
|
335
352
|
//
|
336
353
|
if (!user_consent.analysis || !user_consent.personalization) {
|
337
|
-
//
|
354
|
+
// overload cookie consent settings
|
355
|
+
user_translate.analysis = user_consent.analysis;
|
356
|
+
user_translate.personalization = user_consent.personalization;
|
357
|
+
// disable translation service
|
358
|
+
user_translate.translationEnabled = false;
|
359
|
+
|
360
|
+
cookie_written = j1.writeCookie({
|
361
|
+
name: cookie_names.user_translate,
|
362
|
+
data: user_translate,
|
363
|
+
secure: secure
|
364
|
+
});
|
365
|
+
|
366
|
+
// expire permanent cookies to session
|
338
367
|
j1.expireCookie({ name: cookie_names.user_state });
|
339
368
|
j1.expireCookie({ name: cookie_names.user_consent });
|
340
369
|
j1.expireCookie({ name: cookie_names.user_translate });
|
341
370
|
}
|
371
|
+
|
342
372
|
if (moduleOptions.reloadPageOnChange) {
|
343
373
|
// reload current page (skip cache)
|
344
374
|
location.reload(true);
|