j1-template 2024.2.0 → 2024.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,786 +1,786 @@
|
|
1
|
-
---
|
2
|
-
regenerate: true
|
3
|
-
---
|
4
|
-
|
5
|
-
{% capture cache %}
|
6
|
-
|
7
|
-
{% comment %}
|
8
|
-
# -----------------------------------------------------------------------------
|
9
|
-
# ~/assets/themes/j1/adapter/js/carousel.js
|
10
|
-
# Liquid template to adapt J1 Carousel (Owl Carousel V1) Core functions
|
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
|
-
# Test data:
|
21
|
-
# {{config | 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 template_version = site.version %}
|
32
|
-
{% assign slider_id = '' %}
|
33
|
-
|
34
|
-
{% comment %} Process YML config data
|
35
|
-
================================================================================ {% endcomment %}
|
36
|
-
|
37
|
-
{% comment %} Set config files
|
38
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
39
|
-
{% assign template_config = site.data.j1_config %}
|
40
|
-
{% assign apps = site.data.apps %}
|
41
|
-
{% assign modules = site.data.modules %}
|
42
|
-
|
43
|
-
{% comment %} Set config data
|
44
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
45
|
-
|
46
|
-
{% comment %}
|
47
|
-
--------------------------------------------------------------------------------
|
48
|
-
{% assign carousel_defaults = apps.defaults.carousel.defaults %}
|
49
|
-
{% assign carousel_settings = apps.carousel.settings %}
|
50
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
51
|
-
|
52
|
-
{% assign carousel_defaults = modules.defaults.carousel.defaults %}
|
53
|
-
{% assign carousel_settings = modules.carousel.settings %}
|
54
|
-
|
55
|
-
{% comment %} Set config options
|
56
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
57
|
-
{% assign carousel_options = carousel_defaults | merge: carousel_settings %}
|
58
|
-
|
59
|
-
{% comment %} Detect prod mode
|
60
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
61
|
-
{% assign production = false %}
|
62
|
-
{% if environment == 'prod' or environment == 'production' %}
|
63
|
-
{% assign production = true %}
|
64
|
-
{% endif %}
|
65
|
-
|
66
|
-
/*
|
67
|
-
# -----------------------------------------------------------------------------
|
68
|
-
# ~/assets/themes/j1/adapter/js/carousel.js
|
69
|
-
# JS Adapter for J1 Carousel (Owl Carousel V1)
|
70
|
-
#
|
71
|
-
# Product/Info:
|
72
|
-
# https://jekyll.one
|
73
|
-
#
|
74
|
-
# Copyright (C) 2023, 2024 Juergen Adams
|
75
|
-
#
|
76
|
-
# J1 Template is licensed under the MIT License.
|
77
|
-
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
78
|
-
# -----------------------------------------------------------------------------
|
79
|
-
# Adapter generated: {{site.time}}
|
80
|
-
# -----------------------------------------------------------------------------
|
81
|
-
*/
|
82
|
-
|
83
|
-
// -----------------------------------------------------------------------------
|
84
|
-
// ESLint shimming
|
85
|
-
// -----------------------------------------------------------------------------
|
86
|
-
/* eslint indent: "off" */
|
87
|
-
// -----------------------------------------------------------------------------
|
88
|
-
'use strict';
|
89
|
-
j1.adapter.carousel = ((j1, window) => {
|
90
|
-
var environment = '{{environment}}';
|
91
|
-
var dragging = false;
|
92
|
-
var state = 'not_started';
|
93
|
-
var carouselDefaults;
|
94
|
-
var carouselSettings;
|
95
|
-
var carouselOptions;
|
96
|
-
|
97
|
-
var _this;
|
98
|
-
var logger;
|
99
|
-
var logText;
|
100
|
-
|
101
|
-
// date|time
|
102
|
-
var startTime;
|
103
|
-
var endTime;
|
104
|
-
var startTimeModule;
|
105
|
-
var endTimeModule;
|
106
|
-
var timeSeconds;
|
107
|
-
|
108
|
-
// ---------------------------------------------------------------------------
|
109
|
-
// helper functions
|
110
|
-
// ---------------------------------------------------------------------------
|
111
|
-
|
112
|
-
// ---------------------------------------------------------------------------
|
113
|
-
// main
|
114
|
-
// ---------------------------------------------------------------------------
|
115
|
-
return {
|
116
|
-
|
117
|
-
// -------------------------------------------------------------------------
|
118
|
-
// adapter initializer
|
119
|
-
// -------------------------------------------------------------------------
|
120
|
-
init: (options) => {
|
121
|
-
|
122
|
-
// -----------------------------------------------------------------------
|
123
|
-
// default module settings
|
124
|
-
// -----------------------------------------------------------------------
|
125
|
-
var settings = $.extend({
|
126
|
-
module_name: 'j1.adapter.carousel',
|
127
|
-
generated: '{{site.time}}'
|
128
|
-
}, options);
|
129
|
-
|
130
|
-
// -----------------------------------------------------------------------
|
131
|
-
// global variable settings
|
132
|
-
// -----------------------------------------------------------------------
|
133
|
-
_this = j1.adapter.carousel;
|
134
|
-
logger = log4javascript.getLogger('j1.adapter.carousel');
|
135
|
-
|
136
|
-
// load module DEFAULTS|CONFIG
|
137
|
-
carouselDefaults = $.extend({}, {{analytics_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
|
138
|
-
carouselSettings = $.extend({}, {{analytics_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
|
139
|
-
carouselOptions = $.extend(true, {}, carouselDefaults, carouselSettings);
|
140
|
-
|
141
|
-
// intialize select data (for later access)
|
142
|
-
_this.carousels = {};
|
143
|
-
|
144
|
-
// -----------------------------------------------------------------------
|
145
|
-
// module initializer
|
146
|
-
// -----------------------------------------------------------------------
|
147
|
-
var dependencies_met_page_finished = setInterval (() => {
|
148
|
-
var pageState = $('#content').css("display");
|
149
|
-
var pageVisible = (pageState === 'block') ? true : false;
|
150
|
-
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
151
|
-
|
152
|
-
if (j1CoreFinished && pageVisible) {
|
153
|
-
startTimeModule = Date.now();
|
154
|
-
|
155
|
-
_this.setState('started');
|
156
|
-
logger.debug('\n' + 'state: ' + _this.getState());
|
157
|
-
logger.info('\n' + 'module is being initialized');
|
158
|
-
|
159
|
-
{% for item in carousel_options.carousel %}
|
160
|
-
|
161
|
-
{% if item.show.enabled %}
|
162
|
-
{% assign slider_id = item.show.id %}
|
163
|
-
{% assign slider_title = item.show.title %}
|
164
|
-
{% assign slider_type = item.show.type %}
|
165
|
-
{% assign parallax = item.show.parallax %}
|
166
|
-
{% assign padding = item.show.padding %}
|
167
|
-
{% assign text_color = item.show.text_color %}
|
168
|
-
{% assign font_size = item.show.font_size %}
|
169
|
-
{% assign font_weight = item.show.font_weight %}
|
170
|
-
{% assign background = item.show.background %}
|
171
|
-
{% assign darken = item.show.darken %}
|
172
|
-
{% assign gridify = item.show.gridify %}
|
173
|
-
{% assign lazyLoad = item.show.lightbox %}
|
174
|
-
|
175
|
-
// create an Carousel INSTANCE if slider on id: {{slider_id}} exists
|
176
|
-
if ($('#{{slider_id}}').length) {
|
177
|
-
|
178
|
-
logText = '\n' + 'slider is being processed on id: #{{slider_id}}';
|
179
|
-
logger.info(logText);
|
180
|
-
_this.setState('processing');
|
181
|
-
|
182
|
-
{% if item.show.slide_height != null %}
|
183
|
-
// set slide_height: {{item.show.slide_height}}vh
|
184
|
-
{% assign slide_height = item.show.slide_height %}
|
185
|
-
$('head').append('<style>.owl-carousel .item{height: {{slide_height}}vh;}</style>');
|
186
|
-
{% endif %}
|
187
|
-
|
188
|
-
{% if item.show.slide_space_between %}
|
189
|
-
{% assign slide_space = item.show.slide_space_between %}
|
190
|
-
{% else %}
|
191
|
-
{% assign slide_space = 3 %}
|
192
|
-
{% endif %}
|
193
|
-
|
194
|
-
{% if item.show.slide_border %}
|
195
|
-
{% assign slide_border = "thumbnail" %}
|
196
|
-
{% else %}
|
197
|
-
{% assign slide_border = "" %}
|
198
|
-
{% endif %}
|
199
|
-
|
200
|
-
// place HTML markup for the title
|
201
|
-
{% if slider_title %}
|
202
|
-
var slider_title = '<div class="slider-title">{{slider_title}}</div>';
|
203
|
-
$('#{{slider_id}}').before(slider_title);
|
204
|
-
{% endif %}
|
205
|
-
|
206
|
-
// set space between the slides
|
207
|
-
$('head').append('<style>.{{slider_id}}-item{margin: {{slide_space}}px;}</style>');
|
208
|
-
|
209
|
-
// place additional text carousel styles (border/margin)
|
210
|
-
{% unless parallax %} {% if slider_type == 'text' %}
|
211
|
-
$('head').append('<style>#{{slider_id}}{border-left: 3px solid #0072ff;}</style>');
|
212
|
-
// wait until carousel has been initialized
|
213
|
-
var dependency_met_owl_initialized = setInterval (() => {
|
214
|
-
if ($('#{{slider_id}} > .owl-wrapper-outer').length) {
|
215
|
-
{% if font_size %}
|
216
|
-
$('head').append('<style>#{{slider_id}}{font-size:{{font_size}}}</style>');
|
217
|
-
{% else %}
|
218
|
-
$('head').append('<style>#{{slider_id}}{font-size:1.5rem}</style>');
|
219
|
-
{% endif %}
|
220
|
-
|
221
|
-
{% if font_weight %}
|
222
|
-
$('head').append('<style>#{{slider_id}}{font-weight:{{font_weight}}}</style>');
|
223
|
-
{% else %}
|
224
|
-
$('head').append('<style>#{{slider_id}}{font-weight:400}</style>');
|
225
|
-
{% endif %}
|
226
|
-
|
227
|
-
$('#{{slider_id}} > .owl-wrapper-outer').addClass('ml-3');
|
228
|
-
clearInterval(dependency_met_owl_initialized);
|
229
|
-
}
|
230
|
-
}, 10); // END dependency_met_owl_initialized
|
231
|
-
{% endif %} {% endunless %}
|
232
|
-
|
233
|
-
// place additional parallax styles if enabled
|
234
|
-
{% if parallax %}
|
235
|
-
|
236
|
-
{% if padding %}
|
237
|
-
$('head').append('<style>#{{slider_id}}{padding:{{padding}};position:relative}</style>');
|
238
|
-
{% else %}
|
239
|
-
$('head').append('<style>#{{slider_id}}{padding:50px 0 50px 25px;position:relative}</style>');
|
240
|
-
{% endif %}
|
241
|
-
|
242
|
-
{% if cover %}
|
243
|
-
$('head').append('<style>#{{slider_id}}{background-size: cover}</style>');
|
244
|
-
{% endif %}
|
245
|
-
|
246
|
-
{% if background %}
|
247
|
-
$('head').append('<style>#{{slider_id}}{background:url({{background}}) 50% 0 repeat fixed}</style>');
|
248
|
-
{% else %}
|
249
|
-
$('head').append('<style>#{{slider_id}}{background:url(/assets/images/quotes/default.png) 50% 0 repeat fixed}</style>');
|
250
|
-
{% endif %}
|
251
|
-
|
252
|
-
{% if darken %}
|
253
|
-
$('head').append('<style>#{{slider_id}}:after{top:0;left:0;width:100%;height:100%;content:" ";position:absolute;background:rgba(0,0,0,0.{{darken}})}</style>');
|
254
|
-
{% else %}
|
255
|
-
$('head').append('<style>#{{slider_id}}:after{top:0;left:0;width:100%;height:100%;content:" ";position:absolute;background:rgba(0,0,0,0.2)}</style>');
|
256
|
-
{% endif %}
|
257
|
-
|
258
|
-
{% if text_color %}
|
259
|
-
setTimeout(() => {
|
260
|
-
var parentContainer = document.querySelector('#{{slider_id}} div div');
|
261
|
-
var paragraphs = parentContainer.getElementsByTagName('p');
|
262
|
-
|
263
|
-
// add each paragraph custom color
|
264
|
-
for (var i=0; i<paragraphs.length; i++) {
|
265
|
-
paragraphs[i].style.color = '{{text_color}}';
|
266
|
-
}
|
267
|
-
}, 500)
|
268
|
-
{% endif %}
|
269
|
-
|
270
|
-
{% if font_size %}
|
271
|
-
$('head').append('<style>#{{slider_id}}{font-size:{{font_size}}}</style>');
|
272
|
-
{% else %}
|
273
|
-
$('head').append('<style>#{{slider_id}}{font-size:1.5rem}</style>');
|
274
|
-
{% endif %}
|
275
|
-
|
276
|
-
{% if font_weight %}
|
277
|
-
$('head').append('<style>#{{slider_id}}{font-weight:{{font_weight}}}</style>');
|
278
|
-
{% else %}
|
279
|
-
$('head').append('<style>#{{slider_id}}{font-weight:400}</style>');
|
280
|
-
{% endif %}
|
281
|
-
|
282
|
-
{% if gridify %}
|
283
|
-
$('head').append('<style>#{{slider_id}}:before{top:0;left:0;width:100%;height:100%;content:" ";position:absolute;background:url(/assets/images/modules/patterns/gridtile.png) repeat;}</style>');
|
284
|
-
{% endif %}
|
285
|
-
|
286
|
-
{% endif %}
|
287
|
-
|
288
|
-
// initialize individual show parameters
|
289
|
-
/* eslint-disable */
|
290
|
-
$('#{{slider_id}}').owlCarousel({
|
291
|
-
{% for option in item.show.options %}
|
292
|
-
{{option[0] | json}}: {{option[1] | json}},
|
293
|
-
{% endfor %}
|
294
|
-
// Enable lazyLoad if lightbox is enabled
|
295
|
-
{% if item.show.lightbox %}
|
296
|
-
"lazyLoad": true,
|
297
|
-
{% endif %}
|
298
|
-
"jsonPath": {{carousel_options.xhr_data_path | json}},
|
299
|
-
"jsonSuccess": customDataSuccess_{{forloop.index}}
|
300
|
-
});
|
301
|
-
/* eslint-enable */
|
302
|
-
|
303
|
-
// set instance variable (for later access)
|
304
|
-
_this.carousels.{{slider_id}} = $('#{{slider_id}}').data('owlCarousel');
|
305
|
-
|
306
|
-
// custom show data functions (each slide show)
|
307
|
-
function customDataSuccess_{{forloop.index}}(data){
|
308
|
-
var content = '';
|
309
|
-
for (var i in data['{{slider_id}}']) {
|
310
|
-
|
311
|
-
{% if slider_type == 'text' %}
|
312
|
-
var text = data['{{slider_id}}'][i].text;
|
313
|
-
{% endif %}
|
314
|
-
|
315
|
-
var href = data['{{slider_id}}'][i].href;
|
316
|
-
|
317
|
-
{% if slider_type == 'image' %}
|
318
|
-
var lb = data['{{slider_id}}'][i].lb;
|
319
|
-
var lb_caption = data['{{slider_id}}'][i].lb_caption;
|
320
|
-
var img = data['{{slider_id}}'][i].img;
|
321
|
-
var alt = data['{{slider_id}}'][i].alt;
|
322
|
-
|
323
|
-
// if lightbox is enabled (preference over href)
|
324
|
-
if (lb) {
|
325
|
-
|
326
|
-
if (lb_caption) {
|
327
|
-
|
328
|
-
content += '\t\t' + '<div class="item {{slider_id}}-item {{slide_border}}">'+ '\n';
|
329
|
-
content += '\t\t\t' + '<a href="' +img+ '" ' + 'data-lightbox="{{slider_id}}" data-title="' +lb_caption+ '">' + '\n';
|
330
|
-
content += '\t\t\t\t' + '<img class="lazyOwl" src="' +img+ '" alt="' +lb_caption+ '">' + '\n';
|
331
|
-
content += '\t\t\t' + ' </a>' + '\n';
|
332
|
-
if (href) {
|
333
|
-
content += '\t\t\t' + '<span id="{{slider_id}}_caption" class="text-start carousel-caption"><a class="md-grey-300 link-no-decoration" href="' +href+ '">' +lb_caption+ ' </a> </span>' + '\n';
|
334
|
-
} else {
|
335
|
-
content += '\t\t\t' + '<span id="{{slider_id}}_caption" class="text-start carousel-caption">' +lb_caption+ '</span>' + '\n';
|
336
|
-
}
|
337
|
-
content += '\t\t' + '</div>' + '\n';
|
338
|
-
} else {
|
339
|
-
// jadams, 2021-03-06: added link text (alt) for search engine optimization (SEO|Google)
|
340
|
-
// content += '<a class="item" href="' +img+ '" ' + 'data-lightbox="{{slider_id}}"> <img class="lazyOwl" data-src="' +img+ '" alt="' +alt+ '">' + ' </a>';
|
341
|
-
//
|
342
|
-
content += '<a class="item link-no-decoration" href="' + img + '" ';
|
343
|
-
content += 'data-lightbox="{{slider_id}}"> <img class="lazyOwl" data-src="' + img;
|
344
|
-
content += '" alt="' +alt+ '">' +alt+ ' </a>';
|
345
|
-
}
|
346
|
-
} else if (href) {
|
347
|
-
content += '<div class="item">' + '<img src="' +img+ '" alt="' +alt+ '">' + '</div>';
|
348
|
-
} else {
|
349
|
-
content += '<div class="item">' + '<img src="' +img+ '" alt="' +alt+ '">' + '</div>';
|
350
|
-
}
|
351
|
-
{% endif %}
|
352
|
-
|
353
|
-
{% if slider_type == 'text' %}
|
354
|
-
if (href) {
|
355
|
-
content += '<div class="item">' + '<p href=' +href+ '">' +text+ '</p>' + '</div>';
|
356
|
-
} else {
|
357
|
-
content += '<div class="item">' + '<p>' +text+ '</p>' + '</div>';
|
358
|
-
}
|
359
|
-
{% endif %}
|
360
|
-
}
|
361
|
-
$('#{{slider_id}}').html(content);
|
362
|
-
|
363
|
-
// jadams: managing captions should be adopted from
|
364
|
-
// JustifiedGallery as this simple solution does NOT work
|
365
|
-
// NOTE: Potentially the core of OwlCarousel has to be
|
366
|
-
// changed to manage captions natively
|
367
|
-
// -----------------------------------------------------------
|
368
|
-
// var captionID = '#{{slider_id}}_caption';
|
369
|
-
// $(captionID).hover(
|
370
|
-
// function(e) {
|
371
|
-
// $( this ).find( ".carousel-caption" ).show();
|
372
|
-
// e.stopPropagation();
|
373
|
-
// }, function(e) {
|
374
|
-
// $( this ).find( ".carousel-caption" ).hide();
|
375
|
-
// e.stopPropagation();
|
376
|
-
// }
|
377
|
-
// );
|
378
|
-
|
379
|
-
_this.setState('processed');
|
380
|
-
logger.debug('\n' + 'processing slider finished on id: {{slider_id}}');
|
381
|
-
} // END customDataSuccess_{{forloop.index}}
|
382
|
-
} // END if carousel exists
|
383
|
-
{% endif %}
|
384
|
-
{% endfor %}
|
385
|
-
|
386
|
-
clearInterval(dependencies_met_page_finished);
|
387
|
-
|
388
|
-
var dependencies_met_sliders_processed = setInterval(() => {
|
389
|
-
var slidersProcessed = (_this.getState() === 'processed') ? true : false;
|
390
|
-
|
391
|
-
if (slidersProcessed) {
|
392
|
-
|
393
|
-
_this.setState('finished');
|
394
|
-
logger.debug('\n' + 'state: ' + _this.getState());
|
395
|
-
logger.info('\n' + 'initializing module finished');
|
396
|
-
|
397
|
-
endTimeModule = Date.now();
|
398
|
-
logger.info('\n' + 'module initializing time: ' + (endTimeModule-startTimeModule) + 'ms');
|
399
|
-
|
400
|
-
clearInterval(dependencies_met_sliders_processed);
|
401
|
-
}
|
402
|
-
}, 10); // END 'dependencies_met_sliders_processed'
|
403
|
-
} // END if j1.getState 'finished'
|
404
|
-
}, 10); // END 'dependencies_met_page_finished'
|
405
|
-
}, // END init
|
406
|
-
|
407
|
-
// -----------------------------------------------------------------------
|
408
|
-
// Caption text animation (currently NOT used)
|
409
|
-
// -----------------------------------------------------------------------
|
410
|
-
|
411
|
-
// -------------------------------------------------------------------------
|
412
|
-
// fadeIn()
|
413
|
-
// animation (caption): fadeIn
|
414
|
-
// -------------------------------------------------------------------------
|
415
|
-
fadeIn: (id, options) => {
|
416
|
-
$(id + '.active .caption .fadeIn-1').stop().delay(options.delay)
|
417
|
-
.animate({
|
418
|
-
opacity: options.opacity
|
419
|
-
}, {
|
420
|
-
duration: options.duration,
|
421
|
-
easing: options.easing
|
422
|
-
});
|
423
|
-
$(id + '.active .caption .fadeIn-2').stop().delay(options.delay+200)
|
424
|
-
.animate({
|
425
|
-
opacity: options.opacity
|
426
|
-
}, {
|
427
|
-
duration: options.duration,
|
428
|
-
easing: options.easing
|
429
|
-
});
|
430
|
-
$(id + '.active .caption .fadeIn-3').stop().delay(options.delay+500)
|
431
|
-
.animate({
|
432
|
-
opacity: options.opacity
|
433
|
-
}, {
|
434
|
-
duration: options.duration,
|
435
|
-
easing: options.easing
|
436
|
-
});
|
437
|
-
},
|
438
|
-
|
439
|
-
// -------------------------------------------------------------------------
|
440
|
-
// fadeInUp()
|
441
|
-
// animation (caption): fadeInUp
|
442
|
-
// -------------------------------------------------------------------------
|
443
|
-
fadeInUp: (id, options) => {
|
444
|
-
$(id + '.active .caption .fadeInUp-1')
|
445
|
-
.stop()
|
446
|
-
.delay(options.delay)
|
447
|
-
.animate({
|
448
|
-
opacity: options.opacity,
|
449
|
-
top: options.top
|
450
|
-
}, {
|
451
|
-
duration: options.duration,
|
452
|
-
easing: options.easing
|
453
|
-
});
|
454
|
-
$(id + '.active .caption .fadeInUp-2')
|
455
|
-
.stop()
|
456
|
-
.delay(options.delay+200)
|
457
|
-
.animate({
|
458
|
-
opacity: options.opacity,
|
459
|
-
top: options.top
|
460
|
-
}, {
|
461
|
-
duration: 800,
|
462
|
-
easing: 'easeOutCubic'
|
463
|
-
});
|
464
|
-
$(id + '.active .caption .fadeInUp-3')
|
465
|
-
.stop()
|
466
|
-
.delay(options.delay+500)
|
467
|
-
.animate({
|
468
|
-
opacity: options.opacity,
|
469
|
-
top: options.top
|
470
|
-
}, {
|
471
|
-
duration: options.duration,
|
472
|
-
easing: options.easing
|
473
|
-
});
|
474
|
-
},
|
475
|
-
|
476
|
-
// -------------------------------------------------------------------------
|
477
|
-
// fadeInRight()
|
478
|
-
// animation (caption): fadeInRight
|
479
|
-
// -------------------------------------------------------------------------
|
480
|
-
fadeInRight: (id, options) => {
|
481
|
-
$(id + '.active .caption .fadeInRight-1')
|
482
|
-
.stop()
|
483
|
-
.delay(options.delay)
|
484
|
-
.animate({
|
485
|
-
opacity: options.opacity,
|
486
|
-
left: options.left
|
487
|
-
}, {
|
488
|
-
duration: options.duration,
|
489
|
-
easing: options.easing
|
490
|
-
});
|
491
|
-
$(id + '.active .caption .fadeInRight-2')
|
492
|
-
.stop()
|
493
|
-
.delay(options.delay+200)
|
494
|
-
.animate({
|
495
|
-
opacity: options.opacity,
|
496
|
-
left: options.left
|
497
|
-
}, {
|
498
|
-
duration: options.duration,
|
499
|
-
easing: options.easing
|
500
|
-
});
|
501
|
-
$(id + '.active .caption .fadeInRight-3')
|
502
|
-
.stop()
|
503
|
-
.delay(options.delay+500)
|
504
|
-
.animate({
|
505
|
-
opacity: options.opacity,
|
506
|
-
left: options.left
|
507
|
-
}, {
|
508
|
-
duration: options.duration,
|
509
|
-
easing: options.easing
|
510
|
-
});
|
511
|
-
},
|
512
|
-
|
513
|
-
// -------------------------------------------------------------------------
|
514
|
-
// fadeInDown()
|
515
|
-
// animation (caption): fadeInDown
|
516
|
-
// -------------------------------------------------------------------------
|
517
|
-
fadeInDown: (id, options) => {
|
518
|
-
$('#item-1').backstretch();
|
519
|
-
$(id + '.active .caption .fadeInDown-1')
|
520
|
-
.stop()
|
521
|
-
.delay(options.delay)
|
522
|
-
.animate({
|
523
|
-
opacity: options.opacity,
|
524
|
-
top: options.top
|
525
|
-
}, {
|
526
|
-
duration: options.duration,
|
527
|
-
easing: options.easing
|
528
|
-
});
|
529
|
-
$(id + '.active .caption .fadeInDown-2')
|
530
|
-
.stop()
|
531
|
-
.delay(options.delay+200)
|
532
|
-
.animate({
|
533
|
-
opacity: options.opacity,
|
534
|
-
top: options.top
|
535
|
-
}, {
|
536
|
-
duration: options.duration,
|
537
|
-
easing: options.easing
|
538
|
-
});
|
539
|
-
$(id + '.active .caption .fadeInDown-3')
|
540
|
-
.stop()
|
541
|
-
.delay(options.delay+500)
|
542
|
-
.animate({
|
543
|
-
opacity: options.opacity,
|
544
|
-
top: options.top
|
545
|
-
}, {
|
546
|
-
duration: options.duration,
|
547
|
-
easing: options.easing
|
548
|
-
});
|
549
|
-
},
|
550
|
-
|
551
|
-
// -------------------------------------------------------------------------
|
552
|
-
// fadeInLeft()
|
553
|
-
// animation (caption): fadeInLeft
|
554
|
-
// -------------------------------------------------------------------------
|
555
|
-
fadeInLeft: (id, options) => {
|
556
|
-
$('#item-2').backstretch();
|
557
|
-
$(id + '.active .caption .fadeInLeft-1')
|
558
|
-
.stop()
|
559
|
-
.delay(500)
|
560
|
-
.animate({
|
561
|
-
opacity: options.opacity,
|
562
|
-
top: options.left
|
563
|
-
}, {
|
564
|
-
duration: options.duration,
|
565
|
-
easing: options.easing
|
566
|
-
});
|
567
|
-
$(id + '.active .caption .fadeInLeft-2')
|
568
|
-
.stop()
|
569
|
-
.delay(700)
|
570
|
-
.animate({
|
571
|
-
opacity: options.opacity,
|
572
|
-
top: options.left
|
573
|
-
}, {
|
574
|
-
duration: options.duration,
|
575
|
-
easing: options.easing
|
576
|
-
});
|
577
|
-
$(id + '.active .caption .fadeInLeft-3')
|
578
|
-
.stop()
|
579
|
-
.delay(1000)
|
580
|
-
.animate({
|
581
|
-
opacity: options.opacity,
|
582
|
-
top: options.left
|
583
|
-
}, {
|
584
|
-
duration: options.duration,
|
585
|
-
easing: options.easing
|
586
|
-
});
|
587
|
-
},
|
588
|
-
|
589
|
-
// -------------------------------------------------------------------------
|
590
|
-
// fadeInReset()
|
591
|
-
// reset animation (caption): fadeIn
|
592
|
-
// -------------------------------------------------------------------------
|
593
|
-
fadeInReset: (id, options) => {
|
594
|
-
if (!options.dragging) {
|
595
|
-
$(id + '.caption .fadeIn-1,' +
|
596
|
-
id + '.caption .fadeIn-2,' +
|
597
|
-
id + '.caption .fadeIn-3')
|
598
|
-
.stop()
|
599
|
-
.delay(options.delay)
|
600
|
-
.animate({
|
601
|
-
opacity: options.opacity
|
602
|
-
}, {
|
603
|
-
duration: options.duration,
|
604
|
-
easing: options.easing
|
605
|
-
});
|
606
|
-
} else {
|
607
|
-
$(id + '.caption .fadeIn-1,' +
|
608
|
-
id + '.caption .fadeIn-2,' +
|
609
|
-
id + '.caption .fadeIn-3')
|
610
|
-
.css({
|
611
|
-
opacity: options.opacity
|
612
|
-
});
|
613
|
-
}
|
614
|
-
}, // END fadeOut
|
615
|
-
|
616
|
-
// -------------------------------------------------------------------------
|
617
|
-
// fadeInUpReset()
|
618
|
-
// reset animation (caption): fadeInUp
|
619
|
-
// -------------------------------------------------------------------------
|
620
|
-
fadeInUpReset: (id, options) => {
|
621
|
-
if (!options.dragging) {
|
622
|
-
$(id + '.caption .fadeInUp-1,' +
|
623
|
-
id + '.caption .fadeInUp-2,' +
|
624
|
-
id + '.caption .fadeInUp-3')
|
625
|
-
.stop()
|
626
|
-
.delay(options.delay)
|
627
|
-
.animate({
|
628
|
-
opacity: options.opacity,
|
629
|
-
top: options.top
|
630
|
-
}, {
|
631
|
-
duration: options.duration,
|
632
|
-
easing: options.easing
|
633
|
-
});
|
634
|
-
} else {
|
635
|
-
$(id + '.caption .fadeInUp-1', +
|
636
|
-
id + '.caption .fadeInUp-2,' +
|
637
|
-
id + '.caption .fadeInUp-3')
|
638
|
-
.css({
|
639
|
-
opacity: options.opacity,
|
640
|
-
top: options.top
|
641
|
-
});
|
642
|
-
}
|
643
|
-
}, // END fadeInUpReset
|
644
|
-
|
645
|
-
// -------------------------------------------------------------------------
|
646
|
-
// fadeInRightReset()
|
647
|
-
// reset animation (caption): fadeInRight
|
648
|
-
// -------------------------------------------------------------------------
|
649
|
-
fadeInRightReset: (id, options) => {
|
650
|
-
if (!options.dragging) {
|
651
|
-
$(id + '.caption .fadeInRight-1,' +
|
652
|
-
id + '.caption .fadeInRight-2,' +
|
653
|
-
id + '.caption .fadeInRight-3')
|
654
|
-
.stop()
|
655
|
-
.delay(options.delay)
|
656
|
-
.animate({
|
657
|
-
opacity: options.opacity,
|
658
|
-
left: options.left
|
659
|
-
}, {
|
660
|
-
duration: options.duration,
|
661
|
-
easing: options.easing
|
662
|
-
});
|
663
|
-
} else {
|
664
|
-
$(id + '.caption .fadeInRight-1,' +
|
665
|
-
id + '.caption .fadeInRight-2,' +
|
666
|
-
id + '.caption .fadeInRight-3')
|
667
|
-
.css({
|
668
|
-
opacity: options.opacity,
|
669
|
-
left: options.left
|
670
|
-
});
|
671
|
-
}
|
672
|
-
}, // END fadeInRightReset
|
673
|
-
|
674
|
-
// -------------------------------------------------------------------------
|
675
|
-
// fadeOutDown()
|
676
|
-
// reset animation (caption): fadeInDown
|
677
|
-
// -------------------------------------------------------------------------
|
678
|
-
fadeInDownReset: (id, options) => {
|
679
|
-
if (!options.dragging) {
|
680
|
-
$(id + '.caption .fadeInDown-1,' +
|
681
|
-
id + '.caption .fadeInDown-2,' +
|
682
|
-
id + '.caption .fadeInDown-3')
|
683
|
-
.stop()
|
684
|
-
.delay(options.delay)
|
685
|
-
.animate({
|
686
|
-
opacity: options.opacity,
|
687
|
-
top: options.top
|
688
|
-
}, {
|
689
|
-
duration: options.duration,
|
690
|
-
easing: options.easing
|
691
|
-
});
|
692
|
-
} else {
|
693
|
-
$(id + '.caption .fadeInDown-1,' +
|
694
|
-
id + '.caption .fadeInDown-2,' +
|
695
|
-
id + '.caption .fadeInDown-3')
|
696
|
-
.css({
|
697
|
-
opacity: options.opacity,
|
698
|
-
top: options.transitionTypes
|
699
|
-
});
|
700
|
-
}
|
701
|
-
}, // END fadeOutDown
|
702
|
-
|
703
|
-
// -------------------------------------------------------------------------
|
704
|
-
// fadeInLeftReset()
|
705
|
-
// reset animation (caption): fadeInLeft
|
706
|
-
// -------------------------------------------------------------------------
|
707
|
-
fadeInLeftReset: (id, options) => {
|
708
|
-
if (!options.dragging) {
|
709
|
-
$(id + '.caption .fadeInLeft-1,' +
|
710
|
-
id + '.caption .fadeInLeft-2,' +
|
711
|
-
id + '.caption .fadeInLeft-3')
|
712
|
-
.stop()
|
713
|
-
.delay(options.delay)
|
714
|
-
.animate({
|
715
|
-
opacity: options.opacity,
|
716
|
-
left: options.left
|
717
|
-
}, {
|
718
|
-
duration: options.duration,
|
719
|
-
easing: options.easing
|
720
|
-
});
|
721
|
-
} else {
|
722
|
-
$(id + '.caption .fadeInLeft-1,' +
|
723
|
-
id + '.caption .fadeInLeft-2,' +
|
724
|
-
id + '.caption .fadeInLeft-3')
|
725
|
-
.css({
|
726
|
-
opacity: options.opacity,
|
727
|
-
left: options.left
|
728
|
-
});
|
729
|
-
}
|
730
|
-
}, // END fadeInLeftReset
|
731
|
-
|
732
|
-
// -------------------------------------------------------------------------
|
733
|
-
// messageHandler()
|
734
|
-
// manage messages send from other J1 modules
|
735
|
-
// -------------------------------------------------------------------------
|
736
|
-
messageHandler: (sender, message) => {
|
737
|
-
var json_message = JSON.stringify(message, undefined, 2);
|
738
|
-
|
739
|
-
logText = '\n' + 'received message from ' + sender + ': ' + json_message;
|
740
|
-
logger.debug(logText);
|
741
|
-
|
742
|
-
// -----------------------------------------------------------------------
|
743
|
-
// process commands|actions
|
744
|
-
// -----------------------------------------------------------------------
|
745
|
-
if (message.type === 'command' && message.action === 'module_initialized') {
|
746
|
-
|
747
|
-
//
|
748
|
-
// place handling of command|action here
|
749
|
-
//
|
750
|
-
|
751
|
-
logger.info('\n' + message.text);
|
752
|
-
}
|
753
|
-
|
754
|
-
//
|
755
|
-
// place handling of other command|action here
|
756
|
-
//
|
757
|
-
|
758
|
-
return true;
|
759
|
-
}, // END messageHandler
|
760
|
-
|
761
|
-
// -------------------------------------------------------------------------
|
762
|
-
// setState()
|
763
|
-
// sets the current (processing) state of the module
|
764
|
-
// -------------------------------------------------------------------------
|
765
|
-
setState: (stat) => {
|
766
|
-
_this.state = stat;
|
767
|
-
}, // END setState
|
768
|
-
|
769
|
-
// -------------------------------------------------------------------------
|
770
|
-
// getState()
|
771
|
-
// Returns the current (processing) state of the module
|
772
|
-
// -------------------------------------------------------------------------
|
773
|
-
getState: () => {
|
774
|
-
return _this.state;
|
775
|
-
} // END getState
|
776
|
-
|
777
|
-
}; // END main (return)
|
778
|
-
})(j1, window);
|
779
|
-
|
780
|
-
{% endcapture %}
|
781
|
-
{% if production %}
|
782
|
-
{{ cache | minifyJS }}
|
783
|
-
{% else %}
|
784
|
-
{{ cache | strip_empty_lines }}
|
785
|
-
{% endif %}
|
786
|
-
{% assign cache = nil %}
|
1
|
+
---
|
2
|
+
regenerate: true
|
3
|
+
---
|
4
|
+
|
5
|
+
{% capture cache %}
|
6
|
+
|
7
|
+
{% comment %}
|
8
|
+
# -----------------------------------------------------------------------------
|
9
|
+
# ~/assets/themes/j1/adapter/js/carousel.js
|
10
|
+
# Liquid template to adapt J1 Carousel (Owl Carousel V1) Core functions
|
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
|
+
# Test data:
|
21
|
+
# {{config | 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 template_version = site.version %}
|
32
|
+
{% assign slider_id = '' %}
|
33
|
+
|
34
|
+
{% comment %} Process YML config data
|
35
|
+
================================================================================ {% endcomment %}
|
36
|
+
|
37
|
+
{% comment %} Set config files
|
38
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
39
|
+
{% assign template_config = site.data.j1_config %}
|
40
|
+
{% assign apps = site.data.apps %}
|
41
|
+
{% assign modules = site.data.modules %}
|
42
|
+
|
43
|
+
{% comment %} Set config data
|
44
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
45
|
+
|
46
|
+
{% comment %}
|
47
|
+
--------------------------------------------------------------------------------
|
48
|
+
{% assign carousel_defaults = apps.defaults.carousel.defaults %}
|
49
|
+
{% assign carousel_settings = apps.carousel.settings %}
|
50
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
51
|
+
|
52
|
+
{% assign carousel_defaults = modules.defaults.carousel.defaults %}
|
53
|
+
{% assign carousel_settings = modules.carousel.settings %}
|
54
|
+
|
55
|
+
{% comment %} Set config options
|
56
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
57
|
+
{% assign carousel_options = carousel_defaults | merge: carousel_settings %}
|
58
|
+
|
59
|
+
{% comment %} Detect prod mode
|
60
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
61
|
+
{% assign production = false %}
|
62
|
+
{% if environment == 'prod' or environment == 'production' %}
|
63
|
+
{% assign production = true %}
|
64
|
+
{% endif %}
|
65
|
+
|
66
|
+
/*
|
67
|
+
# -----------------------------------------------------------------------------
|
68
|
+
# ~/assets/themes/j1/adapter/js/carousel.js
|
69
|
+
# JS Adapter for J1 Carousel (Owl Carousel V1)
|
70
|
+
#
|
71
|
+
# Product/Info:
|
72
|
+
# https://jekyll.one
|
73
|
+
#
|
74
|
+
# Copyright (C) 2023, 2024 Juergen Adams
|
75
|
+
#
|
76
|
+
# J1 Template is licensed under the MIT License.
|
77
|
+
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
|
78
|
+
# -----------------------------------------------------------------------------
|
79
|
+
# Adapter generated: {{site.time}}
|
80
|
+
# -----------------------------------------------------------------------------
|
81
|
+
*/
|
82
|
+
|
83
|
+
// -----------------------------------------------------------------------------
|
84
|
+
// ESLint shimming
|
85
|
+
// -----------------------------------------------------------------------------
|
86
|
+
/* eslint indent: "off" */
|
87
|
+
// -----------------------------------------------------------------------------
|
88
|
+
'use strict';
|
89
|
+
j1.adapter.carousel = ((j1, window) => {
|
90
|
+
var environment = '{{environment}}';
|
91
|
+
var dragging = false;
|
92
|
+
var state = 'not_started';
|
93
|
+
var carouselDefaults;
|
94
|
+
var carouselSettings;
|
95
|
+
var carouselOptions;
|
96
|
+
|
97
|
+
var _this;
|
98
|
+
var logger;
|
99
|
+
var logText;
|
100
|
+
|
101
|
+
// date|time
|
102
|
+
var startTime;
|
103
|
+
var endTime;
|
104
|
+
var startTimeModule;
|
105
|
+
var endTimeModule;
|
106
|
+
var timeSeconds;
|
107
|
+
|
108
|
+
// ---------------------------------------------------------------------------
|
109
|
+
// helper functions
|
110
|
+
// ---------------------------------------------------------------------------
|
111
|
+
|
112
|
+
// ---------------------------------------------------------------------------
|
113
|
+
// main
|
114
|
+
// ---------------------------------------------------------------------------
|
115
|
+
return {
|
116
|
+
|
117
|
+
// -------------------------------------------------------------------------
|
118
|
+
// adapter initializer
|
119
|
+
// -------------------------------------------------------------------------
|
120
|
+
init: (options) => {
|
121
|
+
|
122
|
+
// -----------------------------------------------------------------------
|
123
|
+
// default module settings
|
124
|
+
// -----------------------------------------------------------------------
|
125
|
+
var settings = $.extend({
|
126
|
+
module_name: 'j1.adapter.carousel',
|
127
|
+
generated: '{{site.time}}'
|
128
|
+
}, options);
|
129
|
+
|
130
|
+
// -----------------------------------------------------------------------
|
131
|
+
// global variable settings
|
132
|
+
// -----------------------------------------------------------------------
|
133
|
+
_this = j1.adapter.carousel;
|
134
|
+
logger = log4javascript.getLogger('j1.adapter.carousel');
|
135
|
+
|
136
|
+
// load module DEFAULTS|CONFIG
|
137
|
+
carouselDefaults = $.extend({}, {{analytics_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
|
138
|
+
carouselSettings = $.extend({}, {{analytics_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
|
139
|
+
carouselOptions = $.extend(true, {}, carouselDefaults, carouselSettings);
|
140
|
+
|
141
|
+
// intialize select data (for later access)
|
142
|
+
_this.carousels = {};
|
143
|
+
|
144
|
+
// -----------------------------------------------------------------------
|
145
|
+
// module initializer
|
146
|
+
// -----------------------------------------------------------------------
|
147
|
+
var dependencies_met_page_finished = setInterval (() => {
|
148
|
+
var pageState = $('#content').css("display");
|
149
|
+
var pageVisible = (pageState === 'block') ? true : false;
|
150
|
+
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
151
|
+
|
152
|
+
if (j1CoreFinished && pageVisible) {
|
153
|
+
startTimeModule = Date.now();
|
154
|
+
|
155
|
+
_this.setState('started');
|
156
|
+
logger.debug('\n' + 'state: ' + _this.getState());
|
157
|
+
logger.info('\n' + 'module is being initialized');
|
158
|
+
|
159
|
+
{% for item in carousel_options.carousel %}
|
160
|
+
|
161
|
+
{% if item.show.enabled %}
|
162
|
+
{% assign slider_id = item.show.id %}
|
163
|
+
{% assign slider_title = item.show.title %}
|
164
|
+
{% assign slider_type = item.show.type %}
|
165
|
+
{% assign parallax = item.show.parallax %}
|
166
|
+
{% assign padding = item.show.padding %}
|
167
|
+
{% assign text_color = item.show.text_color %}
|
168
|
+
{% assign font_size = item.show.font_size %}
|
169
|
+
{% assign font_weight = item.show.font_weight %}
|
170
|
+
{% assign background = item.show.background %}
|
171
|
+
{% assign darken = item.show.darken %}
|
172
|
+
{% assign gridify = item.show.gridify %}
|
173
|
+
{% assign lazyLoad = item.show.lightbox %}
|
174
|
+
|
175
|
+
// create an Carousel INSTANCE if slider on id: {{slider_id}} exists
|
176
|
+
if ($('#{{slider_id}}').length) {
|
177
|
+
|
178
|
+
logText = '\n' + 'slider is being processed on id: #{{slider_id}}';
|
179
|
+
logger.info(logText);
|
180
|
+
_this.setState('processing');
|
181
|
+
|
182
|
+
{% if item.show.slide_height != null %}
|
183
|
+
// set slide_height: {{item.show.slide_height}}vh
|
184
|
+
{% assign slide_height = item.show.slide_height %}
|
185
|
+
$('head').append('<style>.owl-carousel .item{height: {{slide_height}}vh;}</style>');
|
186
|
+
{% endif %}
|
187
|
+
|
188
|
+
{% if item.show.slide_space_between %}
|
189
|
+
{% assign slide_space = item.show.slide_space_between %}
|
190
|
+
{% else %}
|
191
|
+
{% assign slide_space = 3 %}
|
192
|
+
{% endif %}
|
193
|
+
|
194
|
+
{% if item.show.slide_border %}
|
195
|
+
{% assign slide_border = "thumbnail" %}
|
196
|
+
{% else %}
|
197
|
+
{% assign slide_border = "" %}
|
198
|
+
{% endif %}
|
199
|
+
|
200
|
+
// place HTML markup for the title
|
201
|
+
{% if slider_title %}
|
202
|
+
var slider_title = '<div class="slider-title">{{slider_title}}</div>';
|
203
|
+
$('#{{slider_id}}').before(slider_title);
|
204
|
+
{% endif %}
|
205
|
+
|
206
|
+
// set space between the slides
|
207
|
+
$('head').append('<style>.{{slider_id}}-item{margin: {{slide_space}}px;}</style>');
|
208
|
+
|
209
|
+
// place additional text carousel styles (border/margin)
|
210
|
+
{% unless parallax %} {% if slider_type == 'text' %}
|
211
|
+
$('head').append('<style>#{{slider_id}}{border-left: 3px solid #0072ff;}</style>');
|
212
|
+
// wait until carousel has been initialized
|
213
|
+
var dependency_met_owl_initialized = setInterval (() => {
|
214
|
+
if ($('#{{slider_id}} > .owl-wrapper-outer').length) {
|
215
|
+
{% if font_size %}
|
216
|
+
$('head').append('<style>#{{slider_id}}{font-size:{{font_size}}}</style>');
|
217
|
+
{% else %}
|
218
|
+
$('head').append('<style>#{{slider_id}}{font-size:1.5rem}</style>');
|
219
|
+
{% endif %}
|
220
|
+
|
221
|
+
{% if font_weight %}
|
222
|
+
$('head').append('<style>#{{slider_id}}{font-weight:{{font_weight}}}</style>');
|
223
|
+
{% else %}
|
224
|
+
$('head').append('<style>#{{slider_id}}{font-weight:400}</style>');
|
225
|
+
{% endif %}
|
226
|
+
|
227
|
+
$('#{{slider_id}} > .owl-wrapper-outer').addClass('ml-3');
|
228
|
+
clearInterval(dependency_met_owl_initialized);
|
229
|
+
}
|
230
|
+
}, 10); // END dependency_met_owl_initialized
|
231
|
+
{% endif %} {% endunless %}
|
232
|
+
|
233
|
+
// place additional parallax styles if enabled
|
234
|
+
{% if parallax %}
|
235
|
+
|
236
|
+
{% if padding %}
|
237
|
+
$('head').append('<style>#{{slider_id}}{padding:{{padding}};position:relative}</style>');
|
238
|
+
{% else %}
|
239
|
+
$('head').append('<style>#{{slider_id}}{padding:50px 0 50px 25px;position:relative}</style>');
|
240
|
+
{% endif %}
|
241
|
+
|
242
|
+
{% if cover %}
|
243
|
+
$('head').append('<style>#{{slider_id}}{background-size: cover}</style>');
|
244
|
+
{% endif %}
|
245
|
+
|
246
|
+
{% if background %}
|
247
|
+
$('head').append('<style>#{{slider_id}}{background:url({{background}}) 50% 0 repeat fixed}</style>');
|
248
|
+
{% else %}
|
249
|
+
$('head').append('<style>#{{slider_id}}{background:url(/assets/images/quotes/default.png) 50% 0 repeat fixed}</style>');
|
250
|
+
{% endif %}
|
251
|
+
|
252
|
+
{% if darken %}
|
253
|
+
$('head').append('<style>#{{slider_id}}:after{top:0;left:0;width:100%;height:100%;content:" ";position:absolute;background:rgba(0,0,0,0.{{darken}})}</style>');
|
254
|
+
{% else %}
|
255
|
+
$('head').append('<style>#{{slider_id}}:after{top:0;left:0;width:100%;height:100%;content:" ";position:absolute;background:rgba(0,0,0,0.2)}</style>');
|
256
|
+
{% endif %}
|
257
|
+
|
258
|
+
{% if text_color %}
|
259
|
+
setTimeout(() => {
|
260
|
+
var parentContainer = document.querySelector('#{{slider_id}} div div');
|
261
|
+
var paragraphs = parentContainer.getElementsByTagName('p');
|
262
|
+
|
263
|
+
// add each paragraph custom color
|
264
|
+
for (var i=0; i<paragraphs.length; i++) {
|
265
|
+
paragraphs[i].style.color = '{{text_color}}';
|
266
|
+
}
|
267
|
+
}, 500)
|
268
|
+
{% endif %}
|
269
|
+
|
270
|
+
{% if font_size %}
|
271
|
+
$('head').append('<style>#{{slider_id}}{font-size:{{font_size}}}</style>');
|
272
|
+
{% else %}
|
273
|
+
$('head').append('<style>#{{slider_id}}{font-size:1.5rem}</style>');
|
274
|
+
{% endif %}
|
275
|
+
|
276
|
+
{% if font_weight %}
|
277
|
+
$('head').append('<style>#{{slider_id}}{font-weight:{{font_weight}}}</style>');
|
278
|
+
{% else %}
|
279
|
+
$('head').append('<style>#{{slider_id}}{font-weight:400}</style>');
|
280
|
+
{% endif %}
|
281
|
+
|
282
|
+
{% if gridify %}
|
283
|
+
$('head').append('<style>#{{slider_id}}:before{top:0;left:0;width:100%;height:100%;content:" ";position:absolute;background:url(/assets/images/modules/patterns/gridtile.png) repeat;}</style>');
|
284
|
+
{% endif %}
|
285
|
+
|
286
|
+
{% endif %}
|
287
|
+
|
288
|
+
// initialize individual show parameters
|
289
|
+
/* eslint-disable */
|
290
|
+
$('#{{slider_id}}').owlCarousel({
|
291
|
+
{% for option in item.show.options %}
|
292
|
+
{{option[0] | json}}: {{option[1] | json}},
|
293
|
+
{% endfor %}
|
294
|
+
// Enable lazyLoad if lightbox is enabled
|
295
|
+
{% if item.show.lightbox %}
|
296
|
+
"lazyLoad": true,
|
297
|
+
{% endif %}
|
298
|
+
"jsonPath": {{carousel_options.xhr_data_path | json}},
|
299
|
+
"jsonSuccess": customDataSuccess_{{forloop.index}}
|
300
|
+
});
|
301
|
+
/* eslint-enable */
|
302
|
+
|
303
|
+
// set instance variable (for later access)
|
304
|
+
_this.carousels.{{slider_id}} = $('#{{slider_id}}').data('owlCarousel');
|
305
|
+
|
306
|
+
// custom show data functions (each slide show)
|
307
|
+
function customDataSuccess_{{forloop.index}}(data){
|
308
|
+
var content = '';
|
309
|
+
for (var i in data['{{slider_id}}']) {
|
310
|
+
|
311
|
+
{% if slider_type == 'text' %}
|
312
|
+
var text = data['{{slider_id}}'][i].text;
|
313
|
+
{% endif %}
|
314
|
+
|
315
|
+
var href = data['{{slider_id}}'][i].href;
|
316
|
+
|
317
|
+
{% if slider_type == 'image' %}
|
318
|
+
var lb = data['{{slider_id}}'][i].lb;
|
319
|
+
var lb_caption = data['{{slider_id}}'][i].lb_caption;
|
320
|
+
var img = data['{{slider_id}}'][i].img;
|
321
|
+
var alt = data['{{slider_id}}'][i].alt;
|
322
|
+
|
323
|
+
// if lightbox is enabled (preference over href)
|
324
|
+
if (lb) {
|
325
|
+
|
326
|
+
if (lb_caption) {
|
327
|
+
|
328
|
+
content += '\t\t' + '<div class="item {{slider_id}}-item {{slide_border}}">'+ '\n';
|
329
|
+
content += '\t\t\t' + '<a href="' +img+ '" ' + 'data-lightbox="{{slider_id}}" data-title="' +lb_caption+ '">' + '\n';
|
330
|
+
content += '\t\t\t\t' + '<img class="lazyOwl" src="' +img+ '" alt="' +lb_caption+ '">' + '\n';
|
331
|
+
content += '\t\t\t' + ' </a>' + '\n';
|
332
|
+
if (href) {
|
333
|
+
content += '\t\t\t' + '<span id="{{slider_id}}_caption" class="text-start carousel-caption"><a class="md-grey-300 link-no-decoration" href="' +href+ '">' +lb_caption+ ' </a> </span>' + '\n';
|
334
|
+
} else {
|
335
|
+
content += '\t\t\t' + '<span id="{{slider_id}}_caption" class="text-start carousel-caption">' +lb_caption+ '</span>' + '\n';
|
336
|
+
}
|
337
|
+
content += '\t\t' + '</div>' + '\n';
|
338
|
+
} else {
|
339
|
+
// jadams, 2021-03-06: added link text (alt) for search engine optimization (SEO|Google)
|
340
|
+
// content += '<a class="item" href="' +img+ '" ' + 'data-lightbox="{{slider_id}}"> <img class="lazyOwl" data-src="' +img+ '" alt="' +alt+ '">' + ' </a>';
|
341
|
+
//
|
342
|
+
content += '<a class="item link-no-decoration" href="' + img + '" ';
|
343
|
+
content += 'data-lightbox="{{slider_id}}"> <img class="lazyOwl" data-src="' + img;
|
344
|
+
content += '" alt="' +alt+ '">' +alt+ ' </a>';
|
345
|
+
}
|
346
|
+
} else if (href) {
|
347
|
+
content += '<div class="item">' + '<img src="' +img+ '" alt="' +alt+ '">' + '</div>';
|
348
|
+
} else {
|
349
|
+
content += '<div class="item">' + '<img src="' +img+ '" alt="' +alt+ '">' + '</div>';
|
350
|
+
}
|
351
|
+
{% endif %}
|
352
|
+
|
353
|
+
{% if slider_type == 'text' %}
|
354
|
+
if (href) {
|
355
|
+
content += '<div class="item">' + '<p href=' +href+ '">' +text+ '</p>' + '</div>';
|
356
|
+
} else {
|
357
|
+
content += '<div class="item">' + '<p>' +text+ '</p>' + '</div>';
|
358
|
+
}
|
359
|
+
{% endif %}
|
360
|
+
}
|
361
|
+
$('#{{slider_id}}').html(content);
|
362
|
+
|
363
|
+
// jadams: managing captions should be adopted from
|
364
|
+
// JustifiedGallery as this simple solution does NOT work
|
365
|
+
// NOTE: Potentially the core of OwlCarousel has to be
|
366
|
+
// changed to manage captions natively
|
367
|
+
// -----------------------------------------------------------
|
368
|
+
// var captionID = '#{{slider_id}}_caption';
|
369
|
+
// $(captionID).hover(
|
370
|
+
// function(e) {
|
371
|
+
// $( this ).find( ".carousel-caption" ).show();
|
372
|
+
// e.stopPropagation();
|
373
|
+
// }, function(e) {
|
374
|
+
// $( this ).find( ".carousel-caption" ).hide();
|
375
|
+
// e.stopPropagation();
|
376
|
+
// }
|
377
|
+
// );
|
378
|
+
|
379
|
+
_this.setState('processed');
|
380
|
+
logger.debug('\n' + 'processing slider finished on id: {{slider_id}}');
|
381
|
+
} // END customDataSuccess_{{forloop.index}}
|
382
|
+
} // END if carousel exists
|
383
|
+
{% endif %}
|
384
|
+
{% endfor %}
|
385
|
+
|
386
|
+
clearInterval(dependencies_met_page_finished);
|
387
|
+
|
388
|
+
var dependencies_met_sliders_processed = setInterval(() => {
|
389
|
+
var slidersProcessed = (_this.getState() === 'processed') ? true : false;
|
390
|
+
|
391
|
+
if (slidersProcessed) {
|
392
|
+
|
393
|
+
_this.setState('finished');
|
394
|
+
logger.debug('\n' + 'state: ' + _this.getState());
|
395
|
+
logger.info('\n' + 'initializing module finished');
|
396
|
+
|
397
|
+
endTimeModule = Date.now();
|
398
|
+
logger.info('\n' + 'module initializing time: ' + (endTimeModule-startTimeModule) + 'ms');
|
399
|
+
|
400
|
+
clearInterval(dependencies_met_sliders_processed);
|
401
|
+
}
|
402
|
+
}, 10); // END 'dependencies_met_sliders_processed'
|
403
|
+
} // END if j1.getState 'finished'
|
404
|
+
}, 10); // END 'dependencies_met_page_finished'
|
405
|
+
}, // END init
|
406
|
+
|
407
|
+
// -----------------------------------------------------------------------
|
408
|
+
// Caption text animation (currently NOT used)
|
409
|
+
// -----------------------------------------------------------------------
|
410
|
+
|
411
|
+
// -------------------------------------------------------------------------
|
412
|
+
// fadeIn()
|
413
|
+
// animation (caption): fadeIn
|
414
|
+
// -------------------------------------------------------------------------
|
415
|
+
fadeIn: (id, options) => {
|
416
|
+
$(id + '.active .caption .fadeIn-1').stop().delay(options.delay)
|
417
|
+
.animate({
|
418
|
+
opacity: options.opacity
|
419
|
+
}, {
|
420
|
+
duration: options.duration,
|
421
|
+
easing: options.easing
|
422
|
+
});
|
423
|
+
$(id + '.active .caption .fadeIn-2').stop().delay(options.delay+200)
|
424
|
+
.animate({
|
425
|
+
opacity: options.opacity
|
426
|
+
}, {
|
427
|
+
duration: options.duration,
|
428
|
+
easing: options.easing
|
429
|
+
});
|
430
|
+
$(id + '.active .caption .fadeIn-3').stop().delay(options.delay+500)
|
431
|
+
.animate({
|
432
|
+
opacity: options.opacity
|
433
|
+
}, {
|
434
|
+
duration: options.duration,
|
435
|
+
easing: options.easing
|
436
|
+
});
|
437
|
+
},
|
438
|
+
|
439
|
+
// -------------------------------------------------------------------------
|
440
|
+
// fadeInUp()
|
441
|
+
// animation (caption): fadeInUp
|
442
|
+
// -------------------------------------------------------------------------
|
443
|
+
fadeInUp: (id, options) => {
|
444
|
+
$(id + '.active .caption .fadeInUp-1')
|
445
|
+
.stop()
|
446
|
+
.delay(options.delay)
|
447
|
+
.animate({
|
448
|
+
opacity: options.opacity,
|
449
|
+
top: options.top
|
450
|
+
}, {
|
451
|
+
duration: options.duration,
|
452
|
+
easing: options.easing
|
453
|
+
});
|
454
|
+
$(id + '.active .caption .fadeInUp-2')
|
455
|
+
.stop()
|
456
|
+
.delay(options.delay+200)
|
457
|
+
.animate({
|
458
|
+
opacity: options.opacity,
|
459
|
+
top: options.top
|
460
|
+
}, {
|
461
|
+
duration: 800,
|
462
|
+
easing: 'easeOutCubic'
|
463
|
+
});
|
464
|
+
$(id + '.active .caption .fadeInUp-3')
|
465
|
+
.stop()
|
466
|
+
.delay(options.delay+500)
|
467
|
+
.animate({
|
468
|
+
opacity: options.opacity,
|
469
|
+
top: options.top
|
470
|
+
}, {
|
471
|
+
duration: options.duration,
|
472
|
+
easing: options.easing
|
473
|
+
});
|
474
|
+
},
|
475
|
+
|
476
|
+
// -------------------------------------------------------------------------
|
477
|
+
// fadeInRight()
|
478
|
+
// animation (caption): fadeInRight
|
479
|
+
// -------------------------------------------------------------------------
|
480
|
+
fadeInRight: (id, options) => {
|
481
|
+
$(id + '.active .caption .fadeInRight-1')
|
482
|
+
.stop()
|
483
|
+
.delay(options.delay)
|
484
|
+
.animate({
|
485
|
+
opacity: options.opacity,
|
486
|
+
left: options.left
|
487
|
+
}, {
|
488
|
+
duration: options.duration,
|
489
|
+
easing: options.easing
|
490
|
+
});
|
491
|
+
$(id + '.active .caption .fadeInRight-2')
|
492
|
+
.stop()
|
493
|
+
.delay(options.delay+200)
|
494
|
+
.animate({
|
495
|
+
opacity: options.opacity,
|
496
|
+
left: options.left
|
497
|
+
}, {
|
498
|
+
duration: options.duration,
|
499
|
+
easing: options.easing
|
500
|
+
});
|
501
|
+
$(id + '.active .caption .fadeInRight-3')
|
502
|
+
.stop()
|
503
|
+
.delay(options.delay+500)
|
504
|
+
.animate({
|
505
|
+
opacity: options.opacity,
|
506
|
+
left: options.left
|
507
|
+
}, {
|
508
|
+
duration: options.duration,
|
509
|
+
easing: options.easing
|
510
|
+
});
|
511
|
+
},
|
512
|
+
|
513
|
+
// -------------------------------------------------------------------------
|
514
|
+
// fadeInDown()
|
515
|
+
// animation (caption): fadeInDown
|
516
|
+
// -------------------------------------------------------------------------
|
517
|
+
fadeInDown: (id, options) => {
|
518
|
+
$('#item-1').backstretch();
|
519
|
+
$(id + '.active .caption .fadeInDown-1')
|
520
|
+
.stop()
|
521
|
+
.delay(options.delay)
|
522
|
+
.animate({
|
523
|
+
opacity: options.opacity,
|
524
|
+
top: options.top
|
525
|
+
}, {
|
526
|
+
duration: options.duration,
|
527
|
+
easing: options.easing
|
528
|
+
});
|
529
|
+
$(id + '.active .caption .fadeInDown-2')
|
530
|
+
.stop()
|
531
|
+
.delay(options.delay+200)
|
532
|
+
.animate({
|
533
|
+
opacity: options.opacity,
|
534
|
+
top: options.top
|
535
|
+
}, {
|
536
|
+
duration: options.duration,
|
537
|
+
easing: options.easing
|
538
|
+
});
|
539
|
+
$(id + '.active .caption .fadeInDown-3')
|
540
|
+
.stop()
|
541
|
+
.delay(options.delay+500)
|
542
|
+
.animate({
|
543
|
+
opacity: options.opacity,
|
544
|
+
top: options.top
|
545
|
+
}, {
|
546
|
+
duration: options.duration,
|
547
|
+
easing: options.easing
|
548
|
+
});
|
549
|
+
},
|
550
|
+
|
551
|
+
// -------------------------------------------------------------------------
|
552
|
+
// fadeInLeft()
|
553
|
+
// animation (caption): fadeInLeft
|
554
|
+
// -------------------------------------------------------------------------
|
555
|
+
fadeInLeft: (id, options) => {
|
556
|
+
$('#item-2').backstretch();
|
557
|
+
$(id + '.active .caption .fadeInLeft-1')
|
558
|
+
.stop()
|
559
|
+
.delay(500)
|
560
|
+
.animate({
|
561
|
+
opacity: options.opacity,
|
562
|
+
top: options.left
|
563
|
+
}, {
|
564
|
+
duration: options.duration,
|
565
|
+
easing: options.easing
|
566
|
+
});
|
567
|
+
$(id + '.active .caption .fadeInLeft-2')
|
568
|
+
.stop()
|
569
|
+
.delay(700)
|
570
|
+
.animate({
|
571
|
+
opacity: options.opacity,
|
572
|
+
top: options.left
|
573
|
+
}, {
|
574
|
+
duration: options.duration,
|
575
|
+
easing: options.easing
|
576
|
+
});
|
577
|
+
$(id + '.active .caption .fadeInLeft-3')
|
578
|
+
.stop()
|
579
|
+
.delay(1000)
|
580
|
+
.animate({
|
581
|
+
opacity: options.opacity,
|
582
|
+
top: options.left
|
583
|
+
}, {
|
584
|
+
duration: options.duration,
|
585
|
+
easing: options.easing
|
586
|
+
});
|
587
|
+
},
|
588
|
+
|
589
|
+
// -------------------------------------------------------------------------
|
590
|
+
// fadeInReset()
|
591
|
+
// reset animation (caption): fadeIn
|
592
|
+
// -------------------------------------------------------------------------
|
593
|
+
fadeInReset: (id, options) => {
|
594
|
+
if (!options.dragging) {
|
595
|
+
$(id + '.caption .fadeIn-1,' +
|
596
|
+
id + '.caption .fadeIn-2,' +
|
597
|
+
id + '.caption .fadeIn-3')
|
598
|
+
.stop()
|
599
|
+
.delay(options.delay)
|
600
|
+
.animate({
|
601
|
+
opacity: options.opacity
|
602
|
+
}, {
|
603
|
+
duration: options.duration,
|
604
|
+
easing: options.easing
|
605
|
+
});
|
606
|
+
} else {
|
607
|
+
$(id + '.caption .fadeIn-1,' +
|
608
|
+
id + '.caption .fadeIn-2,' +
|
609
|
+
id + '.caption .fadeIn-3')
|
610
|
+
.css({
|
611
|
+
opacity: options.opacity
|
612
|
+
});
|
613
|
+
}
|
614
|
+
}, // END fadeOut
|
615
|
+
|
616
|
+
// -------------------------------------------------------------------------
|
617
|
+
// fadeInUpReset()
|
618
|
+
// reset animation (caption): fadeInUp
|
619
|
+
// -------------------------------------------------------------------------
|
620
|
+
fadeInUpReset: (id, options) => {
|
621
|
+
if (!options.dragging) {
|
622
|
+
$(id + '.caption .fadeInUp-1,' +
|
623
|
+
id + '.caption .fadeInUp-2,' +
|
624
|
+
id + '.caption .fadeInUp-3')
|
625
|
+
.stop()
|
626
|
+
.delay(options.delay)
|
627
|
+
.animate({
|
628
|
+
opacity: options.opacity,
|
629
|
+
top: options.top
|
630
|
+
}, {
|
631
|
+
duration: options.duration,
|
632
|
+
easing: options.easing
|
633
|
+
});
|
634
|
+
} else {
|
635
|
+
$(id + '.caption .fadeInUp-1', +
|
636
|
+
id + '.caption .fadeInUp-2,' +
|
637
|
+
id + '.caption .fadeInUp-3')
|
638
|
+
.css({
|
639
|
+
opacity: options.opacity,
|
640
|
+
top: options.top
|
641
|
+
});
|
642
|
+
}
|
643
|
+
}, // END fadeInUpReset
|
644
|
+
|
645
|
+
// -------------------------------------------------------------------------
|
646
|
+
// fadeInRightReset()
|
647
|
+
// reset animation (caption): fadeInRight
|
648
|
+
// -------------------------------------------------------------------------
|
649
|
+
fadeInRightReset: (id, options) => {
|
650
|
+
if (!options.dragging) {
|
651
|
+
$(id + '.caption .fadeInRight-1,' +
|
652
|
+
id + '.caption .fadeInRight-2,' +
|
653
|
+
id + '.caption .fadeInRight-3')
|
654
|
+
.stop()
|
655
|
+
.delay(options.delay)
|
656
|
+
.animate({
|
657
|
+
opacity: options.opacity,
|
658
|
+
left: options.left
|
659
|
+
}, {
|
660
|
+
duration: options.duration,
|
661
|
+
easing: options.easing
|
662
|
+
});
|
663
|
+
} else {
|
664
|
+
$(id + '.caption .fadeInRight-1,' +
|
665
|
+
id + '.caption .fadeInRight-2,' +
|
666
|
+
id + '.caption .fadeInRight-3')
|
667
|
+
.css({
|
668
|
+
opacity: options.opacity,
|
669
|
+
left: options.left
|
670
|
+
});
|
671
|
+
}
|
672
|
+
}, // END fadeInRightReset
|
673
|
+
|
674
|
+
// -------------------------------------------------------------------------
|
675
|
+
// fadeOutDown()
|
676
|
+
// reset animation (caption): fadeInDown
|
677
|
+
// -------------------------------------------------------------------------
|
678
|
+
fadeInDownReset: (id, options) => {
|
679
|
+
if (!options.dragging) {
|
680
|
+
$(id + '.caption .fadeInDown-1,' +
|
681
|
+
id + '.caption .fadeInDown-2,' +
|
682
|
+
id + '.caption .fadeInDown-3')
|
683
|
+
.stop()
|
684
|
+
.delay(options.delay)
|
685
|
+
.animate({
|
686
|
+
opacity: options.opacity,
|
687
|
+
top: options.top
|
688
|
+
}, {
|
689
|
+
duration: options.duration,
|
690
|
+
easing: options.easing
|
691
|
+
});
|
692
|
+
} else {
|
693
|
+
$(id + '.caption .fadeInDown-1,' +
|
694
|
+
id + '.caption .fadeInDown-2,' +
|
695
|
+
id + '.caption .fadeInDown-3')
|
696
|
+
.css({
|
697
|
+
opacity: options.opacity,
|
698
|
+
top: options.transitionTypes
|
699
|
+
});
|
700
|
+
}
|
701
|
+
}, // END fadeOutDown
|
702
|
+
|
703
|
+
// -------------------------------------------------------------------------
|
704
|
+
// fadeInLeftReset()
|
705
|
+
// reset animation (caption): fadeInLeft
|
706
|
+
// -------------------------------------------------------------------------
|
707
|
+
fadeInLeftReset: (id, options) => {
|
708
|
+
if (!options.dragging) {
|
709
|
+
$(id + '.caption .fadeInLeft-1,' +
|
710
|
+
id + '.caption .fadeInLeft-2,' +
|
711
|
+
id + '.caption .fadeInLeft-3')
|
712
|
+
.stop()
|
713
|
+
.delay(options.delay)
|
714
|
+
.animate({
|
715
|
+
opacity: options.opacity,
|
716
|
+
left: options.left
|
717
|
+
}, {
|
718
|
+
duration: options.duration,
|
719
|
+
easing: options.easing
|
720
|
+
});
|
721
|
+
} else {
|
722
|
+
$(id + '.caption .fadeInLeft-1,' +
|
723
|
+
id + '.caption .fadeInLeft-2,' +
|
724
|
+
id + '.caption .fadeInLeft-3')
|
725
|
+
.css({
|
726
|
+
opacity: options.opacity,
|
727
|
+
left: options.left
|
728
|
+
});
|
729
|
+
}
|
730
|
+
}, // END fadeInLeftReset
|
731
|
+
|
732
|
+
// -------------------------------------------------------------------------
|
733
|
+
// messageHandler()
|
734
|
+
// manage messages send from other J1 modules
|
735
|
+
// -------------------------------------------------------------------------
|
736
|
+
messageHandler: (sender, message) => {
|
737
|
+
var json_message = JSON.stringify(message, undefined, 2);
|
738
|
+
|
739
|
+
logText = '\n' + 'received message from ' + sender + ': ' + json_message;
|
740
|
+
logger.debug(logText);
|
741
|
+
|
742
|
+
// -----------------------------------------------------------------------
|
743
|
+
// process commands|actions
|
744
|
+
// -----------------------------------------------------------------------
|
745
|
+
if (message.type === 'command' && message.action === 'module_initialized') {
|
746
|
+
|
747
|
+
//
|
748
|
+
// place handling of command|action here
|
749
|
+
//
|
750
|
+
|
751
|
+
logger.info('\n' + message.text);
|
752
|
+
}
|
753
|
+
|
754
|
+
//
|
755
|
+
// place handling of other command|action here
|
756
|
+
//
|
757
|
+
|
758
|
+
return true;
|
759
|
+
}, // END messageHandler
|
760
|
+
|
761
|
+
// -------------------------------------------------------------------------
|
762
|
+
// setState()
|
763
|
+
// sets the current (processing) state of the module
|
764
|
+
// -------------------------------------------------------------------------
|
765
|
+
setState: (stat) => {
|
766
|
+
_this.state = stat;
|
767
|
+
}, // END setState
|
768
|
+
|
769
|
+
// -------------------------------------------------------------------------
|
770
|
+
// getState()
|
771
|
+
// Returns the current (processing) state of the module
|
772
|
+
// -------------------------------------------------------------------------
|
773
|
+
getState: () => {
|
774
|
+
return _this.state;
|
775
|
+
} // END getState
|
776
|
+
|
777
|
+
}; // END main (return)
|
778
|
+
})(j1, window);
|
779
|
+
|
780
|
+
{% endcapture %}
|
781
|
+
{% if production %}
|
782
|
+
{{ cache | minifyJS }}
|
783
|
+
{% else %}
|
784
|
+
{{ cache | strip_empty_lines }}
|
785
|
+
{% endif %}
|
786
|
+
{% assign cache = nil %}
|