j1-template 2021.1.11 → 2021.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/blocks/footer/boxes/issue.proc +28 -5
  3. data/_includes/themes/j1/blocks/footer/boxes/legal_statements.proc +66 -23
  4. data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +0 -1
  5. data/_includes/themes/j1/blocks/footer/boxes/news_box.proc +16 -1
  6. data/_includes/themes/j1/layouts/content_generator_app.html +1 -1
  7. data/_includes/themes/j1/layouts/content_generator_blog_archive.html +197 -219
  8. data/_includes/themes/j1/layouts/content_generator_collection.html +4 -2
  9. data/_includes/themes/j1/layouts/content_generator_page.html +4 -1
  10. data/_includes/themes/j1/layouts/content_generator_post.html +31 -23
  11. data/_includes/themes/j1/layouts/content_generator_raw.html +1 -1
  12. data/_includes/themes/j1/layouts/layout_metadata_generator.html +55 -0
  13. data/_includes/themes/j1/modules/connectors/comment/commento.html +31 -0
  14. data/_includes/themes/j1/modules/connectors/comment/custom-provider.html +7 -8
  15. data/_includes/themes/j1/modules/connectors/comment/disqus.html +12 -54
  16. data/_includes/themes/j1/modules/connectors/comment/facebook.html +7 -8
  17. data/_includes/themes/j1/modules/connectors/comment/hyvor.html +33 -0
  18. data/_includes/themes/j1/modules/connectors/comment/just-comments.html +31 -0
  19. data/_includes/themes/j1/modules/connectors/comments +3 -0
  20. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +27 -5
  21. data/_includes/themes/j1/procedures/posts/pager.proc +123 -0
  22. data/_layouts/default.html +52 -1
  23. data/assets/data/cookieconsent.html +0 -2
  24. data/assets/data/disqus.js +81 -0
  25. data/assets/data/hyvor.js +72 -0
  26. data/assets/data/menu.html +1 -1
  27. data/assets/data/mmenu_toc.html +20 -1
  28. data/assets/data/panel.html +28 -7
  29. data/assets/error_pages/HTTP204.html +2 -1
  30. data/assets/error_pages/HTTP400.html +2 -1
  31. data/assets/error_pages/HTTP401.html +2 -1
  32. data/assets/error_pages/HTTP403.html +2 -1
  33. data/assets/error_pages/HTTP404.html +2 -1
  34. data/assets/error_pages/HTTP444.html +93 -0
  35. data/assets/error_pages/HTTP500.html +2 -1
  36. data/assets/error_pages/HTTP501.html +2 -1
  37. data/assets/error_pages/HTTP502.html +2 -1
  38. data/assets/error_pages/HTTP503.html +2 -1
  39. data/assets/themes/j1/adapter/js/algolia.js +10 -10
  40. data/assets/themes/j1/adapter/js/asciidoctor.js +6 -6
  41. data/assets/themes/j1/adapter/js/attic.js +17 -17
  42. data/assets/themes/j1/adapter/js/bmd.js +6 -6
  43. data/assets/themes/j1/adapter/js/carousel.js +10 -10
  44. data/assets/themes/j1/adapter/js/clipboard.js +10 -10
  45. data/assets/themes/j1/adapter/js/cookieConsent.js +58 -47
  46. data/assets/themes/j1/adapter/js/fam.js +34 -34
  47. data/assets/themes/j1/adapter/js/framer.js +6 -6
  48. data/assets/themes/j1/adapter/js/j1.js +520 -252
  49. data/assets/themes/j1/adapter/js/justifiedGallery.js +11 -11
  50. data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +19 -19
  51. data/assets/themes/j1/adapter/js/lightbox.js +6 -6
  52. data/assets/themes/j1/adapter/js/logger.js +7 -7
  53. data/assets/themes/j1/adapter/js/mmenu.js +25 -25
  54. data/assets/themes/j1/adapter/js/navigator.js +55 -48
  55. data/assets/themes/j1/adapter/js/quicksearch.js +6 -6
  56. data/assets/themes/j1/adapter/js/rouge.js +7 -7
  57. data/assets/themes/j1/adapter/js/rtable.js +6 -6
  58. data/assets/themes/j1/adapter/js/themer.js +43 -47
  59. data/assets/themes/j1/adapter/js/toccer.js +9 -9
  60. data/assets/themes/j1/modules/backstretch/js/backstretch.js +3 -3
  61. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +35 -23
  62. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +2 -2
  63. data/assets/themes/j1/modules/lunrSearch/js/quicksearch.js +1 -1
  64. data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +74 -55
  65. data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +75 -57
  66. data/lib/j1/version.rb +3 -3
  67. data/lib/starter_web/Gemfile +4 -5
  68. data/lib/starter_web/_config.yml +42 -24
  69. data/lib/starter_web/_data/blocks/footer.yml +52 -20
  70. data/lib/starter_web/_data/blocks/panel.yml +4 -4
  71. data/lib/starter_web/_data/builder/blog_navigator.yml +9 -192
  72. data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +389 -0
  73. data/lib/starter_web/_data/j1_config.yml +24 -10
  74. data/lib/starter_web/_data/locales/be.yml +269 -0
  75. data/lib/starter_web/_data/locales/cs.yml +218 -0
  76. data/lib/starter_web/_data/locales/da.yml +213 -0
  77. data/lib/starter_web/_data/locales/de.yml +222 -0
  78. data/lib/starter_web/_data/locales/el.yml +215 -0
  79. data/lib/starter_web/_data/locales/en.yml +215 -0
  80. data/lib/starter_web/_data/locales/es.yml +219 -0
  81. data/lib/starter_web/_data/locales/et.yml +207 -0
  82. data/lib/starter_web/_data/locales/fi.yml +211 -0
  83. data/lib/starter_web/_data/locales/fr.yml +219 -0
  84. data/lib/starter_web/_data/locales/hr.yml +240 -0
  85. data/lib/starter_web/_data/locales/hu.yml +196 -0
  86. data/lib/starter_web/_data/locales/it.yml +215 -0
  87. data/lib/starter_web/_data/locales/lv.yml +233 -0
  88. data/lib/starter_web/_data/locales/nl.yml +213 -0
  89. data/lib/starter_web/_data/locales/pl.yml +241 -0
  90. data/lib/starter_web/_data/locales/pt.yml +217 -0
  91. data/lib/starter_web/_data/locales/readme +4 -0
  92. data/lib/starter_web/_data/locales/ro.yml +209 -0
  93. data/lib/starter_web/_data/locales/ru.yml +269 -0
  94. data/lib/starter_web/_data/locales/sk.yml +211 -0
  95. data/lib/starter_web/_data/locales/sl.yml +209 -0
  96. data/lib/starter_web/_data/locales/sv.yml +207 -0
  97. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +11 -10
  98. data/lib/starter_web/_data/modules/defaults/themer.yml +1 -0
  99. data/lib/starter_web/_data/modules/themer.yml +1 -0
  100. data/lib/starter_web/_data/plugins/defaults/paginator.yml +7 -6
  101. data/lib/starter_web/_data/plugins/paginator.yml +3 -0
  102. data/lib/starter_web/_includes/attributes.asciidoc +1 -1
  103. data/lib/starter_web/_plugins/date-i18n.rb +67 -0
  104. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  105. data/lib/starter_web/assets/images/modules/attics/markus-spiske-1920x1280.jpg +0 -0
  106. data/lib/starter_web/assets/images/modules/attics/matthew-dockery-1920x1280.jpg +0 -0
  107. data/lib/starter_web/collections/posts/public/featured/_posts/2020-01-01-about-cookies.adoc +1 -1
  108. data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-01-site-generators.adoc +1 -1
  109. data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +1 -1
  110. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +2 -2
  111. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +2 -2
  112. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +2 -2
  113. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +2 -2
  114. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +1 -1
  115. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +1 -1
  116. data/lib/starter_web/index.html +3 -3
  117. data/lib/starter_web/package.json +1 -1
  118. data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +3 -0
  119. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +3 -0
  120. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +3 -0
  121. data/lib/starter_web/pages/public/blog/navigator/archive.html +80 -12
  122. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +94 -26
  123. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +81 -12
  124. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +95 -37
  125. data/lib/starter_web/pages/public/blog/navigator/index.html +4 -0
  126. data/lib/starter_web/pages/public/cookieConsent.adoc +3 -0
  127. data/lib/starter_web/pages/public/learn/quickstart.adoc +473 -0
  128. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +0 -1
  129. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -1
  130. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +0 -2
  131. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +0 -2
  132. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +0 -1
  133. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +0 -1
  134. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +0 -1
  135. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +0 -1
  136. data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +0 -1
  137. data/lib/starter_web/pages/public/learn/where_to_go.adoc +0 -1
  138. data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +116 -0
  139. data/lib/starter_web/pages/public/legal/de/100_impress.adoc +94 -0
  140. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +320 -0
  141. data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +123 -0
  142. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -1
  143. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -1
  144. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +81 -20
  145. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +34 -16
  146. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  147. data/lib/starter_web/utilsrv/package.json +1 -1
  148. metadata +41 -4
  149. data/_includes/themes/j1/procedures/global/pager.proc +0 -79
  150. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.org.asciidoc +0 -244
