j1-template 2023.0.13 → 2023.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/assets/data/banner.html +2 -2
  3. data/assets/themes/j1/adapter/js/advertising.js +21 -8
  4. data/assets/themes/j1/adapter/js/analytics.js +24 -8
  5. data/assets/themes/j1/adapter/js/carousel.js +10 -13
  6. data/assets/themes/j1/adapter/js/clipboard.js +8 -1
  7. data/assets/themes/j1/adapter/js/comments.js +193 -198
  8. data/assets/themes/j1/adapter/js/cookieConsent.js +27 -20
  9. data/assets/themes/j1/adapter/js/dropdowns.js +7 -10
  10. data/assets/themes/j1/adapter/js/fab.js +10 -17
  11. data/assets/themes/j1/adapter/js/framer.js +27 -31
  12. data/assets/themes/j1/adapter/js/j1.js +2 -0
  13. data/assets/themes/j1/adapter/js/justifiedGallery.js +15 -15
  14. data/assets/themes/j1/adapter/js/lightbox.js +25 -16
  15. data/assets/themes/j1/adapter/js/logger.js +13 -7
  16. data/assets/themes/j1/adapter/js/lunr.js +9 -11
  17. data/assets/themes/j1/adapter/js/masonry.js +9 -11
  18. data/assets/themes/j1/adapter/js/masterslider.js +28 -25
  19. data/assets/themes/j1/adapter/js/nbinteract.js +20 -15
  20. data/assets/themes/j1/adapter/js/particles.js +9 -7
  21. data/assets/themes/j1/adapter/js/rangeSlider.js +11 -13
  22. data/assets/themes/j1/adapter/js/rouge.js +1 -0
  23. data/assets/themes/j1/adapter/js/rtable.js +11 -13
  24. data/assets/themes/j1/adapter/js/scroller.js +18 -2
  25. data/assets/themes/j1/adapter/js/themer.js +23 -16
  26. data/assets/themes/j1/adapter/js/toccer.js +16 -20
  27. data/assets/themes/j1/adapter/js/translator.js +28 -30
  28. data/assets/themes/j1/adapter/js/waves.js +9 -7
  29. data/lib/j1/version.rb +1 -1
  30. data/lib/starter_web/Gemfile +1 -1
  31. data/lib/starter_web/README.md +5 -5
  32. data/lib/starter_web/_config.yml +2 -2
  33. data/lib/starter_web/_data/j1_config.yml +432 -432
  34. data/lib/starter_web/_data/modules/analytics.yml +2 -65
  35. data/lib/starter_web/_data/modules/comments.yml +11 -1
  36. data/lib/starter_web/_data/modules/defaults/analytics.yml +3 -3
  37. data/lib/starter_web/_data/modules/defaults/comments.yml +0 -25
  38. data/lib/starter_web/_data/modules/scroller.yml +1 -1
  39. data/lib/starter_web/_data/resources.yml +1 -1
  40. data/lib/starter_web/_data/templates/feed.xml +1 -1
  41. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  42. data/lib/starter_web/package.json +1 -1
  43. data/lib/starter_web/pages/public/about/site.adoc +76 -76
  44. data/lib/starter_web/pages/public/learn/roundtrip/asciidoc_extensions.adoc +2 -2
  45. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  46. data/lib/starter_web/utilsrv/package.json +1 -1
  47. metadata +2 -2
@@ -92,6 +92,7 @@ regenerate: true
92
92
  {% assign production = true %}
93
93
  {% endif %}
94
94
 
