j1-template 2022.0.12 → 2022.0.16
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 +65 -44
- data/assets/themes/j1/adapter/js/algolia.js +9 -9
- data/assets/themes/j1/adapter/js/analytics.js +46 -24
- data/assets/themes/j1/adapter/js/asciidoctor.js +9 -9
- data/assets/themes/j1/adapter/js/attic.js +9 -1
- data/assets/themes/j1/adapter/js/bmd.js +9 -10
- data/assets/themes/j1/adapter/js/carousel.js +9 -9
- data/assets/themes/j1/adapter/js/clipboard.js +9 -9
- data/assets/themes/j1/adapter/js/comments.js +31 -10
- data/assets/themes/j1/adapter/js/cookieConsent.js +73 -80
- data/assets/themes/j1/adapter/js/fab.js +10 -10
- data/assets/themes/j1/adapter/js/framer.js +59 -58
- data/assets/themes/j1/adapter/js/j1.js +166 -103
- data/assets/themes/j1/adapter/js/justifiedGallery.js +11 -10
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +9 -9
- data/assets/themes/j1/adapter/js/lightbox.js +11 -4
- data/assets/themes/j1/adapter/js/logger.js +10 -3
- data/assets/themes/j1/adapter/js/mmenu.js +9 -9
- data/assets/themes/j1/adapter/js/navigator.js +9 -9
- data/assets/themes/j1/adapter/js/quicksearch.js +9 -9
- data/assets/themes/j1/adapter/js/rouge.js +9 -9
- data/assets/themes/j1/adapter/js/rtable.js +9 -9
- data/assets/themes/j1/adapter/js/rtextResizer.js +9 -9
- data/assets/themes/j1/adapter/js/scroller.js +12 -7
- data/assets/themes/j1/adapter/js/themer.js +11 -2
- data/assets/themes/j1/adapter/js/toccer.js +9 -9
- data/assets/themes/j1/adapter/js/translator.js +13 -16
- data/assets/themes/j1/core/css/vendor.css +6 -1
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +4 -3
- 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/exe/j1 +31 -11
- data/lib/j1/commands/generate.rb +37 -36
- data/lib/j1/commands/help.rb +35 -0
- data/lib/j1/commands/patch.rb +81 -0
- data/lib/j1/commands/reset.rb +36 -0
- data/lib/j1/commands/setup.rb +126 -0
- data/lib/j1/commands/site.rb +27 -0
- data/lib/j1/external.rb +1 -1
- data/lib/j1/utils/exec_until_trap.rb +28 -0
- data/lib/j1/utils.rb +31 -0
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -1
- 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/modules/advertising.yml +1 -12
- data/lib/starter_web/_data/modules/analytics.yml +1 -1
- data/lib/starter_web/_data/modules/cookies.yml +5 -2
- data/lib/starter_web/_data/modules/defaults/advertising.yml +7 -8
- data/lib/starter_web/_data/modules/defaults/comments.yml +4 -4
- data/lib/starter_web/_data/modules/defaults/cookies.yml +106 -36
- data/lib/starter_web/_data/modules/defaults/themer.yml +3 -2
- data/lib/starter_web/_data/modules/themer.yml +2 -1
- 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 +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.comments.asciidoc +1 -1
- 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 +5 -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/400_asciidoc_extensions.adoc +7 -7
- 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 +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6747e12e42b4cbc106beb6bbef14dbc74b7e43c050d88371bcbd814d62bf76e0
|
4
|
+
data.tar.gz: e4d94adc0891fc86bc5f53f702534aeb74caeca9ebf1f51d101271317b244278
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2743934801254b32fcba41d44183c5f94580f5bcf5460cc816277359fdf81127c1b47e95600b2856e8152e9db0e3c862e9d0cecffa2a7db06b9350467a0db8cc
|
7
|
+
data.tar.gz: 752db1543f50ca13e4b1ce9477796b588bf1bb8447ba0e8fb47f0bf1ffba1daa4f39b40536ababd655d7cc4cf529fd615ebbb89931614bcabc4913c03d74fd2c
|
@@ -89,6 +89,8 @@ j1.adapter.advertising = (function (j1, window) {
|
|
89
89
|
{% comment %} Set global variables
|
90
90
|
-------------------------------------------------------------------------------- {% endcomment %}
|
91
91
|
var environment = '{{environment}}';
|
92
|
+
var date = new Date();
|
93
|
+
var timestamp_now = date.toISOString();
|
92
94
|
var gadScript = document.createElement('script');
|
93
95
|
var adInitializerScript = document.createElement('script');
|
94
96
|
var autoHideOnUnfilled = {{advertising_options.google.autoHideOnUnfilled}};
|
@@ -102,10 +104,9 @@ var baseUrl;
|
|
102
104
|
var hostname;
|
103
105
|
var cookie_names;
|
104
106
|
var user_consent;
|
105
|
-
var
|
106
|
-
var
|
107
|
-
var
|
108
|
-
var cookie_domain;
|
107
|
+
var advertisingProvider;
|
108
|
+
var providerID;
|
109
|
+
var validProviderID;
|
109
110
|
var _this;
|
110
111
|
var logger;
|
111
112
|
var logText;
|
@@ -125,38 +126,47 @@ var logText;
|
|
125
126
|
// [INFO ] [j1.adapter.advertising ] [ detected advertising provider (j1_config): {{advertising_provider}}} ]
|
126
127
|
// [INFO ] [j1.adapter.advertising ] [ start processing load region head, layout: {{page.layout}} ]
|
127
128
|
|
129
|
+
// -----------------------------------------------------------------------
|
130
|
+
// Default module settings
|
131
|
+
// -----------------------------------------------------------------------
|
132
|
+
var settings = $.extend({
|
133
|
+
module_name: 'j1.adapter.advertising',
|
134
|
+
generated: '{{site.time}}'
|
135
|
+
}, options);
|
136
|
+
|
137
|
+
// -----------------------------------------------------------------------
|
138
|
+
// Global variable settings
|
139
|
+
// -----------------------------------------------------------------------
|
128
140
|
cookie_names = j1.getCookieNames();
|
129
141
|
user_consent = j1.readCookie(cookie_names.user_consent);
|
130
142
|
url = new liteURL(window.location.href);
|
131
|
-
baseUrl = url.origin;
|
132
143
|
hostname = url.hostname;
|
133
|
-
domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
134
|
-
cookie_option_domain = '{{cookie_options.domain}}';
|
135
|
-
|
136
|
-
// set domain used by cookies
|
137
|
-
if (cookie_option_domain == 'auto') {
|
138
|
-
domainAttribute = domain ;
|
139
|
-
} else {
|
140
|
-
domainAttribute = hostname;
|
141
|
-
}
|
142
144
|
|
143
145
|
{% case advertising_provider %}
|
144
146
|
{% when "google" %}
|
145
147
|
// [INFO ] [j1.adapter.advertising ] [ place provider: Google Adsense ]
|
148
|
+
|
146
149
|
_this = j1.adapter.advertising;
|
147
150
|
logger = log4javascript.getLogger('j1.adapter.advertising.google');
|
151
|
+
|
148
152
|
// initialize state flag
|
149
153
|
_this.setState('started');
|
150
154
|
logger.info('\n' + 'state: ' + _this.getState());
|
151
155
|
logger.info('\n' + 'module is being initialized');
|
152
|
-
// default module settings
|
153
|
-
var settings = $.extend({
|
154
|
-
module_name: 'j1.adapter.advertising',
|
155
|
-
generated: '2021-12-18 18:55:38 +0000'
|
156
|
-
}, options);
|
157
156
|
|
158
157
|
var dependencies_met_page_ready = setInterval(function() {
|
159
158
|
if (j1.getState() == 'finished') {
|
159
|
+
|
160
|
+
providerID = '{{advertising_options.google.publisherID}}';
|
161
|
+
advertisingProvider = 'Google Adsense';
|
162
|
+
validProviderID = (providerID.includes('your')) ? false : true;
|
163
|
+
if (!validProviderID) {
|
164
|
+
logger.warn('\n' + 'invalid publisherID detected for Google Adsense (GAS): ' + providerID);
|
165
|
+
logger.info('\n' + 'skip initialization for provider: ' + advertisingProvider);
|
166
|
+
clearInterval(dependencies_met_page_ready);
|
167
|
+
return false;
|
168
|
+
}
|
169
|
+
|
160
170
|
if (user_consent.personalization) {
|
161
171
|
// place all ads configured for the page
|
162
172
|
// NOTE: currently NOT implemented/used
|
@@ -165,22 +175,22 @@ var logText;
|
|
165
175
|
|
166
176
|
// add gad api dynamically in the head section
|
167
177
|
// -----------------------------------------------------------------
|
168
|
-
logger.info('\n' + 'add
|
178
|
+
logger.info('\n' + 'add gas api in section: head');
|
169
179
|
gadScript.async = true;
|
170
|
-
gadScript.id = '
|
180
|
+
gadScript.id = 'gas-api';
|
171
181
|
gadScript.src = '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
|
172
182
|
gadScript.setAttribute('data-ad-client', 'ca-pub-3885670015316130');
|
173
183
|
document.head.appendChild(gadScript);
|
174
184
|
|
175
185
|
// setup monitor for state changes on all ads configured
|
176
186
|
// ---------------------------------------------------------------
|
177
|
-
logger.
|
187
|
+
logger.debug('\n' + 'setup monitoring');
|
178
188
|
_this.monitor_ads();
|
179
189
|
|
180
190
|
// run protection check
|
181
191
|
// -------------------------------------------------------------------
|
182
192
|
if (checkTrackingProtection) {
|
183
|
-
logger.
|
193
|
+
logger.debug('\n' + 'run checks for tracking protection');
|
184
194
|
_this.check_tracking_protection();
|
185
195
|
|
186
196
|
var dependencies_met_tracking_check_ready = setInterval (function (options) {
|
@@ -217,22 +227,26 @@ var logText;
|
|
217
227
|
}
|
218
228
|
clearInterval(dependencies_met_page_ready);
|
219
229
|
} else {
|
220
|
-
|
230
|
+
// manage GAD cookies if no consent is given|rejected
|
231
|
+
// -----------------------------------------------------------------
|
232
|
+
var gasCookies = j1.findCookie('__ga');
|
221
233
|
logger.warn('\n' + 'consent on cookies disabled for personalization');
|
222
234
|
logger.warn('\n' + 'initialization of module advertising skipped');
|
223
235
|
|
224
|
-
//
|
225
|
-
//
|
226
|
-
//
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
236
|
+
// remove cookies on invalid GAS config or left from a previous
|
237
|
+
// session/page view if they exists
|
238
|
+
// ---------------------------------------------------------------------
|
239
|
+
gasCookies.forEach(function (item) {
|
240
|
+
// Remove cookies from Google Ads
|
241
|
+
if (hostname == 'localhost') {
|
242
|
+
j1.removeCookie({ name: item, domain: false, secure: false });
|
243
|
+
} else {
|
244
|
+
j1.removeCookie({ name: item, domain: '.' + hostname, secure: false });
|
245
|
+
}
|
246
|
+
});
|
235
247
|
|
248
|
+
// manage tracking protection
|
249
|
+
// -----------------------------------------------------------------
|
236
250
|
if (checkTrackingProtection) {
|
237
251
|
if (!user_consent.personalization) {
|
238
252
|
logText = '\n' + 'consent on cookies disabled for personalization';
|
@@ -270,21 +284,28 @@ var logText;
|
|
270
284
|
|
271
285
|
// -------------------------------------------------------------------------
|
272
286
|
// monitor_ads()
|
273
|
-
// monitor for state changes on the ad
|
287
|
+
// monitor for state changes on the ad placed in pages (if any)
|
288
|
+
//
|
289
|
+
// NOTE: Check visibility state of the adSlot to prevent multiple
|
290
|
+
// processing of the same slot
|
274
291
|
// -------------------------------------------------------------------------
|
275
292
|
monitor_ads: function () {
|
293
|
+
var logger = log4javascript.getLogger('j1.adapter.advertising.monitor.ads');
|
276
294
|
|
277
295
|
$('.adsbygoogle').attrchange({
|
278
296
|
trackValues: true,
|
279
297
|
callback: function (event) {
|
280
298
|
if (event.newValue === 'unfilled') {
|
281
|
-
var elm
|
282
|
-
|
283
|
-
if (
|
284
|
-
|
285
|
-
if (
|
286
|
-
logger.warn('\n' + '
|
287
|
-
|
299
|
+
var elm = event.target.dataset;
|
300
|
+
var adSlotIsVisible = $('#' + elm.adSlot ).is(":visible");
|
301
|
+
if (adSlotIsVisible) {
|
302
|
+
if (addBorderOnUnfilled) { $('.adsbygoogle').addClass('border--dotted'); }
|
303
|
+
if (elm.adClient) {
|
304
|
+
logger.warn('\n' + 'found ad state ' + event.newValue + ' for slot: ' + elm.adSlot);
|
305
|
+
if (autoHideOnUnfilled) {
|
306
|
+
logger.warn('\n' + ' hide ad for slot: ' + elm.adSlot);
|
307
|
+
$('#' + elm.adSlot ).hide();
|
308
|
+
}
|
288
309
|
}
|
289
310
|
}
|
290
311
|
}
|
@@ -305,7 +326,7 @@ var logText;
|
|
305
326
|
// https://stackoverflow.com/questions/33959324/how-to-detect-if-a-user-is-using-tracking-protection-in-firefox-42
|
306
327
|
// -------------------------------------------------------------------------
|
307
328
|
check_tracking_protection: function () {
|
308
|
-
var logger = log4javascript.getLogger('j1.adapter.advertising.tracking
|
329
|
+
var logger = log4javascript.getLogger('j1.adapter.advertising.monitor.tracking');
|
309
330
|
|
310
331
|
logText = '\n' + 'check for trackingprotection';
|
311
332
|
logger.info(logText);
|
@@ -98,15 +98,6 @@ j1.adapter.algolia = (function (j1, window) {
|
|
98
98
|
// -------------------------------------------------------------------------
|
99
99
|
init: function (options) {
|
100
100
|
|
101
|
-
// -----------------------------------------------------------------------
|
102
|
-
// globals
|
103
|
-
// -----------------------------------------------------------------------
|
104
|
-
_this = j1.adapter.algolia;
|
105
|
-
logger = log4javascript.getLogger('j1.adapter.algolia');
|
106
|
-
|
107
|
-
// initialize state flag
|
108
|
-
_this.state = 'pending';
|
109
|
-
|
110
101
|
// -----------------------------------------------------------------------
|
111
102
|
// Default module settings
|
112
103
|
// -----------------------------------------------------------------------
|
@@ -115,6 +106,15 @@ j1.adapter.algolia = (function (j1, window) {
|
|
115
106
|
generated: '{{site.time}}'
|
116
107
|
}, options);
|
117
108
|
|
109
|
+
// -----------------------------------------------------------------------
|
110
|
+
// Global variable settings
|
111
|
+
// -----------------------------------------------------------------------
|
112
|
+
_this = j1.adapter.algolia;
|
113
|
+
logger = log4javascript.getLogger('j1.adapter.algolia');
|
114
|
+
|
115
|
+
// initialize state flag
|
116
|
+
_this.state = 'pending';
|
117
|
+
|
118
118
|
_this.setState('started');
|
119
119
|
logger.info('\n' + 'state: ' + _this.getState());
|
120
120
|
logger.info('\n' + 'module is being initialized');
|
@@ -85,12 +85,17 @@ j1.adapter.analytics = (function (j1, window) {
|
|
85
85
|
|
86
86
|
{% comment %} Set global variables
|
87
87
|
-------------------------------------------------------------------------------- {% endcomment %}
|
88
|
-
var
|
89
|
-
var
|
90
|
-
var
|
91
|
-
var
|
92
|
-
var
|
93
|
-
var
|
88
|
+
var url = new liteURL(window.location.href);
|
89
|
+
var hostname = url.hostname;
|
90
|
+
var environment = '{{environment}}';
|
91
|
+
var gaScript = document.createElement('script');
|
92
|
+
var providerID = '{{analytics_options.google.trackingID}}';
|
93
|
+
var validProviderID = (providerID.includes('your')) ? false : true;
|
94
|
+
var optInOut = {{analytics_options.google.optInOut}};
|
95
|
+
var anonymizeIP = {{analytics_options.google.anonymizeIP}};
|
96
|
+
var cookie_names = j1.getCookieNames();
|
97
|
+
var date = new Date();
|
98
|
+
var timestamp_now = date.toISOString();
|
94
99
|
var gaCookies;
|
95
100
|
var user_consent;
|
96
101
|
var gaExists;
|
@@ -116,24 +121,37 @@ var logText;
|
|
116
121
|
{% case analytics_provider %}
|
117
122
|
{% when "google" %}
|
118
123
|
// [INFO ] [j1.adapter.analytics ] [ place provider: Google Adsense ]
|
124
|
+
|
125
|
+
// -----------------------------------------------------------------------
|
126
|
+
// Default module settings
|
127
|
+
// -----------------------------------------------------------------------
|
128
|
+
var settings = $.extend({
|
129
|
+
module_name: 'j1.adapter.analytics',
|
130
|
+
generated: '{{site.time}}'
|
131
|
+
}, options);
|
132
|
+
|
133
|
+
// -----------------------------------------------------------------------
|
134
|
+
// Global variable settings
|
135
|
+
// -----------------------------------------------------------------------
|
119
136
|
_this = j1.adapter.analytics;
|
120
137
|
logger = log4javascript.getLogger('j1.adapter.analytics.google');
|
138
|
+
|
121
139
|
// initialize state flag
|
122
140
|
_this.setState('started');
|
123
141
|
logger.info('\n' + 'state: ' + _this.getState());
|
124
142
|
logger.info('\n' + 'module is being initialized');
|
125
|
-
// default module settings
|
126
|
-
var settings = $.extend({
|
127
|
-
module_name: 'j1.adapter.analytics',
|
128
|
-
generated: '2021-12-18 18:55:38 +0000'
|
129
|
-
}, options);
|
130
143
|
|
131
|
-
// remove
|
132
|
-
//
|
144
|
+
// remove cookies on invalid GA config or left from a previous
|
145
|
+
// session/page view if they exists
|
146
|
+
// ---------------------------------------------------------------------
|
133
147
|
gaCookies = j1.findCookie('_ga');
|
134
148
|
gaCookies.forEach(function (item) {
|
135
|
-
logger.warn('\n' + 'delete
|
136
|
-
|
149
|
+
logger.warn('\n' + 'delete cookie created by Google Analytics: ' + item);
|
150
|
+
if (hostname == 'localhost') {
|
151
|
+
j1.removeCookie({ name: item, domain: false, secure: false });
|
152
|
+
} else {
|
153
|
+
j1.removeCookie({ name: item, domain: '.' + hostname, secure: false });
|
154
|
+
}
|
137
155
|
});
|
138
156
|
|
139
157
|
var dependencies_met_page_ready = setInterval(function() {
|
@@ -143,23 +161,27 @@ var logText;
|
|
143
161
|
if (!gaExists) {
|
144
162
|
// add ga api dynamically in the head section
|
145
163
|
// -----------------------------------------------------------------
|
146
|
-
logger.info('\n' + '
|
164
|
+
logger.info('\n' + 'Google Analytics API added in section: head');
|
147
165
|
gaScript.async = true;
|
148
166
|
gaScript.id = 'google-tag-manager';
|
149
|
-
gaScript.src = '//www.googletagmanager.com/gtag/js?id=
|
167
|
+
gaScript.src = '//www.googletagmanager.com/gtag/js?id=' + providerID;
|
150
168
|
document.head.appendChild(gaScript);
|
151
169
|
}
|
152
170
|
|
153
171
|
user_consent = j1.readCookie(cookie_names.user_consent);
|
154
172
|
if (user_consent.analysis) {
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
173
|
+
if (validProviderID) {
|
174
|
+
logger.info('\n' + 'user consent on analytics: ' + user_consent.analysis);
|
175
|
+
logger.info('\n' + 'enable Google Analytics on ID: ' + providerID);
|
176
|
+
GTagOptIn.register(providerID);
|
177
|
+
GTagOptIn.optIn();
|
178
|
+
} else {
|
179
|
+
logger.warn('\n' + 'invalid trackig id detected for Google Analytics: ' + providerID);
|
180
|
+
}
|
159
181
|
} else {
|
160
182
|
logger.info('\n' + 'user consent on analytics: ' + user_consent.analysis);
|
161
|
-
logger.warn('\n' + 'disable:
|
162
|
-
GTagOptIn.register(
|
183
|
+
logger.warn('\n' + 'disable Google Analytics on ID: ' + providerID);
|
184
|
+
GTagOptIn.register(providerID);
|
163
185
|
GTagOptIn.optOut();
|
164
186
|
}
|
165
187
|
clearInterval(dependencies_met_page_ready);
|
@@ -174,7 +196,7 @@ var logText;
|
|
174
196
|
var dependencies_met_page_ready = setInterval(function() {
|
175
197
|
if (j1.getState() == 'finished') {
|
176
198
|
logger = log4javascript.getLogger('j1.adapter.analytics.google');
|
177
|
-
logger.info('\n' + '
|
199
|
+
logger.info('\n' + 'Google Analytics: disabled');
|
178
200
|
clearInterval(dependencies_met_page_ready);
|
179
201
|
}
|
180
202
|
}, 25);
|
@@ -69,7 +69,15 @@ j1.adapter.asciidoctor = (function (j1, window) {
|
|
69
69
|
init: function (options) {
|
70
70
|
|
71
71
|
// -----------------------------------------------------------------------
|
72
|
-
//
|
72
|
+
// Default module settings
|
73
|
+
// -----------------------------------------------------------------------
|
74
|
+
var settings = $.extend({
|
75
|
+
module_name: 'j1.adapter.rtable',
|
76
|
+
generated: '{{site.time}}'
|
77
|
+
}, options);
|
78
|
+
|
79
|
+
// -----------------------------------------------------------------------
|
80
|
+
// Global variable settings
|
73
81
|
// -----------------------------------------------------------------------
|
74
82
|
_this = j1.adapter.asciidoctor;
|
75
83
|
logger = log4javascript.getLogger('j1.adapter.asciidoctor');
|
@@ -79,14 +87,6 @@ j1.adapter.asciidoctor = (function (j1, window) {
|
|
79
87
|
logger.info('\n' + 'state: ' + _this.getState());
|
80
88
|
logger.info('\n' + 'module is being initialized');
|
81
89
|
|
82
|
-
// -----------------------------------------------------------------------
|
83
|
-
// Default module settings
|
84
|
-
// -----------------------------------------------------------------------
|
85
|
-
var settings = $.extend({
|
86
|
-
module_name: 'j1.adapter.rtable',
|
87
|
-
generated: '{{site.time}}'
|
88
|
-
}, options);
|
89
|
-
|
90
90
|
// -----------------------------------------------------------------------
|
91
91
|
// asciidoctor initializer
|
92
92
|
// -----------------------------------------------------------------------
|
@@ -102,7 +102,15 @@ j1.adapter.attic = (function (j1, window) {
|
|
102
102
|
init: function (options) {
|
103
103
|
|
104
104
|
// -----------------------------------------------------------------------
|
105
|
-
//
|
105
|
+
// Default module settings
|
106
|
+
// -----------------------------------------------------------------------
|
107
|
+
var settings = $.extend({
|
108
|
+
module_name: 'j1.adapter.attic',
|
109
|
+
generated: '{{site.time}}'
|
110
|
+
}, options);
|
111
|
+
|
112
|
+
// -----------------------------------------------------------------------
|
113
|
+
// Global variable settings
|
106
114
|
// -----------------------------------------------------------------------
|
107
115
|
_this = j1.adapter.attic;
|
108
116
|
logger = log4javascript.getLogger('j1.adapter.attic');
|
@@ -69,7 +69,15 @@ j1.adapter.bmd = (function (j1, window) {
|
|
69
69
|
init: function (options) {
|
70
70
|
|
71
71
|
// -----------------------------------------------------------------------
|
72
|
-
//
|
72
|
+
// Default module settings
|
73
|
+
// -----------------------------------------------------------------------
|
74
|
+
var settings = $.extend({
|
75
|
+
module_name: 'j1.adapter.bmd',
|
76
|
+
generated: '{{site.time}}'
|
77
|
+
}, options);
|
78
|
+
|
79
|
+
// -----------------------------------------------------------------------
|
80
|
+
// Global variable settings
|
73
81
|
// -----------------------------------------------------------------------
|
74
82
|
_this = j1.adapter.bmd;
|
75
83
|
logger = log4javascript.getLogger('j1.adapter.bmd');
|
@@ -78,15 +86,6 @@ j1.adapter.bmd = (function (j1, window) {
|
|
78
86
|
_this.setState('started');
|
79
87
|
logger.info('\n' + 'state: ' + _this.getState());
|
80
88
|
logger.info('\n' + 'module is being initialized');
|
81
|
-
|
82
|
-
// -----------------------------------------------------------------------
|
83
|
-
// Default module settings
|
84
|
-
// -----------------------------------------------------------------------
|
85
|
-
var settings = $.extend({
|
86
|
-
module_name: 'j1.adapter.bmd',
|
87
|
-
generated: '{{site.time}}'
|
88
|
-
}, options);
|
89
|
-
|
90
89
|
// -----------------------------------------------------------------------
|
91
90
|
// BMD initializer
|
92
91
|
// -----------------------------------------------------------------------
|
@@ -99,15 +99,6 @@ j1.adapter.carousel = (function (j1, window) {
|
|
99
99
|
// -------------------------------------------------------------------------
|
100
100
|
init: function (options) {
|
101
101
|
|
102
|
-
// -----------------------------------------------------------------------
|
103
|
-
// globals
|
104
|
-
// -----------------------------------------------------------------------
|
105
|
-
_this = j1.adapter.carousel;
|
106
|
-
logger = log4javascript.getLogger('j1.adapter.carousel');
|
107
|
-
|
108
|
-
// initialize state flag
|
109
|
-
_this.state = 'pending';
|
110
|
-
|
111
102
|
// -----------------------------------------------------------------------
|
112
103
|
// Default module settings
|
113
104
|
// -----------------------------------------------------------------------
|
@@ -116,6 +107,15 @@ j1.adapter.carousel = (function (j1, window) {
|
|
116
107
|
generated: '{{site.time}}'
|
117
108
|
}, options);
|
118
109
|
|
110
|
+
// -----------------------------------------------------------------------
|
111
|
+
// Global variable settings
|
112
|
+
// -----------------------------------------------------------------------
|
113
|
+
_this = j1.adapter.carousel;
|
114
|
+
logger = log4javascript.getLogger('j1.adapter.carousel');
|
115
|
+
|
116
|
+
// initialize state flag
|
117
|
+
_this.state = 'pending';
|
118
|
+
|
119
119
|
{% comment %} Load module config from yml data
|
120
120
|
-------------------------------------------------------------------------- {% endcomment %}
|
121
121
|
// Load module DEFAULTS|CONFIG
|
@@ -89,20 +89,20 @@ j1.adapter.clipboard = (function (j1, window) {
|
|
89
89
|
init: function (options) {
|
90
90
|
|
91
91
|
// -----------------------------------------------------------------------
|
92
|
-
//
|
93
|
-
// -----------------------------------------------------------------------
|
94
|
-
_this = j1.adapter.clipboard;
|
95
|
-
language = '{{site.language}}';
|
96
|
-
logger = log4javascript.getLogger('j1.adapter.clipboard');
|
97
|
-
|
98
|
-
// -----------------------------------------------------------------------
|
99
|
-
// defaults
|
92
|
+
// Default module settings
|
100
93
|
// -----------------------------------------------------------------------
|
101
94
|
var settings = $.extend({
|
102
95
|
module_name: 'j1.adapter.clipboard',
|
103
96
|
generated: '{{site.time}}'
|
104
97
|
}, options);
|
105
98
|
|
99
|
+
// -----------------------------------------------------------------------
|
100
|
+
// Global variable settings
|
101
|
+
// -----------------------------------------------------------------------
|
102
|
+
_this = j1.adapter.clipboard;
|
103
|
+
language = '{{site.language}}';
|
104
|
+
logger = log4javascript.getLogger('j1.adapter.clipboard');
|
105
|
+
|
106
106
|
// initialize state flag
|
107
107
|
_this.state = 'started';
|
108
108
|
logText = '\n' + 'initialization: started';
|
@@ -159,7 +159,7 @@ j1.adapter.clipboard = (function (j1, window) {
|
|
159
159
|
if ( isNoClip.length == 0) {
|
160
160
|
var btnHtml = '';
|
161
161
|
|
162
|
-
btnHtml = '<div class="j1-clipboard"><span class="btn-clipboard
|
162
|
+
btnHtml = '<div class="j1-clipboard"><span class="btn-clipboard" data-bs-toggle="tooltip" data-bs-placement="left" title="' + btnTitle +'">' + btnText + '</span></div>';
|
163
163
|
|
164
164
|
$(this).before(btnHtml);
|
165
165
|
$('.btn-clipboard').tooltip();
|
@@ -124,7 +124,8 @@ var comments_provider = '{{comments_provider}}';
|
|
124
124
|
var dqApiScript = document.createElement('script');
|
125
125
|
var hvApiScript = document.createElement('script');
|
126
126
|
var hvCallbackScript = document.createElement('script');
|
127
|
-
var
|
127
|
+
var providerID = '{{site_id}}';
|
128
|
+
var validProviderID = (providerID.includes('your')) ? false : true;
|
128
129
|
var comments_headline = '{{comments_headline}}';
|
129
130
|
var cookie_names = j1.getCookieNames();
|
130
131
|
var user_consent;
|
@@ -147,13 +148,18 @@ var logText;
|
|
147
148
|
// [INFO ] [j1.adapter.comments ] [ detected comments provider (j1_config): {{comments_provider}}} ]
|
148
149
|
// [INFO ] [j1.adapter.comments ] [ start processing load region head, layout: {{page.layout}} ]
|
149
150
|
|
150
|
-
//
|
151
|
-
//
|
151
|
+
// -----------------------------------------------------------------------
|
152
|
+
// Default module settings
|
153
|
+
// -----------------------------------------------------------------------
|
152
154
|
var settings = $.extend({
|
153
155
|
module_name: 'j1.adapter.comments',
|
154
|
-
generated: '
|
156
|
+
generated: '{{site.time}}'
|
155
157
|
}, options);
|
156
158
|
|
159
|
+
// -----------------------------------------------------------------------
|
160
|
+
// Global variable settings
|
161
|
+
// -----------------------------------------------------------------------
|
162
|
+
|
157
163
|
{% if site_id %}
|
158
164
|
|
159
165
|
_this = j1.adapter.comments;
|
@@ -162,9 +168,17 @@ var logText;
|
|
162
168
|
{% case comments_provider %}
|
163
169
|
{% when "hyvor" %}
|
164
170
|
// [INFO ] [j1.adapter.comments ] [ place provider: Hyvor Talk ]
|
171
|
+
|
165
172
|
var dependencies_met_page_ready = setInterval(function() {
|
166
173
|
if (j1.getState() == 'finished') {
|
167
174
|
|
175
|
+
if (!validProviderID) {
|
176
|
+
logger.warn('\n' + 'invalid site id detected for Hyvor Talk: ' + providerID);
|
177
|
+
logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
|
178
|
+
clearInterval(dependencies_met_page_ready);
|
179
|
+
return false;
|
180
|
+
}
|
181
|
+
|
168
182
|
// initialize state flag, issue init message
|
169
183
|
// -------------------------------------------------------------------
|
170
184
|
_this.setState('started');
|
@@ -179,7 +193,7 @@ var logText;
|
|
179
193
|
// -----------------------------------------------------------------
|
180
194
|
$('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
|
181
195
|
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
182
|
-
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on siteID: ' +
|
196
|
+
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on siteID: ' + providerID);
|
183
197
|
|
184
198
|
// add Hyvor Talk Web API
|
185
199
|
// NOTE: don't change the script id
|
@@ -193,7 +207,7 @@ var logText;
|
|
193
207
|
// -----------------------------------------------------------------
|
194
208
|
hvCallbackScript.id = 'hyvor-callback';
|
195
209
|
hvCallbackScript.text = '\n';
|
196
|
-
hvCallbackScript.text += 'var HYVOR_TALK_WEBSITE = ' +
|
210
|
+
hvCallbackScript.text += 'var HYVOR_TALK_WEBSITE = ' + providerID + '\n';
|
197
211
|
hvCallbackScript.text += 'var HYVOR_TALK_CONFIG = {' + '\n';
|
198
212
|
hvCallbackScript.text += ' url: false,' + '\n';
|
199
213
|
hvCallbackScript.text += ' id: false' + '\n';
|
@@ -217,7 +231,7 @@ var logText;
|
|
217
231
|
// disable Hyvor Talk
|
218
232
|
// -----------------------------------------------------------------
|
219
233
|
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
220
|
-
logger.warn('\n' + 'disable
|
234
|
+
logger.warn('\n' + 'disable Hyvor Talk on site id: ' + providerID);
|
221
235
|
|
222
236
|
// remove Hyvor Talk resources
|
223
237
|
// -----------------------------------------------------------------
|
@@ -235,6 +249,13 @@ var logText;
|
|
235
249
|
var dependencies_met_page_ready = setInterval(function() {
|
236
250
|
if (j1.getState() == 'finished') {
|
237
251
|
|
252
|
+
if (!validProviderID) {
|
253
|
+
logger.warn('\n' + 'invalid short name detected for Disqus: ' + providerID);
|
254
|
+
logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
|
255
|
+
clearInterval(dependencies_met_page_ready);
|
256
|
+
return;
|
257
|
+
}
|
258
|
+
|
238
259
|
// initialize state flag, issue init message
|
239
260
|
// -------------------------------------------------------------------
|
240
261
|
_this.setState('started');
|
@@ -247,7 +268,7 @@ var logText;
|
|
247
268
|
if (user_consent.personalization) {
|
248
269
|
$('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
|
249
270
|
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
250
|
-
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on
|
271
|
+
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
|
251
272
|
|
252
273
|
// old Disqus Web API init
|
253
274
|
// -----------------------------------------------------------------
|
@@ -279,7 +300,7 @@ var logText;
|
|
279
300
|
// add|initialize Disqus Web API
|
280
301
|
// -----------------------------------------------------------------
|
281
302
|
dqApiScript.id = 'dq-web-api';
|
282
|
-
dqApiScript.src = '//' +
|
303
|
+
dqApiScript.src = '//' + providerID + '.disqus.com/embed.js";'
|
283
304
|
dqApiScript.setAttribute("data-timestamp", '"' + timestamp_now + '"');
|
284
305
|
document.head.appendChild(dqApiScript);
|
285
306
|
|
@@ -288,7 +309,7 @@ var logText;
|
|
288
309
|
$('#main-content').append('<div id="disqus_thread"></div>');
|
289
310
|
} else {
|
290
311
|
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
291
|
-
logger.warn('\n' + 'disable comments provider' + ' {{comments_provider}} on
|
312
|
+
logger.warn('\n' + 'disable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
|
292
313
|
$('#leave-a-comment').remove();
|
293
314
|
$('#dq-web-api').remove();
|
294
315
|
$('#hdisqus_thread').remove();
|