j1-template 2022.0.6 → 2022.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/ads/google_ad_content_home.html +11 -0
  3. data/_includes/themes/j1/modules/ads/google_ad_top_home.html +11 -0
  4. data/_layouts/default.html +0 -57
  5. data/apps/public/cc/index.adoc +0 -1
  6. data/assets/data/article_navigator/index.html +0 -1
  7. data/assets/data/news_panel_posts/index.html +0 -1
  8. data/assets/error_pages/HTTP444.html +4 -4
  9. data/assets/error_pages/HTTP445.html +7 -6
  10. data/assets/error_pages/HTTP446.html +110 -0
  11. data/assets/error_pages/HTTP447.html +110 -0
  12. data/assets/error_pages/HTTP448.html +111 -0
  13. data/assets/themes/j1/adapter/js/advertising.js +416 -0
  14. data/assets/themes/j1/adapter/js/cookieConsent.js +72 -37
  15. data/assets/themes/j1/adapter/js/framer.js +0 -3
  16. data/assets/themes/j1/adapter/js/j1.js +120 -212
  17. data/assets/themes/j1/adapter/js/rouge.js +1 -1
  18. data/assets/themes/j1/adapter/js/scroller.js +1 -1
  19. data/assets/themes/j1/adapter/js/themer.js +0 -1
  20. data/assets/themes/j1/adapter/js/translator.js +147 -98
  21. data/assets/themes/j1/core/css/themes/unodark/bootstrap.css +6 -0
  22. data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +1 -1
  23. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +6 -0
  24. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  25. data/assets/themes/j1/modules/advertising/js/google/adInitializer.js +117 -0
  26. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +29 -13
  27. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
  28. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +1 -1
  29. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +1 -1
  30. data/assets/themes/j1/modules/scroller/js/scroller.js +1 -1
  31. data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +0 -1
  32. data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
  33. data/assets/themes/j1/modules/translator/js/translator.js +98 -63
  34. data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
  35. data/lib/j1/version.rb +3 -3
  36. data/lib/starter_web/Gemfile +1 -1
  37. data/lib/starter_web/_config.yml +2 -7
  38. data/lib/starter_web/_data/layouts/default.yml +7 -7
  39. data/lib/starter_web/_data/layouts/home.yml +24 -0
  40. data/lib/starter_web/_data/modules/advertising.yml +137 -10
  41. data/lib/starter_web/_data/modules/cookies.yml +30 -0
  42. data/lib/starter_web/_data/modules/defaults/advertising.yml +105 -0
  43. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -3
  44. data/lib/starter_web/_data/modules/defaults/cookies.yml +112 -0
  45. data/lib/starter_web/_data/modules/navigator_menu.yml +10 -1
  46. data/lib/starter_web/_data/resources.yml +24 -0
  47. data/lib/starter_web/_includes/attributes.asciidoc +6 -1
  48. data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_content_home.html +11 -0
  49. data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_top_home.html +11 -0
  50. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  51. data/lib/starter_web/index.html +0 -1
  52. data/lib/starter_web/package.json +1 -1
  53. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
  54. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
  55. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +0 -1
  56. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +0 -1
  57. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +0 -1
  58. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -2
  59. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -2
  60. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -2
  61. data/lib/starter_web/pages/public/blog/navigator/archive.html +1 -2
  62. data/lib/starter_web/pages/public/blog/navigator/index.html +1 -2
  63. data/lib/starter_web/pages/public/learn/quickstart.adoc +1 -1
  64. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +4 -3
  65. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.ads.asciidoc +265 -0
  66. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.no_ads.asciidoc +237 -0
  67. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +64 -2
  68. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +1 -1
  69. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +1 -1
  70. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
  71. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +1 -1
  72. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +1 -1
  73. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +1 -1
  74. data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +1 -1
  75. data/lib/starter_web/pages/public/learn/roundtrip/_includes/google-ad.js +130 -0
  76. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +2 -12
  77. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +0 -1
  78. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +0 -1
  79. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +2 -12
  80. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +0 -1
  81. data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +1 -1
  82. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +1 -1
  83. data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +1 -1
  84. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  85. data/lib/starter_web/utilsrv/package.json +1 -1
  86. metadata +17 -47
  87. data/_includes/themes/j1/modules/connectors/ad/custom-provider.html +0 -30
  88. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +0 -62
  89. data/_includes/themes/j1/modules/connectors/ads +0 -56
  90. data/lib/starter_web/pages/_test_pages/100_side-bar-tester.adoc +0 -244
  91. data/lib/starter_web/pages/_test_pages/_includes/attributes.asciidoc +0 -110
  92. data/lib/starter_web/pages/_test_pages/_includes/documents/100_gistblock.asciidoc +0 -28
  93. data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_info.asciidoc +0 -14
  94. data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_left_warning.asciidoc +0 -11
  95. data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_right_danger.asciidoc +0 -11
  96. data/lib/starter_web/pages/_test_pages/_includes/documents/410_central_success.asciidoc +0 -11
  97. data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_left_info.asciidoc +0 -11
  98. data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_right_success.asciidoc +0 -11
  99. data/lib/starter_web/pages/_test_pages/_includes/documents/410_table_bs_modal_examples.asciidoc +0 -47
  100. data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_info.asciidoc +0 -11
  101. data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_left_info.asciidoc +0 -11
  102. data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_right_success.asciidoc +0 -11
  103. data/lib/starter_web/pages/_test_pages/_includes/documents/419_advanced_modals_demo.asciidoc +0 -337
  104. data/lib/starter_web/pages/_test_pages/_includes/documents/tables/bs_modal_examples.asciidoc +0 -47
  105. data/lib/starter_web/pages/_test_pages/accordion-01-tester.adoc +0 -220
  106. data/lib/starter_web/pages/_test_pages/accordion-02-tester.adoc +0 -177
  107. data/lib/starter_web/pages/_test_pages/accordion-03-tester.adoc +0 -148
  108. data/lib/starter_web/pages/_test_pages/attribute-changes-01-tester.adoc +0 -226
  109. data/lib/starter_web/pages/_test_pages/backdrop-tester.adoc +0 -109
  110. data/lib/starter_web/pages/_test_pages/button-tester-1.adoc +0 -127
  111. data/lib/starter_web/pages/_test_pages/card-tester.adoc +0 -128
  112. data/lib/starter_web/pages/_test_pages/cookieConsent.adoc +0 -96
  113. data/lib/starter_web/pages/_test_pages/deepl.0.adoc +0 -258
  114. data/lib/starter_web/pages/_test_pages/deepl.adoc +0 -204
  115. data/lib/starter_web/pages/_test_pages/desandro-button.adoc +0 -171
  116. data/lib/starter_web/pages/_test_pages/desandro.adoc +0 -147
  117. data/lib/starter_web/pages/_test_pages/flipcard-1-tester.adoc +0 -308
  118. data/lib/starter_web/pages/_test_pages/formular-01-tester.adoc +0 -167
  119. data/lib/starter_web/pages/_test_pages/formular-02-tester.adoc +0 -727
  120. data/lib/starter_web/pages/_test_pages/google-translate-tester.0.adoc +0 -113
  121. data/lib/starter_web/pages/_test_pages/google-translate-tester.1.adoc +0 -233
  122. data/lib/starter_web/pages/_test_pages/google-translate-tester.3.adoc +0 -149
  123. data/lib/starter_web/pages/_test_pages/google-translate-tester.4.adoc +0 -239
  124. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-2.adoc +0 -183
  125. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-3.adoc +0 -235
  126. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-4.adoc +0 -222
  127. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-5.adoc +0 -119
  128. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.1.adoc +0 -236
  129. data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.adoc +0 -225
  130. data/lib/starter_web/pages/_test_pages/list-group-tester.adoc +0 -265
  131. data/lib/starter_web/pages/_test_pages/tictok.adoc +0 -127
