j1-template 2024.2.0 → 2024.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/data/gemini-ui.html +2 -2
- data/assets/themes/j1/adapter/js/advertising.js +2 -10
- data/assets/themes/j1/adapter/js/analytics.js +1 -5
- data/assets/themes/j1/adapter/js/bmd.js +195 -195
- data/assets/themes/j1/adapter/js/carousel.js +786 -786
- data/assets/themes/j1/adapter/js/clipboard.js +1 -0
- data/assets/themes/j1/adapter/js/comments.js +1 -0
- data/assets/themes/j1/adapter/js/cookieConsent.js +460 -466
- data/assets/themes/j1/adapter/js/customModule.js +5 -4
- data/assets/themes/j1/adapter/js/docsearch.js +1 -0
- data/assets/themes/j1/adapter/js/dropdowns.js +1 -0
- data/assets/themes/j1/adapter/js/fab.js +1 -0
- data/assets/themes/j1/adapter/js/gallery.js +495 -494
- data/assets/themes/j1/adapter/js/gemini.js +154 -128
- data/assets/themes/j1/adapter/js/iconPicker.js +257 -255
- data/assets/themes/j1/adapter/js/iconPickerPage.js +279 -279
- data/assets/themes/j1/adapter/js/iframer.js +3 -2
- data/assets/themes/j1/adapter/js/j1.js +3285 -3285
- data/assets/themes/j1/adapter/js/lazyLoader.js +241 -241
- data/assets/themes/j1/adapter/js/lightbox.js +242 -241
- data/assets/themes/j1/adapter/js/logger.js +1 -0
- data/assets/themes/j1/adapter/js/lunr.js +6 -10
- data/assets/themes/j1/adapter/js/masonry.js +427 -426
- data/assets/themes/j1/adapter/js/masterslider.js +526 -526
- data/assets/themes/j1/adapter/js/mmenu.js +1 -0
- data/assets/themes/j1/adapter/js/navigator.js +2 -2
- data/assets/themes/j1/adapter/js/particles.js +1 -0
- data/assets/themes/j1/adapter/js/rangeSlider.js +1 -0
- data/assets/themes/j1/adapter/js/rouge.js +288 -287
- data/assets/themes/j1/adapter/js/rtable.js +309 -309
- data/assets/themes/j1/adapter/js/slick.js +487 -487
- data/assets/themes/j1/adapter/js/slimSelect.js +3 -5
- data/assets/themes/j1/adapter/js/themeToggler.js +281 -280
- data/assets/themes/j1/adapter/js/themes.js +0 -1
- data/assets/themes/j1/adapter/js/toccer.js +1 -0
- data/assets/themes/j1/adapter/js/translator.js +1 -0
- data/assets/themes/j1/adapter/js/waves.js +1 -0
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +23 -17
- data/assets/themes/j1/modules/js-cookies/js/js.cookie.js +147 -0
- data/assets/themes/j1/modules/js-cookies/js/js.cookie.min.js +2 -0
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/themes.yml +171 -171
- data/lib/starter_web/_data/resources.yml +26 -0
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +500 -500
- metadata +4 -2
@@ -1,494 +1,495 @@
|
|
1
|
-
---
|
2
|
-
regenerate: true
|
3
|
-
---
|
4
|
-
|
5
|
-
{% capture cache %}
|
6
|
-
|
7
|
-
{% comment %}
|
8
|
-
# -----------------------------------------------------------------------------
|
9
|
-
# ~/assets/themes/j1/adapter/js/gallery.js
|
10
|
-
# Liquid template to create the J1 Adapter for J1 Gallery
|
11
|
-
#
|
12
|
-
# Product/Info:
|
13
|
-
# https://jekyll.one
|
14
|
-
#
|
15
|
-
# Copyright (C) 2023, 2024 Juergen Adams
|
16
|
-
#
|
17
|
-
# J1 Template is licensed under the MIT License.
|
18
|
-
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
19
|
-
# -----------------------------------------------------------------------------
|
20
|
-
{% endcomment %}
|
21
|
-
|
22
|
-
{% comment %} Liquid procedures
|
23
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
24
|
-
|
25
|
-
{% comment %} Set global settings
|
26
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
27
|
-
{% assign environment = site.environment %}
|
28
|
-
{% assign template_version = site.version %}
|
29
|
-
|
30
|
-
{% comment %} Process YML config data
|
31
|
-
================================================================================ {% endcomment %}
|
32
|
-
|
33
|
-
{% comment %} Set config files
|
34
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
35
|
-
{% assign template_config = site.data.j1_config %}
|
36
|
-
{% assign apps = site.data.apps %}
|
37
|
-
{% assign modules = site.data.modules %}
|
38
|
-
|
39
|
-
{% comment %} Set config data
|
40
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
41
|
-
{% assign gallery_defaults = modules.defaults.gallery.defaults %}
|
42
|
-
{% assign gallery_settings = modules.gallery.settings %}
|
43
|
-
|
44
|
-
{% comment %} Set config options
|
45
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
46
|
-
{% assign gallery_options = gallery_defaults | merge: gallery_settings %}
|
47
|
-
|
48
|
-
{% comment %} Detect prod mode
|
49
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
50
|
-
{% assign production = false %}
|
51
|
-
{% if environment == 'prod' or environment == 'production' %}
|
52
|
-
{% assign production = true %}
|
53
|
-
{% endif %}
|
54
|
-
|
55
|
-
/*
|
56
|
-
# -----------------------------------------------------------------------------
|
57
|
-
# ~/assets/themes/j1/adapter/js/gallery.js
|
58
|
-
# JS Adapter for J1 Gallery
|
59
|
-
#
|
60
|
-
# Product/Info:
|
61
|
-
# https://jekyll.one
|
62
|
-
# https://github.com/miromannino/Justified-Gallery
|
63
|
-
#
|
64
|
-
# Copyright (C) 2020 Miro Mannino
|
65
|
-
# Copyright (C) 2023 Sachin Neravath
|
66
|
-
# Copyright (C) 2023, 2024 Juergen Adams
|
67
|
-
#
|
68
|
-
# J1 Template is licensed under the MIT License.
|
69
|
-
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
70
|
-
# Justified Gallery is licensed under the MIT license
|
71
|
-
# See: https://github.com/miromannino/Justified-Gallery/blob/master/LICENSE
|
72
|
-
# lightGallery is licensed under the GPLv3 license
|
73
|
-
# See: https://github.com/sachinchoolur/lightGallery/blob/master/LICENSE
|
74
|
-
# -----------------------------------------------------------------------------
|
75
|
-
# Adapter generated: {{site.time}}
|
76
|
-
# -----------------------------------------------------------------------------
|
77
|
-
*/
|
78
|
-
|
79
|
-
// -----------------------------------------------------------------------------
|
80
|
-
// ESLint shimming
|
81
|
-
// -----------------------------------------------------------------------------
|
82
|
-
/* eslint indent: "off" */
|
83
|
-
// -----------------------------------------------------------------------------
|
84
|
-
'use strict';
|
85
|
-
j1.adapter.gallery = ((j1, window) => {
|
86
|
-
|
87
|
-
{% comment %} Global variables
|
88
|
-
------------------------------------------------------------------------------ {% endcomment %}
|
89
|
-
var environment = '{{environment}}';
|
90
|
-
var state = 'not_started';
|
91
|
-
var play_button = '/assets/themes/j1/modules/lightGallery/css/themes/uno/icons/play-button.png';
|
92
|
-
|
93
|
-
var
|
94
|
-
var
|
95
|
-
var
|
96
|
-
var
|
97
|
-
var
|
98
|
-
|
99
|
-
|
100
|
-
var
|
101
|
-
var
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
var
|
106
|
-
var
|
107
|
-
var
|
108
|
-
var
|
109
|
-
|
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
|
-
var
|
163
|
-
var
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
logger.
|
172
|
-
|
173
|
-
|
174
|
-
_this.
|
175
|
-
|
176
|
-
|
177
|
-
logger.
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
//
|
189
|
-
//
|
190
|
-
|
191
|
-
|
192
|
-
var
|
193
|
-
var
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
{%
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
//
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
{%
|
226
|
-
{
|
227
|
-
{
|
228
|
-
{%
|
229
|
-
{
|
230
|
-
{
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
//
|
239
|
-
|
240
|
-
logger.debug('\n' + 'dyn_loader,
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
{
|
246
|
-
{
|
247
|
-
{
|
248
|
-
|
249
|
-
"
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
{%
|
254
|
-
{%
|
255
|
-
{%
|
256
|
-
{
|
257
|
-
{
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
{%
|
265
|
-
{%
|
266
|
-
{%
|
267
|
-
{
|
268
|
-
{
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
{%
|
277
|
-
{%
|
278
|
-
{%
|
279
|
-
{
|
280
|
-
{
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
{%
|
288
|
-
{%
|
289
|
-
{%
|
290
|
-
{
|
291
|
-
{
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
{%
|
299
|
-
{%
|
300
|
-
{%
|
301
|
-
{
|
302
|
-
{
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
{%
|
310
|
-
{%
|
311
|
-
{%
|
312
|
-
{
|
313
|
-
{
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
//
|
324
|
-
//
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
logger.debug('\n' + 'dyn_loader,
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
{
|
334
|
-
{
|
335
|
-
{
|
336
|
-
|
337
|
-
"
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
{%
|
342
|
-
{%
|
343
|
-
{%
|
344
|
-
{
|
345
|
-
{
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
{%
|
353
|
-
{%
|
354
|
-
{%
|
355
|
-
{
|
356
|
-
{
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
{%
|
365
|
-
{%
|
366
|
-
{%
|
367
|
-
{
|
368
|
-
{
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
{%
|
376
|
-
{%
|
377
|
-
{%
|
378
|
-
{
|
379
|
-
{
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
{%
|
387
|
-
{%
|
388
|
-
{%
|
389
|
-
{
|
390
|
-
{
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
//
|
408
|
-
//
|
409
|
-
//
|
410
|
-
//
|
411
|
-
//
|
412
|
-
|
413
|
-
|
414
|
-
var
|
415
|
-
var
|
416
|
-
var
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
//
|
442
|
-
//
|
443
|
-
//
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
//
|
452
|
-
//
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
//
|
457
|
-
//
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
//
|
464
|
-
//
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
//
|
471
|
-
//
|
472
|
-
//
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
//
|
479
|
-
//
|
480
|
-
//
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
}
|
487
|
-
|
488
|
-
|
489
|
-
{%
|
490
|
-
|
491
|
-
{
|
492
|
-
|
493
|
-
{
|
494
|
-
{%
|
1
|
+
---
|
2
|
+
regenerate: true
|
3
|
+
---
|
4
|
+
|
5
|
+
{% capture cache %}
|
6
|
+
|
7
|
+
{% comment %}
|
8
|
+
# -----------------------------------------------------------------------------
|
9
|
+
# ~/assets/themes/j1/adapter/js/gallery.js
|
10
|
+
# Liquid template to create the J1 Adapter for J1 Gallery
|
11
|
+
#
|
12
|
+
# Product/Info:
|
13
|
+
# https://jekyll.one
|
14
|
+
#
|
15
|
+
# Copyright (C) 2023, 2024 Juergen Adams
|
16
|
+
#
|
17
|
+
# J1 Template is licensed under the MIT License.
|
18
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
19
|
+
# -----------------------------------------------------------------------------
|
20
|
+
{% endcomment %}
|
21
|
+
|
22
|
+
{% comment %} Liquid procedures
|
23
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
24
|
+
|
25
|
+
{% comment %} Set global settings
|
26
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
27
|
+
{% assign environment = site.environment %}
|
28
|
+
{% assign template_version = site.version %}
|
29
|
+
|
30
|
+
{% comment %} Process YML config data
|
31
|
+
================================================================================ {% endcomment %}
|
32
|
+
|
33
|
+
{% comment %} Set config files
|
34
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
35
|
+
{% assign template_config = site.data.j1_config %}
|
36
|
+
{% assign apps = site.data.apps %}
|
37
|
+
{% assign modules = site.data.modules %}
|
38
|
+
|
39
|
+
{% comment %} Set config data
|
40
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
41
|
+
{% assign gallery_defaults = modules.defaults.gallery.defaults %}
|
42
|
+
{% assign gallery_settings = modules.gallery.settings %}
|
43
|
+
|
44
|
+
{% comment %} Set config options
|
45
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
46
|
+
{% assign gallery_options = gallery_defaults | merge: gallery_settings %}
|
47
|
+
|
48
|
+
{% comment %} Detect prod mode
|
49
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
50
|
+
{% assign production = false %}
|
51
|
+
{% if environment == 'prod' or environment == 'production' %}
|
52
|
+
{% assign production = true %}
|
53
|
+
{% endif %}
|
54
|
+
|
55
|
+
/*
|
56
|
+
# -----------------------------------------------------------------------------
|
57
|
+
# ~/assets/themes/j1/adapter/js/gallery.js
|
58
|
+
# JS Adapter for J1 Gallery
|
59
|
+
#
|
60
|
+
# Product/Info:
|
61
|
+
# https://jekyll.one
|
62
|
+
# https://github.com/miromannino/Justified-Gallery
|
63
|
+
#
|
64
|
+
# Copyright (C) 2020 Miro Mannino
|
65
|
+
# Copyright (C) 2023 Sachin Neravath
|
66
|
+
# Copyright (C) 2023, 2024 Juergen Adams
|
67
|
+
#
|
68
|
+
# J1 Template is licensed under the MIT License.
|
69
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
70
|
+
# Justified Gallery is licensed under the MIT license
|
71
|
+
# See: https://github.com/miromannino/Justified-Gallery/blob/master/LICENSE
|
72
|
+
# lightGallery is licensed under the GPLv3 license
|
73
|
+
# See: https://github.com/sachinchoolur/lightGallery/blob/master/LICENSE
|
74
|
+
# -----------------------------------------------------------------------------
|
75
|
+
# Adapter generated: {{site.time}}
|
76
|
+
# -----------------------------------------------------------------------------
|
77
|
+
*/
|
78
|
+
|
79
|
+
// -----------------------------------------------------------------------------
|
80
|
+
// ESLint shimming
|
81
|
+
// -----------------------------------------------------------------------------
|
82
|
+
/* eslint indent: "off" */
|
83
|
+
// -----------------------------------------------------------------------------
|
84
|
+
'use strict';
|
85
|
+
j1.adapter.gallery = ((j1, window) => {
|
86
|
+
|
87
|
+
{% comment %} Global variables
|
88
|
+
------------------------------------------------------------------------------ {% endcomment %}
|
89
|
+
var environment = '{{environment}}';
|
90
|
+
var state = 'not_started';
|
91
|
+
var play_button = '/assets/themes/j1/modules/lightGallery/css/themes/uno/icons/play-button.png';
|
92
|
+
|
93
|
+
var url;
|
94
|
+
var origin;
|
95
|
+
var galleryDefaults;
|
96
|
+
var gallerySettings;
|
97
|
+
var galleryOptions;
|
98
|
+
var frontmatterOptions;
|
99
|
+
|
100
|
+
var _this;
|
101
|
+
var logger;
|
102
|
+
var logText;
|
103
|
+
|
104
|
+
// date|time
|
105
|
+
var startTime;
|
106
|
+
var endTime;
|
107
|
+
var startTimeModule;
|
108
|
+
var endTimeModule;
|
109
|
+
var timeSeconds;
|
110
|
+
|
111
|
+
// ---------------------------------------------------------------------------
|
112
|
+
// helper functions
|
113
|
+
// ---------------------------------------------------------------------------
|
114
|
+
|
115
|
+
// ---------------------------------------------------------------------------
|
116
|
+
// main
|
117
|
+
// ---------------------------------------------------------------------------
|
118
|
+
return {
|
119
|
+
|
120
|
+
// -------------------------------------------------------------------------
|
121
|
+
// adapter initializer
|
122
|
+
// -------------------------------------------------------------------------
|
123
|
+
init: (options) => {
|
124
|
+
url = new URL(window.location.href);
|
125
|
+
origin = url.origin;
|
126
|
+
|
127
|
+
// flag used for Chromium browser workaround
|
128
|
+
j1['jg'] = {
|
129
|
+
callback: {},
|
130
|
+
};
|
131
|
+
|
132
|
+
// -----------------------------------------------------------------------
|
133
|
+
// default module settings
|
134
|
+
// -----------------------------------------------------------------------
|
135
|
+
var settings = $.extend({
|
136
|
+
module_name: 'j1.adapter.gallery',
|
137
|
+
generated: '{{site.time}}'
|
138
|
+
}, options);
|
139
|
+
|
140
|
+
// -----------------------------------------------------------------------
|
141
|
+
// global variable settings
|
142
|
+
// -----------------------------------------------------------------------
|
143
|
+
_this = j1.adapter.gallery;
|
144
|
+
logger = log4javascript.getLogger('j1.adapter.gallery');
|
145
|
+
|
146
|
+
// create settings object from frontmatter (page settings)
|
147
|
+
frontmatterOptions = options != null ? $.extend({}, options) : {};
|
148
|
+
|
149
|
+
// Load module DEFAULTS|CONFIG
|
150
|
+
galleryDefaults = $.extend({}, {{gallery_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
|
151
|
+
gallerySettings = $.extend({}, {{gallery_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
|
152
|
+
galleryOptions = $.extend(true, {}, galleryDefaults, gallerySettings, frontmatterOptions);
|
153
|
+
|
154
|
+
// load HTML portion for all grids
|
155
|
+
console.debug('loading HTML portion for all galleries configured');
|
156
|
+
_this.loadGalleryHTML(galleryOptions, galleryOptions.galleries);
|
157
|
+
|
158
|
+
// -----------------------------------------------------------------------
|
159
|
+
// module initializer
|
160
|
+
// -----------------------------------------------------------------------
|
161
|
+
var dependency_met_page_ready = setInterval (() => {
|
162
|
+
var pageState = $('#content').css("display");
|
163
|
+
var pageVisible = (pageState === 'block') ? true : false;
|
164
|
+
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
165
|
+
|
166
|
+
if (j1CoreFinished && pageVisible) {
|
167
|
+
startTimeModule = Date.now();
|
168
|
+
|
169
|
+
// initialize state flag
|
170
|
+
_this.setState('started');
|
171
|
+
logger.debug('\n' + 'state: ' + _this.getState());
|
172
|
+
logger.info('\n' + 'module is being initialized');
|
173
|
+
|
174
|
+
_this.initialize(galleryOptions);
|
175
|
+
_this.setState('finished');
|
176
|
+
|
177
|
+
logger.debug('\n' + 'state: ' + _this.getState());
|
178
|
+
logger.info('\n' + 'module initialized successfully');
|
179
|
+
|
180
|
+
endTimeModule = Date.now();
|
181
|
+
logger.info('\n' + 'module initializing time: ' + (endTimeModule-startTimeModule) + 'ms');
|
182
|
+
|
183
|
+
clearInterval(dependency_met_page_ready);
|
184
|
+
} // END 'finished' && 'pageVisible'
|
185
|
+
}, 10); // END dependency_met_page_ready
|
186
|
+
}, // END init
|
187
|
+
|
188
|
+
// -----------------------------------------------------------------------
|
189
|
+
// Load AJAX data and initialize the jg gallery
|
190
|
+
// -----------------------------------------------------------------------
|
191
|
+
initialize: (options) => {
|
192
|
+
var xhrLoadState = 'pending'; // (initial) load state for the HTML portion of the slider
|
193
|
+
var load_dependencies = {};
|
194
|
+
var dependency;
|
195
|
+
|
196
|
+
logger = log4javascript.getLogger('j1.adapter.gallery');
|
197
|
+
|
198
|
+
_this.setState('running');
|
199
|
+
logger.debug('\n' + 'state: ' + _this.getState());
|
200
|
+
|
201
|
+
{% for gallery in gallery_options.galleries %}
|
202
|
+
|
203
|
+
{% if gallery.enabled %}
|
204
|
+
{% assign gallery_id = gallery.id %}
|
205
|
+
logger.info('\n' + 'found gallery on id: ' + '{{gallery_id}}');
|
206
|
+
|
207
|
+
// create dynamic loader variable to setup the grid on id {{gallery_id}}
|
208
|
+
dependency = 'dependencies_met_html_loaded_{{gallery_id}}';
|
209
|
+
load_dependencies[dependency] = '';
|
210
|
+
|
211
|
+
// initialize the gallery if HTML portion successfully loaded
|
212
|
+
//
|
213
|
+
load_dependencies['dependencies_met_html_loaded_{{gallery_id}}'] = setInterval (() => {
|
214
|
+
// check if HTML portion of the gallery is loaded successfully
|
215
|
+
xhrLoadState = j1.xhrDOMState['#{{gallery_id}}_parent'];
|
216
|
+
if (xhrLoadState === 'success') {
|
217
|
+
var $grid_{{gallery_id}} = $('#{{gallery_id}}'); // used for later access
|
218
|
+
|
219
|
+
logger.debug('\n' + 'dyn_loader, initialize gallery on id: ' + '{{gallery_id}}');
|
220
|
+
|
221
|
+
j1.jg.callback.{{gallery_id}} = 'waiting';
|
222
|
+
|
223
|
+
/* eslint-disable */
|
224
|
+
$('#{{gallery_id}}').justifiedGallery({
|
225
|
+
{% for option in gallery.gallery_options %}
|
226
|
+
{% if option[0] contains "gutters" %}
|
227
|
+
{{'margins' | json}}: {{option[1] | json}},
|
228
|
+
{% continue %}
|
229
|
+
{% endif %}
|
230
|
+
{{option[0] | json}}: {{option[1] | json}},
|
231
|
+
{% endfor %}
|
232
|
+
})
|
233
|
+
.on('jg.complete', (evt) => {
|
234
|
+
evt.stopPropagation();
|
235
|
+
|
236
|
+
j1.jg.callback.{{gallery_id}} = 'successful';
|
237
|
+
|
238
|
+
// setup the lightbox
|
239
|
+
//
|
240
|
+
logger.debug('\n' + 'dyn_loader, callback "jg.complete" entered on id: ' + '{{gallery_id}}');
|
241
|
+
logger.debug('\n' + 'dyn_loader, initialize lightGallery on id: ' + '{{gallery_id}}');
|
242
|
+
|
243
|
+
var lg = document.getElementById("{{gallery_id}}");
|
244
|
+
lightGallery(lg, {
|
245
|
+
"plugins": [{{gallery.lightGallery.plugins}}],
|
246
|
+
{% for option in gallery.lightGallery.options %}
|
247
|
+
{{option[0] | json}}: {{option[1] | json}},
|
248
|
+
{% endfor %}
|
249
|
+
"galleryId": "{{gallery_id}}",
|
250
|
+
"selector": ".lg-item",
|
251
|
+
{% if gallery.video == 'html5' and gallery.lightGallery.videojsOptions.enabled %}
|
252
|
+
"videojsOptions": {
|
253
|
+
{% for option in gallery.lightGallery.videojsOptions %}
|
254
|
+
{% if option[0] contains "enabled" %}
|
255
|
+
{% continue %}
|
256
|
+
{% endif %}
|
257
|
+
{{option[0] | json}}: {{option[1] | json}},
|
258
|
+
{% endfor %}
|
259
|
+
}
|
260
|
+
{% endif %}
|
261
|
+
|
262
|
+
{% if gallery.video == 'youtube' and gallery.lightGallery.playerParams.enabled %}
|
263
|
+
"youTubePlayerParams": {
|
264
|
+
{% for option in gallery.lightGallery.playerParams %}
|
265
|
+
{% if option[0] contains "enabled" %}
|
266
|
+
{% continue %}
|
267
|
+
{% endif %}
|
268
|
+
{{option[0] | json}}: {{option[1] | json}},
|
269
|
+
{% endfor %}
|
270
|
+
"origin": "origin"
|
271
|
+
}
|
272
|
+
{% endif %}
|
273
|
+
|
274
|
+
{% if gallery.video == 'vimeo' and gallery.lightGallery.playerParams.enabled %}
|
275
|
+
"vimeoPlayerParams": {
|
276
|
+
{% for option in gallery.lightGallery.playerParams %}
|
277
|
+
{% if option[0] contains "enabled" %}
|
278
|
+
{% continue %}
|
279
|
+
{% endif %}
|
280
|
+
{{option[0] | json}}: {{option[1] | json}},
|
281
|
+
{% endfor %}
|
282
|
+
}
|
283
|
+
{% endif %}
|
284
|
+
|
285
|
+
{% if gallery.video == 'dailymotion' and gallery.lightGallery.playerParams.enabled %}
|
286
|
+
"dailymotionPlayerParams": {
|
287
|
+
{% for option in gallery.lightGallery.playerParams %}
|
288
|
+
{% if option[0] contains "enabled" %}
|
289
|
+
{% continue %}
|
290
|
+
{% endif %}
|
291
|
+
{{option[0] | json}}: {{option[1] | json}},
|
292
|
+
{% endfor %}
|
293
|
+
}
|
294
|
+
{% endif %}
|
295
|
+
|
296
|
+
{% if gallery.video == 'wistia' and gallery.lightGallery.playerParams.enabled %}
|
297
|
+
"wistiaPlayerParams": {
|
298
|
+
{% for option in gallery.lightGallery.playerParams %}
|
299
|
+
{% if option[0] contains "enabled" %}
|
300
|
+
{% continue %}
|
301
|
+
{% endif %}
|
302
|
+
{{option[0] | json}}: {{option[1] | json}},
|
303
|
+
{% endfor %}
|
304
|
+
}
|
305
|
+
{% endif %}
|
306
|
+
|
307
|
+
{% if gallery.video == 'tiktok' and gallery.lightGallery.playerParams.enabled %}
|
308
|
+
"tiktokPlayerParams": {
|
309
|
+
{% for option in gallery.lightGallery.playerParams %}
|
310
|
+
{% if option[0] contains "enabled" %}
|
311
|
+
{% continue %}
|
312
|
+
{% endif %}
|
313
|
+
{{option[0] | json}}: {{option[1] | json}},
|
314
|
+
{% endfor %}
|
315
|
+
}
|
316
|
+
{% endif %}
|
317
|
+
|
318
|
+
}); // END lightGallery
|
319
|
+
|
320
|
+
}); // END justifiedGallery on('jg.complete)
|
321
|
+
/* eslint-enable */
|
322
|
+
|
323
|
+
// workaround for Chromium brwosers if callback jg.complete
|
324
|
+
// NOT fired
|
325
|
+
//
|
326
|
+
setTimeout(() => {
|
327
|
+
if (j1.jg.callback.{{gallery_id}} == 'waiting') {
|
328
|
+
logger.debug('\n' + 'dyn_loader, callback "jg.callback": ' + j1.jg.callback.{{gallery_id}})
|
329
|
+
logger.debug('\n' + 'dyn_loader, initialize lightGallery on id: ' + '{{gallery_id}}');
|
330
|
+
|
331
|
+
var lg = document.getElementById("{{gallery_id}}");
|
332
|
+
lightGallery(lg, {
|
333
|
+
"plugins": [{{gallery.lightGallery.plugins}}],
|
334
|
+
{% for option in gallery.lightGallery.options %}
|
335
|
+
{{option[0] | json}}: {{option[1] | json}},
|
336
|
+
{% endfor %}
|
337
|
+
"galleryId": "{{gallery_id}}",
|
338
|
+
"selector": ".lg-item",
|
339
|
+
{% if gallery.video == 'html5' and gallery.lightGallery.videojsOptions.enabled %}
|
340
|
+
"videojsOptions": {
|
341
|
+
{% for option in gallery.lightGallery.videojsOptions %}
|
342
|
+
{% if option[0] contains "enabled" %}
|
343
|
+
{% continue %}
|
344
|
+
{% endif %}
|
345
|
+
{{option[0] | json}}: {{option[1] | json}},
|
346
|
+
{% endfor %}
|
347
|
+
}
|
348
|
+
{% endif %}
|
349
|
+
|
350
|
+
{% if gallery.video == 'youtube' and gallery.lightGallery.playerParams.enabled %}
|
351
|
+
"youTubePlayerParams": {
|
352
|
+
{% for option in gallery.lightGallery.playerParams %}
|
353
|
+
{% if option[0] contains "enabled" %}
|
354
|
+
{% continue %}
|
355
|
+
{% endif %}
|
356
|
+
{{option[0] | json}}: {{option[1] | json}},
|
357
|
+
{% endfor %}
|
358
|
+
"origin": "origin"
|
359
|
+
}
|
360
|
+
{% endif %}
|
361
|
+
|
362
|
+
{% if gallery.video == 'vimeo' and gallery.lightGallery.playerParams.enabled %}
|
363
|
+
"vimeoPlayerParams": {
|
364
|
+
{% for option in gallery.lightGallery.playerParams %}
|
365
|
+
{% if option[0] contains "enabled" %}
|
366
|
+
{% continue %}
|
367
|
+
{% endif %}
|
368
|
+
{{option[0] | json}}: {{option[1] | json}},
|
369
|
+
{% endfor %}
|
370
|
+
}
|
371
|
+
{% endif %}
|
372
|
+
|
373
|
+
{% if gallery.video == 'dailymotion' and gallery.lightGallery.playerParams.enabled %}
|
374
|
+
"dailymotionPlayerParams": {
|
375
|
+
{% for option in gallery.lightGallery.playerParams %}
|
376
|
+
{% if option[0] contains "enabled" %}
|
377
|
+
{% continue %}
|
378
|
+
{% endif %}
|
379
|
+
{{option[0] | json}}: {{option[1] | json}},
|
380
|
+
{% endfor %}
|
381
|
+
}
|
382
|
+
{% endif %}
|
383
|
+
|
384
|
+
{% if gallery.video == 'wistia' and gallery.lightGallery.playerParams.enabled %}
|
385
|
+
"wistiaPlayerParams": {
|
386
|
+
{% for option in gallery.lightGallery.playerParams %}
|
387
|
+
{% if option[0] contains "enabled" %}
|
388
|
+
{% continue %}
|
389
|
+
{% endif %}
|
390
|
+
{{option[0] | json}}: {{option[1] | json}},
|
391
|
+
{% endfor %}
|
392
|
+
}
|
393
|
+
{% endif %}
|
394
|
+
|
395
|
+
}); // END lightGallery
|
396
|
+
} // END if j1.jg.callback
|
397
|
+
}, 1000); // END timeout
|
398
|
+
|
399
|
+
clearInterval(load_dependencies['dependencies_met_html_loaded_{{gallery_id}}']);
|
400
|
+
} // END if xhrLoadState === 'success'
|
401
|
+
}, 10); // END dependencies_met_html_loaded
|
402
|
+
|
403
|
+
{% endif %} // ENDIF gallery enabled
|
404
|
+
{% endfor %}
|
405
|
+
}, // END initialize
|
406
|
+
|
407
|
+
// -------------------------------------------------------------------------
|
408
|
+
// loadGalleryHTML()
|
409
|
+
// loads the HTML portion via AJAX for all galleries configured.
|
410
|
+
// NOTE: Make sure the placeholder DIV is available in the content
|
411
|
+
// page as generated using the Asciidoc extension gallery::
|
412
|
+
// -------------------------------------------------------------------------
|
413
|
+
loadGalleryHTML: (options, gallery) => {
|
414
|
+
var numGalleries = Object.keys(gallery).length;
|
415
|
+
var active_grids = numGalleries;
|
416
|
+
var xhr_data_path = options.xhr_data_path + '/index.html';
|
417
|
+
var xhr_container_id;
|
418
|
+
|
419
|
+
console.debug('number of galleries found: ' + active_grids);
|
420
|
+
|
421
|
+
_this.setState('load_data');
|
422
|
+
Object.keys(gallery).forEach((key) => {
|
423
|
+
if (gallery[key].enabled) {
|
424
|
+
xhr_container_id = gallery[key].id + '_parent';
|
425
|
+
|
426
|
+
console.debug('load HTML portion on gallery id: ' + gallery[key].id);
|
427
|
+
j1.loadHTML({
|
428
|
+
xhr_container_id: xhr_container_id,
|
429
|
+
xhr_data_path: xhr_data_path,
|
430
|
+
xhr_data_element: gallery[key].id
|
431
|
+
});
|
432
|
+
} else {
|
433
|
+
console.debug('gallery found disabled on id: ' + gallery[key].id);
|
434
|
+
active_grids--;
|
435
|
+
}
|
436
|
+
});
|
437
|
+
console.debug('galleries loaded in page enabled|all: ' + active_grids + '|' + numGalleries);
|
438
|
+
_this.setState('data_loaded');
|
439
|
+
}, // END loadGalleryHTML
|
440
|
+
|
441
|
+
// -------------------------------------------------------------------------
|
442
|
+
// messageHandler()
|
443
|
+
// manage messages send from other J1 modules
|
444
|
+
// -------------------------------------------------------------------------
|
445
|
+
messageHandler: (sender, message) => {
|
446
|
+
var json_message = JSON.stringify(message, undefined, 2);
|
447
|
+
|
448
|
+
logText = '\n' + 'received message from ' + sender + ': ' + json_message;
|
449
|
+
logger.debug(logText);
|
450
|
+
|
451
|
+
// -----------------------------------------------------------------------
|
452
|
+
// process commands|actions
|
453
|
+
// -----------------------------------------------------------------------
|
454
|
+
if (message.type === 'command' && message.action === 'module_initialized') {
|
455
|
+
|
456
|
+
//
|
457
|
+
// place handling of command|action here
|
458
|
+
//
|
459
|
+
|
460
|
+
logger.info('\n' + message.text);
|
461
|
+
}
|
462
|
+
|
463
|
+
//
|
464
|
+
// place handling of other command|action here
|
465
|
+
//
|
466
|
+
|
467
|
+
return true;
|
468
|
+
}, // END messageHandler
|
469
|
+
|
470
|
+
// -------------------------------------------------------------------------
|
471
|
+
// setState()
|
472
|
+
// sets the current (processing) state of the module
|
473
|
+
// -------------------------------------------------------------------------
|
474
|
+
setState: (stat) => {
|
475
|
+
_this.state = stat;
|
476
|
+
}, // END setState
|
477
|
+
|
478
|
+
// -------------------------------------------------------------------------
|
479
|
+
// getState()
|
480
|
+
// Returns the current (processing) state of the module
|
481
|
+
// -------------------------------------------------------------------------
|
482
|
+
getState: () => {
|
483
|
+
return _this.state;
|
484
|
+
} // END getState
|
485
|
+
|
486
|
+
}; // END main (return)
|
487
|
+
})(j1, window);
|
488
|
+
|
489
|
+
{% endcapture %}
|
490
|
+
{% if production %}
|
491
|
+
{{ cache | minifyJS }}
|
492
|
+
{% else %}
|
493
|
+
{{ cache | strip_empty_lines }}
|
494
|
+
{% endif %}
|
495
|
+
{% assign cache = nil %}
|