@@ -79,8 +79,8 @@ j1.adapter['bmd'] = (function (j1, window) {
79
79
 
80
80
  // initialize state flag
81
81
  _this.setState('started');
82
- logger.info('state: ' + _this.getState());
83
- logger.info('module is being initialized');
82
+ logger.info('\n' + 'state: ' + _this.getState());
83
+ logger.info('\n' + 'module is being initialized');
84
84
 
85
85
  // -----------------------------------------------------------------------
86
86
  // Default module settings
@@ -93,7 +93,7 @@ j1.adapter['bmd'] = (function (j1, window) {
93
93
  // -----------------------------------------------------------------------
94
94
  // BMD initializer
95
95
  // -----------------------------------------------------------------------
96
- var log_text = 'BMD is being initialized';
96
+ var log_text = '\n' + 'BMD is being initialized';
97
97
  logger.info(log_text);
98
98
 
99
99
  var dependencies_met_j1_finished = setInterval(function() {
@@ -101,7 +101,7 @@ j1.adapter['bmd'] = (function (j1, window) {
101
101
  $('body').bootstrapMaterialDesign();
102
102
 
103
103
  _this.setState('finished');
104
- logger.info('state: ' + _this.getState());
104
+ logger.info('\n' + 'state: ' + _this.getState());
105
105
 
106
106
  clearInterval(dependencies_met_j1_finished);
107
107
  } // END dependencies_met_j1_finished
@@ -116,7 +116,7 @@ j1.adapter['bmd'] = (function (j1, window) {
116
116
  messageHandler: function (sender, message) {
117
117
  var json_message = JSON.stringify(message, undefined, 2);
118
118
 
119
- logText = 'received message from ' + sender + ': ' + json_message;
119
+ logText = '\n' + 'received message from ' + sender + ': ' + json_message;
120
120
  logger.debug(logText);
121
121
 
122
122
  // -----------------------------------------------------------------------
@@ -126,7 +126,7 @@ j1.adapter['bmd'] = (function (j1, window) {
126
126
  //
127
127
  // Place handling of command|action here
128
128
  //
129
- logger.info(message.text);
129
+ logger.info('\n' + message.text);
130
130
  }
131
131
 
132
132
  //
@@ -131,8 +131,8 @@ j1.adapter['carousel'] = (function (j1, window) {
131
131
  }
132
132
 
133
133
  _this.setState('started');
134
- logger.info('state: ' + _this.getState());
135
- logger.info('module is being initialized');
134
+ logger.info('\n' + 'state: ' + _this.getState());
135
+ logger.info('\n' + 'module is being initialized');
136
136
 
137
137
  var dependencies_met_page_finished = setInterval(function() {
138
138
  if (j1.getState() == 'finished') {
@@ -157,11 +157,11 @@ j1.adapter['carousel'] = (function (j1, window) {
157
157
  if ($('#{{slider_id}}').length) {
158
158
 
159
159
  {% if environment == 'development' %}
160
- logText = 'slider is being initialized on id: #{{slider_id}}';
160
+ logText = '\n' + 'slider is being initialized on id: #{{slider_id}}';
161
161
  logger.info(logText);
162
162
  _this.setState('running');
163
- logger.info('state: ' + _this.getState());
164
- logger.info('module is being initialized');
163
+ logger.info('\n' + 'state: ' + _this.getState());
164
+ logger.info('\n' + 'module is being initialized');
165
165
  {% endif %}
166
166
 
167
167
  {% if item.show.slide_height != null %}
@@ -336,7 +336,7 @@ j1.adapter['carousel'] = (function (j1, window) {
336
336
  {% endif %}
337
337
  }
338
338
  $('#{{slider_id}}').html(content);
339
- logText = 'initializing slider finished on id: {{slider_id}}';
339
+ logText = '\n' + 'initializing slider finished on id: {{slider_id}}';
340
340
  logger.info(logText);
341
341
  } // END customDataSuccess_{{forloop.index}}
342
342
  } // END if carousel exists
@@ -345,8 +345,8 @@ j1.adapter['carousel'] = (function (j1, window) {
345
345
  clearInterval(dependencies_met_page_finished);
346
346
  }
347
347
  _this.setState('finished');
348
- logger.info('state: ' + _this.getState());
349
- logger.info('initializing module finished');
348
+ logger.info('\n' + 'state: ' + _this.getState());
349
+ logger.info('\n' + 'initializing module finished');
350
350
  }, 25); // END 'dependencies_met_adapter_finished'
351
351
  }, // END init
352
352
 
@@ -357,7 +357,7 @@ j1.adapter['carousel'] = (function (j1, window) {
357
357
  messageHandler: function (sender, message) {
358
358
  var json_message = JSON.stringify(message, undefined, 2);
359
359
 
360
- logText = 'received message from ' + sender + ': ' + json_message;
360
+ logText = '\n' + 'received message from ' + sender + ': ' + json_message;
361
361
  logger.debug(logText);
362
362
 
363
363
  // -----------------------------------------------------------------------
@@ -367,7 +367,7 @@ j1.adapter['carousel'] = (function (j1, window) {
367
367
  //
368
368
  // Place handling of command|action here
369
369
  //
370
- logger.info(message.text);
370
+ logger.info('\n' + message.text);
371
371
  }
372
372
 
373
373
  //
@@ -101,13 +101,13 @@ j1.adapter['clipboard'] = (function (j1, window) {
101
101
 
102
102
  // initialize state flag
103
103
  _this.state = 'started';
104
- logText = 'initialization: started';
104
+ logText = '\n' + 'initialization: started';
105
105
  logger.info(logText);
106
106
 
107
107
  // initialize ClipboardJS if page is loaded
108
108
  var dependencies_met_j1_finished = setInterval(function() {
109
109
  if ( j1.getState() == 'finished' ) {
110
- logText = 'create clipboard';
110
+ logText = '\n' + 'create clipboard';
111
111
  logger.info(logText);
112
112
 
113
113
  clipboardJS = new ClipboardJS('.btn-clipboard', {
@@ -120,10 +120,10 @@ j1.adapter['clipboard'] = (function (j1, window) {
120
120
  _this.initEventHandler(clipboardJS);
121
121
 
122
122
  clearInterval(dependencies_met_j1_finished);
123
- logger.info('met dependencies for: j1');
123
+ logger.info('\n' + 'met dependencies for: j1');
124
124
  _this.setState('finished');
125
- logger.info('state: ' + _this.getState());
126
- logger.info('module initialized successfully');
125
+ logger.info('\n' + 'state: ' + _this.getState());
126
+ logger.info('\n' + 'module initialized successfully');
127
127
  }
128
128
  }, 25); // END dependencies_met_j1_finished
129
129
  },
@@ -154,7 +154,7 @@ j1.adapter['clipboard'] = (function (j1, window) {
154
154
  clipboard.on('success', function (e) {
155
155
  $(e.trigger).attr('title', 'copied!').tooltip('_fixTitle').tooltip('show').attr('title', 'Copy to clipboard').tooltip('_fixTitle');
156
156
  var logger = log4javascript.getLogger('j1.initClipboard');
157
- var logText = 'initialization copy-to-clipboard sucessfull';
157
+ var logText = '\n' + 'initialization copy-to-clipboard sucessfull';
158
158
  logger.debug(logText);
159
159
  /* Cleanup clipped data for trailing numbers */
160
160
  var splitted = e.text.split('\n');
@@ -168,7 +168,7 @@ j1.adapter['clipboard'] = (function (j1, window) {
168
168
  clipboard.on('error', function (e) {
169
169
  var fallbackMsg = /Mac/i.test(navigator.userAgent) ? 'press \u2318 to copy' : 'press ctrl-c to copy';
170
170
  logger = log4javascript.getLogger('j1.initClipboard');
171
- logText = 'initialization copy-to-clipboard failed, fallback used.';
171
+ logText = '\n' + 'initialization copy-to-clipboard failed, fallback used.';
172
172
  logger.warn(logText);
173
173
  $(e.trigger).attr('title', fallbackMsg).tooltip('_fixTitle').tooltip('show').attr('title', 'copy to clipboard').tooltip('_fixTitle');
174
174
  });
@@ -182,7 +182,7 @@ j1.adapter['clipboard'] = (function (j1, window) {
182
182
  // var json_message = JSON.stringify(message, undefined, 2); // multiline
183
183
  var json_message = JSON.stringify(message);
184
184
 
185
- logText = 'received message from ' + sender + ': ' + json_message;
185
+ logText = '\n' + 'received message from ' + sender + ': ' + json_message;
186
186
  logger.debug(logText);
187
187
 
188
188
  // -----------------------------------------------------------------------
@@ -192,10 +192,10 @@ j1.adapter['clipboard'] = (function (j1, window) {
192
192
  //
193
193
  // Place handling of command|action here
194
194
  //
195
- logger.info(message.text);
195
+ logger.info('\n' + message.text);
196
196
  }
197
197
  if (message.type === 'command' && message.action === 'status') {
198
- logger.info('messageHandler: received - ' + message.action);
198
+ logger.info('\n' + 'messageHandler: received - ' + message.action);
199
199
  }
200
200
 
201
201
  //
@@ -39,6 +39,8 @@ regenerate: true
39
39
  {% assign tracking_enabled = template_config.analytics.enabled %}
40
40
  {% assign tracking_id = template_config.analytics.google.tracking_id %}
41
41
 
42
+ {% assign comment_provider = site.data.j1_config.comments.provider %}
43
+
42
44
  {% comment %} Set config options
43
45
  -------------------------------------------------------------------------------- {% endcomment %}
44
46
  {% assign consent_options = consent_defaults | merge: consent_settings %}
@@ -78,20 +80,28 @@ regenerate: true
78
80
  'use strict';
79
81
 
80
82
  {% comment %} Main
81
- --------------------------------------------------------------- {% endcomment %}
83
+ -------------------------------------------------------------------------------- {% endcomment %}
82
84
  j1.adapter['cookieConsent'] = (function (j1, window) {
83
85
 
84
86
  var environment = '{{environment}}';
85
87
  var tracking_enabled = ('{{tracking_enabled}}' === 'true') ? true: false;
86
88
  var tracking_id = '{{tracking_id}}';
87
89
  var tracking_id_valid = (tracking_id.includes('tracking-id')) ? false : true;
90
+ var comment_provider = '{{comment_provider}}';
88
91
  var moduleOptions = {};
89
92
  var _this;
90
93
  var $modal;
91
94
  var user_cookie;
92
95
  var logger;
96
+ var url;
97
+ var baseUrl;
98
+ var hostname;
99
+ var domain;
100
+ var cookie_domain;
101
+ var secure;
93
102
  var logText;
94
103
  var cookie_written;
104
+ var language;
95
105
 
96
106
  // NOTE: RegEx for tracking_id: ^(G|UA|YT|MO)-[a-zA-Z0-9-]+$
97
107
  // See: https://stackoverflow.com/questions/20411767/how-to-validate-google-analytics-tracking-id-using-a-javascript-function/20412153
@@ -113,8 +123,21 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
113
123
  // -----------------------------------------------------------------------
114
124
  // globals
115
125
  // -----------------------------------------------------------------------
116
- _this = j1.adapter.cookieConsent;
117
- logger = log4javascript.getLogger('j1.adapter.cookieConsent');
126
+ _this = j1.adapter.cookieConsent;
127
+ logger = log4javascript.getLogger('j1.adapter.cookieConsent');
128
+ url = new liteURL(window.location.href);
129
+ baseUrl = url.origin;
130
+ hostname = url.hostname;
131
+ domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
132
+ secure = (url.protocol.includes('https')) ? true : false;
133
+ language = "{{site.language}}";
134
+
135
+ // set domain used by cookies
136
+ if(domain !== 'localhost') {
137
+ cookie_domain = '.' + hostname;
138
+ } else {
139
+ cookie_domain = hostname;
140
+ }
118
141
 
119
142
  // initialize state flag
120
143
  _this.state = 'pending';
@@ -144,22 +167,24 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
144
167
  var dependencies_met_page_ready = setInterval (function (options) {
145
168
  if ( j1.getState() === 'finished' ) {
146
169
  _this.setState('started');
147
- logger.info('state: ' + _this.getState());
148
- logger.info('module is being initialized');
170
+ logger.info('\n' + 'state: ' + _this.getState());
171
+ logger.info('\n' + 'module is being initialized');
149
172
 
150
173
  j1.cookieConsent = new BootstrapCookieConsent({
151
174
  contentURL: moduleOptions.contentURL,
152
175
  cookieName: moduleOptions.cookieName,
153
- language: moduleOptions.language,
176
+ language: language,
154
177
  whitelisted: moduleOptions.whitelisted,
155
178
  reloadPageOnChange: moduleOptions.reloadPageOnChange,
156
- xhr_data_element: moduleOptions.xhr_data_element + '-' + moduleOptions.language,
179
+ xhr_data_element: moduleOptions.xhr_data_element + '-' + language,
180
+ sameSite: moduleOptions.sameSite,
181
+ secure: secure,
157
182
  postSelectionCallback: function () {j1.adapter.cookieConsent.cbCookie()}
158
183
  });
159
184
 
160
185
  _this.setState('finished');
161
- logger.info('state: ' + _this.getState());
162
- logger.debug('module initialized successfully');
186
+ logger.info('\n' + 'state: ' + _this.getState());
187
+ logger.debug('\n' + 'module initialized successfully');
163
188
  clearInterval(dependencies_met_page_ready);
164
189
  }
165
190
  });
@@ -172,7 +197,7 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
172
197
  messageHandler: function (sender, message) {
173
198
  var json_message = JSON.stringify(message, undefined, 2);
174
199
 
175
- logText = 'received message from ' + sender + ': ' + json_message;
200
+ logText = '\n' + 'received message from ' + sender + ': ' + json_message;
176
201
  logger.debug(logText);
177
202
 
178
203
  // -----------------------------------------------------------------------
@@ -182,7 +207,7 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
182
207
  //
183
208
  // Place handling of command|action here
184
209
  //
185
- logger.info(message.text);
210
+ logger.info('\n' + message.text);
186
211
  }
187
212
 
188
213
  //
@@ -222,8 +247,8 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
222
247
  var json = JSON.stringify(user_consent);
223
248
  var user_agent = platform.ua;
224
249
 
225
- logger.info('Entered post selection callback from CookieConsent');
226
- logger.info('Current values from CookieConsent: ' + json);
250
+ logger.info('\n' + 'entered post selection callback from CookieConsent');
251
+ logger.info('\n' + 'current values from CookieConsent: ' + json);
227
252
 
228
253
  // enable cookie button if not visible
229
254
  if ($('#quickLinksCookieButton').css('display') === 'none') {
@@ -235,20 +260,19 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
235
260
  // because page is reloaded after selection
236
261
  //
237
262
  // if (tracking_enabled && !tracking_id_valid) {
238
- // logger.error('tracking enabled, but invalid tracking id found: ' + tracking_id);
263
+ // logger.error('\n' + 'tracking enabled, but invalid tracking id found: ' + tracking_id);
239
264
  // } else {
240
- // logger.warn('tracking enabled, tracking id found: ' + tracking_id);
265
+ // logger.warn('\n' + 'tracking enabled, tracking id found: ' + tracking_id);
241
266
  // }
242
267
 
243
- // for development only
244
- if (environment === 'development') {
245
- gaCookies.forEach(item => console.log('cookieConsent: ' + item));
246
- j1Cookies.forEach(item => console.log('cookieConsent: ' + item));
247
- }
268
+ logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
269
+ j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
270
+ logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
271
+ gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
248
272
 
249
273
  if (user_agent.includes('iPad')) {
250
- logger.warn('Product detected : ' + platform.product);
251
- logger.warn('Skip deleting (unwanted) cookies for this platform');
274
+ logger.warn('\n' + 'product detected : ' + platform.product);
275
+ logger.warn('\n' + 'skip deleting (unwanted) cookies for this platform');
252
276
  }
253
277
 
254
278
  // Manage Google Analytics OptIn/Out
@@ -256,47 +280,34 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
256
280
  if (tracking_enabled && tracking_id_valid) {
257
281
  GTagOptIn.register(tracking_id);
258
282
  if (user_consent.analyses) {
259
- logger.info('Enable: GA');
283
+ logger.info('\n' + 'enable: GA');
260
284
  GTagOptIn.optIn();
261
285
  } else {
262
- logger.warn('Disable: GA');
286
+ logger.warn('\n' + 'disable: GA');
263
287
  GTagOptIn.optOut();
264
288
 
265
289
  if (!user_agent.includes('iPad')) {
266
290
  gaCookies.forEach(function (item) {
267
- logger.warn('Delete GA cookie: ' + item);
268
- j1.removeCookie({name: item, path: '/'});
291
+ logger.warn('\n' + 'delete GA cookie: ' + item);
292
+ j1.removeCookie({ name: item, domain: cookie_domain });
269
293
  });
270
294
  }
271
295
  }
272
296
 
273
- if (!user_consent.analyses || !user_consent.personalization) {
274
- // expire consent|state cookies to session
275
- cookie_written = j1.writeCookie({
276
- name: cookie_names.user_state,
277
- data: user_state,
278
- samesite: 'Strict'
279
- });
280
- if (!cookie_written) {
281
- logger.error('failed to write cookie: ' + cookie_names.user_state);
282
- }
297
+ // Managing providers for personalization OptIn/Out (Comments|Ads)
298
+ // moved to J1 adapter
283
299
 
284
- cookie_written = j1.writeCookie({
285
- name: cookie_names.user_consent,
286
- data: user_consent,
287
- samesite: 'Strict'
288
- });
289
- if (!cookie_written) {
290
- logger.error('failed to write cookie: ' + cookie_names.user_consent);
291
- }
300
+ if (!user_consent.analyses || !user_consent.personalization) {
301
+ // expire consent|state cookies to session
302
+ j1.expireCookie({ name: cookie_names.user_state });
303
+ j1.expireCookie({ name: cookie_names.user_consent });
292
304
  }
293
-
294
- if (moduleOptions.reloadPageOnChange) {
305
+ if (moduleOptions.reloadPageOnChange) {
295
306
  // reload current page (skip cache)
296
307
  location.reload(true);
297
308
  }
298
- } // END if tracking_enabled
299
309
 
310
+ } // END if tracking_enabled
300
311
  } // END cbCookie
301
312
 
302
313
  }; // END return
@@ -127,8 +127,8 @@ j1.adapter['fam'] = (function (j1, window) {
127
127
 
128
128
  // initialize state flag
129
129
  _this.setState('started');
130
- logger.info('set module state to: ' + _this.getState());
131
- logger.info('module is being initialized');
130
+ logger.info('\n' + 'set module state to: ' + _this.getState());
131
+ logger.info('\n' + 'module is being initialized');
132
132
 
133
133
  // create settings object from frontmatterOptions
134
134
  var frontmatterOptions = options != null ? $.extend({}, options) : {};
@@ -161,7 +161,7 @@ j1.adapter['fam'] = (function (j1, window) {
161
161
 
162
162
  var dependencies_met_navigator = setInterval(function() {
163
163
  if (j1.adapter.navigator.getState() == 'finished') {
164
- logger.info('met dependencies for: navigator');
164
+ logger.info('\n' + 'met dependencies for: navigator');
165
165
  _this.famLoader(moduleOptions);
166
166
  clearInterval(dependencies_met_navigator);
167
167
  }
@@ -175,10 +175,10 @@ j1.adapter['fam'] = (function (j1, window) {
175
175
  famLoader: function (famOptions) {
176
176
 
177
177
  _this.setState('loading');
178
- logger.info('set module state to: ' + _this.getState());
179
- logger.info('load HTML data for fam');
178
+ logger.info('\n' + 'set module state to: ' + _this.getState());
179
+ logger.info('\n' + 'load HTML data for fam');
180
180
 
181
- j1.xhrData ({
181
+ j1.loadHTML({
182
182
  xhr_container_id: famOptions.xhr_container_id,
183
183
  xhr_data_path: famOptions.xhr_data_path,
184
184
  xhr_data_element: famOptions.fam_menu_id },
@@ -192,15 +192,15 @@ j1.adapter['fam'] = (function (j1, window) {
192
192
  var dependencies_met_fam_initialized = setInterval (function () {
193
193
  if (j1.xhrDOMState['#' + famOptions.xhr_container_id] == 'success' && j1.getState() == 'finished') {
194
194
  _this.setState('loaded');
195
- logger.info('set module state to: ' + _this.getState());
196
- logger.info('HTML data for fam: ' + _this.getState());
195
+ logger.info('\n' + 'set module state to: ' + _this.getState());
196
+ logger.info('\n' + 'HTML data for fam: ' + _this.getState());
197
197
 
198
198
  // _this.scrollSpy(famOptions);
199
199
  _this.buttonInitializer(famOptions);
200
200
 
201
201
  _this.setState('finished');
202
- logger.info('state: ' + _this.getState());
203
- logger.info('module initialized successfully');
202
+ logger.info('\n' + 'state: ' + _this.getState());
203
+ logger.info('\n' + 'module initialized successfully');
204
204
 
205
205
  $('.fam-btn').show();
206
206
 
@@ -231,14 +231,14 @@ j1.adapter['fam'] = (function (j1, window) {
231
231
  //
232
232
  $('a[href="#void"]').click(function(e) {
233
233
  e.preventDefault ? e.preventDefault() : e.returnValue = false;
234
- logger.info('bound click event to "#void", suppress default action');
234
+ logger.info('\n' + 'bound click event to "#void", suppress default action');
235
235
  });
236
236
 
237
237
  // check if multiple buttons detected
238
238
  if ( famButtons.length == 1 ) {
239
239
  _this.setState('processing');
240
- logger.info('set module state to: ' + _this.getState());
241
- logger.info('initialize fam menu');
240
+ logger.info('\n' + 'set module state to: ' + _this.getState());
241
+ logger.info('\n' + 'initialize fam menu');
242
242
 
243
243
  actionButtonId = famButtons[0].firstElementChild.id;
244
244
  actionMenuId = actionButtonId.replace('_button', '');
@@ -281,25 +281,25 @@ j1.adapter['fam'] = (function (j1, window) {
281
281
  eventHandler = item.event_handler;
282
282
  // check if eventhandler configured is a SINGLE word
283
283
  if (eventHandler.split(' ').length == 1) {
284
- logger.info('register pre-configured eventhandler ' +eventHandler+ ' on id: #' + item.id);
284
+ logger.info('\n' + 'register pre-configured eventhandler ' +eventHandler+ ' on id: #' + item.id);
285
285
 
286
286
  if ( eventHandler === 'open_mmenu_toc' ) {
287
287
  if ($('#j1-toc-mgr').length) {
288
- logger.info('found toc in page: enabled');
288
+ logger.info('\n' + 'found toc in page: enabled');
289
289
  var dependencies_met_toccer_finished = setInterval (function () {
290
290
  if ( j1.adapter.toccer.getState() == 'finished' ) {
291
- logger.info('met dependencies for: toccer');
291
+ logger.info('\n' + 'met dependencies for: toccer');
292
292
 
293
293
  // famOptions.mode === 'icon'
294
- // ? logger.info('fam mode detected: icon')
295
- // : logger.info('fam mode detected: menu');
294
+ // ? logger.info('\n' + 'fam mode detected: icon')
295
+ // : logger.info('\n' + 'fam mode detected: menu');
296
296
 
297
297
  $('#open_mmenu_toc').show();
298
298
  clearInterval(dependencies_met_toccer_finished);
299
299
  }
300
300
  }, 25); // END dependencies_met_toccer_finished
301
301
  } else {
302
- logger.info('found toc in page: disabled');
302
+ logger.info('\n' + 'found toc in page: disabled');
303
303
  }
304
304
  } else {
305
305
  $('#' + item.id).show();
@@ -313,16 +313,16 @@ j1.adapter['fam'] = (function (j1, window) {
313
313
  });
314
314
  });
315
315
  } else {
316
- logger.info('register custom eventhandler on id: #' + item.id);
316
+ logger.info('\n' + 'register custom eventhandler on id: #' + item.id);
317
317
  }
318
318
  } else {
319
319
  // alert ('Creating Eventhandler failed on id: #' + item.id);
320
- logger.error('Creating Eventhandler failed on id: #' + item.id);
320
+ logger.error('\n' + 'creating Eventhandler failed on id: #' + item.id);
321
321
  } // END if items (action buttons)
322
322
  });
323
323
  } else {
324
324
  // single action, create FAB
325
- logger.info('single action found for FAM, create: FAB');
325
+ logger.info('\n' + 'single action found for FAM, create: FAB');
326
326
 
327
327
  // disable hover event (CSS)
328
328
  // $actionButton.css({'pointer-events': 'none'})
@@ -331,7 +331,7 @@ j1.adapter['fam'] = (function (j1, window) {
331
331
  eventHandler = item.event_handler;
332
332
  // check if eventhandler configured is a SINGLE word
333
333
  if (eventHandler.split(' ').length == 1) {
334
- logger.info('register pre-configured eventhandler ' +eventHandler+ ' on id: #' + actionButtonId);
334
+ logger.info('\n' + 'register pre-configured eventhandler ' +eventHandler+ ' on id: #' + actionButtonId);
335
335
 
336
336
  if (eventHandler === 'scroll_to_top') {
337
337
  // register click event
@@ -346,10 +346,10 @@ j1.adapter['fam'] = (function (j1, window) {
346
346
  if ( eventHandler === 'open_mmenu_toc' ) {
347
347
  // check if toccer (toc_mgr) is available
348
348
  if ($('#j1-toc-mgr').length) {
349
- logger.info('found toc in page: enabled');
349
+ logger.info('\n' + 'found toc in page: enabled');
350
350
  var dependencies_met_toccer_finished = setInterval (function () {
351
351
  if ( j1.adapter.toccer.getState() == 'finished' ) {
352
- logger.info('met dependencies for toccer: finished');
352
+ logger.info('\n' + 'met dependencies for toccer: finished');
353
353
  // change the id of the $actionButton to the already
354
354
  // registered id by mmenu adapter of ('open_mmenu_toc')
355
355
  // to open the TOC sidebar
@@ -359,8 +359,8 @@ j1.adapter['fam'] = (function (j1, window) {
359
359
  }
360
360
  }, 25); // END dependencies_met_toccer_finished
361
361
  } else {
362
- logger.info('found toc in page: disabled');
363
- logger.info('eventhandler: disabled');
362
+ logger.info('\n' + 'found toc in page: disabled');
363
+ logger.info('\n' + 'eventhandler: disabled');
364
364
  }
365
365
  } // END if eventHandler == open_mmenu_toc
366
366
  }
@@ -368,8 +368,8 @@ j1.adapter['fam'] = (function (j1, window) {
368
368
  } // END else
369
369
  } else {
370
370
  // alert ('Multiple FAM buttons found: ' + famButtons.length);
371
- logger.error('Multiple FAM buttons found: ' + famButtons.length);
372
- logger.info('FAM container set to hidden: ' + $famContainer);
371
+ logger.error('\n' + 'multiple FAM buttons found: ' + famButtons.length);
372
+ logger.info('\n' + 'FAM container set to hidden: ' + $famContainer);
373
373
  $famContainer.hide();
374
374
  } // END if famButton
375
375
  }, // END buttonInitializer
@@ -573,7 +573,7 @@ j1.adapter['fam'] = (function (j1, window) {
573
573
  // var json_message = JSON.stringify(message, undefined, 2); // multiline
574
574
  var json_message = JSON.stringify(message);
575
575
 
576
- logText = 'received message from ' + sender + ': ' + json_message;
576
+ logText = '\n' + 'received message from ' + sender + ': ' + json_message;
577
577
  logger.debug(logText);
578
578
 
579
579
  // -----------------------------------------------------------------------
@@ -583,10 +583,10 @@ j1.adapter['fam'] = (function (j1, window) {
583
583
  //
584
584
  // Place handling of command|action here
585
585
  //
586
- logger.info(message.text);
586
+ logger.info('\n' + message.text);
587
587
  }
588
588
  if (message.type === 'command' && message.action === 'status') {
589
- logger.info('messageHandler: received - ' + message.action);
589
+ logger.info('\n' + 'messageHandler: received - ' + message.action);
590
590
  }
591
591
 
592
592
  //
@@ -645,8 +645,8 @@ j1.adapter['fam'] = (function (j1, window) {
645
645
  ? $famContainer.css('display','block')
646
646
  : $famContainer.css('display','none');
647
647
 
648
- // logger.debug('content pos detected as: ' + m + 'px');
649
- // logger.debug('scroll pos detected as: ' + scrollPos + 'px');
648
+ // logger.debug('\n' + 'content pos detected as: ' + m + 'px');
649
+ // logger.debug('\n' + 'scroll pos detected as: ' + scrollPos + 'px');
650
650
  }); // END setTop on scroll
651
651
 
652
652
  }, // END scrollSpy