j1-template 2022.0.4 → 2022.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/_layouts/default.html +34 -75
  3. data/assets/error_pages/HTTP444.html +4 -4
  4. data/assets/error_pages/HTTP445.html +3 -3
  5. data/assets/error_pages/HTTP446.html +110 -0
  6. data/assets/themes/j1/adapter/js/cookieConsent.js +53 -25
  7. data/assets/themes/j1/adapter/js/j1.js +81 -196
  8. data/assets/themes/j1/adapter/js/themer.js +0 -1
  9. data/assets/themes/j1/adapter/js/translator.js +107 -56
  10. data/assets/themes/j1/core/css/themes/unodark/bootstrap.css +6 -0
  11. data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +1 -1
  12. data/assets/themes/j1/core/js/template.js +5 -6
  13. data/assets/themes/j1/core/js/template.min.js +1 -1
  14. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  15. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +29 -13
  16. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
  17. data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +0 -1
  18. data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
  19. data/assets/themes/j1/modules/translator/js/translator.js +98 -63
  20. data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
  21. data/lib/j1/version.rb +1 -1
  22. data/lib/starter_web/Gemfile +1 -1
  23. data/lib/starter_web/_config.yml +2 -3
  24. data/lib/starter_web/_data/modules/cookies.yml +30 -0
  25. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -3
  26. data/lib/starter_web/_data/modules/defaults/cookies.yml +103 -0
  27. data/lib/starter_web/_data/modules/navigator_menu.yml +10 -1
  28. data/lib/starter_web/_includes/attributes.asciidoc +6 -1
  29. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  30. data/lib/starter_web/package.json +1 -1
  31. data/lib/starter_web/pages/_test_pages/google-translate-tester.1.adoc +0 -2
  32. data/lib/starter_web/pages/_test_pages/google-translate-tester.4.adoc +0 -2
  33. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
  34. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
  35. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -1
  36. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -1
  37. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -1
  38. data/lib/starter_web/pages/public/blog/navigator/archive.html +1 -1
  39. data/lib/starter_web/pages/public/blog/navigator/index.html +1 -1
  40. data/lib/starter_web/pages/public/learn/quickstart.adoc +1 -1
  41. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +1 -1
  42. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -2
  43. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +1 -1
  44. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +1 -1
  45. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
  46. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +1 -1
  47. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +1 -1
  48. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +1 -1
  49. data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +1 -1
  50. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +2 -12
  51. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +2 -12
  52. data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +1 -1
  53. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +1 -1
  54. data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +1 -1
  55. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  56. data/lib/starter_web/utilsrv/package.json +1 -1
  57. metadata +5 -2
@@ -35,6 +35,9 @@ regenerate: true
35
35
 
36
36
  {% comment %} Set config data
37
37
  -------------------------------------------------------------------------------- {% endcomment %}
38
+ {% assign cookie_defaults = modules.defaults.cookies.defaults %}
39
+ {% assign cookie_settings = modules.cookies.settings %}
40
+
38
41
  {% assign translator_defaults = modules.defaults.translator.defaults %}
39
42
  {% assign translator_settings = modules.translator.settings %}
40
43
  {% assign tracking_enabled = template_config.analytics.enabled %}
@@ -42,6 +45,7 @@ regenerate: true
42
45
  {% comment %} Set config options
43
46
  -------------------------------------------------------------------------------- {% endcomment %}
44
47
  {% assign translator_options = translator_defaults | merge: translator_settings %}
48
+ {% assign cookie_options = cookie_defaults | merge: cookie_settings %}
45
49
 
46
50
  {% assign production = false %}
47
51
  {% if environment == 'prod' or environment == 'production' %}
