j1-template 2022.0.10 → 2022.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/themes/j1/adapter/js/advertising.js +66 -48
- data/assets/themes/j1/adapter/js/algolia.js +10 -13
- data/assets/themes/j1/adapter/js/analytics.js +259 -0
- data/assets/themes/j1/adapter/js/asciidoctor.js +10 -13
- data/assets/themes/j1/adapter/js/attic.js +10 -5
- data/assets/themes/j1/adapter/js/bmd.js +10 -14
- data/assets/themes/j1/adapter/js/carousel.js +10 -13
- data/assets/themes/j1/adapter/js/clipboard.js +9 -10
- data/assets/themes/j1/adapter/js/comments.js +407 -0
- data/assets/themes/j1/adapter/js/cookieConsent.js +106 -87
- data/assets/themes/j1/adapter/js/fab.js +11 -11
- data/assets/themes/j1/adapter/js/framer.js +60 -62
- data/assets/themes/j1/adapter/js/j1.js +225 -268
- data/assets/themes/j1/adapter/js/justifiedGallery.js +12 -14
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +10 -13
- data/assets/themes/j1/adapter/js/lightbox.js +12 -9
- data/assets/themes/j1/adapter/js/logger.js +11 -5
- data/assets/themes/j1/adapter/js/mmenu.js +11 -12
- data/assets/themes/j1/adapter/js/navigator.js +13 -12
- data/assets/themes/j1/adapter/js/quicksearch.js +10 -13
- data/assets/themes/j1/adapter/js/rouge.js +10 -13
- data/assets/themes/j1/adapter/js/rtable.js +10 -13
- data/assets/themes/j1/adapter/js/rtextResizer.js +10 -13
- data/assets/themes/j1/adapter/js/scroller.js +13 -11
- data/assets/themes/j1/adapter/js/themer.js +12 -3
- data/assets/themes/j1/adapter/js/toccer.js +10 -13
- data/assets/themes/j1/adapter/js/translator.js +35 -81
- data/assets/themes/j1/core/js/template.js +13 -5
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/advertising/js/google/adInitializer.js +14 -4
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +11 -2
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -9
- data/lib/starter_web/_data/apps/carousel.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/carousel.yml +3 -2
- data/lib/starter_web/_data/apps/defaults/justifiedGallery.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/justifiedGalleryCustomizer.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/lightGallery.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/lightbox.yml +2 -2
- data/lib/starter_web/_data/apps/justifiedGallery.yml +2 -2
- data/lib/starter_web/_data/apps/justifiedGalleryCustomizer.yml +2 -2
- data/lib/starter_web/_data/apps/lightGallery.yml +2 -2
- data/lib/starter_web/_data/apps/lightbox.yml +2 -2
- data/lib/starter_web/_data/blocks/banner.yml +3 -2
- data/lib/starter_web/_data/blocks/defaults/banner.yml +9 -0
- data/lib/starter_web/_data/blocks/defaults/footer.yml +9 -0
- data/lib/starter_web/_data/blocks/defaults/panel.yml +9 -0
- data/lib/starter_web/_data/blocks/footer.yml +3 -2
- data/lib/starter_web/_data/blocks/panel.yml +3 -2
- data/lib/starter_web/_data/builder/blog_navigator.yml +3 -2
- data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +8 -8
- data/lib/starter_web/_data/j1_config.yml +0 -116
- data/lib/starter_web/_data/layouts/default.yml +14 -14
- data/lib/starter_web/_data/layouts/home.ads.yml +262 -0
- data/lib/starter_web/_data/layouts/home.no-ads.yml +262 -0
- data/lib/starter_web/_data/layouts/home.yml +1 -1
- data/lib/starter_web/_data/layouts/page.yml +7 -18
- data/lib/starter_web/_data/layouts/post.yml +0 -11
- data/lib/starter_web/_data/modules/advertising.yml +4 -14
- data/lib/starter_web/_data/modules/analytics.yml +99 -0
- data/lib/starter_web/_data/modules/attics.yml +3 -2
- data/lib/starter_web/_data/modules/comments.yml +55 -0
- data/lib/starter_web/_data/modules/cookieconsent.yml +2 -1
- data/lib/starter_web/_data/modules/cookies.yml +6 -1
- data/lib/starter_web/_data/modules/defaults/advertising.yml +9 -9
- data/lib/starter_web/_data/modules/defaults/analytics.yml +93 -0
- data/lib/starter_web/_data/modules/defaults/attics.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/authentication.yml +51 -48
- data/lib/starter_web/_data/modules/defaults/comments.yml +114 -0
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -3
- data/lib/starter_web/_data/modules/defaults/cookies.yml +107 -26
- data/lib/starter_web/_data/modules/defaults/fab.yml +4 -2
- data/lib/starter_web/_data/modules/defaults/framer.yml +2 -3
- data/lib/starter_web/_data/modules/defaults/log4javascript.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/log4r.yml +2 -2
- data/lib/starter_web/_data/modules/defaults/navigator.yml +4 -2
- data/lib/starter_web/_data/modules/defaults/quicksearch.yml +4 -3
- data/lib/starter_web/_data/modules/defaults/rtable.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/scoller.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/themer.yml +119 -118
- data/lib/starter_web/_data/modules/defaults/toccer.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/translator.yml +1 -1
- data/lib/starter_web/_data/modules/fab.yml +3 -2
- data/lib/starter_web/_data/modules/framer.yml +3 -4
- data/lib/starter_web/_data/modules/log4r.yml +2 -2
- data/lib/starter_web/_data/modules/navigator.yml +4 -2
- data/lib/starter_web/_data/modules/quicksearch.yml +3 -3
- data/lib/starter_web/_data/modules/rtable.yml +3 -3
- data/lib/starter_web/_data/modules/scroller.yml +2 -3
- data/lib/starter_web/_data/modules/themer.yml +2 -3
- data/lib/starter_web/_data/modules/toccer.yml +3 -3
- data/lib/starter_web/_data/modules/translator.yml +1 -1
- data/lib/starter_web/_data/plugins/defaults/paginator.yml +2 -2
- data/lib/starter_web/_data/plugins/paginator.yml +2 -2
- data/lib/starter_web/_data/resources.yml +442 -309
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.ads.asciidoc +196 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.comments.asciidoc +182 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-site-generators.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-wiki-series.adoc +1 -1
- data/lib/starter_web/index.html +0 -3
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +1 -4
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +1 -4
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +1 -4
- data/lib/starter_web/pages/public/learn/roundtrip/{100_present_images.no_ads.asciidoc → 100_present_images.base.asciidoc} +0 -0
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.comments.asciidoc +237 -0
- data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +23 -2
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +100 -166
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +14 -26
- data/_includes/themes/j1/blocks/ads/ad.html +0 -64
- data/_includes/themes/j1/modules/boards/news_pin_board.html +0 -183
- data/_includes/themes/j1/modules/connectors/analytic/custom-provider.html +0 -32
- data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +0 -30
- data/_includes/themes/j1/modules/connectors/analytics +0 -60
- data/_includes/themes/j1/modules/connectors/comment/commento.html +0 -31
- data/_includes/themes/j1/modules/connectors/comment/custom-provider.html +0 -30
- data/_includes/themes/j1/modules/connectors/comment/disqus.html +0 -32
- data/_includes/themes/j1/modules/connectors/comment/facebook.html +0 -30
- data/_includes/themes/j1/modules/connectors/comment/hyvor.html +0 -32
- data/_includes/themes/j1/modules/connectors/comment/just-comments.html +0 -31
- data/_includes/themes/j1/modules/connectors/comments +0 -64
- data/_includes/themes/j1/modules/connectors/sharing +0 -29
- data/_includes/themes/j1/modules/connectors/survey/custom-provider.html +0 -30
- data/_includes/themes/j1/modules/connectors/survey/jotform.html +0 -32
- data/_includes/themes/j1/modules/connectors/surveys +0 -58
- data/_includes/themes/j1/modules/connectors/translator +0 -58
- data/_includes/themes/j1/modules/connectors/translators/custom-translator.html +0 -32
- data/_includes/themes/j1/modules/connectors/translators/google-translator.html +0 -53
- data/_includes/themes/j1/modules/search/algolia.html +0 -181
- data/_includes/themes/j1/modules/search/docsearch.html +0 -42
- data/assets/data/disqus.js +0 -81
- data/assets/data/hyvor.js +0 -72
@@ -19,6 +19,7 @@ regenerate: true
|
|
19
19
|
# -----------------------------------------------------------------------------
|
20
20
|
# Test data:
|
21
21
|
# {{ liquid_var | debug }}
|
22
|
+
# cookie_options: {{ cookie_options | debug }}
|
22
23
|
# -----------------------------------------------------------------------------
|
23
24
|
{% endcomment %}
|
24
25
|
|
@@ -36,18 +37,21 @@ regenerate: true
|
|
36
37
|
-------------------------------------------------------------------------------- {% endcomment %}
|
37
38
|
{% assign cookie_defaults = modules.defaults.cookies.defaults %}
|
38
39
|
{% assign cookie_settings = modules.cookies.settings %}
|
39
|
-
|
40
40
|
{% assign consent_defaults = modules.defaults.cookieconsent.defaults %}
|
41
41
|
{% assign consent_settings = modules.cookieconsent.settings %}
|
42
|
-
{% assign
|
43
|
-
{% assign
|
44
|
-
|
45
|
-
{% assign comment_provider = site.data.j1_config.comments.provider %}
|
42
|
+
{% assign analytics_defaults = modules.defaults.analytics.defaults %}
|
43
|
+
{% assign analytics_settings = modules.analytics.settings %}
|
46
44
|
|
47
45
|
{% comment %} Set config options
|
48
46
|
-------------------------------------------------------------------------------- {% endcomment %}
|
49
47
|
{% assign consent_options = consent_defaults | merge: consent_settings %}
|
50
48
|
{% assign cookie_options = cookie_defaults | merge: cookie_settings %}
|
49
|
+
{% assign analytics_options = analytics_defaults | merge: analytics_settings %}
|
50
|
+
|
51
|
+
{% comment %} Set variables
|
52
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
53
|
+
{% assign tracking_enabled = analytics_options.enabled %}
|
54
|
+
{% assign tracking_id = analytics_options.google.trackingID %}
|
51
55
|
|
52
56
|
{% assign production = false %}
|
53
57
|
{% if environment == 'prod' or environment == 'production' %}
|
@@ -78,17 +82,13 @@ regenerate: true
|
|
78
82
|
/* eslint quotes: "off" */
|
79
83
|
// -----------------------------------------------------------------------------
|
80
84
|
'use strict';
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
var
|
87
|
-
var
|
88
|
-
var tracking_id = '{{tracking_id}}';
|
89
|
-
var tracking_id_valid = (tracking_id.includes('tracking-id')) ? false : true;
|
90
|
-
var comment_provider = '{{comment_provider}}';
|
91
|
-
var moduleOptions = {};
|
85
|
+
j1.adapter.cookieConsent = (function (j1, window) {
|
86
|
+
var environment = '{{environment}}';
|
87
|
+
var tracking_enabled = ('{{tracking_enabled}}' === 'true') ? true: false;
|
88
|
+
var tracking_id = '{{tracking_id}}';
|
89
|
+
var tracking_id_valid = (tracking_id.includes('tracking-id')) ? false : true;
|
90
|
+
var expireCookiesOnRequiredOnly = ('{{cookie_options.expireCookiesOnRequiredOnly}}' === 'true') ? true: false;
|
91
|
+
var moduleOptions = {};
|
92
92
|
var _this;
|
93
93
|
var $modal;
|
94
94
|
var cookie_names;
|
@@ -97,7 +97,7 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
97
97
|
var url;
|
98
98
|
var baseUrl;
|
99
99
|
var hostname;
|
100
|
-
var
|
100
|
+
var auto_domain;
|
101
101
|
var cookie_option_domain;
|
102
102
|
var cookie_domain;
|
103
103
|
var secure;
|
@@ -125,7 +125,15 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
125
125
|
init: function (options) {
|
126
126
|
|
127
127
|
// -----------------------------------------------------------------------
|
128
|
-
//
|
128
|
+
// Default module settings
|
129
|
+
// -----------------------------------------------------------------------
|
130
|
+
var settings = $.extend({
|
131
|
+
module_name: 'j1.adapter.cookieConsent',
|
132
|
+
generated: '{{site.time}}'
|
133
|
+
}, options);
|
134
|
+
|
135
|
+
// -----------------------------------------------------------------------
|
136
|
+
// Global variable settings
|
129
137
|
// -----------------------------------------------------------------------
|
130
138
|
_this = j1.adapter.cookieConsent;
|
131
139
|
logger = log4javascript.getLogger('j1.adapter.cookieConsent');
|
@@ -133,8 +141,8 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
133
141
|
url = new liteURL(window.location.href);
|
134
142
|
baseUrl = url.origin;
|
135
143
|
hostname = url.hostname;
|
136
|
-
|
137
|
-
cookie_option_domain = '{{cookie_options.domain}}';
|
144
|
+
auto_domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
145
|
+
cookie_option_domain = ('{{cookie_options.domain}}' === 'true');
|
138
146
|
secure = (url.protocol.includes('https')) ? true : false;
|
139
147
|
contentLanguage = '{{site.language}}';
|
140
148
|
navigatorLanguage = navigator.language || navigator.userLanguage;
|
@@ -142,14 +150,6 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
142
150
|
// initialize state flag
|
143
151
|
_this.state = 'pending';
|
144
152
|
|
145
|
-
// -----------------------------------------------------------------------
|
146
|
-
// Default module settings
|
147
|
-
// -----------------------------------------------------------------------
|
148
|
-
var settings = $.extend({
|
149
|
-
module_name: 'j1.adapter.cookieConsent',
|
150
|
-
generated: '{{site.time}}'
|
151
|
-
}, options);
|
152
|
-
|
153
153
|
{% comment %} Load module config from yml data
|
154
154
|
-------------------------------------------------------------------------- {% endcomment %}
|
155
155
|
// Load module DEFAULTS|CONFIG
|
@@ -174,11 +174,29 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
174
174
|
var expires = '{{cookie_options.expires}}';
|
175
175
|
var same_site = '{{cookie_options.same_site}}';
|
176
176
|
|
177
|
+
// // set domain used by cookies
|
178
|
+
// if (cookie_option_domain == 'auto') {
|
179
|
+
// domainAttribute = domain ;
|
180
|
+
// } else {
|
181
|
+
// domainAttribute = '';
|
182
|
+
// }
|
183
|
+
|
177
184
|
// set domain used by cookies
|
178
|
-
if (cookie_option_domain
|
179
|
-
|
180
|
-
|
181
|
-
|
185
|
+
if (cookie_option_domain) {
|
186
|
+
if (cookie_option_domain == 'auto') {
|
187
|
+
domainAttribute = auto_domain;
|
188
|
+
stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
|
189
|
+
} else if (cookie_option_domain) {
|
190
|
+
domainAttribute = domain;
|
191
|
+
stringifiedAttributes += '; ' + 'Domain=' + domainAttribute;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
// Failsafe: if 'None' is given for samesite in non-secure
|
196
|
+
// environments open access to cookies to subdomains
|
197
|
+
// ---------------------------------------------------------------------
|
198
|
+
if (same_site == 'None' && !secure) {
|
199
|
+
same_site = 'Lax';
|
182
200
|
}
|
183
201
|
|
184
202
|
if ( j1.getState() === 'finished' ) {
|
@@ -259,18 +277,21 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
259
277
|
|
260
278
|
// -------------------------------------------------------------------------
|
261
279
|
// cbCookie()
|
262
|
-
// Called by CookieConsent module after the user has
|
263
|
-
// made his selection
|
280
|
+
// Called (callback) by CookieConsent module after the user has
|
281
|
+
// made his selection
|
264
282
|
// -------------------------------------------------------------------------
|
265
283
|
cbCookie: function () {
|
266
|
-
var
|
267
|
-
var
|
268
|
-
var
|
269
|
-
var
|
270
|
-
var
|
271
|
-
var
|
272
|
-
var
|
273
|
-
var
|
284
|
+
var url = new liteURL(window.location.href);
|
285
|
+
var hostname = url.hostname;
|
286
|
+
var gaCookies = j1.findCookie('_ga');
|
287
|
+
var gasCookies = j1.findCookie('__ga');
|
288
|
+
var j1Cookies = j1.findCookie('j1');
|
289
|
+
var cookie_names = j1.getCookieNames();
|
290
|
+
var user_state = j1.readCookie(cookie_names.user_state);
|
291
|
+
var user_consent = j1.readCookie(cookie_names.user_consent);
|
292
|
+
var user_translate = j1.readCookie(cookie_names.user_translate);
|
293
|
+
var json = JSON.stringify(user_consent);
|
294
|
+
var user_agent = platform.ua;
|
274
295
|
var cookie_written;
|
275
296
|
|
276
297
|
logger.info('\n' + 'entered post selection callback from CookieConsent');
|
@@ -281,40 +302,15 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
281
302
|
$('#quickLinksCookieButton').css('display', 'block');
|
282
303
|
}
|
283
304
|
|
284
|
-
// jadams, 2021-11-29: disabled additional logs to verify the existance
|
285
|
-
// of J1 and GA cookies (testing only)
|
286
|
-
//
|
287
|
-
// logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
288
|
-
// j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
289
|
-
// logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
290
|
-
// gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
291
|
-
//
|
292
|
-
// if (user_agent.includes('iPad')) {
|
293
|
-
// logger.warn('\n' + 'product detected : ' + platform.product);
|
294
|
-
// logger.warn('\n' + 'skip deleting (unwanted) cookies for this platform');
|
295
|
-
// }
|
296
|
-
|
297
305
|
// Manage Google Analytics OptIn/Out
|
298
306
|
// See: https://github.com/luciomartinez/gtag-opt-in/wiki
|
299
307
|
if (tracking_enabled && tracking_id_valid) {
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
GTagOptIn.optOut();
|
307
|
-
|
308
|
-
if (!user_agent.includes('iPad')) {
|
309
|
-
gaCookies.forEach(function (item) {
|
310
|
-
logger.warn('\n' + 'delete GA cookie: ' + item);
|
311
|
-
j1.removeCookie({ name: item, domain: cookie_domain });
|
312
|
-
});
|
313
|
-
}
|
314
|
-
}
|
315
|
-
|
316
|
-
// Managing providers using personalization OptIn/Out
|
317
|
-
// (Comments|Ads|Translation)
|
308
|
+
// Managing cookie life-time
|
309
|
+
// ---------------------------------------------------------------------
|
310
|
+
// If cookie settings allows only "required" cookies, all "persistent"
|
311
|
+
// cookies (Comments|Ads|Translation) get expired to "session" for
|
312
|
+
// better GDPR compliance. The GDPR regulations does NOT require
|
313
|
+
// any consent on session-only cookies.
|
318
314
|
//
|
319
315
|
if (!user_consent.analysis || !user_consent.personalization) {
|
320
316
|
|
@@ -331,6 +327,7 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
331
327
|
});
|
332
328
|
|
333
329
|
// expire permanent cookies to session
|
330
|
+
// -------------------------------------------------------------------
|
334
331
|
j1.expireCookie({ name: cookie_names.user_state });
|
335
332
|
j1.expireCookie({ name: cookie_names.user_consent });
|
336
333
|
j1.expireCookie({ name: cookie_names.user_translate });
|
@@ -340,21 +337,41 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
340
337
|
location.reload(true);
|
341
338
|
}
|
342
339
|
} else {
|
343
|
-
//
|
344
|
-
//
|
340
|
+
// Failsafe: Make (really) sure the all GA|GAS cookies removed
|
341
|
+
// left from a previous session/page view for better privacy compliance
|
342
|
+
// ---------------------------------------------------------------------
|
343
|
+
|
344
|
+
// remove cookies on invalid GA config or left from a previous
|
345
|
+
// session/page view if they exists
|
345
346
|
// ---------------------------------------------------------------------
|
346
347
|
gaCookies.forEach(function (item) {
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
j1.removeCookie({ name: item, domain:
|
348
|
+
logger.warn('\n' + 'delete GA cookie: ' + item);
|
349
|
+
if (hostname == 'localhost') {
|
350
|
+
j1.removeCookie({ name: item, domain: false, secure: false });
|
351
|
+
} else {
|
352
|
+
j1.removeCookie({ name: item, domain: '.' + hostname, secure: false });
|
352
353
|
}
|
353
354
|
});
|
354
355
|
|
355
|
-
//
|
356
|
-
//
|
357
|
-
//
|
356
|
+
// remove cookies on invalid GAS config or left from a previous
|
357
|
+
// session/page view if they exists
|
358
|
+
// ---------------------------------------------------------------------
|
359
|
+
gasCookies.forEach(function (item) {
|
360
|
+
// Remove cookies from Google Ads
|
361
|
+
logger.warn('\n' + 'delete GAS cookie: ' + item);
|
362
|
+
if (hostname == 'localhost') {
|
363
|
+
j1.removeCookie({ name: item, domain: false, secure: false });
|
364
|
+
} else {
|
365
|
+
j1.removeCookie({ name: item, domain: '.' + hostname, secure: false });
|
366
|
+
}
|
367
|
+
});
|
368
|
+
|
369
|
+
// Managing cookie life-time. If cookie settings allows only
|
370
|
+
// "required" cookies, all "persistent" cookies (Comments|Ads|Translation)
|
371
|
+
// get expired to "session" for better GDPR compliance. The GDPR
|
372
|
+
// regulations|privacy does NOT require any consent on using cookies
|
373
|
+
// for session-only cookies.
|
374
|
+
// ---------------------------------------------------------------------
|
358
375
|
if (!user_consent.analysis || !user_consent.personalization) {
|
359
376
|
// overload cookie consent settings
|
360
377
|
user_translate.analysis = user_consent.analysis;
|
@@ -368,10 +385,12 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
368
385
|
secure: secure
|
369
386
|
});
|
370
387
|
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
388
|
+
if (expireCookiesOnRequiredOnly) {
|
389
|
+
// expire permanent cookies to session
|
390
|
+
j1.expireCookie({ name: cookie_names.user_state });
|
391
|
+
j1.expireCookie({ name: cookie_names.user_consent });
|
392
|
+
j1.expireCookie({ name: cookie_names.user_translate });
|
393
|
+
}
|
375
394
|
}
|
376
395
|
|
377
396
|
if (moduleOptions.reloadPageOnChange) {
|
@@ -78,10 +78,10 @@ regenerate: true
|
|
78
78
|
/* eslint indent: "off" */
|
79
79
|
// -----------------------------------------------------------------------------
|
80
80
|
'use strict';
|
81
|
+
j1.adapter.fab = (function (j1, window) {
|
81
82
|
|
82
|
-
j1.adapter['fab'] = (function (j1, window) {
|
83
83
|
// ---------------------------------------------------------------------------
|
84
|
-
//
|
84
|
+
// Global variable settings
|
85
85
|
// ---------------------------------------------------------------------------
|
86
86
|
var isMobile = j1.core.isMobile();
|
87
87
|
var environment = '{{environment}}';
|
@@ -116,7 +116,15 @@ j1.adapter['fab'] = (function (j1, window) {
|
|
116
116
|
init: function (options) {
|
117
117
|
|
118
118
|
// -----------------------------------------------------------------------
|
119
|
-
//
|
119
|
+
// Default module settings
|
120
|
+
// -----------------------------------------------------------------------
|
121
|
+
var settings = $.extend({
|
122
|
+
module_name: 'j1.adapter.fab',
|
123
|
+
generated: '{{site.time}}'
|
124
|
+
}, options);
|
125
|
+
|
126
|
+
// -----------------------------------------------------------------------
|
127
|
+
// Global variable settings
|
120
128
|
// -----------------------------------------------------------------------
|
121
129
|
_this = j1.adapter.fab;
|
122
130
|
logger = log4javascript.getLogger('j1.adapter.fab');
|
@@ -132,14 +140,6 @@ j1.adapter['fab'] = (function (j1, window) {
|
|
132
140
|
// create settings object from frontmatterOptions
|
133
141
|
var frontmatterOptions = options != null ? $.extend({}, options) : {};
|
134
142
|
|
135
|
-
// -----------------------------------------------------------------------
|
136
|
-
// defaults
|
137
|
-
// -----------------------------------------------------------------------
|
138
|
-
var settings = $.extend({
|
139
|
-
module_name: 'j1.adapter.fab',
|
140
|
-
generated: '{{site.time}}'
|
141
|
-
}, options);
|
142
|
-
|
143
143
|
// -----------------------------------------------------------------------
|
144
144
|
// options loader
|
145
145
|
// -----------------------------------------------------------------------
|
@@ -78,10 +78,7 @@ regenerate: false
|
|
78
78
|
/* eslint indent: "off" */
|
79
79
|
// -----------------------------------------------------------------------------
|
80
80
|
'use strict';
|
81
|
-
|
82
|
-
{% comment %} Main
|
83
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
84
|
-
j1.adapter['framer'] = (function (j1, window) {
|
81
|
+
j1.adapter.framer = (function (j1, window) {
|
85
82
|
|
86
83
|
{% comment %} Set global variables
|
87
84
|
------------------------------------------------------------------------------ {% endcomment %}
|
@@ -107,64 +104,65 @@ j1.adapter['framer'] = (function (j1, window) {
|
|
107
104
|
|
108
105
|
var dependencies_met_page_finished = setInterval (function () {
|
109
106
|
if (j1.getState() === 'finished') {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
107
|
+
|
108
|
+
// -----------------------------------------------------------------------
|
109
|
+
// Default module settings
|
110
|
+
// -----------------------------------------------------------------------
|
111
|
+
var settings = $.extend({
|
112
|
+
module_name: 'j1.adapter.example',
|
113
|
+
generated: '{{site.time}}'
|
114
|
+
}, options);
|
115
|
+
|
116
|
+
// -----------------------------------------------------------------------
|
117
|
+
// Global variable settings
|
118
|
+
// -----------------------------------------------------------------------
|
119
|
+
_this = j1.adapter.framer;
|
120
|
+
logger = log4javascript.getLogger('j1.adapter.framer');
|
121
|
+
|
122
|
+
// initialize state flag
|
123
|
+
_this.setState('started');
|
124
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
125
|
+
logger.info('\n' + 'module is being initialized');
|
126
|
+
|
127
|
+
{% comment %} Load module config from yml data
|
128
|
+
-------------------------------------------------------------------------- {% endcomment %}
|
129
|
+
// Load module DEFAULTS|CONFIG
|
130
|
+
/* eslint-disable */
|
131
|
+
moduleOptions = $.extend({}, {{framer_options | replace: '=>', ':' | replace: 'nil', '""'}});
|
132
|
+
/* eslint-enable */
|
133
|
+
|
134
|
+
if (typeof settings !== 'undefined') {
|
135
|
+
moduleOptions = j1.mergeData(moduleOptions, settings);
|
136
|
+
}
|
137
|
+
|
138
|
+
iFrameResize({
|
139
|
+
log: moduleOptions.log,
|
140
|
+
autoResize: moduleOptions.autoResize,
|
141
|
+
bodyBackground: moduleOptions.bodyBackground,
|
142
|
+
bodyMargin: moduleOptions.bodyMargin,
|
143
|
+
checkOrigin: moduleOptions.checkOrigin,
|
144
|
+
inPageLinks: moduleOptions.inPageLinks,
|
145
|
+
interval: moduleOptions.interval,
|
146
|
+
heightCalculationMethod: moduleOptions.heightCalculationMethod,
|
147
|
+
maxHeight: moduleOptions.maxHeight,
|
148
|
+
minWidth: moduleOptions.minWidth,
|
149
|
+
maxWidth: moduleOptions.maxWidth,
|
150
|
+
minHeight: moduleOptions.minHeight,
|
151
|
+
resizeFrom: moduleOptions.resizeFrom,
|
152
|
+
scrolling: moduleOptions.scrolling,
|
153
|
+
sizeHeight: moduleOptions.sizeHeight,
|
154
|
+
sizeWidth: moduleOptions.sizeWidth,
|
155
|
+
tolerance: moduleOptions.tolerance,
|
156
|
+
widthCalculationMethod: moduleOptions.widthCalculationMethod,
|
157
|
+
targetOrigin: moduleOptions.checkOrigin
|
158
|
+
});
|
159
|
+
|
160
|
+
_this.setState('finished');
|
161
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
162
|
+
logger.info('\n' + 'initializing module finished');
|
163
|
+
|
164
|
+
clearInterval(dependencies_met_page_finished);
|
165
|
+
return true;
|
168
166
|
}
|
169
167
|
}, 25);
|
170
168
|
}, // END init
|