j1-template 2022.0.10 → 2022.0.11
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 +1 -4
- data/assets/themes/j1/adapter/js/algolia.js +1 -4
- data/assets/themes/j1/adapter/js/analytics.js +237 -0
- data/assets/themes/j1/adapter/js/asciidoctor.js +1 -4
- data/assets/themes/j1/adapter/js/attic.js +1 -4
- data/assets/themes/j1/adapter/js/bmd.js +1 -4
- data/assets/themes/j1/adapter/js/carousel.js +1 -4
- data/assets/themes/j1/adapter/js/clipboard.js +1 -2
- data/assets/themes/j1/adapter/js/comments.js +387 -0
- data/assets/themes/j1/adapter/js/cookieConsent.js +35 -27
- data/assets/themes/j1/adapter/js/fab.js +1 -1
- data/assets/themes/j1/adapter/js/framer.js +1 -4
- data/assets/themes/j1/adapter/js/j1.js +52 -166
- data/assets/themes/j1/adapter/js/justifiedGallery.js +1 -4
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +1 -4
- data/assets/themes/j1/adapter/js/lightbox.js +1 -5
- data/assets/themes/j1/adapter/js/logger.js +1 -2
- data/assets/themes/j1/adapter/js/mmenu.js +2 -3
- data/assets/themes/j1/adapter/js/navigator.js +4 -3
- data/assets/themes/j1/adapter/js/quicksearch.js +1 -4
- data/assets/themes/j1/adapter/js/rouge.js +1 -4
- data/assets/themes/j1/adapter/js/rtable.js +1 -4
- data/assets/themes/j1/adapter/js/rtextResizer.js +1 -4
- data/assets/themes/j1/adapter/js/scroller.js +1 -4
- data/assets/themes/j1/adapter/js/themer.js +1 -1
- data/assets/themes/j1/adapter/js/toccer.js +1 -4
- data/assets/themes/j1/adapter/js/translator.js +25 -68
- 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/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/page.yml +7 -18
- data/lib/starter_web/_data/layouts/post.yml +0 -11
- data/lib/starter_web/_data/modules/advertising.yml +3 -2
- 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 +2 -0
- data/lib/starter_web/_data/modules/defaults/advertising.yml +4 -3
- 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 +19 -8
- 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/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/package.json +1 -1
- 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/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +12 -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
@@ -0,0 +1,387 @@
|
|
1
|
+
---
|
2
|
+
regenerate: true
|
3
|
+
---
|
4
|
+
|
5
|
+
{% capture cache %}
|
6
|
+
|
7
|
+
{% comment %}
|
8
|
+
# -----------------------------------------------------------------------------
|
9
|
+
# ~/assets/themes/j1/adapter/js/comments.js
|
10
|
+
# Liquid template to adapt the Comments module
|
11
|
+
#
|
12
|
+
# Product/Info:
|
13
|
+
# https://jekyll.one
|
14
|
+
# Copyright (C) 2021 Juergen Adams
|
15
|
+
#
|
16
|
+
# J1 Template is licensed under the MIT License.
|
17
|
+
# For details, see https://jekyll.one
|
18
|
+
# -----------------------------------------------------------------------------
|
19
|
+
# Test data:
|
20
|
+
# {{ liquid_var | debug }}
|
21
|
+
# comments_options: {{ comments_options | debug }}
|
22
|
+
# -----------------------------------------------------------------------------
|
23
|
+
{% endcomment %}
|
24
|
+
|
25
|
+
{% comment %} Liquid procedures
|
26
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
27
|
+
|
28
|
+
{% comment %} Set global settings
|
29
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
30
|
+
{% assign environment = site.environment %}
|
31
|
+
{% assign asset_path = "/assets/themes/j1" %}
|
32
|
+
|
33
|
+
{% comment %} Process YML config data
|
34
|
+
================================================================================ {% endcomment %}
|
35
|
+
|
36
|
+
{% comment %} Set config files
|
37
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
38
|
+
{% assign template_config = site.data.j1_config %}
|
39
|
+
{% assign blocks = site.data.blocks %}
|
40
|
+
{% assign modules = site.data.modules %}
|
41
|
+
|
42
|
+
{% comment %} Set config data (settings only)
|
43
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
44
|
+
{% assign comments_defaults = modules.defaults.comments.defaults %}
|
45
|
+
{% assign comments_settings = modules.comments.settings %}
|
46
|
+
|
47
|
+
{% comment %} Set config options (settings only)
|
48
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
49
|
+
{% assign comments_options = comments_defaults | merge: comments_settings %}
|
50
|
+
|
51
|
+
{% comment %} Variables
|
52
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
53
|
+
{% assign comments = comments_options.enabled %}
|
54
|
+
{% assign comments_provider = comments_options.provider %}
|
55
|
+
|
56
|
+
{% if comments_provider == 'disqus' %}
|
57
|
+
{% assign site_id = comments_options.disqus.site_id %}
|
58
|
+
{% elsif comments_provider == 'hyvor' %}
|
59
|
+
{% assign site_id = comments_options.hyvor.site_id %}
|
60
|
+
{% elsif comments_provider == 'commento' %}
|
61
|
+
{% assign site_id = comments_options.commento.site_id %}
|
62
|
+
{% elsif comments_provider == 'just-comments' %}
|
63
|
+
{% assign site_id = comments_options.just-comments.site_id %}
|
64
|
+
{% elsif comments_provider == 'facebook' %}
|
65
|
+
{% assign site_id = comments_options.facebook.site_id %}
|
66
|
+
{% else %}
|
67
|
+
{% assign site_id = false %}
|
68
|
+
{% endif %}
|
69
|
+
|
70
|
+
{% comment %} language detection
|
71
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
72
|
+
{% if site.language == "en" %}
|
73
|
+
{% assign language = "en" %}
|
74
|
+
{% elsif site.language == "de"%}
|
75
|
+
{% assign language = "de" %}
|
76
|
+
{% else %}
|
77
|
+
{% assign language = "en" %}
|
78
|
+
{% endif %}
|
79
|
+
|
80
|
+
{% if language == "en" %}
|
81
|
+
{% assign comments_headline = comments_options.comments_headline.en %}
|
82
|
+
{% endif %}
|
83
|
+
|
84
|
+
{% if language == "de" %}
|
85
|
+
{% assign comments_headline = comments_options.comments_headline.de %}
|
86
|
+
{% endif %}
|
87
|
+
|
88
|
+
{% assign production = false %}
|
89
|
+
{% if environment == 'prod' or environment == 'production' %}
|
90
|
+
{% assign production = true %}
|
91
|
+
{% endif %}
|
92
|
+
|
93
|
+
/*
|
94
|
+
# -----------------------------------------------------------------------------
|
95
|
+
# ~/assets/themes/j1/adapter/js/comments.js
|
96
|
+
# J1 Adapter for the comments module
|
97
|
+
#
|
98
|
+
# Product/Info:
|
99
|
+
# https://jekyll.one
|
100
|
+
#
|
101
|
+
# Copyright (C) 2021 Juergen Adams
|
102
|
+
#
|
103
|
+
# J1 Template is licensed under the MIT License.
|
104
|
+
# For details, see https://jekyll.one
|
105
|
+
# -----------------------------------------------------------------------------
|
106
|
+
# Adapter generated: {{site.time}}
|
107
|
+
# -----------------------------------------------------------------------------
|
108
|
+
*/
|
109
|
+
|
110
|
+
// -----------------------------------------------------------------------------
|
111
|
+
// ESLint shimming
|
112
|
+
// -----------------------------------------------------------------------------
|
113
|
+
/* eslint indent: "off" */
|
114
|
+
// -----------------------------------------------------------------------------
|
115
|
+
'use strict';
|
116
|
+
j1.adapter.comments = (function (j1, window) {
|
117
|
+
|
118
|
+
{% comment %} Set global variables
|
119
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
120
|
+
var environment = '{{environment}}';
|
121
|
+
var comments_provider = '{{comments_provider}}';
|
122
|
+
var dqApiScript = document.createElement('script');
|
123
|
+
var hvApiScript = document.createElement('script');
|
124
|
+
var hvCallbackScript = document.createElement('script');
|
125
|
+
var siteID = '{{site_id}}';
|
126
|
+
var comments_headline = '{{comments_headline}}';
|
127
|
+
var cookie_names = j1.getCookieNames();
|
128
|
+
var user_consent;
|
129
|
+
var _this;
|
130
|
+
var logger;
|
131
|
+
var logText;
|
132
|
+
|
133
|
+
// ---------------------------------------------------------------------------
|
134
|
+
// Main object
|
135
|
+
// ---------------------------------------------------------------------------
|
136
|
+
return {
|
137
|
+
|
138
|
+
// -------------------------------------------------------------------------
|
139
|
+
// init()
|
140
|
+
// adapter initializer
|
141
|
+
// -------------------------------------------------------------------------
|
142
|
+
init: function (options) {
|
143
|
+
|
144
|
+
{% if comments %}
|
145
|
+
// [INFO ] [j1.adapter.comments ] [ detected comments provider (j1_config): {{comments_provider}}} ]
|
146
|
+
// [INFO ] [j1.adapter.comments ] [ start processing load region head, layout: {{page.layout}} ]
|
147
|
+
|
148
|
+
// default module settings
|
149
|
+
// ----------------------------------------------------------------------
|
150
|
+
var settings = $.extend({
|
151
|
+
module_name: 'j1.adapter.comments',
|
152
|
+
generated: '2021-12-18 18:55:38 +0000'
|
153
|
+
}, options);
|
154
|
+
|
155
|
+
{% if site_id %}
|
156
|
+
|
157
|
+
_this = j1.adapter.comments;
|
158
|
+
logger = log4javascript.getLogger('j1.adapter.comments');
|
159
|
+
|
160
|
+
{% case comments_provider %}
|
161
|
+
{% when "hyvor" %}
|
162
|
+
// [INFO ] [j1.adapter.comments ] [ place provider: Hyvor Talk ]
|
163
|
+
var dependencies_met_page_ready = setInterval(function() {
|
164
|
+
if (j1.getState() == 'finished') {
|
165
|
+
|
166
|
+
// initialize state flag, issue init message
|
167
|
+
// -------------------------------------------------------------------
|
168
|
+
_this.setState('started');
|
169
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
170
|
+
logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
|
171
|
+
|
172
|
+
// place|remove initialization code
|
173
|
+
// -------------------------------------------------------------------
|
174
|
+
user_consent = j1.readCookie(cookie_names.user_consent);
|
175
|
+
if (user_consent.personalization) {
|
176
|
+
// enable Hyvor Talk
|
177
|
+
// -----------------------------------------------------------------
|
178
|
+
$('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
|
179
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
180
|
+
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on siteID: ' + siteID);
|
181
|
+
|
182
|
+
// add Hyvor Talk Web API
|
183
|
+
// NOTE: don't change the script id
|
184
|
+
// -----------------------------------------------------------------
|
185
|
+
hvApiScript.id = 'hyvor-embed';
|
186
|
+
hvApiScript.src = '//talk.hyvor.com/web-api/embed.js';
|
187
|
+
hvApiScript.async = true;
|
188
|
+
document.head.appendChild(hvApiScript);
|
189
|
+
|
190
|
+
// add Hyvor Talk callback script
|
191
|
+
// -----------------------------------------------------------------
|
192
|
+
hvCallbackScript.id = 'hyvor-callback';
|
193
|
+
hvCallbackScript.text = '\n';
|
194
|
+
hvCallbackScript.text += 'var HYVOR_TALK_WEBSITE = ' + siteID + '\n';
|
195
|
+
hvCallbackScript.text += 'var HYVOR_TALK_CONFIG = {' + '\n';
|
196
|
+
hvCallbackScript.text += ' url: false,' + '\n';
|
197
|
+
hvCallbackScript.text += ' id: false' + '\n';
|
198
|
+
hvCallbackScript.text += ' };' + '\n';
|
199
|
+
document.head.appendChild(hvCallbackScript);
|
200
|
+
|
201
|
+
// add Hyvor Talk comment container
|
202
|
+
// NOTE: don't change the div id
|
203
|
+
// -----------------------------------------------------------------
|
204
|
+
$('#main-content').append('<div id="hyvor-talk-view"></div>');
|
205
|
+
|
206
|
+
// add recommended title to the comments iframe for SEO optimization
|
207
|
+
// -------------------------------------------------------------------
|
208
|
+
var dependencies_met_load_provider_finished = setInterval (function () {
|
209
|
+
if ($('#hyvor-talk-view').children().length) {
|
210
|
+
$('#hyvor-talk-iframe').prop('title', 'Hyvor comments iframe');
|
211
|
+
clearInterval(dependencies_met_load_provider_finished);
|
212
|
+
}
|
213
|
+
}, 25);
|
214
|
+
} else {
|
215
|
+
// disable Hyvor Talk
|
216
|
+
// -----------------------------------------------------------------
|
217
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
218
|
+
logger.warn('\n' + 'disable comments provider' + ' {{comments_provider}} on siteID: ' + siteID);
|
219
|
+
|
220
|
+
// remove Hyvor Talk resources
|
221
|
+
// -----------------------------------------------------------------
|
222
|
+
$('#leave-a-comment').remove();
|
223
|
+
$('#hyvor-embed').remove();
|
224
|
+
$('#hyvor-callback').remove();
|
225
|
+
$('#hyvor-talk-view').remove();
|
226
|
+
}
|
227
|
+
clearInterval(dependencies_met_page_ready);
|
228
|
+
} // END if getState 'finished'
|
229
|
+
}, 25);
|
230
|
+
|
231
|
+
{% when "disqus" %}
|
232
|
+
// [INFO ] [j1.adapter.comments ] [ place provider: Disqus ]
|
233
|
+
var dependencies_met_page_ready = setInterval(function() {
|
234
|
+
if (j1.getState() == 'finished') {
|
235
|
+
|
236
|
+
// initialize state flag, issue init message
|
237
|
+
// -------------------------------------------------------------------
|
238
|
+
_this.setState('started');
|
239
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
240
|
+
logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
|
241
|
+
|
242
|
+
// place|remove initialization code
|
243
|
+
// -------------------------------------------------------------------
|
244
|
+
user_consent = j1.readCookie(cookie_names.user_consent);
|
245
|
+
if (user_consent.personalization) {
|
246
|
+
$('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
|
247
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
248
|
+
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on siteID: ' + siteID);
|
249
|
+
|
250
|
+
// old Disqus Web API init
|
251
|
+
// -----------------------------------------------------------------
|
252
|
+
// var disqus_shortname = '{{site_id}}';
|
253
|
+
// // -----------------------------------------------------------------
|
254
|
+
// // RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE
|
255
|
+
// // SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
|
256
|
+
// // LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT:
|
257
|
+
// // https://disqus.com/admin/universalcode/#configuration-variables
|
258
|
+
// // -----------------------------------------------------------------
|
259
|
+
// //
|
260
|
+
// // var disqus_config = function () {
|
261
|
+
// // this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
|
262
|
+
// // Replace PAGE_IDENTIFIER with your page's unique
|
263
|
+
// // identifier variable
|
264
|
+
// // this.page.identifier = PAGE_IDENTIFIER;
|
265
|
+
// // };
|
266
|
+
// //
|
267
|
+
// // DON'T EDIT BELOW THIS LINE
|
268
|
+
// // -----------------------------------------------------------------
|
269
|
+
// (function() {
|
270
|
+
// var d = document,
|
271
|
+
// s = d.createElement('script');
|
272
|
+
// s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
273
|
+
// s.setAttribute('data-timestamp', +new Date());
|
274
|
+
// (d.head || d.body).appendChild(s);
|
275
|
+
// })();
|
276
|
+
|
277
|
+
// add|initialize Disqus Web API
|
278
|
+
// -----------------------------------------------------------------
|
279
|
+
var d = new Date();
|
280
|
+
var currDate = d.toString().slice(0, 33); // extract the data part
|
281
|
+
|
282
|
+
dqApiScript.id = 'dq-web-api';
|
283
|
+
dqApiScript.src = '//' + siteID + '.disqus.com/embed.js";'
|
284
|
+
dqApiScript.setAttribute("data-timestamp", '"' + currDate + '"');
|
285
|
+
document.head.appendChild(dqApiScript);
|
286
|
+
|
287
|
+
// add Disqus comment container
|
288
|
+
// -----------------------------------------------------------------
|
289
|
+
$('#main-content').append('<div id="disqus_thread"></div>');
|
290
|
+
} else {
|
291
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
292
|
+
logger.warn('\n' + 'disable comments provider' + ' {{comments_provider}} on siteID: ' + siteID);
|
293
|
+
$('#leave-a-comment').remove();
|
294
|
+
$('#dq-web-api').remove();
|
295
|
+
$('#hdisqus_thread').remove();
|
296
|
+
}
|
297
|
+
|
298
|
+
// add recommended title to the comments iframe for SEO optimization
|
299
|
+
// -------------------------------------------------------------------
|
300
|
+
// var dependencies_met_load_provider_finished = setInterval (function () {
|
301
|
+
// if ($('#disqus_thread').children().length) {
|
302
|
+
// $('#hyvor-talk-iframe').prop('title', 'Disqus comments iframe');
|
303
|
+
// clearInterval(dependencies_met_load_provider_finished);
|
304
|
+
// }
|
305
|
+
// }, 25);
|
306
|
+
|
307
|
+
clearInterval(dependencies_met_page_ready);
|
308
|
+
} // END if getState 'finished'
|
309
|
+
}, 25);
|
310
|
+
|
311
|
+
{% endcase %}
|
312
|
+
// [INFO ] [j1.adapter.comments ] [ end processing ]
|
313
|
+
{% else %}
|
314
|
+
var dependencies_met_page_ready = setInterval(function() {
|
315
|
+
if (j1.getState() == 'finished') {
|
316
|
+
logger = log4javascript.getLogger('j1.adapter.comments');
|
317
|
+
logger.warn('\n' + 'provider or site ID for comment services wrong or not set');
|
318
|
+
clearInterval(dependencies_met_page_ready);
|
319
|
+
}
|
320
|
+
}, 25);
|
321
|
+
{% endif %}
|
322
|
+
|
323
|
+
{% else %}
|
324
|
+
var dependencies_met_page_ready = setInterval(function() {
|
325
|
+
if (j1.getState() == 'finished') {
|
326
|
+
logger = log4javascript.getLogger('j1.adapter.comments');
|
327
|
+
logger.info('\n' + 'comment services: disabled');
|
328
|
+
clearInterval(dependencies_met_page_ready);
|
329
|
+
}
|
330
|
+
}, 25);
|
331
|
+
{% endif %}
|
332
|
+
return;
|
333
|
+
}, // END init
|
334
|
+
|
335
|
+
// -------------------------------------------------------------------------
|
336
|
+
// messageHandler()
|
337
|
+
// manage messages send from other J1 modules
|
338
|
+
// -------------------------------------------------------------------------
|
339
|
+
messageHandler: function (sender, message) {
|
340
|
+
var json_message = JSON.stringify(message, undefined, 2);
|
341
|
+
|
342
|
+
logText = '\n' + 'received message from ' + sender + ': ' + json_message;
|
343
|
+
logger.debug(logText);
|
344
|
+
|
345
|
+
// -----------------------------------------------------------------------
|
346
|
+
// Process commands|actions
|
347
|
+
// -----------------------------------------------------------------------
|
348
|
+
if (message.type === 'command' && message.action === 'module_initialized') {
|
349
|
+
//
|
350
|
+
// Place handling of command|action here
|
351
|
+
//
|
352
|
+
logger.info('\n' + message.text);
|
353
|
+
}
|
354
|
+
|
355
|
+
//
|
356
|
+
// Place handling of other command|action here
|
357
|
+
//
|
358
|
+
|
359
|
+
return true;
|
360
|
+
}, // END messageHandler
|
361
|
+
|
362
|
+
// -------------------------------------------------------------------------
|
363
|
+
// setState()
|
364
|
+
// Sets the current (processing) state of the module
|
365
|
+
// -------------------------------------------------------------------------
|
366
|
+
setState: function (stat) {
|
367
|
+
_this.state = stat;
|
368
|
+
}, // END setState
|
369
|
+
|
370
|
+
// -------------------------------------------------------------------------
|
371
|
+
// getState()
|
372
|
+
// Returns the current (processing) state of the module
|
373
|
+
// -------------------------------------------------------------------------
|
374
|
+
getState: function () {
|
375
|
+
return _this.state;
|
376
|
+
} // END getState
|
377
|
+
|
378
|
+
}; // END return
|
379
|
+
})(j1, window);
|
380
|
+
|
381
|
+
{% endcapture %}
|
382
|
+
{% if production %}
|
383
|
+
{{ cache | minifyJS }}
|
384
|
+
{% else %}
|
385
|
+
{{ cache | strip_empty_lines }}
|
386
|
+
{% endif %}
|
387
|
+
{% assign cache = nil %}
|
@@ -78,10 +78,7 @@ regenerate: true
|
|
78
78
|
/* eslint quotes: "off" */
|
79
79
|
// -----------------------------------------------------------------------------
|
80
80
|
'use strict';
|
81
|
-
|
82
|
-
{% comment %} Main
|
83
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
84
|
-
j1.adapter['cookieConsent'] = (function (j1, window) {
|
81
|
+
j1.adapter.cookieConsent = (function (j1, window) {
|
85
82
|
|
86
83
|
var environment = '{{environment}}';
|
87
84
|
var tracking_enabled = ('{{tracking_enabled}}' === 'true') ? true: false;
|
@@ -259,8 +256,8 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
259
256
|
|
260
257
|
// -------------------------------------------------------------------------
|
261
258
|
// cbCookie()
|
262
|
-
// Called by CookieConsent module after the user has
|
263
|
-
// made his selection
|
259
|
+
// Called (callback) by CookieConsent module after the user has
|
260
|
+
// made his selection
|
264
261
|
// -------------------------------------------------------------------------
|
265
262
|
cbCookie: function () {
|
266
263
|
var gaCookies = j1.findCookie('_ga');
|
@@ -297,24 +294,30 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
297
294
|
// Manage Google Analytics OptIn/Out
|
298
295
|
// See: https://github.com/luciomartinez/gtag-opt-in/wiki
|
299
296
|
if (tracking_enabled && tracking_id_valid) {
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
}
|
315
|
-
|
316
|
-
//
|
317
|
-
//
|
297
|
+
// jadams, 2021-12-20: GA OptIn|Out handling moved to (new)
|
298
|
+
// analytics adapter (adapter/js/analytics.js)
|
299
|
+
// ---------------------------------------------------------------------
|
300
|
+
// GTagOptIn.register(tracking_id);
|
301
|
+
// if (user_consent.analysis) {
|
302
|
+
// logger.info('\n' + 'enable: GA');
|
303
|
+
// GTagOptIn.optIn();
|
304
|
+
// } else {
|
305
|
+
// logger.warn('\n' + 'disable: GA');
|
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 cookie life-time. If cookie settings allows only
|
317
|
+
// "required" cookies, all "persistent" cookies (Comments|Ads|Translation)
|
318
|
+
// get expired to "session" for better GDPR compliance. The GDPR
|
319
|
+
// regulations|privacy does NOT require any consent on using cookies
|
320
|
+
// for session-only cookies.
|
318
321
|
//
|
319
322
|
if (!user_consent.analysis || !user_consent.personalization) {
|
320
323
|
|
@@ -331,6 +334,7 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
331
334
|
});
|
332
335
|
|
333
336
|
// expire permanent cookies to session
|
337
|
+
// -------------------------------------------------------------------
|
334
338
|
j1.expireCookie({ name: cookie_names.user_state });
|
335
339
|
j1.expireCookie({ name: cookie_names.user_consent });
|
336
340
|
j1.expireCookie({ name: cookie_names.user_translate });
|
@@ -341,7 +345,7 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
341
345
|
}
|
342
346
|
} else {
|
343
347
|
// jadams, 2021-08-10: remove cookies on invalid GA config or left
|
344
|
-
// cookies from previous session if they exists
|
348
|
+
// cookies from previous session/page view if they exists
|
345
349
|
// ---------------------------------------------------------------------
|
346
350
|
gaCookies.forEach(function (item) {
|
347
351
|
// Skip cookies from Google Ads
|
@@ -352,8 +356,11 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
352
356
|
}
|
353
357
|
});
|
354
358
|
|
355
|
-
// Managing
|
356
|
-
// (Comments|Ads|Translation)
|
359
|
+
// Managing cookie life-time. If cookie settings allows only
|
360
|
+
// "required" cookies, all "persistent" cookies (Comments|Ads|Translation)
|
361
|
+
// get expired to "session" for better GDPR compliance. The GDPR
|
362
|
+
// regulations|privacy does NOT require any consent on using cookies
|
363
|
+
// for session-only cookies.
|
357
364
|
//
|
358
365
|
if (!user_consent.analysis || !user_consent.personalization) {
|
359
366
|
// overload cookie consent settings
|
@@ -369,6 +376,7 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
369
376
|
});
|
370
377
|
|
371
378
|
// expire permanent cookies to session
|
379
|
+
// -------------------------------------------------------------------
|
372
380
|
j1.expireCookie({ name: cookie_names.user_state });
|
373
381
|
j1.expireCookie({ name: cookie_names.user_consent });
|
374
382
|
j1.expireCookie({ name: cookie_names.user_translate });
|
@@ -78,8 +78,8 @@ 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
|
// globals
|
85
85
|
// ---------------------------------------------------------------------------
|
@@ -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 %}
|