95
+
95
96
  /*
96
97
  # -----------------------------------------------------------------------------
97
98
  # ~/assets/themes/j1/adapter/js/comments.js
@@ -122,14 +123,18 @@ j1.adapter.comments = (function (j1, window) {
122
123
  var environment = '{{environment}}';
123
124
  var date = new Date();
124
125
  var timestamp_now = date.toISOString();
126
+ var cookie_names = j1.getCookieNames();
125
127
  var comments_provider = '{{comments_provider}}';
126
128
  var dqApiScript = document.createElement('script');
127
129
  var hvApiScript = document.createElement('script');
128
130
  var hvCallbackScript = document.createElement('script');
129
- var providerID = '{{site_id}}';
130
- var validProviderID = (providerID.includes('your')) ? false : true;
131
131
  var comments_headline = '{{comments_headline}}';
132
- var cookie_names = j1.getCookieNames();
132
+ var providerID;
133
+ var validProviderID;
134
+ var commentsDefaults;
135
+ var commentsSettings;
136
+ var commentsOptions;
137
+ var frontmatterOptions;
133
138
  var user_consent;
134
139
  var _this;
135
140
  var logger;
@@ -146,224 +151,214 @@ var logText;
146
151
  // -------------------------------------------------------------------------
147
152
  init: function (options) {
148
153
 
149
- {% if comments %}
150
- // [INFO ] [j1.adapter.comments ] [ detected comments provider (j1_config): {{comments_provider}}} ]
151
- // [INFO ] [j1.adapter.comments ] [ start processing load region head, layout: {{page.layout}} ]
152
-
153
- // -----------------------------------------------------------------------
154
- // Default module settings
155
- // -----------------------------------------------------------------------
156
- var settings = $.extend({
157
- module_name: 'j1.adapter.comments',
158
- generated: '{{site.time}}'
159
- }, options);
160
-
161
154
  // -----------------------------------------------------------------------
162
155
  // Global variable settings
163
156
  // -----------------------------------------------------------------------
164
157
 
165
- // create settings object from frontmatter
166
- var frontmatterOptions = options != null ? $.extend({}, options) : {};
158
+ // create settings object from frontmatter (page settings)
159
+ frontmatterOptions = options != null ? $.extend({}, options) : {};
167
160
 
168
- // create settings object from comment options
169
- var commentDefaults = $.extend({}, {{comments_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
170
- var commentSettings = $.extend({}, {{comments_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
161
+ // Load module DEFAULTS|CONFIG
162
+ commentsDefaults = $.extend({}, {{comments_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
163
+ commentsSettings = $.extend({}, {{comments_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
164
+ commentsOptions = $.extend(true, {}, commentsDefaults, commentsSettings, frontmatterOptions);
171
165
 
172
- // merge all comment options
173
- var commentOptions = $.extend({}, commentDefaults, commentSettings, frontmatterOptions);
174
-
175
- // check comment options from frontmatter
176
- if (commentOptions.enabled) {
177
- {% if site_id %}
166
+ // overload module config from page settings (frontmatter)
167
+ if (typeof commentsOptions.comments !== 'undefined' ) {
168
+ commentsOptions.enabled = (commentsOptions.comments) === 'true' ? true : false;
169
+ }
178
170
 
179
- _this = j1.adapter.comments;
180
- logger = log4javascript.getLogger('j1.adapter.comments');
171
+ if (commentsOptions.enabled) {
172
+ // [INFO ] [j1.adapter.comments ] [ detected comments provider (j1_config): {{comments_provider}}} ]
173
+ // [INFO ] [j1.adapter.comments ] [ start processing load region head, layout: {{page.layout}} ]
181
174
 
182
- {% case comments_provider %}
183
- {% when "hyvor" %}
184
- // [INFO ] [j1.adapter.comments ] [ place provider: Hyvor Talk ]
175
+ // ---------------------------------------------------------------------
176
+ // Default module settings
177
+ // ---------------------------------------------------------------------
178
+ var settings = $.extend({
179
+ module_name: 'j1.adapter.comments',
180
+ generated: '{{site.time}}'
181
+ }, options);
185
182
 
186
- var dependencies_met_page_ready = setInterval(function() {
187
- if (j1.getState() == 'finished') {
183
+ _this = j1.adapter.comments;
184
+ logger = log4javascript.getLogger('j1.adapter.comments');
188
185
 
189
- if (!validProviderID) {
190
- logger.warn('\n' + 'invalid site id detected for Hyvor Talk: ' + providerID);
191
- logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
192
- clearInterval(dependencies_met_page_ready);
193
- return false;
194
- }
186
+ // check the site ID to be used for a provider
187
+ providerID = (typeof commentsOptions.site_id == "number") ? commentsOptions.site_id.toString() : commentsOptions.hyvor.site_id;
188
+ validProviderID = (providerID.includes('your')) ? false : true;
195
189
 
196
- // initialize state flag, issue init message
197
- // -------------------------------------------------------------------
198
- _this.setState('started');
199
- logger.debug('\n' + 'state: ' + _this.getState());
200
- logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
201
-
202
- // place|remove initialization code
203
- // -------------------------------------------------------------------
204
- user_consent = j1.readCookie(cookie_names.user_consent);
205
- if (user_consent.personalization) {
206
- // enable Hyvor Talk
207
- // -----------------------------------------------------------------
208
- $('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
209
- logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
210
- logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on siteID: ' + providerID);
190
+ {% case comments_provider %}
191
+ {% when "hyvor" %}
192
+ // [INFO ] [j1.adapter.comments ] [ place provider: Hyvor Talk ]
211
193
 
212
- // add Hyvor Talk Web API
213
- // NOTE: don't change the script id
214
- // -----------------------------------------------------------------
215
- hvApiScript.id = 'hyvor-embed';
216
- hvApiScript.src = '//talk.hyvor.com/web-api/embed.js';
217
- hvApiScript.async = true;
218
- document.head.appendChild(hvApiScript);
194
+ var dependencies_met_page_ready = setInterval(function() {
195
+ if (j1.getState() == 'finished') {
219
196
 
220
- // add Hyvor Talk callback script
221
- // -----------------------------------------------------------------
222
- hvCallbackScript.id = 'hyvor-callback';
223
- hvCallbackScript.text = '\n';
224
- hvCallbackScript.text += 'var HYVOR_TALK_WEBSITE = ' + providerID + '\n';
225
- hvCallbackScript.text += 'var HYVOR_TALK_CONFIG = {' + '\n';
226
- hvCallbackScript.text += ' url: false,' + '\n';
227
- hvCallbackScript.text += ' id: false' + '\n';
228
- hvCallbackScript.text += ' };' + '\n';
229
- document.head.appendChild(hvCallbackScript);
230
-
231
- // add Hyvor Talk comment container
232
- // NOTE: don't change the div id
233
- // -----------------------------------------------------------------
234
- $('#main-content').append('<div id="hyvor-talk-view"></div>');
197
+ if (!validProviderID) {
198
+ logger.warn('\n' + 'invalid site id detected for Hyvor Talk: ' + providerID);
199
+ logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
200
+ clearInterval(dependencies_met_page_ready);
201
+ return false;
202
+ }
235
203
 
236
- // add recommended title to the comments iframe for SEO optimization
237
- // -------------------------------------------------------------------
238
- var dependencies_met_load_provider_finished = setInterval (function () {
239
- if ($('#hyvor-talk-view').children().length) {
240
- $('#hyvor-talk-iframe').prop('title', 'Hyvor comments iframe');
241
- clearInterval(dependencies_met_load_provider_finished);
242
- }
243
- }, 25);
244
- } else {
245
- // disable Hyvor Talk
204
+ // initialize state flag, issue init message
246
205
  // -----------------------------------------------------------------
247
- logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
248
- logger.warn('\n' + 'disable Hyvor Talk on site id: ' + providerID);
206
+ _this.setState('started');
207
+ logger.debug('\n' + 'state: ' + _this.getState());
208
+ logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
249
209
 
250
- // remove Hyvor Talk resources
210
+ // place|remove initialization code
251
211
  // -----------------------------------------------------------------
252
- $('#leave-a-comment').remove();
253
- $('#hyvor-embed').remove();
254
- $('#hyvor-callback').remove();
255
- $('#hyvor-talk-view').remove();
256
- }
257
- clearInterval(dependencies_met_page_ready);
258
- } // END if getState 'finished'
259
- }, 25);
260
-
261
- {% when "disqus" %}
262
- // [INFO ] [j1.adapter.comments ] [ place provider: Disqus ]
263
- var dependencies_met_page_ready = setInterval(function() {
264
- if (j1.getState() == 'finished') {
265
-
266
- if (!validProviderID) {
267
- logger.warn('\n' + 'invalid short name detected for Disqus: ' + providerID);
268
- logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
212
+ user_consent = j1.readCookie(cookie_names.user_consent);
213
+ if (user_consent.personalization) {
214
+ // enable Hyvor Talk
215
+ // ---------------------------------------------------------------
216
+ $('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
217
+ logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
218
+ logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on siteID: ' + providerID);
219
+
220
+ // add Hyvor Talk Web API
221
+ // NOTE: don't change the script id
222
+ // ---------------------------------------------------------------
223
+ hvApiScript.id = 'hyvor-embed';
224
+ hvApiScript.src = '//talk.hyvor.com/web-api/embed.js';
225
+ hvApiScript.async = true;
226
+ document.head.appendChild(hvApiScript);
227
+
228
+ // add Hyvor Talk callback script
229
+ // ---------------------------------------------------------------
230
+ hvCallbackScript.id = 'hyvor-callback';
231
+ hvCallbackScript.text = '\n';
232
+ hvCallbackScript.text += 'var HYVOR_TALK_WEBSITE = "' + providerID + '"\n';
233
+ hvCallbackScript.text += 'var HYVOR_TALK_CONFIG = {' + '\n';
234
+ hvCallbackScript.text += ' url: false,' + '\n';
235
+ hvCallbackScript.text += ' id: false' + '\n';
236
+ hvCallbackScript.text += ' };' + '\n';
237
+ document.head.appendChild(hvCallbackScript);
238
+
239
+ // add Hyvor Talk comment container
240
+ // NOTE: don't change the div id
241
+ // ---------------------------------------------------------------
242
+ $('#main-content').append('<div id="hyvor-talk-view"></div>');
243
+
244
+ // add recommended title to the comments iframe for SEO optimization
245
+ // ---------------------------------------------------------------
246
+ var dependencies_met_load_provider_finished = setInterval (function () {
247
+ if ($('#hyvor-talk-view').children().length) {
248
+ $('#hyvor-talk-iframe').prop('title', 'Hyvor comments iframe');
249
+ clearInterval(dependencies_met_load_provider_finished);
250
+ }
251
+ }, 25);
252
+ } else {
253
+ // disable Hyvor Talk
254
+ // ---------------------------------------------------------------
255
+ logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
256
+ logger.warn('\n' + 'disable Hyvor Talk on site id: ' + providerID);
257
+
258
+ // remove Hyvor Talk resources
259
+ // ---------------------------------------------------------------
260
+ $('#leave-a-comment').remove();
261
+ $('#hyvor-embed').remove();
262
+ $('#hyvor-callback').remove();
263
+ $('#hyvor-talk-view').remove();
264
+ }
269
265
  clearInterval(dependencies_met_page_ready);
270
- return;
271
- }
272
-
273
- // initialize state flag, issue init message
274
- // -------------------------------------------------------------------
275
- _this.setState('started');
276
- logger.debug('\n' + 'state: ' + _this.getState());
277
- logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
278
-
279
- // place|remove initialization code
280
- // -------------------------------------------------------------------
281
- user_consent = j1.readCookie(cookie_names.user_consent);
282
- if (user_consent.personalization) {
283
- $('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
284
- logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
285
- logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
286
-
287
- // old Disqus Web API init
288
- // -----------------------------------------------------------------
289
- // var disqus_shortname = '{{site_id}}';
290
- // // -----------------------------------------------------------------
291
- // // RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE
292
- // // SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
293
- // // LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT:
294
- // // https://disqus.com/admin/universalcode/#configuration-variables
295
- // // -----------------------------------------------------------------
296
- // //
297
- // // var disqus_config = function () {
298
- // // this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
299
- // // Replace PAGE_IDENTIFIER with your page's unique
300
- // // identifier variable
301
- // // this.page.identifier = PAGE_IDENTIFIER;
302
- // // };
303
- // //
304
- // // DON'T EDIT BELOW THIS LINE
305
- // // -----------------------------------------------------------------
306
- // (function() {
307
- // var d = document,
308
- // s = d.createElement('script');
309
- // s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
310
- // s.setAttribute('data-timestamp', +new Date());
311
- // (d.head || d.body).appendChild(s);
312
- // })();
313
-
314
- // add|initialize Disqus Web API
266
+ } // END if getState 'finished'
267
+ }, 25);
268
+
269
+ {% when "disqus" %}
270
+ // [INFO ] [j1.adapter.comments ] [ place provider: Disqus ]
271
+ var dependencies_met_page_ready = setInterval(function() {
272
+ if (j1.getState() == 'finished') {
273
+
274
+ if (!validProviderID) {
275
+ logger.warn('\n' + 'invalid short name detected for Disqus: ' + providerID);
276
+ logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
277
+ clearInterval(dependencies_met_page_ready);
278
+ return;
279
+ }
280
+
281
+ // initialize state flag, issue init message
315
282
  // -----------------------------------------------------------------
316
- dqApiScript.id = 'dq-web-api';
317
- dqApiScript.src = '//' + providerID + '.disqus.com/embed.js";'
318
- dqApiScript.setAttribute("data-timestamp", '"' + timestamp_now + '"');
319
- document.head.appendChild(dqApiScript);
283
+ _this.setState('started');
284
+ logger.debug('\n' + 'state: ' + _this.getState());
285
+ logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
320
286
 
321
- // add Disqus comment container
287
+ // place|remove initialization code
322
288
  // -----------------------------------------------------------------
323
- $('#main-content').append('<div id="disqus_thread"></div>');
324
- } else {
325
- logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
326
- logger.warn('\n' + 'disable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
327
- $('#leave-a-comment').remove();
328
- $('#dq-web-api').remove();
329
- $('#hdisqus_thread').remove();
330
- }
289
+ user_consent = j1.readCookie(cookie_names.user_consent);
290
+ if (user_consent.personalization) {
291
+ $('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
292
+ logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
293
+ logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
294
+
295
+ // old Disqus Web API init
296
+ // ---------------------------------------------------------------
297
+ // var disqus_shortname = '{{site_id}}';
298
+ // // ------------------------------------------------------------
299
+ // // RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE
300
+ // // SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
301
+ // // LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT:
302
+ // // https://disqus.com/admin/universalcode/#configuration-variables
303
+ // // ------------------------------------------------------------
304
+ // //
305
+ // // var disqus_config = function () {
306
+ // // this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
307
+ // // Replace PAGE_IDENTIFIER with your page's unique
308
+ // // identifier variable
309
+ // // this.page.identifier = PAGE_IDENTIFIER;
310
+ // // };
311
+ // //
312
+ // // DON'T EDIT BELOW THIS LINE
313
+ // // ------------------------------------------------------------
314
+ // (function() {
315
+ // var d = document,
316
+ // s = d.createElement('script');
317
+ // s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
318
+ // s.setAttribute('data-timestamp', +new Date());
319
+ // (d.head || d.body).appendChild(s);
320
+ // })();
321
+
322
+ // add|initialize Disqus Web API
323
+ // ---------------------------------------------------------------
324
+ dqApiScript.id = 'dq-web-api';
325
+ dqApiScript.src = '//' + providerID + '.disqus.com/embed.js";'
326
+ dqApiScript.setAttribute("data-timestamp", '"' + timestamp_now + '"');
327
+ document.head.appendChild(dqApiScript);
328
+
329
+ // add Disqus comment container
330
+ // ---------------------------------------------------------------
331
+ $('#main-content').append('<div id="disqus_thread"></div>');
332
+ } else {
333
+ logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
334
+ logger.warn('\n' + 'disable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
335
+ $('#leave-a-comment').remove();
336
+ $('#dq-web-api').remove();
337
+ $('#hdisqus_thread').remove();
338
+ }
331
339
 
332
- // add recommended title to the comments iframe for SEO optimization
333
- // -------------------------------------------------------------------
334
- // var dependencies_met_load_provider_finished = setInterval (function () {
335
- // if ($('#disqus_thread').children().length) {
336
- // $('#hyvor-talk-iframe').prop('title', 'Disqus comments iframe');
337
- // clearInterval(dependencies_met_load_provider_finished);
338
- // }
339
- // }, 25);
340
-
341
- clearInterval(dependencies_met_page_ready);
342
- } // END if getState 'finished'
343
- }, 25);
344
- {% endcase %}
345
-
346
- {% else %}
347
- var dependencies_met_page_ready = setInterval(function() {
348
- if (j1.getState() == 'finished') {
349
- logger = log4javascript.getLogger('j1.adapter.comments');
350
- logger.warn('\n' + 'provider or site ID for comment services wrong or not set');
351
- clearInterval(dependencies_met_page_ready);
352
- }
353
- }, 25);
354
- {% endif %}
355
- } // END if 'commentOptions.comments'
356
-
357
- {% else %}
358
- var dependencies_met_page_ready = setInterval(function() {
359
- if (j1.getState() == 'finished') {
360
- logger = log4javascript.getLogger('j1.adapter.comments');
361
- logger.info('\n' + 'comment services: disabled');
362
- clearInterval(dependencies_met_page_ready);
363
- }
364
- }, 25);
365
- {% endif %}
340
+ // add recommended title to the comments iframe for SEO optimization
341
+ // -----------------------------------------------------------------
342
+ // var dependencies_met_load_provider_finished = setInterval (function () {
343
+ // if ($('#disqus_thread').children().length) {
344
+ // $('#hyvor-talk-iframe').prop('title', 'Disqus comments iframe');
345
+ // clearInterval(dependencies_met_load_provider_finished);
346
+ // }
347
+ // }, 25);
366
348
 
349
+ clearInterval(dependencies_met_page_ready);
350
+ } // END if getState 'finished'
351
+ }, 25);
352
+ {% endcase %}
353
+ } else {
354
+ var dependencies_met_page_ready = setInterval(function() {
355
+ if (j1.getState() == 'finished') {
356
+ logger = log4javascript.getLogger('j1.adapter.comments');
357
+ logger.info('\n' + 'comment services: disabled');
358
+ clearInterval(dependencies_met_page_ready);
359
+ }
360
+ }, 25);
361
+ } // END if 'commentsOptions.comments'
367
362
 
368
363
  }, // END init
369
364
 
@@ -90,7 +90,9 @@ j1.adapter.cookieConsent = (function (j1, window) {
90
90
  var tracking_id = '{{tracking_id}}';
91
91
  var tracking_id_valid = (tracking_id.includes('tracking-id')) ? false : true;
92
92
  var expireCookiesOnRequiredOnly = ('{{cookie_options.expireCookiesOnRequiredOnly}}' === 'true') ? true: false;
93
- var moduleOptions = {};
93
+ var cookieConsentDefaults;
94
+ var cookieConsentSettings;
95
+ var cookieConsentOptions;
94
96
  var _this;
95
97
  var $modal;
96
98
  var cookie_names;
@@ -149,6 +151,11 @@ j1.adapter.cookieConsent = (function (j1, window) {
149
151
  contentLanguage = '{{site.language}}';
150
152
  navigatorLanguage = navigator.language || navigator.userLanguage;
151
153
 
154
+ // Load module DEFAULTS|CONFIG
155
+ cookieConsentDefaults = $.extend({}, {{consent_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
156
+ cookieConsentSettings = $.extend({}, {{consent_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
157
+ cookieConsentOptions = $.extend(true, {}, cookieConsentDefaults, cookieConsentSettings);
158
+
152
159
  // initialize state flag
153
160
  _this.state = 'pending';
154
161
 
@@ -156,17 +163,17 @@ j1.adapter.cookieConsent = (function (j1, window) {
156
163
  -------------------------------------------------------------------------- {% endcomment %}
157
164
  // Load module DEFAULTS|CONFIG
158
165
  /* eslint-disable */