@@ -95,6 +99,7 @@ j1.adapter['translator'] = (function (j1, window) {
95
99
  var hostname;
96
100
  var domain;
97
101
  var cookie_domain;
102
+ var domain_enabled;
98
103
  var secure;
99
104
  var logText;
100
105
  var cookie_written;
@@ -111,10 +116,17 @@ j1.adapter['translator'] = (function (j1, window) {
111
116
 
112
117
  // ---------------------------------------------------------------------------
113
118
  // setCookie()
114
- // writes a flat cookie (not using an encoded JSON string)
119
+ // writes a FLAT cookie (not using an encoded JSON string)
115
120
  // ---------------------------------------------------------------------------
116
121
  function setCookie(options /*cName, cValue, expDays*/) {
117
- var defaults = {};
122
+ var date = new Date();
123
+ var timestamp_now = date.toISOString()
124
+ var url = new liteURL(window.location.href);
125
+ var baseUrl = url.origin;;
126
+ var hostname = url.hostname;
127
+ var domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
128
+ var domain_enabled = '{{cookie_options.domain}}';
129
+ var defaults = {};
118
130
  var settings;
119
131
  var document_cookie;
120
132
  var stringifiedAttributes = '';
@@ -123,8 +135,8 @@ j1.adapter['translator'] = (function (j1, window) {
123
135
  name: '',
124
136
  path: '/',
125
137
  expires: 0,
126
- domain: 'localhost',
127
- samesite: 'Strict',
138
+ domain: true,
139
+ samesite: 'Lax',
128
140
  http_only: false,
129
141
  secure: false
130
142
  };
@@ -137,6 +149,13 @@ j1.adapter['translator'] = (function (j1, window) {
137
149
  stringifiedAttributes += '; ' + 'expires=' + date.toUTCString();
138
150
  }
139
151
 
152
+ if (domain != hostname) {
153
+ settings.domain = domain_enabled ? '.' + domain : hostname;
154
+ } else {
155
+ settings.domain = hostname;
156
+ }
157
+ stringifiedAttributes += '; ' + 'domain=' + settings.domain;
158
+
140
159
  stringifiedAttributes += '; ' + 'SameSite=' + settings.samesite;
141
160
 
142
161
  if (settings.secure) {
@@ -168,7 +187,7 @@ j1.adapter['translator'] = (function (j1, window) {
168
187
  baseUrl = url.origin;
169
188
  hostname = url.hostname;
170
189
  domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
171
- cookie_domain = (domain.includes('.')) ? '.' + domain : domain;
190
+ domain_enabled = '{{cookie_options.domain}}';
172
191
  secure = (url.protocol.includes('https')) ? true : false;
173
192
  navigator_language = navigator.language || navigator.userLanguage; // userLanguage for MS IE compatibility
174
193
  translation_language = navigator_language.split('-')[0];
@@ -188,23 +207,8 @@ j1.adapter['translator'] = (function (j1, window) {
188
207
  'translationLanguage': translation_language,
189
208
  };
190
209
 
191
- // load|initialize user translate cookie
192
- if (j1.existsCookie(cookie_names.user_translate)) {
193
- user_translate = j1.readCookie(cookie_names.user_translate);
194
- } else {
195
- logger.debug('\n' + 'write to cookie : ' + cookie_names.user_translate);
196
- cookie_written = j1.writeCookie({
197
- name: cookie_names.user_translate,
198
- data: user_translate,
199
- samesite: 'Strict',
200
- secure: secure,
201
- expires: 365
202
- });
203
- }
204
-
205
210
  // initialize state flag
206
211
  _this.state = 'pending';
207
- // _this.settings.languageList = '/assets/data/ms_select.json';
208
212
 
209
213
  // -----------------------------------------------------------------------
210
214
  // Default module settings
@@ -229,7 +233,30 @@ j1.adapter['translator'] = (function (j1, window) {
229
233
  // initializer
230
234
  // -----------------------------------------------------------------------
231
235
  var dependencies_met_page_ready = setInterval (function (options) {
232
- user_consent = j1.readCookie(cookie_names.user_consent);
236
+ var expires = '{{cookie_options.expires}}';
237
+ var same_site = '{{cookie_options.same_site}}';
238
+ user_consent = j1.readCookie(cookie_names.user_consent);
239
+
240
+ // set domain used by cookies
241
+ if (domain != hostname) {
242
+ cookie_domain = domain_enabled ? '.' + domain : hostname;
243
+ } else {
244
+ cookie_domain = hostname;
245
+ }
246
+
247
+ // load|initialize user translate cookie
248
+ if (j1.existsCookie(cookie_names.user_translate)) {
249
+ user_translate = j1.readCookie(cookie_names.user_translate);
250
+ } else {
251
+ logger.debug('\n' + 'write to cookie : ' + cookie_names.user_translate);
252
+ cookie_written = j1.writeCookie({
253
+ name: cookie_names.user_translate,
254
+ data: user_translate,
255
+ samesite: 'Strict',
256
+ secure: secure,
257
+ expires: 365
258
+ });
259
+ }
233
260
 
234
261
  if ( j1.getState() === 'finished' ) {
235
262
  _this.setState('started');
@@ -257,16 +284,28 @@ j1.adapter['translator'] = (function (j1, window) {
257
284
  }
258
285
  }
259
286
 
260
- // update user_translate cookie
261
- user_translate.analysis = user_consent.analysis;
262
- user_translate.personalization = user_consent.personalization;
263
- cookie_written = j1.writeCookie({
264
- name: cookie_names.user_translate,
265
- data: user_translate,
266
- samesite: 'Strict',
267
- secure: secure,
268
- expires: 365
269
- });
287
+ // load|set user translate cookie
288
+ user_translate = j1.readCookie(cookie_names.user_translate);
289
+ if (!user_consent.analysis || !user_consent.personalization) {
290
+ // disable translation service
291
+ user_translate.translationEnabled = false;
292
+ cookie_written = j1.writeCookie({
293
+ name: cookie_names.user_translate,
294
+ data: user_translate,
295
+ secure: secure
296
+ });
297
+
298
+ // expire permanent cookie to session
299
+ j1.expireCookie({ name: cookie_names.user_translate });
300
+ } else {
301
+ logger.debug('\n' + 'write to cookie : ' + cookie_names.user_translate);
302
+ cookie_written = j1.writeCookie({
303
+ name: cookie_names.user_translate,
304
+ data: user_translate,
305
+ secure: secure,
306
+ expires: 365
307
+ });
308
+ }
270
309
 
271
310
  if (moduleOptions.dialogLanguage === 'auto') {
272
311
  moduleOptions.dialogLanguage = '{{contentLanguage}}';
@@ -274,7 +313,11 @@ j1.adapter['translator'] = (function (j1, window) {
274
313
 
275
314
  j1.translator = new Translator({
276
315
  contentURL: moduleOptions.contentURL, // dialog content (modals) for all supported languages
277
- cookieName: moduleOptions.cookieName, // the name of the User State Cookie (primary data)
316
+ cookieName: cookie_names.user_translate, // name of the translator cookie
317
+ cookieStorageDays: expires, // lifetime of a cookie [0..365], 0: session cookie
318
+ cookieSameSite: same_site, // restrict consent cookie
319
+ cookieDomain: cookie_domain, // set domain (hostname|domain)
320
+ cookieSecure: secure, // set
278
321
  cookieConsentName: moduleOptions.cookieConsentName, // the name of the Cookie Consent Cookie (secondary data)
279
322
  disableLanguageSelector: moduleOptions.disableLanguageSelector, // disable language dropdown for translation in dialog (modal)
280
323
  dialogContainerID: moduleOptions.dialogContainerID, // dest container, the dialog modal is loaded (dynamically)
@@ -288,7 +331,7 @@ j1.adapter['translator'] = (function (j1, window) {
288
331
  });
289
332
 
290
333
  // enable|disable translation (after callback)
291
- if (user_consent.analysis && user_consent.personalization && user_translate.translationEnabled) {
334
+ if (user_translate.analysis && user_translate.personalization && user_translate.translationEnabled) {
292
335
  if (moduleOptions.translatorName === 'google') {
293
336
  head.appendChild(script);
294
337
  if ($('google_translate_element')) {
@@ -304,12 +347,9 @@ j1.adapter['translator'] = (function (j1, window) {
304
347
  }
305
348
  }
306
349
 
307
- // Click events moved to Navigator (core)
308
- //
309
- // $('#quickLinksTranslateButton').click(function(e) {
310
- // logger.info('\n' + 'call default action');
311
- // j1.translator.showDialog();
312
- // });
350
+ // -------------------------------------------------------------------
351
+ // NOTE: Click events moved to Navigator (core)
352
+ // -------------------------------------------------------------------
313
353
 
314
354
  _this.setState('finished');
315
355
  logger.info('\n' + 'state: ' + _this.getState());
@@ -376,35 +416,37 @@ j1.adapter['translator'] = (function (j1, window) {
376
416
 
377
417
  // -------------------------------------------------------------------------
378
418
  // cbGoogle()
379
- // Called by the translator CORE module after the user made the
380
- // selection for a translation|language
419
+ // Called by the translator CORE module after the user has made
420
+ // the selection for a translation|language
381
421
  // -------------------------------------------------------------------------
382
422
  cbGoogle: function () {
383
423
  var logger = log4javascript.getLogger('j1.adapter.translator.cbGoogle');
384
424
  var cookie_names = j1.getCookieNames();
385
- var user_state = j1.readCookie(cookie_names.user_state);
386
425
  var user_consent = j1.readCookie(cookie_names.user_consent);
387
426
  var user_translate = j1.readCookie(cookie_names.user_translate);
388
427
  var msDropdown = document.getElementById('dropdownJSON').msDropdown;
428
+ var url = new liteURL(window.location.href);
429
+ var baseUrl = url.origin;;
430
+ var hostname = url.hostname;
431
+ var domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
432
+ var domain_enabled = '{{cookie_options.domain}}';
433
+ var same_site = '{{cookie_options.same_site}}';
434
+
389
435
  var selectedTranslationLanguage;
390
436
  var srcLang;
391
437
  var destLang;
392
438
  var transCode;
393
439
 
394
- selectedTranslationLanguage = msDropdown.value;
395
- logger.info('\n' + 'selected translation language: ' + selectedTranslationLanguage);
396
440
 
397
- // update cookie consent settings
398
- user_consent.analysis = user_translate.analysis;
399
- user_consent.personalization = user_translate.personalization;
441
+ // set domain used by cookies
442
+ if (domain != hostname) {
443
+ cookie_domain = domain_enabled ? '.' + domain : hostname;
444
+ } else {
445
+ cookie_domain = hostname;
446
+ }
400
447
 
401
- cookie_written = j1.writeCookie({
402
- name: cookie_names.user_consent,
403
- data: user_consent,
404
- samesite: 'Strict',
405
- secure: secure,
406
- expires: 365
407
- });
448
+ selectedTranslationLanguage = msDropdown.value;
449
+ logger.info('\n' + 'selected translation language: ' + selectedTranslationLanguage);
408
450
 
409
451
  // set content language
410
452
  if (moduleOptions.contentLanguage === 'auto') {
@@ -430,8 +472,17 @@ j1.adapter['translator'] = (function (j1, window) {
430
472
  Cookies.remove('googtrans', { domain: hostname });
431
473
  Cookies.remove('googtrans');
432
474
 
433
- // write the googtrans cookie w/o DOMAIN!
434
- Cookies.set('googtrans', transCode);
475
+ // -----------------------------------------------------------------------
476
+ // NOTE: googtrans cookie will be rewritten (by Google!?) for
477
+ // attributes 'SameSite' and potentially 'Domain'. This results
478
+ // for 'SameSite' in an empty field!
479
+ // -----------------------------------------------------------------------
480
+
481
+ // write the googtrans cookie (w/o DOMAIN?!)
482
+ Cookies.set('googtrans', transCode, {
483
+ Domain: cookie_domain,
484
+ sameSite: 'Lax'
485
+ });
435
486
 
436
487
  // reload current page (skip cache)
437
488
  location.reload(true);
@@ -8557,6 +8557,12 @@ table tr.even, table tr.alt, table tr:nth-of-type(even) {
8557
8557
  color: #bdbdbd;
8558
8558
  border-bottom: 1px dotted #424242 !important; }
8559
8559
 
8560
+ .series-exerpt {
8561
+ color: #e0e0e0; }
8562
+
8563
+ .series-navigation ul li a {
8564
+ background-color: #e0e0e0; }
8565
+
8560
8566
  /*
8561
8567
  # -----------------------------------------------------------------------------
8562
8568
  # ~/100_template_css/scss/theme_uno_dark/extentions/_tags.scss