j1-template 2022.0.7 → 2022.0.8
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 -56
- 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 +53 -24
- data/assets/themes/j1/adapter/js/j1.js +70 -176
- data/assets/themes/j1/adapter/js/translator.js +106 -52
- 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/translator/js/translator.js +97 -62
- 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 +1 -1
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -3
- data/lib/starter_web/_data/modules/defaults/cookies.yml +70 -6
- 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 +3 -2
@@ -12,4 +12,4 @@
|
|
12
12
|
# See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE
|
13
13
|
# -----------------------------------------------------------------------------
|
14
14
|
*/
|
15
|
-
"use strict";function Translator(d){var
|
15
|
+
"use strict";function Translator(d){var q=this;var w=log4javascript.getLogger("j1.core.translator");var m=new liteURL(window.location.href);var c=(m.protocol.includes("https"))?true:false;var r=false;var h;var u;var g={set:function(x,D,F,A,E,B){var C=window.btoa(D);var y="; expires=Thu, 01 Jan 1970 00:00:00 UTC";if(F>0){var z=new Date();z.setTime(z.getTime()+(F*24*60*60*1000));y="; expires="+z.toUTCString()}if(B){document.cookie=x+"="+(C||"")+y+"; Path=/; SameSite="+A+"; Domain="+E+"; Secure="+B+";"}else{document.cookie=x+"="+(C||"")+y+"; Path=/; SameSite="+A+";Domain="+E+"; "}},get:function(y){var B=y+"=";var x=document.cookie.split(";");for(var z=0;z<x.length;z++){var D=x[z];while(D.charAt(0)===" "){D=D.substring(1,D.length)}if(D.indexOf(B)===0){var C=D.substring(B.length,D.length);var A=window.atob(C);return A}}return undefined}};w.info("\ninitializing core module: started");w.info("\nstate: started");this.props={contentURL:"/assets/data/translator",cookieName:"j1.user.state",cookieConsentName:"j1.user.consent",cookieStorageDays:365,cookieSameSite:"Lax",cookieSecure:c,translationEnabled:false,disableLanguageSelector:false,translatorName:"google",translationLanguages:"all",translationLanguage:"auto",translateAllPages:true,hideSuggestionBox:true,hidePoweredBy:true,hideTopFrame:true,dialogLanguage:"content",dialogLanguages:["en","de"],dialogContainerID:"translator-modal",xhrDataElement:"",postSelectionCallback:"",};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;w.info("\ninitializing core module: started");w.info("\nstate: started");var s={translatorName:"google",translationEnabled:false,translateAllPages:true,useLanguageFromBrowser:true,translationLanguage:"de",analysis:true,personalization:true};var e=g.get(q.props.cookieName);if(!e){w.info("\ninitializing translator cookie: "+q.props.cookieName);g.set(q.props.cookieName,JSON.stringify(s),q.props.cookieStorageDays,q.props.cookieSameSite,q.props.cookieDomain,q.props.cookieSecure)}var o={documentReady:function(x){if(document.readyState!=="loading"){x()}else{document.addEventListener("DOMContentLoaded",x)}}};function v(){var x={};var y=false;var z=0;var A=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){y=arguments[0];z++}var C=function(D){for(var E in D){if(Object.prototype.hasOwnProperty.call(D,E)){if(y&&Object.prototype.toString.call(D[E])==="[object Object]"){x[E]=v(true,x[E],D[E])}else{x[E]=D[E]}}}};for(;z<A;z++){var B=arguments[z];C(B)}return x}function i(C,z){var x=Array.prototype.slice.call(arguments,2);var B=C.split(".");var A=B.pop();for(var y=0;y<B.length;y++){z=z[B[y]]}return z[A].apply(z,x)}function k(y){var x;var z=v({size:0,width:250,multiple:false,selectedIndex:1,enableAutoFilter:false,visibleRows:null,},y);x="#"+z.selector;$.ajax({url:z.url,dataType:"json",success:function(C){var B=[];if(q.props.translationLanguages.includes("all")){B=C[z.elm]}else{for(var A=0;A<C[z.elm].length;A++){if(q.props.translationLanguages.includes(C[z.elm][A].value)){B.push(C[z.elm][A])}}}if(z.visibleRows>B.length){z.visibleRows=B.length}MsDropdown.make(x,{byJson:{data:B,name:z.name,size:z.size,width:z.width,multiple:z.multiple,},enableAutoFilter:z.enableAutoFilter,visibleRows:z.visibleRows,})},error:function(A,C,B){w.error("\nfailed to retrieve JSON data from: "+z.url)}})}function n(){o.documentReady(function(){q.modal=document.getElementById(q.props.dialogContainerID);if(!q.modal){w.info("\nload consent modal");q.modal=document.createElement("div");q.modal.id=q.props.dialogContainerID;q.modal.style.display="none";q.modal.setAttribute("class","modal fade");q.modal.setAttribute("tabindex","-1");q.modal.setAttribute("role","dialog");q.modal.setAttribute("aria-labelledby",q.props.dialogContainerID);document.body.append(q.modal);q.$modal=$(q.modal);q.$modal.on("show.bs.modal",function(){var y;var z;w.info("\nshow.bs.modal: entered");$.when(k({url:"/assets/data/iso-639-language-codes-flags.json",elm:"iso-639-languages",selector:"dropdownJSON",width:400,visibleRows:8,})).then(function(A){w.info("\ncreating msDropdown from JSON data: finished")})});q.$modal.on("shown.bs.modal",function(){var y;var z;z=setInterval(function(){if(typeof document.getElementById("dropdownJSON").msDropdown!=="undefined"){y=document.getElementById("dropdownJSON").msDropdown;if(!y.length){w.error("\nno msDropdown found in translation dialog");q.$modal.hide()}else{if(q.props.translationLanguage==="auto"){h=navigator.language||navigator.userLanguage;u=h.split("-")[0]}else{u=q.props.translationLanguage}y.selectedIndex=$("#dropdownJSON option[value="+u+"]").index();if(q.props.disableLanguageSelector){y.disabled=true}$("#dropdownJSON").show();$("body").addClass("stop-scrolling");w.info("\nmsDropdown successfully loaded in translation dialog");clearInterval(z)}}},25)});q.$modal.on("hidden.bs.modal",function(){$("body").removeClass("stop-scrolling");i(q.props.postSelectionCallback,window)});var x=q.props.contentURL+"/index.html";$.get(x).done(function(y){w.info("\nloading consent modal: successfully");q.modal.innerHTML=y;q.modal.innerHTML=$("#"+q.props.xhrDataElement).eq(0).html();q.modal.style.display="block";$(q.modal).modal({backdrop:"static",keyboard:false});q.$buttonDoNotAgree=$("#translator-buttonDoNotAgree");q.$buttonAgree=$("#translator-buttonAgree");q.$buttonSave=$("#translator-buttonSave");q.$buttonAgreeAll=$("#translator-buttonAgreeAll");w.info("\nload/initialze options from cookie");l();j();$("#google-options").on("hide.bs.collapse",function(){r=false;l()}).on("show.bs.collapse",function(){r=true;l()});w.info("\ninitialze button event handler");q.$buttonDoNotAgree.click(function(){b()});q.$buttonAgree.click(function(){p()});q.$buttonSave.click(function(){$("#google-options").collapse("hide");t();j()});q.$buttonAgreeAll.click(function(){$("#google-options").collapse("hide");p()});q.$modal.modal("show")}).fail(function(){w.error("\nloading translator dialog (modal): failed");w.warn("\nprobably no|wrong `contentURL` set")})}else{q.$modal.modal("show")}}.bind(this))}function j(){var z=q.getSettings();if(z){for(var y in z){var x=q.$modal.find("#google-options .translator-option[data-name="+y+'] input[type="checkbox"]');x.prop("checked",z[y])}}}function l(){if(r){q.$buttonDoNotAgree.hide();q.$buttonAgree.hide();q.$buttonSave.show();q.$buttonAgreeAll.show()}else{q.$buttonDoNotAgree.show();q.$buttonAgree.show();q.$buttonSave.hide();q.$buttonAgreeAll.hide()}}function a(y){var x=q.$modal.find("#google-options .translator-option");var A={};for(var B=0;B<x.length;B++){var D=x[B];var z=D.getAttribute("data-name");if(z==="necessary"){A[z]=true}else{if(y===undefined){var C=$(D).find('input[type="checkbox"]');A[z]=C.prop("checked")}else{A[z]=!!y}}}return A}function p(){var x=JSON.parse(g.get(q.props.cookieConsentName));var y={};y.analysis=true;y.personalization=true;y.translationEnabled=true;x.analysis=y.analysis;x.personalization=y.personalization;g.set(q.props.cookieConsentName,JSON.stringify(x),q.props.cookieStorageDays,q.props.cookieSameSite,q.props.cookieDomain,q.props.cookieSecure);g.set(q.props.cookieName,JSON.stringify(y),q.props.cookieStorageDays,q.props.cookieSameSite,q.props.cookieDomain,q.props.cookieSecure);q.$modal.modal("hide")}function b(){var x=a();x.translationEnabled=false;g.set(q.props.cookieName,JSON.stringify(x),q.props.cookieStorageDays,q.props.cookieSameSite,q.props.cookieDomain,q.props.cookieSecure);q.$modal.modal("hide")}function t(){var y=a();var x=JSON.parse(g.get(q.props.cookieConsentName));x.analysis=y.analysis;x.personalization=y.personalization;g.set(q.props.cookieConsentName,JSON.stringify(x),q.props.cookieStorageDays,q.props.cookieSameSite,q.props.cookieDomain,q.props.cookieSecure);g.set(q.props.cookieName,JSON.stringify(y),q.props.cookieStorageDays,q.props.cookieSameSite,q.props.cookieDomain,q.props.cookieSecure);q.$modal.modal("hide")}this.showDialog=function(){n()};this.getSettings=function(y){var x=g.get(q.props.cookieName);if(x){var z=JSON.parse(g.get(q.props.cookieName));if(y===undefined){return z}else{if(z){return z[y]}else{return false}}}else{return undefined}};w.info("\ninitializing core module finished");w.info("\nstate: finished")};
|
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.8'
|
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.8
|
57
57
|
|
58
58
|
# version
|
59
59
|
# ------------------------------------------------------------------------------
|
@@ -31,9 +31,9 @@ defaults:
|
|
31
31
|
dialogLanguage: content # auto|content|one of dialogLanguages
|
32
32
|
dialogLanguages: [en, de] # supported dialog (modal) languages, defaults to FIRST language defined by languages
|
33
33
|
contentURL: /assets/data/cookieconsent # dialog content (modals) for all supported languages
|
34
|
-
cookieName:
|
35
|
-
cookieStorageDays:
|
36
|
-
cookieSameSite:
|
34
|
+
# cookieName: j1.user.consent # name of the user consent cookie
|
35
|
+
# cookieStorageDays: 365 # duration the consent cookie is stored
|
36
|
+
# cookieSameSite: Strict # restrict consent cookie to first-party, do NOT send cookie to other domains
|
37
37
|
reloadPageOnChange: true # reload current page if user settings has been changed
|
38
38
|
whitelisted: [ '/pages/public/legal/en/privacy' ] # pages NO consent issued, currently NOT supported
|
39
39
|
xhrDataElement: consent-data # container for all language-specific consent modals (taken from contentURL)
|
@@ -28,12 +28,76 @@ description:
|
|
28
28
|
# Default settings
|
29
29
|
#
|
30
30
|
defaults:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
|
32
|
+
# ----------------------------------------------------------------------------
|
33
|
+
# Settings/Attributes
|
34
|
+
#
|
35
|
+
# path
|
36
|
+
# --------------------------------------------------------------------------
|
37
|
+
# Attribute 'path' indicates a URL PATH that must exist in the requested
|
38
|
+
# URL in order to send the Cookie header
|
39
|
+
#
|
40
|
+
# values: string
|
41
|
+
# default: '/'
|
42
|
+
#
|
43
|
+
# domain
|
44
|
+
# --------------------------------------------------------------------------
|
45
|
+
# Switch 'domain' controls if the value for the attribute 'domain' is
|
46
|
+
# (automatically) set to hostname (false) or domain (true) for the host
|
47
|
+
# set the cookie.
|
48
|
+
# If set to 'false', the attribute defaults to the same host that set the
|
49
|
+
# cookie. If the host is set, all subdomains are EXCLUDED (restricted).
|
50
|
+
# If set to 'true', the attribute defaults to the domain which hosts can
|
51
|
+
# receive a cookie. This setting allows ALL subdomains to receive a cookie.
|
52
|
+
#
|
53
|
+
# NOTE: Be carefull setting switch 'domain' to true. For sites deployed
|
54
|
+
# to hosts of (public domain) providers like Netlify, this will open
|
55
|
+
# cookie access to hosts! See 'same_site'.
|
56
|
+
#
|
57
|
+
# values: [false|true]
|
58
|
+
# default: false
|
59
|
+
#
|
60
|
+
# expires
|
61
|
+
# --------------------------------------------------------------------------
|
62
|
+
# lifetime of a cookie [0..365] days. The value of 0 results in a
|
63
|
+
# SESSION cookie. For all otrher values >0, the cookie results in a
|
64
|
+
# PERMANENT cookie.
|
65
|
+
#
|
66
|
+
# values: [0..365]
|
67
|
+
# default: 0
|
68
|
+
#
|
69
|
+
# same_site
|
70
|
+
# --------------------------------------------------------------------------
|
71
|
+
# Lax: sent for all requests (including subdomains).
|
72
|
+
# Strict: the cookie is only sent to the site where it originated
|
73
|
+
# (excluding subdomains)
|
74
|
+
#
|
75
|
+
# values: [Strict|Lax]
|
76
|
+
# default: Strict
|
77
|
+
#
|
78
|
+
# http_only
|
79
|
+
# --------------------------------------------------------------------------
|
80
|
+
# prevent access to cookie values via JavaScript
|
81
|
+
#
|
82
|
+
# values: [false|true]
|
83
|
+
# default: false
|
84
|
+
|
85
|
+
# secure
|
86
|
+
# --------------------------------------------------------------------------
|
87
|
+
# Cookies are only sent to the server with an encrypted request over
|
88
|
+
# the HTTPS protocol
|
89
|
+
#
|
90
|
+
# values: [false|true]
|
91
|
+
# default: false
|
92
|
+
#
|
93
|
+
# ----------------------------------------------------------------------------
|
94
|
+
#
|
95
|
+
path: /
|
96
|
+
domain: true
|
97
|
+
expires: 0
|
98
|
+
same_site: Strict
|
99
|
+
http_only: false
|
100
|
+
secure: false
|
37
101
|
|
38
102
|
# ------------------------------------------------------------------------------
|
39
103
|
# END config
|
@@ -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.8
|
441
441
|
:j1--site-name: Jekyll One
|
442
442
|
end::products[]
|
443
443
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: j1-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2022.0.
|
4
|
+
version: 2022.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- juergen_jekyll_one
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -376,6 +376,7 @@ files:
|
|
376
376
|
- assets/error_pages/HTTP404.html
|
377
377
|
- assets/error_pages/HTTP444.html
|
378
378
|
- assets/error_pages/HTTP445.html
|
379
|
+
- assets/error_pages/HTTP446.html
|
379
380
|
- assets/error_pages/HTTP500.html
|
380
381
|
- assets/error_pages/HTTP501.html
|
381
382
|
- assets/error_pages/HTTP502.html
|