159
- moduleOptions = $.extend({}, {{consent_options | replace: '=>', ':' | replace: 'nil', '""'}});
166
+ // moduleOptions = $.extend({}, {{consent_options | replace: '=>', ':' | replace: 'nil', '""'}});
160
167
  /* eslint-enable */
161
168
 
162
- if (typeof settings !== 'undefined') {
163
- moduleOptions = $.extend({}, moduleOptions, settings);
164
- }
169
+ // if (typeof settings !== 'undefined') {
170
+ // moduleOptions = $.extend({}, moduleOptions, settings);
171
+ // }
165
172
 
166
- if (moduleOptions.dialogLanguage === 'auto') {
167
- moduleOptions.dialogLanguage = navigatorLanguage;
168
- } else if (moduleOptions.dialogLanguage === 'content') {
169
- moduleOptions.dialogLanguage = contentLanguage;
173
+ if (cookieConsentOptions.dialogLanguage === 'auto') {
174
+ cookieConsentOptions.dialogLanguage = navigatorLanguage;
175
+ } else if (cookieConsentOptions.dialogLanguage === 'content') {
176
+ cookieConsentOptions.dialogLanguage = contentLanguage;
170
177
  }
171
178
 
172
179
  // -----------------------------------------------------------------------
@@ -176,7 +183,7 @@ j1.adapter.cookieConsent = (function (j1, window) {
176
183
  var same_site = '{{cookie_options.same_site}}';
177
184
  var expires;
178
185
 
179
- if (moduleOptions.enabled) {
186
+ if (cookieConsentOptions.enabled) {
180
187
  expires = '{{cookie_options.expires}}';
181
188
  } else {
182
189
  // expire permanent cookies to session
@@ -216,23 +223,23 @@ j1.adapter.cookieConsent = (function (j1, window) {
216
223
  _this.setState('started');
217
224
 
218
225
 
219
- if (moduleOptions.enabled) {
226
+ if (cookieConsentOptions.enabled) {
220
227
  logger.debug('\n' + 'state: ' + _this.getState());
221
228
  logger.info('\n' + 'module is being initialized');
222
229
 
223
230
  j1.cookieConsent = new CookieConsent ({
224
- contentURL: moduleOptions.contentURL, // dialog content (modals) for all supported languages
231
+ contentURL: cookieConsentOptions.contentURL, // dialog content (modals) for all supported languages
225
232
  cookieName: cookie_names.user_consent, // name of the consent cookie
226
233
  cookieStorageDays: expires, // lifetime of a cookie [0..365], 0: session cookie
227
234
  cookieSameSite: same_site, // restrict consent cookie
228
235
  cookieSecure: secure, // only sent to the server with an encrypted request over HTTPS
229
236
  cookieDomain: domainAttribute, // set domain (hostname|domain)
230
- dialogLanguage: moduleOptions.dialogLanguage, // language for the dialog (modal)
231
- whitelisted: moduleOptions.whitelisted, // pages NO cookie dialog is shown
232
- reloadPageOnChange: moduleOptions.reloadPageOnChange, // reload if setzings has changed
233
- dialogContainerID: moduleOptions.dialogContainerID, // container, the dialog modal is (dynamically) loaded
234
- xhrDataElement: moduleOptions.xhrDataElement, // container for all language-specific dialogs (modals)
235
- postSelectionCallback: moduleOptions.postSelectionCallback, // callback function, called after the user has made his selection
237
+ dialogLanguage: cookieConsentOptions.dialogLanguage, // language for the dialog (modal)
238
+ whitelisted: cookieConsentOptions.whitelisted, // pages NO cookie dialog is shown
239
+ reloadPageOnChange: cookieConsentOptions.reloadPageOnChange, // reload if setzings has changed
240
+ dialogContainerID: cookieConsentOptions.dialogContainerID, // container, the dialog modal is (dynamically) loaded
241
+ xhrDataElement: cookieConsentOptions.xhrDataElement, // container for all language-specific dialogs (modals)
242
+ postSelectionCallback: cookieConsentOptions.postSelectionCallback, // callback function, called after the user has made his selection
236
243
  });
237
244
  } else {
238
245
  logger.warn('\n' + 'module is disabled');
@@ -351,7 +358,7 @@ j1.adapter.cookieConsent = (function (j1, window) {
351
358
  j1.expireCookie({ name: cookie_names.user_consent });
352
359
  j1.expireCookie({ name: cookie_names.user_translate });
353
360
  }
354
- if (moduleOptions.reloadPageOnChange) {
361
+ if (cookieConsentOptions.reloadPageOnChange) {
355
362
  // reload current page (skip cache)
356
363
  location.reload(true);
357
364
  }
@@ -412,7 +419,7 @@ j1.adapter.cookieConsent = (function (j1, window) {
412
419
  }
413
420
  }
414
421
 
415
- if (moduleOptions.reloadPageOnChange) {
422
+ if (cookieConsentOptions.reloadPageOnChange) {
416
423
  // reload current page (skip cache)
417
424
  location.reload(true);
418
425
  }
@@ -83,9 +83,10 @@ j1.adapter.dropdowns = (function (j1, window) {
83
83
  {% comment %} Set global variables
84
84
  ------------------------------------------------------------------------------ {% endcomment %}
85
85
  var environment = '{{environment}}';
86
- var moduleOptions = {};
87
86
  var instances = [];
88
- var frontmatterOptions;
87
+ var dropdownsDefaults;
88
+ var dropdownsSettings;
89
+ var dropdownsOptions;
89
90
  var _this;
90
91
  var logger;
91
92
  var logText;
@@ -118,20 +119,16 @@ j1.adapter.dropdowns = (function (j1, window) {
118
119
  _this = j1.adapter.dropdowns;
119
120
  logger = log4javascript.getLogger('j1.adapter.dropdowns');
120
121
 
122
+ // Load module DEFAULTS|CONFIG
123
+ dropdownsDefaults = $.extend({}, {{comments_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
124
+ dropdownsSettings = $.extend({}, {{comments_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
125
+ dropdownsOptions = $.extend(true, {}, dropdownsDefaults, dropdownsSettings);
121
126
 
122
127
  // initialize state flag
123
128
  _this.setState('started');
124
129
  logger.debug('\n' + 'state: ' + _this.getState());
125
130
  logger.info('\n' + 'module is being initialized');
126
131
 
127
- // create settings object from frontmatterOptions
128
- frontmatterOptions = options != null ? $.extend({}, options) : {};
129
- moduleOptions = $.extend({}, {{dropdowns_options | replace: 'nil', 'null' | replace: '=>', ':' }});
130
-
131
- if (typeof frontmatterOptions !== 'undefined') {
132
- moduleOptions = $.extend({}, moduleOptions, frontmatterOptions);;
133
- }
134
-
135
132
  var dependencies_met_j1_finished = setInterval(function() {
136
133
  if (j1.getState() == 'finished') {
137
134
  var elms = document.querySelectorAll('.dropdowns');
@@ -90,6 +90,8 @@ j1.adapter.fab = (function (j1, window) {
90
90
  var dclFinished = false;
91
91
  var moduleOptions = {};
92
92
  var cookie_names = j1.getCookieNames();
93
+ var fabDefaults;
94
+ var fabSettings;
93
95
  var fabOptions;
94
96
  var frontmatterOptions;
95
97
  var user_state;
@@ -139,31 +141,22 @@ j1.adapter.fab = (function (j1, window) {
139
141
  logger.info('\n' + 'set module state to: ' + _this.getState());
140
142
  logger.info('\n' + 'module is being initialized');
141
143
 
142
- // create settings object from frontmatterOptions
143
- var frontmatterOptions = options != null ? $.extend({}, options) : {};
144
+ // create settings object from frontmatter (page settings)
145
+ frontmatterOptions = options != null ? $.extend({}, options) : {};
144
146
 
145
- // -----------------------------------------------------------------------
146
- // options loader
147
- // -----------------------------------------------------------------------
148
- /* eslint-disable */
149
- fabOptions = $.extend({}, {{fab_options | replace: 'nil', 'null' | replace: '=>', ':' }});
150
-
151
- // Load (individual) frontmatter options (currently NOT used)
152
- if (options != null) { frontmatterOptions = $.extend({}, options); }
153
-
154
- if (typeof frontmatterOptions !== 'undefined') {
155
- moduleOptions = $.extend({}, fabOptions, frontmatterOptions);
156
- }
157
- /* eslint-enable */
147
+ // Load module DEFAULTS|CONFIG
148
+ fabDefaults = $.extend({}, {{fab_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
149
+ fabSettings = $.extend({}, {{fab_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
150
+ fabOptions = $.extend(true, {}, fabDefaults, fabSettings, frontmatterOptions);
158
151
 
159
152
  // save config settings into the FAB object for global access
160
153
  //
161
- _this['moduleOptions'] = moduleOptions;
154
+ _this['moduleOptions'] = fabOptions;
162
155
 
163
156
  var dependencies_met_navigator = setInterval(function() {
164
157
  if (j1.adapter.navigator.getState() == 'finished') {
165
158
  logger.debug('\n' + 'met dependencies for: navigator');
166
- _this.fabLoader(moduleOptions);
159
+ _this.fabLoader(fabOptions);
167
160
  clearInterval(dependencies_met_navigator);
168
161
  }
169
162
  }, 25);