@@ -54,6 +54,9 @@ regenerate: true
54
54
  {% assign footer_config_defaults = blocks.defaults.footer.defaults %}
55
55
  {% assign toccer_defaults = modules.defaults.toccer.defaults %}
56
56
 
57
+ {% assign cookie_defaults = modules.defaults.cookies.defaults %}
58
+ {% assign cookie_settings = modules.cookies.settings %}
59
+
57
60
  {% assign themer_defaults = modules.defaults.themer.defaults %}
58
61
  {% assign themer_settings = modules.themer.settings %}
59
62
 
@@ -67,6 +70,7 @@ regenerate: true
67
70
  -------------------------------------------------------------------------------- {% endcomment %}
68
71
  {% assign toccer_options = toccer_defaults | merge: toccer_settings %}
69
72
  {% assign themer_options = themer_defaults| merge: themer_settings %}
73
+ {% assign cookie_options = cookie_defaults | merge: cookie_settings %}
70
74
 
71
75
  {% assign authentication_options = authentication_defaults | merge: authentication_settings %}
72
76
 
@@ -170,9 +174,7 @@ var j1 = (function () {
170
174
  // Default comment provider information
171
175
  var comment_provider = '{{comment_provider}}';
172
176
  var site_id = '{{site_id}}';
173
-
174
- // Default translator settings (currently NOT supported)
175
- // var translation_enabled = {{template_config.translation.enabled}};
177
+ var check_cookies = {{cookie_options.check_cookies}};
176
178
 
177
179
  var current_user_data;
178
180
  var current_page;
@@ -305,7 +307,7 @@ var j1 = (function () {
305
307
  j1['xhrDOMState'] = {};
306
308
 
307
309
  // -----------------------------------------------------------------------
308
- // update cookies if browser window get closed
310
+ // final updates before browser page|tab
309
311
  // see: https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing
310
312
  // -----------------------------------------------------------------------
311
313
  window.addEventListener('beforeunload', function (event) {
@@ -318,52 +320,27 @@ var j1 = (function () {
318
320
  var url;
319
321
  var baseUrl;
320
322
 
321
- // final update of the user state cookie before browser page|tab
322
- // get closed
323
- if (user_state) {
324
- user_state.session_active = false;
325
- user_state.last_session_ts = timestamp_now;
323
+ // final update of the user state cookie
324
+ user_state.session_active = false;
325
+ user_state.last_session_ts = timestamp_now;
326
326
 
327
- if (!user_consent.analysis || !user_consent.personalization) {
328
- // rewrite consent|state cookies to session
329
- logger.debug('\n' + 'write to cookie : ' + cookie_names.user_consent);
330
- cookie_written = j1.writeCookie({
331
- name: cookie_names.user_consent,
332
- data: user_consent,
333
- samesite: 'Strict',
334
- secure: secure,
335
- expires: 0
336
- });
337
- if (!cookie_written) {
338
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_consent);
339
- }
340
- logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
341
- cookie_written = j1.writeCookie({
342
- name: cookie_names.user_state,
343
- data: user_state,
344
- samesite: 'Strict',
345
- secure: secure,
346
- expires: 0
347
- });
348
- if (!cookie_written) {
349
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_consent);
350
- }
351
- } else {
352
- logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
353
- cookie_written = j1.writeCookie({
354
- name: cookie_names.user_state,
355
- data: user_state,
356
- samesite: 'Strict',
357
- secure: secure,
358
- expires: 365
359
- });
360
- if (!cookie_written) {
361
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_state);
362
- }
363
- }
327
+ if (!user_consent.analysis || !user_consent.personalization) {
328
+ logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
329
+
330
+ cookie_written = j1.writeCookie({
331
+ name: cookie_names.user_state,
332
+ data: user_state,
333
+ secure: secure,
334
+ expires: 0
335
+ });
364
336
  } else {
365
- // jadams, 2021-07-11: on beforeunload, a user state cookie is expected
366
- logger.error('\n' + 'missing cookie detected: ' + cookie_names.user_state);
337
+ logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
338
+ cookie_written = j1.writeCookie({
339
+ name: cookie_names.user_state,
340
+ data: user_state,
341
+ secure: secure,
342
+ expires: 365
343
+ });
367
344
  }
368
345
  }); // END beforeunload
369
346
 
@@ -379,115 +356,37 @@ var j1 = (function () {
379
356
  : cookie_written = j1.writeCookie({
380
357
  name: cookie_names.user_session,
381
358
  data: user_session,
382
- samesite: 'Strict',
383
359
  secure: secure,
384
360
  expires: 0
385
361
  });
386
- if (!cookie_written) {
387
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_session);
388
- }
389
362
 
390
363
  user_state = j1.existsCookie(cookie_names.user_state)
391
364
  ? j1.readCookie(cookie_names.user_state)
392
365
  : cookie_written = j1.writeCookie({
393
366
  name: cookie_names.user_state,
394
367
  data: user_state,
395
- samesite: 'Strict',
396
368
  secure: secure,
397
369
  expires: 365
398
370
  });
399
- if (!cookie_written) {
400
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_state);
401
- }
402
371
 
403
- // jadams, 2021-07-11: Found situation that user_state NOT initialized
404
- // correctly (user_state == false).
405
- // TODO: Check if/why user state (cookie NOT created?) NOT initialized
406
- // for what reason.
407
- if (!user_state) {
408
- logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
409
- logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
410
- j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
411
- logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
412
- gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
413
- user_state = j1.readCookie(cookie_names.user_state);
414
- user_state.session_active = true;
372
+ // jadams, 2021-12-06: Check if access to cookies for this site failed.
373
+ // Possibly, a third-party domain or an attacker tries to access it.
374
+ if (check_cookies) {
375
+ if (!user_state) {
376
+ logger.error('\n' + 'Access to cookie failed or cookie not found: ' + cookie_names.user_state);
377
+ logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
378
+ // redirect to error page: blocked content
379
+ window.location.href = '/446.html';
380
+ }
415
381
  }
416
382
 
417
383
  if (!user_consent.analysis || !user_consent.personalization) {
418
- // rewrite consent|state cookies to session
419
- logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
420
- cookie_written = j1.writeCookie({
421
- name: cookie_names.user_state,
422
- data: user_state,
423
- samesite: 'Strict',
424
- secure: secure,
425
- expires: 0
426
- });
427
- if (!cookie_written) {
428
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_state);
429
- }
430
- } else {
431
- logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
432
- cookie_written = j1.writeCookie({
433
- name: cookie_names.user_state,
434
- data: user_state,
435
- samesite: 'Strict',
436
- secure: secure,
437
- expires: 365
438
- });
439
- if (!cookie_written) {
440
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_state);
441
- }
384
+ // expire permanent cookies to session
385
+ j1.expireCookie({ name: cookie_names.user_state });
386
+ j1.expireCookie({ name: cookie_names.user_consent });
387
+ j1.expireCookie({ name: cookie_names.user_translate });
442
388
  }
443
389
 
444
- // jadams, 2021-11-10: anchor links of type #void are used/managed
445
- // by the FAB module. No geneneraL use for NOW.
446
- // -----------------------------------------------------------------------
447
- // initialize event handler for smooth scroll on in-page anchors
448
- // $('a[href*=\\#]').on('click', function (event) {
449
- // // ignore void links
450
- // if (window.location.href.includes('#void')||this.href.includes('#void')) {
451
- // return false;
452
- // }
453
- // // for external links, redirect to this page
454
- // if (window.location.pathname !== this.pathname) {
455
- // window.location.href = this.href;
456
- // } else {
457
- // // continue on in-page anchor
458
- // var toccerScrollDuration = 300;
459
- // var toccerScrollOffset = 10;
460
- //
461
- // // calculate offset value for correct (smooth) scroll position
462
- // //
463
- // var $pagehead = $('.attic');
464
- // var $navbar = $('nav.navbar');
465
- // var $adblock = $('#adblock');
466
- // var navbarType = $navbar.hasClass('navbar-fixed') ? 'fixed' : 'scrolled';
467
- // var fontSize = $('body').css('font-size').replace('px','');
468
- // var start = window.pageYOffset;
469
- // var l = parseInt(fontSize);
470
- // var h = $pagehead.length ? $pagehead.height() : 0;
471
- // var n = $navbar.length ? $navbar.height() : 0;
472
- // var a = $adblock.length ? $adblock.height() : 0;
473
- // var scrollOffset = navbarType == 'fixed' ? -1*(n + a + l) : -1*(h + n + a + l);
474
- //
475
- // // TODO: to be checked why this static offset (toccerScrollOffset)
476
- // // is needed
477
- // scrollOffset = scrollOffset + toccerScrollOffset;
478
- //
479
- // logger.debug('\n' + 'scroll to anchor: ' + this.hash);
480
- // $("html, body").animate({
481
- // scrollTop: $($(this).attr("href")).offset().top + scrollOffset + "px"
482
- // }, {
483
- // duration: toccerScrollDuration,
484
- // easing: "swing"
485
- // });
486
- // // disable bubble up the event
487
- // return false;
488
- // } // End in-page link
489
- // }); // END click event on anchors
490
-
491
390
  // initialize event handler for window/history/back on <ESC>
492
391
  // -----------------------------------------------------------------------
493
392
  window.onkeyup = function (event) {
@@ -522,15 +421,10 @@ var j1 = (function () {
522
421
  cookie_written = j1.writeCookie({
523
422
  name: cookie_names.user_session,
524
423
  data: user_session,
525
- samesite: 'Strict',
526
424
  secure: secure,
527
425
  expires: 0
528
426
  });
529
427
 
530
- if (!cookie_written) {
531
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_session);
532
- }
533
-
534
428
  j1.setState(curr_state);
535
429
  logger.info('\n' + 'state: ' + j1.getState());
536
430
 
@@ -571,13 +465,9 @@ var j1 = (function () {
571
465
  cookie_written = j1.writeCookie({
572
466
  name: cookie_names.user_session,
573
467
  data: user_session,
574
- samesite: 'Strict',
575
468
  secure: secure,
576
469
  expires: 0
577
470
  });
578
- if (!cookie_written) {
579
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_session);
580
- }
581
471
 
582
472
  j1.setState(curr_state);
583
473
  logger.info('\n' + 'state: ' + j1.getState());
@@ -606,7 +496,8 @@ var j1 = (function () {
606
496
  themeName = user_session.theme_name;
607
497
  themeCss = user_session.theme_css;
608
498
 
609
- // save last page access
499
+ // -----------------------------------------------------------------------
500
+ // Save last page access
610
501
  // see: https://stackoverflow.com/questions/3528324/how-to-get-the-previous-url-in-javascript
611
502
  // see: https://developer.mozilla.org/de/docs/Web/API/Window/history
612
503
  //
@@ -634,15 +525,10 @@ var j1 = (function () {
634
525
  cookie_written = j1.writeCookie({
635
526
  name: cookie_names.user_session,
636
527
  data: user_session,
637
- samesite: 'Strict',
638
528
  secure: secure,
639
529
  expires: 0
640
530
  });
641
531
 
642
- if (!cookie_written) {
643
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_session);
644
- }
645
-
646
532
  // NOTE: asynchronous calls should be rewitten to xhrData
647
533
  // initialize page resources for blocks
648
534
  j1.initBanner(settings);
@@ -651,20 +537,15 @@ var j1 = (function () {
651
537
 
652
538
  state = 'running';
653
539
  logger.info('\n' + 'state: ' + state);
654
- // logger.info(logText);
655
540
 
656
541
  user_session.timestamp = timestamp_now;
657
542
  logger.debug('\n' + 'write to cookie : ' + cookie_names.user_session);
658
543
  cookie_written = j1.writeCookie({
659
544
  name: cookie_names.user_session,
660
545
  data: user_session,
661
- samesite: 'Strict',
662
546
  secure: secure,
663
547
  expires: 0
664
548
  });
665
- if (!cookie_written) {
666
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_session);
667
- }
668
549
 
669
550
  // -----------------------------------------------------------------------
670
551
  // additional BS helpers from j1.core
@@ -786,7 +667,6 @@ var j1 = (function () {
786
667
  // initPanel()
787
668
  // AJAX fetcher to load and place all panel used for a page
788
669
  // -------------------------------------------------------------------------
789
- // ToDo:
790
670
  initPanel: function ( options ) {
791
671
  var logger = log4javascript.getLogger('j1.initPanel');
792
672
  var panel = [];
@@ -1007,20 +887,17 @@ var j1 = (function () {
1007
887
  cookie_written = j1.writeCookie({
1008
888
  name: cookie_names.user_session,
1009
889
  data: user_session,
1010
- samesite: 'Strict',
1011
890
  secure: secure,
1012
891
  expires: 0
1013
892
  });
1014
- if (!cookie_written) {
1015
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_session);
1016
- }
1017
893
 
1018
894
  providerPermissions = user_session.provider_permissions;
1019
895
  categoryAllowed = providerPermissions.includes(user_session.page_permission);
1020
896
 
897
+ // -------------------------------------------------------------------
1021
898
  // check protected pages (applies for APP only)
1022
899
  // make sure that protected pages are ALWAYS checked for permissions
1023
- // -------------------------------------------------------------------
900
+ //
1024
901
  if (
1025
902
  j1.authEnabled() &&
1026
903
  user_session.page_permission !== 'public' &&
@@ -1123,13 +1000,7 @@ var j1 = (function () {
1123
1000
  $('#quickLinksCookieButton').css('display', 'none');
1124
1001
  }
1125
1002
 
1126
- // show|hide translator icon (currently NOT supported)
1127
- // if (translation_enabled) {
1128
- // logger.info('\n' + 'translator detected: google');
1129
- // logger.info('\n' + 'initialize language selector');
1130
- // $('.goog-te-combo').addClass('form-control');
1131
- // }
1132
-
1003
+ // -----------------------------------------------------------------
1133
1004
  // show cc icon (currently NOT supported)
1134
1005
  // $('#quickLinksControlCenterButton').css('display', 'block');
1135
1006
 
@@ -1183,6 +1054,7 @@ var j1 = (function () {
1183
1054
 
1184
1055
  // Set|Log status
1185
1056
  state = 'finished';
1057
+ j1.setState(state);
1186
1058
  logText = '\n' + 'state: ' + state;
1187
1059
  logger.info(logText);
1188
1060
  logText = '\n' + 'page finalized successfully';
@@ -1192,7 +1064,7 @@ var j1 = (function () {
1192
1064
  } else {
1193
1065
  // web mode
1194
1066
  setTimeout (function() {
1195
- j1.setState('finished');
1067
+ // j1.setState('finished');
1196
1068
  logger.info('\n' + 'state: finished');
1197
1069
  logger.info('\n' + 'page initialization: finished');
1198
1070
 
@@ -1301,20 +1173,9 @@ var j1 = (function () {
1301
1173
  cookie_written = j1.writeCookie({
1302
1174
  name: cookie_names.user_session,
1303
1175
  data: user_session,
1304
- samesite: 'Strict',
1305
1176
  secure: secure,
1306
1177
  expires: 0
1307
1178
  });
1308
- if (!cookie_written) {
1309
- logger.error('\n' + 'failed to write cookie: ' + cookie_names.user_session);
1310
- }
1311
-
1312
- // show|hide translator icon (currently NOT supported)
1313
- // if (translation_enabled) {
1314
- // logger.info('\n' + 'translator detected: google');
1315
- // logger.info('\n' + 'initialize language selector');
1316
- // $('.goog-te-combo').addClass('form-control');
1317
- // }
1318
1179
 
1319
1180
  // show cc icon (currently NOT supported)
1320
1181
  // $('#quickLinksControlCenterButton').css('display', 'block');
@@ -1364,8 +1225,9 @@ var j1 = (function () {
1364
1225
  current_user_data = j1.mergeData(user_session, user_state);
1365
1226
  j1.core.navigator.updateSidebar(current_user_data);
1366
1227
 
1367
- // set|log status
1228
+ // Set|Log status
1368
1229
  state = 'finished';
1230
+ j1.setState(state);
1369
1231
  logText = '\n' + 'state: ' + state;
1370
1232
  logger.info(logText);
1371
1233
  logText = '\n' + 'page finalized successfully';
@@ -1450,6 +1312,7 @@ var j1 = (function () {
1450
1312
 
1451
1313
  return scrollOffset;
1452
1314
  },
1315
+
1453
1316
  // -------------------------------------------------------------------------
1454
1317
  // scrollTo()
1455
1318
  // Scrolls smooth to any anchor referenced by an page URL on
@@ -1754,25 +1617,29 @@ var j1 = (function () {
1754
1617
  // context/HTTPS).
1755
1618
  // -------------------------------------------------------------------------
1756
1619
  writeCookie: function (options /*name, data, [path, expires, domain, samesite, http_only, secure]*/) {
1757
- var date = new Date();
1758
- var timestamp_now = date.toISOString();
1759
- var cookie_data = {};
1620
+ var date = new Date();
1621
+ var timestamp_now = date.toISOString()
1622
+ var url = new liteURL(window.location.href);
1623
+ var baseUrl = url.origin;;
1624
+ var hostname = url.hostname;
1625
+ var domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
1626
+ var stringifiedAttributes = '';
1627
+ var cookie_data = {};
1760
1628
  var data_json;
1761
1629
  var data_encoded;
1762
1630
  var expires;
1763
- var stringifiedAttributes = '';
1631
+ var domainAttribute;
1764
1632
 
1765
1633
  var defaults = {
1766
- data: {},
1767
- name: '',
1768
- path: '/',
1769
- expires: 0,
1770
- domain: 'localhost',
1771
- samesite: 'Strict',
1772
- http_only: false,
1773
- secure: false
1634
+ data: {},
1635
+ name: '',
1636
+ path: '{{cookie_options.path}}',
1637
+ expires: '{{cookie_options.expires}}',
1638
+ domain: '{{cookie_options.domain}}',
1639
+ samesite: '{{cookie_options.same_site}}',
1640
+ http_only: '{{cookie_options.http_only}}',
1641
+ secure: '{{cookie_options.secure}}'
1774
1642
  };
1775
-
1776
1643
  var settings = $.extend(defaults, options);
1777
1644
 
1778
1645
  cookie_data.timestamp = timestamp_now;
@@ -1788,17 +1655,26 @@ var j1 = (function () {
1788
1655
  data_encoded = window.btoa(data_json);
1789
1656
  }
1790
1657
 
1791
- stringifiedAttributes += '; ' + 'path=' + settings.path;
1658
+ stringifiedAttributes += '; ' + 'Path=' + settings.path;
1792
1659
 
1793
1660
  if (settings.expires > 0) {
1794
1661
  date.setTime(date.getTime() + (settings.expires * 24 * 60 * 60 * 1000));
1795
- stringifiedAttributes += '; ' + 'expires=' + date.toUTCString();
1662
+ stringifiedAttributes += '; ' + 'Expires=' + date.toUTCString();
1796
1663
  }
1797
1664
 
1798
1665
  stringifiedAttributes += '; ' + 'SameSite=' + settings.samesite;
1799
1666
 
1800
- if (settings.secure) {
1801
- stringifiedAttributes += '; ' + 'secure=' + settings.secure;
1667
+ // set domain used by cookies
1668
+ if (settings.domain == 'auto') {
1669
+ domainAttribute = domain;
1670
+ stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
1671
+ } else {
1672
+ domainAttribute = '';
1673
+ stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
1674
+ }
1675
+
1676
+ if (settings.secure == 'true') {
1677
+ stringifiedAttributes += '; ' + 'Secure=' + settings.secure;
1802
1678
  }
1803
1679
 
1804
1680
  // write the cookie
@@ -1833,16 +1709,31 @@ var j1 = (function () {
1833
1709
  // removeCookie (Vanilla JS)
1834
1710
  // -------------------------------------------------------------------------
1835
1711
  removeCookie: function (options /*name, [path, domain]*/) {
1836
- var cookieExists;
1712
+ var domainAttribute;
1713
+
1837
1714
  var defaults = {
1838
- domain: 'localhost',
1839
- path: '/'
1715
+ path: '{{cookie_options.path}}',
1716
+ expires: '{{cookie_options.expires}}',
1717
+ domain: '{{cookie_options.domain}}',
1718
+ samesite: '{{cookie_options.same_site}}',
1719
+ http_only: '{{cookie_options.http_only}}',
1720
+ secure: '{{cookie_options.secure}}'
1840
1721
  };
1722
+ var cookieExists;
1723
+
1841
1724
  var settings = $.extend(defaults, options);
1842
1725
 
1726
+ // set domain used by cookies
1727
+ if (settings.domain == 'auto') {
1728
+ domainAttribute = domain ;
1729
+ } else {
1730
+ // domainAttribute = hostname;
1731
+ domainAttribute = '';
1732
+ }
1733
+
1843
1734
  if (j1.findCookie(settings.name)) {
1844
1735
  // clear cookie CONTENT and set expiry date in the PAST
1845
- document.cookie = settings.name + '=; domain=' + settings.domain + '; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
1736
+ document.cookie = settings.name + '=; Domain=' + domainAttribute + '; Expires=Thu, 01 Jan 1970 00:00:00 UTC; Path=/;';
1846
1737
  return true;
1847
1738
  } else {
1848
1739
  return false;
@@ -1868,13 +1759,30 @@ var j1 = (function () {
1868
1759
  // to JavaScript. For that reason, attributes needs to be set explicitly.
1869
1760
  // -------------------------------------------------------------------------
1870
1761
  expireCookie: function (options /*name [,path, samesite, secure]*/) {
1762
+ var url = new liteURL(window.location.href);
1763
+ var baseUrl = url.origin;;
1764
+ var hostname = url.hostname;
1765
+ var domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
1766
+ var domainAttribute;
1767
+
1871
1768
  var defaults = {
1872
- path: '/',
1873
- samesite: 'Strict',
1874
- secure: false
1769
+ path: '{{cookie_options.path}}',
1770
+ expires: '{{cookie_options.expires}}',
1771
+ domain: '{{cookie_options.domain}}',
1772
+ samesite: '{{cookie_options.same_site}}',
1773
+ http_only: '{{cookie_options.http_only}}',
1774
+ secure: '{{cookie_options.secure}}'
1875
1775
  };
1876
1776
  var settings = $.extend(defaults, options);
1877
1777
 
1778
+ // set domain used by cookies
1779
+ if (settings.domain == 'auto') {
1780
+ domainAttribute = domain ;
1781
+ } else {
1782
+ // domainAttribute = hostname;
1783
+ domainAttribute = '';
1784
+ }
1785
+
1878
1786
  var dc = document.cookie; // all cookies in page
1879
1787
  var end = dc.length; // default to end of the string
1880
1788
  var prefix = settings.name + '='; // search string for the cookie name given
@@ -1902,10 +1810,10 @@ var j1 = (function () {
1902
1810
 
1903
1811
  // expire cookie to session
1904
1812
  content = decodeURI(dc.substring(begin + prefix.length, end) ).replace(/"/g, '');
1905
- if (settings.secure) {
1906
- document.cookie = settings.name + '=' + content +'; path=' + settings.path + '; ' + 'SameSite=' + settings.samesite + '; secure';
1813
+ if (settings.secure == 'true') {
1814
+ document.cookie = settings.name + '=' + content +'; Path=' + settings.path + '; ' + 'SameSite=' + settings.samesite + '; ' + 'Domain=' + domainAttribute + '; Secure' + '; ';
1907
1815
  } else {
1908
- document.cookie = settings.name + '=' + content +'; path=' + settings.path + '; ' + 'SameSite=' + settings.samesite;
1816
+ document.cookie = settings.name + '=' + content +'; Path=' + settings.path + '; ' + 'SameSite=' + settings.samesite + '; ' + 'Domain=' + domainAttribute + '; ';
1909
1817
  }
1910
1818
 
1911
1819
  return true;
@@ -146,7 +146,7 @@ j1.adapter['rouge'] = (function (j1, window) {
146
146
  var dependencies_met_j1_finished = setInterval(function() {
147
147
  if (j1.getState() == 'finished') {
148
148
  $('.dropdown-menu a').click(function(){
149
- $('#selected').html("Current Selection: <div class='bg-primary mt-1 p-2'>"+$(this).text()+"</div>");
149
+ $('#selected-theme').html('Current selection: <div class="md-gray-900 mt-1 p-2" style="background-color: #BDBDBD; font-weight: 700;">' +$(this).text() + '</div>');
150
150
  });
151
151
  _this.setState('finished');
152
152
  logger.info('\n' + 'state: ' + _this.getState());
@@ -226,7 +226,7 @@ var lastPageInfo;
226
226
 
227
227
  clearInterval(dependencies_met_page_ready);
228
228
  }
229
- });
229
+ }, 25);
230
230
  // END generate scrollers
231
231
  },
232
232
 
@@ -203,7 +203,6 @@ j1.adapter['themer'] = (function (j1, window) {
203
203
  cookie_written = j1.writeCookie({
204
204
  name: cookie_names.user_state,
205
205
  data: user_state,
206
- samesite: 'Strict',
207
206
  secure: secure,
208
207
  expires: 365
209
208
  });