j1-template 2022.0.11 → 2022.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/themes/j1/adapter/js/comments.js +3 -4
- data/assets/themes/j1/adapter/js/cookieConsent.js +25 -7
- data/assets/themes/j1/adapter/js/j1.js +17 -9
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +11 -2
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c037151437cd15323621e862ab96516d0949d4de2d6126a7fd7b2b1ce61ea9f
|
4
|
+
data.tar.gz: 4d70c7d408321ada5b32579b811c42c2758fec708878f6d839174239632889f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8262cafb8ec127d6ec93d2d39f8ec0d5826f6b3dca61314472af7b88506304f5c54024bee15ccc4a782d7baaeae0a0e39de3e9253b0cb6869d3618e63ea70d67
|
7
|
+
data.tar.gz: 2da79d073c80ab3a76a8787b443e2d08b6a4bb3d8ef9ff119efb78ac3659b4a27acecab3925bc5f1527f4f2f6c2134f2524174010146c3cf5a28808fd86fa75d
|
@@ -118,6 +118,8 @@ j1.adapter.comments = (function (j1, window) {
|
|
118
118
|
{% comment %} Set global variables
|
119
119
|
-------------------------------------------------------------------------------- {% endcomment %}
|
120
120
|
var environment = '{{environment}}';
|
121
|
+
var date = new Date();
|
122
|
+
var timestamp_now = date.toISOString();
|
121
123
|
var comments_provider = '{{comments_provider}}';
|
122
124
|
var dqApiScript = document.createElement('script');
|
123
125
|
var hvApiScript = document.createElement('script');
|
@@ -276,12 +278,9 @@ var logText;
|
|
276
278
|
|
277
279
|
// add|initialize Disqus Web API
|
278
280
|
// -----------------------------------------------------------------
|
279
|
-
var d = new Date();
|
280
|
-
var currDate = d.toString().slice(0, 33); // extract the data part
|
281
|
-
|
282
281
|
dqApiScript.id = 'dq-web-api';
|
283
282
|
dqApiScript.src = '//' + siteID + '.disqus.com/embed.js";'
|
284
|
-
dqApiScript.setAttribute("data-timestamp", '"' +
|
283
|
+
dqApiScript.setAttribute("data-timestamp", '"' + timestamp_now + '"');
|
285
284
|
document.head.appendChild(dqApiScript);
|
286
285
|
|
287
286
|
// add Disqus comment container
|
@@ -19,6 +19,7 @@ regenerate: true
|
|
19
19
|
# -----------------------------------------------------------------------------
|
20
20
|
# Test data:
|
21
21
|
# {{ liquid_var | debug }}
|
22
|
+
# cookie_options: {{ cookie_options | debug }}
|
22
23
|
# -----------------------------------------------------------------------------
|
23
24
|
{% endcomment %}
|
24
25
|
|
@@ -94,7 +95,7 @@ j1.adapter.cookieConsent = (function (j1, window) {
|
|
94
95
|
var url;
|
95
96
|
var baseUrl;
|
96
97
|
var hostname;
|
97
|
-
var
|
98
|
+
var auto_domain;
|
98
99
|
var cookie_option_domain;
|
99
100
|
var cookie_domain;
|
100
101
|
var secure;
|
@@ -130,8 +131,8 @@ j1.adapter.cookieConsent = (function (j1, window) {
|
|
130
131
|
url = new liteURL(window.location.href);
|
131
132
|
baseUrl = url.origin;
|
132
133
|
hostname = url.hostname;
|
133
|
-
|
134
|
-
cookie_option_domain = '{{cookie_options.domain}}';
|
134
|
+
auto_domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
135
|
+
cookie_option_domain = ('{{cookie_options.domain}}' === 'true');
|
135
136
|
secure = (url.protocol.includes('https')) ? true : false;
|
136
137
|
contentLanguage = '{{site.language}}';
|
137
138
|
navigatorLanguage = navigator.language || navigator.userLanguage;
|
@@ -171,11 +172,28 @@ j1.adapter.cookieConsent = (function (j1, window) {
|
|
171
172
|
var expires = '{{cookie_options.expires}}';
|
172
173
|
var same_site = '{{cookie_options.same_site}}';
|
173
174
|
|
175
|
+
// // set domain used by cookies
|
176
|
+
// if (cookie_option_domain == 'auto') {
|
177
|
+
// domainAttribute = domain ;
|
178
|
+
// } else {
|
179
|
+
// domainAttribute = '';
|
180
|
+
// }
|
181
|
+
|
174
182
|
// set domain used by cookies
|
175
|
-
if (cookie_option_domain
|
176
|
-
|
177
|
-
|
178
|
-
|
183
|
+
if (cookie_option_domain) {
|
184
|
+
if (cookie_option_domain == 'auto') {
|
185
|
+
domainAttribute = auto_domain;
|
186
|
+
stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
|
187
|
+
} else if (cookie_option_domain) {
|
188
|
+
domainAttribute = domain;
|
189
|
+
stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
// Failsafe: if 'None' is given for samesite in non-secure environments
|
194
|
+
// -----------------------------------------------------------------------
|
195
|
+
if (same_site == 'None' && !secure) {
|
196
|
+
same_site = 'Lax';
|
179
197
|
}
|
180
198
|
|
181
199
|
if ( j1.getState() === 'finished' ) {
|
@@ -1504,11 +1504,11 @@ var j1 = (function () {
|
|
1504
1504
|
// -------------------------------------------------------------------------
|
1505
1505
|
writeCookie: function (options /*name, data, [path, expires, domain, samesite, http_only, secure]*/) {
|
1506
1506
|
var date = new Date();
|
1507
|
-
var timestamp_now = date.toISOString()
|
1507
|
+
var timestamp_now = date.toISOString();
|
1508
1508
|
var url = new liteURL(window.location.href);
|
1509
1509
|
var baseUrl = url.origin;;
|
1510
1510
|
var hostname = url.hostname;
|
1511
|
-
var
|
1511
|
+
var auto_domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
1512
1512
|
var stringifiedAttributes = '';
|
1513
1513
|
var cookie_data = {};
|
1514
1514
|
var data_json;
|
@@ -1521,13 +1521,19 @@ var j1 = (function () {
|
|
1521
1521
|
name: '',
|
1522
1522
|
path: '{{cookie_options.path}}',
|
1523
1523
|
expires: '{{cookie_options.expires}}',
|
1524
|
-
domain: '{{cookie_options.domain}}',
|
1524
|
+
domain: ('{{cookie_options.domain}}' === 'true'), // convert string to boolean
|
1525
1525
|
samesite: '{{cookie_options.same_site}}',
|
1526
1526
|
http_only: '{{cookie_options.http_only}}',
|
1527
1527
|
secure: '{{cookie_options.secure}}'
|
1528
1528
|
};
|
1529
1529
|
var settings = $.extend(defaults, options);
|
1530
1530
|
|
1531
|
+
// Failsafe: if 'None' is given for samesite in non-secure environments
|
1532
|
+
// -----------------------------------------------------------------------
|
1533
|
+
if (settings.samesite == 'None' && !settings.secure) {
|
1534
|
+
settings.samesite = 'Lax';
|
1535
|
+
}
|
1536
|
+
|
1531
1537
|
cookie_data.timestamp = timestamp_now;
|
1532
1538
|
|
1533
1539
|
if (j1.existsCookie(settings.name)) {
|
@@ -1551,12 +1557,14 @@ var j1 = (function () {
|
|
1551
1557
|
stringifiedAttributes += '; ' + 'SameSite=' + settings.samesite;
|
1552
1558
|
|
1553
1559
|
// set domain used by cookies
|
1554
|
-
if (settings.domain
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
+
if (settings.domain) {
|
1561
|
+
if (settings.domain == 'auto') {
|
1562
|
+
domainAttribute = auto_domain;
|
1563
|
+
stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
|
1564
|
+
} else if (settings.domain) {
|
1565
|
+
domainAttribute = settings.domain;
|
1566
|
+
stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
|
1567
|
+
}
|
1560
1568
|
}
|
1561
1569
|
|
1562
1570
|
if (settings.secure == true) {
|
@@ -86,15 +86,24 @@ function CookieConsent(props) {
|
|
86
86
|
set: function (name, value, days, cookieSameSite, cookieDomain, cookieSecure) {
|
87
87
|
var value_encoded = window.btoa(value);
|
88
88
|
var expires = '; expires=Thu, 01 Jan 1970 00:00:00 UTC';
|
89
|
+
|
89
90
|
if (days>0) {
|
90
91
|
var date = new Date();
|
91
92
|
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
92
93
|
expires = "; expires=" + date.toUTCString();
|
93
94
|
}
|
95
|
+
|
96
|
+
// TODO: cookie attriebutes should be 'stringified' as done
|
97
|
+
// in j1.adapter.writeCookie()
|
98
|
+
// NOTE: DISABLED attribute 'Domain' for now
|
99
|
+
//------------------------------------------------------------------------
|
100
|
+
|
94
101
|
if (cookieSecure) {
|
95
|
-
|
102
|
+
// document.cookie = name + "=" + (value_encoded || '') + expires + '; Path=/; SameSite=' + cookieSameSite + '; ' + 'Domain=' + cookieDomain + '; ' + 'Secure=' + cookieSecure + ';';
|
103
|
+
document.cookie = name + "=" + (value_encoded || '') + expires + '; Path=/; SameSite=' + cookieSameSite + '; ' + 'Secure=' + cookieSecure + ';';
|
96
104
|
} else {
|
97
|
-
|
105
|
+
// document.cookie = name + "=" + (value_encoded || '') + expires + '; Path=/; SameSite=' + cookieSameSite + ';' + 'Domain=' + cookieDomain + '; ';
|
106
|
+
document.cookie = name + "=" + (value_encoded || '') + expires + '; Path=/; SameSite=' + cookieSameSite + ';';
|
98
107
|
}
|
99
108
|
},
|
100
109
|
get: function (name) {
|
@@ -24,4 +24,4 @@
|
|
24
24
|
# outside of J1 Template!
|
25
25
|
# -----------------------------------------------------------------------------
|
26
26
|
*/
|
27
|
-
"use strict";function CookieConsent(d){var v=log4javascript.getLogger("j1.core.CookieConsent");var p=this;var q=false;var e=new liteURL(window.location.href);var c=(e.protocol.includes("https"))?true:false;var j;var g;var t;v.info("\ninitializing core module: started");v.info("\nstate: started");this.props={autoShowDialog:true,dialogLanguage:"content",dialogLanguages:["en","de"],contentURL:"/assets/data/cookieconsent",postSelectionCallback:"",whitelisted:[],xhrDataElement:"consent-data",dialogContainerID:"consent-modal"};for(var f in d){this.props[f]=d[f]}if(this.props.dialogLanguage.indexOf("-")!==-1){this.props.dialogLanguage=this.props.dialogLanguage.split("-")[0]}if(!this.props.dialogLanguages.includes(this.props.dialogLanguage)){this.props.dialogLanguage=this.props.dialogLanguages[0]}this.props.xhrDataElement=this.props.xhrDataElement+"-"+this.props.dialogLanguage;this.props.cookieSecure=c;var h={set:function(w,C,E,z,D,A){var B=window.btoa(C);var x="; expires=Thu, 01 Jan 1970 00:00:00 UTC";if(E>0){var y=new Date();y.setTime(y.getTime()+(E*24*60*60*1000));x="; expires="+y.toUTCString()}if(A){document.cookie=w+"="+(B||"")+x+"; Path=/; SameSite="+z+";
|
27
|
+
"use strict";function CookieConsent(d){var v=log4javascript.getLogger("j1.core.CookieConsent");var p=this;var q=false;var e=new liteURL(window.location.href);var c=(e.protocol.includes("https"))?true:false;var j;var g;var t;v.info("\ninitializing core module: started");v.info("\nstate: started");this.props={autoShowDialog:true,dialogLanguage:"content",dialogLanguages:["en","de"],contentURL:"/assets/data/cookieconsent",postSelectionCallback:"",whitelisted:[],xhrDataElement:"consent-data",dialogContainerID:"consent-modal"};for(var f in d){this.props[f]=d[f]}if(this.props.dialogLanguage.indexOf("-")!==-1){this.props.dialogLanguage=this.props.dialogLanguage.split("-")[0]}if(!this.props.dialogLanguages.includes(this.props.dialogLanguage)){this.props.dialogLanguage=this.props.dialogLanguages[0]}this.props.xhrDataElement=this.props.xhrDataElement+"-"+this.props.dialogLanguage;this.props.cookieSecure=c;var h={set:function(w,C,E,z,D,A){var B=window.btoa(C);var x="; expires=Thu, 01 Jan 1970 00:00:00 UTC";if(E>0){var y=new Date();y.setTime(y.getTime()+(E*24*60*60*1000));x="; expires="+y.toUTCString()}if(A){document.cookie=w+"="+(B||"")+x+"; Path=/; SameSite="+z+"; Secure="+A+";"}else{document.cookie=w+"="+(B||"")+x+"; Path=/; SameSite="+z+";"}},get:function(x){var A=x+"=";var w=document.cookie.split(";");for(var y=0;y<w.length;y++){var C=w[y];while(C.charAt(0)===" "){C=C.substring(1,C.length)}if(C.indexOf(A)===0){var B=C.substring(A.length,C.length);var z=window.atob(B);return z}}return undefined}};var n={documentReady:function(w){if(document.readyState!=="loading"){w()}else{document.addEventListener("DOMContentLoaded",w)}}};function u(){var w={};var x=false;var y=0;var z=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){x=arguments[0];y++}var B=function(C){for(var D in C){if(Object.prototype.hasOwnProperty.call(C,D)){if(x&&Object.prototype.toString.call(C[D])==="[object Object]"){w[D]=u(true,w[D],C[D])}else{w[D]=C[D]}}}};for(;y<z;y++){var A=arguments[y];B(A)}return w}function i(B,y){var w=Array.prototype.slice.call(arguments,2);var A=B.split(".");var z=A.pop();for(var x=0;x<A.length;x++){y=y[A[x]]}return y[z].apply(y,w)}function m(w){n.documentReady(function(){p.modal=document.getElementById(p.props.dialogContainerID);if(!p.modal){v.info("\nload consent modal");p.modal=document.createElement("div");p.modal.id=p.props.dialogContainerID;p.modal.style.display="none";p.modal.setAttribute("class","modal fade");p.modal.setAttribute("tabindex","-1");p.modal.setAttribute("role","dialog");p.modal.setAttribute("aria-labelledby",p.props.dialogContainerID);document.body.append(p.modal);p.$modal=$(p.modal);p.$modal.on("hidden.bs.modal",function(){i(p.props.postSelectionCallback,window)});var x=p.props.contentURL+"/index.html";$.get(x).done(function(y){v.info("\nloading consent modal: successfully");p.modal.innerHTML=y;p.modal.innerHTML=$("#"+p.props.xhrDataElement).eq(0).html();p.modal.style.display="block";$(p.modal).modal({backdrop:"static",keyboard:false});p.$buttonDoNotAgree=$("#bccs-buttonDoNotAgree");p.$buttonAgree=$("#bccs-buttonAgree");p.$buttonSave=$("#bccs-buttonSave");p.$buttonAgreeAll=$("#bccs-buttonAgreeAll");v.info("\nload/initialze options from cookie");l();k();$("#bccs-options").on("hide.bs.collapse",function(){q=false;l()}).on("show.bs.collapse",function(){q=true;l()});v.info("\ninitialze event handler");p.$buttonDoNotAgree.click(function(){b()});p.$buttonAgree.click(function(){o()});p.$buttonSave.click(function(){$("#bccs-options").collapse("hide");s();k()});p.$buttonAgreeAll.click(function(){$("#bccs-options").collapse("hide");o();k()});p.$modal.modal("show")}).fail(function(){v.error("\nloading consent modal: failed");v.warn("\nprobably no `contentURL` set")})}else{p.$modal.modal("show")}}.bind(this))}function k(){var y=p.getSettings();if(y){for(var x in y){var w=p.$modal.find("#bccs-options .bccs-option[data-name='"+x+"'] input[type='checkbox']");w.prop("checked",y[x])}}}function l(){if(q){p.$buttonDoNotAgree.hide();p.$buttonAgree.hide();p.$buttonSave.show();p.$buttonAgreeAll.show()}else{p.$buttonDoNotAgree.show();p.$buttonAgree.show();p.$buttonSave.hide();p.$buttonAgreeAll.hide()}}function a(x){var w=p.$modal.find("#bccs-options .bccs-option");var z={};for(var A=0;A<w.length;A++){var C=w[A];var y=C.getAttribute("data-name");if(y==="necessary"){z[y]=true}else{if(x===undefined){var B=$(C).find("input[type='checkbox']");z[y]=B.prop("checked")}else{z[y]=!!x}}}return z}function o(){h.set(p.props.cookieName,JSON.stringify(a(true)),p.props.cookieStorageDays,p.props.cookieSameSite,p.props.cookieDomain,c);p.$modal.modal("hide")}function b(){h.set(p.props.cookieName,JSON.stringify(a(false)),0,p.props.cookieSameSite,p.props.cookieDomain,c);p.$modal.modal("hide");window.location.href="/445.html"}function s(){h.set(p.props.cookieName,JSON.stringify(a()),p.props.cookieStorageDays,p.props.cookieSameSite,p.props.cookieDomain,c);p.$modal.modal("hide")}t=(this.props.whitelisted.indexOf(window.location.pathname)>-1);var r=h.get(this.props.cookieName);if((r===undefined||r==="false")&&this.props.autoShowDialog&&!t){m()}v.info("\ninitializing core module finished");v.info("\nstate: finished");this.showDialog=function(){t=(this.props.whitelisted.indexOf(window.location.pathname)>-1);if(!t){m()}};this.getSettings=function(x){var w=h.get(p.props.cookieName);if(w){var y=JSON.parse(h.get(p.props.cookieName));if(x===undefined){return y}else{if(y){return y[x]}else{return false}}}else{return undefined}}};
|
data/lib/j1/version.rb
CHANGED
data/lib/starter_web/Gemfile
CHANGED
@@ -53,7 +53,7 @@ gem 'jekyll', '~> 4.2'
|
|
53
53
|
|
54
54
|
# Theme Rubies, default: J1 Template (NOT used for the development system)
|
55
55
|
#
|
56
|
-
gem 'j1-template', '~> 2022.0.
|
56
|
+
gem 'j1-template', '~> 2022.0.12'
|
57
57
|
|
58
58
|
# ------------------------------------------------------------------------------
|
59
59
|
# PRODUCTION: Gem needed for the Jekyll and J1 prod environment
|
data/lib/starter_web/_config.yml
CHANGED
@@ -53,7 +53,7 @@ environment: development
|
|
53
53
|
# ------------------------------------------------------------------------------
|
54
54
|
# Sets the build version of J1 Template Gem
|
55
55
|
#
|
56
|
-
version: 2022.0.
|
56
|
+
version: 2022.0.12
|
57
57
|
|
58
58
|
# version
|
59
59
|
# ------------------------------------------------------------------------------
|
@@ -437,7 +437,7 @@ end::tables[]
|
|
437
437
|
// -----------------------------------------------------------------------------
|
438
438
|
tag::products[]
|
439
439
|
:j1--license: MIT License
|
440
|
-
:j1--version: 2022.0.
|
440
|
+
:j1--version: 2022.0.12
|
441
441
|
:j1--site-name: Jekyll One
|
442
442
|
end::products[]
|
443
443
|
|