j1-template 2023.1.0 → 2023.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/layouts/content_generator_collection.html +2 -3
- data/assets/data/banner.html +8 -6
- data/assets/data/masonry.html +263 -73
- data/assets/data/slick.html +155 -59
- data/assets/error_pages/HTTP204.html +1 -1
- data/assets/error_pages/HTTP400.html +1 -1
- data/assets/error_pages/HTTP401.html +1 -1
- data/assets/error_pages/HTTP403.html +1 -1
- data/assets/error_pages/HTTP404.html +1 -1
- data/assets/error_pages/HTTP444.html +1 -1
- data/assets/error_pages/HTTP445.html +1 -1
- data/assets/error_pages/HTTP446.html +1 -1
- data/assets/error_pages/HTTP447.html +1 -1
- data/assets/error_pages/HTTP448.html +1 -1
- data/assets/error_pages/HTTP500.html +1 -1
- data/assets/error_pages/HTTP501.html +1 -1
- data/assets/error_pages/HTTP502.html +1 -1
- data/assets/error_pages/HTTP503.html +1 -1
- data/assets/themes/j1/adapter/js/masonry.js +9 -1
- data/assets/themes/j1/adapter/js/slick.js +239 -134
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +247 -0
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +55 -57
- data/assets/themes/j1/core/js/template.min.js +6 -6
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/masonry/css/theme/uno.css +1 -1
- data/assets/themes/j1/modules/masonry/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/slick/lightbox/README.md +6 -1
- data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.css +36 -0
- data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.min.css +15 -0
- data/assets/themes/j1/modules/slick/lightbox/js/slick-lightbox.js +1 -1
- data/assets/themes/j1/modules/slick/slider/css/theme/uno.css +173 -137
- data/assets/themes/j1/modules/slick/slider/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/slick/slider/js/slick.js +2970 -2233
- data/assets/themes/j1/modules/translator/css/translator.css +3 -19
- data/assets/themes/j1/modules/translator/css/translator.min.css +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +25 -1
- data/lib/starter_web/_data/blocks/banner.yml +45 -46
- data/lib/starter_web/_data/blocks/panel.yml +9 -9
- data/lib/starter_web/_data/layouts/home.yml +39 -21
- data/lib/starter_web/_data/modules/defaults/slick.yml +2 -2
- data/lib/starter_web/_data/modules/masonry.yml +155 -41
- data/lib/starter_web/_data/modules/navigator_menu.yml +632 -591
- data/lib/starter_web/_data/modules/scroller.yml +1 -1
- data/lib/starter_web/_data/modules/slick.yml +260 -54
- data/lib/starter_web/_data/puma/config.rb +10 -0
- data/lib/starter_web/_data/resources.yml +1 -0
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +24 -0
- data/lib/starter_web/_includes/custom/static/readme +1 -1
- data/lib/starter_web/_includes/custom/templates/collection_panel.html +131 -0
- data/lib/starter_web/_includes/custom/templates/custom_header.html +98 -76
- data/lib/starter_web/_includes/custom/templates/people_panel.html +144 -0
- data/lib/starter_web/_includes/custom/templates/readme +1 -1
- data/lib/starter_web/_plugins/asciidoctor/carousel-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gist-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/lightbox-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/mdil-icon-inline.rb +10 -0
- data/lib/starter_web/_plugins/asciidoctor/placeholder-inline.rb +44 -0
- data/lib/starter_web/_plugins/asciidoctor/slick-block.rb +1 -1
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/images/collections/people/diana-petersen.jpg +0 -0
- data/lib/starter_web/assets/images/collections/people/larry-parker.jpg +0 -0
- data/lib/starter_web/assets/images/collections/people/parveen-anand.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kelly-sikkemal.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kira-auf-der-heide.jpg +0 -0
- data/lib/starter_web/assets/images/modules/gallery/old_times/image_02.jpg +0 -0
- data/lib/starter_web/collections/_biography/a-life-in-questions.adoc +5 -5
- data/lib/starter_web/collections/_biography/becoming.adoc +5 -5
- data/lib/starter_web/collections/_biography/born-to-run.adoc +5 -5
- data/lib/starter_web/collections/_biography/forty-autumns.adoc +5 -5
- data/lib/starter_web/collections/_biography/not-dead-yet.adoc +5 -6
- data/lib/starter_web/collections/_biography/princess-diarist-the.adoc +5 -5
- data/lib/starter_web/collections/_biography/when-breath-becomes-air.adoc +6 -7
- data/lib/starter_web/collections/_fantasy/harry-potter-deathly-hallows.adoc +14 -4
- data/lib/starter_web/collections/_fantasy/harry-potter-philosophers-stone.adoc +13 -3
- data/lib/starter_web/collections/_fantasy/mistborn-trilogy.adoc +11 -3
- data/lib/starter_web/collections/_fantasy/ready-player-one.adoc +15 -3
- data/lib/starter_web/collections/_fantasy/sword-of-destiny.adoc +11 -3
- data/lib/starter_web/collections/_fantasy/terry-pratchet-diary-2017.adoc +11 -3
- data/lib/starter_web/collections/_people/diana-petersen.adoc +167 -0
- data/lib/starter_web/collections/_people/larry-parker.adoc +167 -0
- data/lib/starter_web/collections/_people/parveen-anand.adoc +167 -0
- data/lib/starter_web/collections/_portfolio/branding.adoc +97 -0
- data/lib/starter_web/collections/_portfolio/graphic_design.adoc +97 -0
- data/lib/starter_web/collections/_portfolio/identity.adoc +99 -0
- data/lib/starter_web/collections/_portfolio/illustration.adoc +101 -0
- data/lib/starter_web/collections/_portfolio/photography.adoc +100 -0
- data/lib/starter_web/collections/_portfolio/web_design.adoc +109 -0
- data/lib/starter_web/collections/_romance/breath-of-snow-and-ashes-a.adoc +12 -3
- data/lib/starter_web/collections/_romance/dressmaker-the.adoc +10 -3
- data/lib/starter_web/collections/_romance/fiery-cross-the.adoc +13 -3
- data/lib/starter_web/collections/_romance/it-ends-with-us.adoc +11 -3
- data/lib/starter_web/collections/_romance/outlander-novel.adoc +12 -3
- data/lib/starter_web/collections/_romance/virgins-outlander-short-story.adoc +16 -4
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-static-site-generators.adoc +2 -2
- data/lib/starter_web/collections/posts/public/featured/_posts/_includes/attributes.asciidoc +2 -2
- data/lib/starter_web/collections/posts/public/series/_posts/2022-08-01-organize-your-life.adoc +4 -4
- data/lib/starter_web/collections/posts/public/series/_posts/2022-08-02-organize-your-life.adoc +4 -4
- data/lib/starter_web/collections/posts/public/series/_posts/2022-08-03-organize-your-life.adoc +4 -4
- data/lib/starter_web/collections/posts/public/series/_posts/2022-09-01-organize-your-life.adoc +4 -4
- data/lib/starter_web/collections/posts/public/series/_posts/2022-09-02-organize-your-life.adoc +4 -4
- data/lib/starter_web/index.html +129 -129
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_all_books.adoc +107 -0
- data/lib/starter_web/pages/public/{bookshelf → learn/bookshelf}/article_previewer/viewer_biography.adoc +21 -12
- data/lib/starter_web/pages/public/{bookshelf → learn/bookshelf}/article_previewer/viewer_fantasy.adoc +11 -6
- data/lib/starter_web/pages/public/{bookshelf → learn/bookshelf}/article_previewer/viewer_romance.adoc +11 -5
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +53 -4
- data/lib/starter_web/pages/public/plans/plans.adoc +25 -12
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +59 -79
- data/assets/data/masonry.4.html +0 -213
- data/assets/themes/j1/adapter/js/slick.3.js +0 -365
- data/lib/starter_web/assets/images/collections/blog/wikipedia/columbia-river.1200x400.jpg +0 -0
- data/lib/starter_web/assets/images/collections/blog/wikipedia/minneapolis.1200x400.jpg +0 -0
- data/lib/starter_web/assets/images/collections/blog/wikipedia/narcise-snake-pits.1200x400.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img1.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img2.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img3.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img4.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img5.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img6.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img7.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img8.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/200x150/img9.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/client-1.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/client-2.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/client-3.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/client-4.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/client-5.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/client-6.png +0 -0
- data/lib/starter_web/assets/images/parsa/customers/client-7.png +0 -0
- data/lib/starter_web/assets/images/parsa/icons/favicon.ico +0 -0
- data/lib/starter_web/assets/images/parsa/icons/icon.png +0 -0
- data/lib/starter_web/assets/images/parsa/icons/icon.svg +0 -152
- data/lib/starter_web/assets/images/parsa/icons/logo.svg +0 -172
- data/lib/starter_web/assets/images/parsa/masthead/19-02-_2023_09-05-46.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/masthead/banner-img.png +0 -0
- data/lib/starter_web/assets/images/parsa/pages/1920x1280/author.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/pages/1920x1280/contact.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/pages/author.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/pages/contact.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/partners/scalable/facebook.svg +0 -34
- data/lib/starter_web/assets/images/parsa/partners/scalable/google.svg +0 -35
- data/lib/starter_web/assets/images/parsa/partners/scalable/ibm.svg +0 -24
- data/lib/starter_web/assets/images/parsa/partners/scalable/microsoft.svg +0 -42
- data/lib/starter_web/assets/images/parsa/posts/1280x1024/post-img.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/posts/1280x1024/post-single.jpg +0 -0
- data/lib/starter_web/assets/images/parsa/promo/home/screenshot.jpg +0 -0
- data/lib/starter_web/pages/public/previewer/preview_masonry.adoc +0 -361
- data/lib/starter_web/pages/public/previewer/preview_slick_slider.adoc +0 -375
- /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/1.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/2.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/3.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/4.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/5.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/6.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/icons → icons/controls}/close-icon.svg +0 -0
- /data/lib/starter_web/assets/images/{parsa/icons → icons/controls}/up.svg +0 -0
- /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/dynamic-web-access.png +0 -0
- /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/jamstack-generators.png +0 -0
- /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/jekyll.1200x400.png +0 -0
- /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/jekyll.png +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-1.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-2.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-3.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-4.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-5.jpg +0 -0
- /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/static-web-access.png +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-1.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-10.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-11.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-12.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-13.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-2.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-3.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-4.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-5.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-6.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-7.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-8.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-9.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/post-img.jpg +0 -0
- /data/lib/starter_web/assets/images/{parsa/posts → posts}/post-single.jpg +0 -0
- /data/lib/starter_web/pages/public/{bookshelf → learn/bookshelf}/jekyll_collections.adoc +0 -0
@@ -21,6 +21,8 @@ regenerate: true
|
|
21
21
|
# {{ liquid_var | debug }}
|
22
22
|
# cookie_options: {{ cookie_options | debug }}
|
23
23
|
# -----------------------------------------------------------------------------
|
24
|
+
# See: https://github.com/kenwheeler/slick
|
25
|
+
# -----------------------------------------------------------------------------
|
24
26
|
{% endcomment %}
|
25
27
|
|
26
28
|
{% comment %} Liquid var initialization
|
@@ -28,15 +30,17 @@ regenerate: true
|
|
28
30
|
|
29
31
|
{% comment %} Set config files
|
30
32
|
-------------------------------------------------------------------------------- {% endcomment %}
|
31
|
-
{% assign environment
|
32
|
-
{% assign blocks
|
33
|
-
{% assign modules
|
34
|
-
{% assign template_config
|
33
|
+
{% assign environment = site.environment %}
|
34
|
+
{% assign blocks = site.data.blocks %}
|
35
|
+
{% assign modules = site.data.modules %}
|
36
|
+
{% assign template_config = site.data.j1_config %}
|
35
37
|
|
36
38
|
{% comment %} Set config data
|
37
39
|
-------------------------------------------------------------------------------- {% endcomment %}
|
38
|
-
{% assign slick_defaults
|
39
|
-
{% assign slick_settings
|
40
|
+
{% assign slick_defaults = modules.defaults.slick.defaults %}
|
41
|
+
{% assign slick_settings = modules.slick.settings %}
|
42
|
+
{% assign slick_lightbox_defaults = modules.defaults.slick.defaults.lightbox %}
|
43
|
+
{% assign slick_lightbox_settings = modules.slick.settings.lightbox %}
|
40
44
|
|
41
45
|
{% comment %} Set config options
|
42
46
|
-------------------------------------------------------------------------------- {% endcomment %}
|
@@ -78,15 +82,18 @@ regenerate: true
|
|
78
82
|
j1.adapter.slick = (function (j1, window) {
|
79
83
|
var environment = '{{environment}}';
|
80
84
|
var responsiveSettings = [];
|
81
|
-
var
|
85
|
+
var carouselResponsiveSettings = [];
|
82
86
|
var _this;
|
83
87
|
var logger;
|
84
88
|
var logText;
|
85
89
|
var slickDefaults;
|
86
90
|
var slickSettings;
|
91
|
+
var slickLightboxDefaults;
|
92
|
+
var slickLightboxSettings;
|
93
|
+
var slickLightboxOptions;
|
87
94
|
var slickOptions;
|
88
|
-
var
|
89
|
-
var
|
95
|
+
var carouselOptions;
|
96
|
+
var carouselSettings;
|
90
97
|
|
91
98
|
// ---------------------------------------------------------------------------
|
92
99
|
// Helper functions
|
@@ -101,12 +108,14 @@ j1.adapter.slick = (function (j1, window) {
|
|
101
108
|
// Initializer
|
102
109
|
// -------------------------------------------------------------------------
|
103
110
|
init: function (options) {
|
104
|
-
var xhrLoadState
|
105
|
-
var load_dependencies
|
106
|
-
var
|
111
|
+
var xhrLoadState = 'pending'; // (initial) load state for the HTML portion of the carousel
|
112
|
+
var load_dependencies = {}; // dynamic variable
|
113
|
+
var carouselResponsiveSettingsOBJ = {}; // initial object for responsive settings
|
114
|
+
var reload_on_resize = false;
|
107
115
|
var dependency;
|
108
|
-
var
|
109
|
-
var
|
116
|
+
var carouselResponsiveSettingsYAML;
|
117
|
+
var carouselResponsiveSettingsSTRING;
|
118
|
+
var slick_lightbox_enabled;
|
110
119
|
|
111
120
|
// -----------------------------------------------------------------------
|
112
121
|
// Default module settings
|
@@ -117,23 +126,33 @@ j1.adapter.slick = (function (j1, window) {
|
|
117
126
|
}, options);
|
118
127
|
|
119
128
|
// Load module DEFAULTS|CONFIG
|
120
|
-
slickDefaults
|
121
|
-
slickSettings
|
122
|
-
|
129
|
+
slickDefaults = $.extend({}, {{slick_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
|
130
|
+
slickSettings = $.extend({}, {{slick_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
|
131
|
+
slickLightboxDefaults = $.extend({}, {{slick_lightbox_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
|
132
|
+
slickLightboxSettings = $.extend({}, {{slick_lightbox_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
|
133
|
+
slickLightboxOptions = $.extend(true, {}, slickLightboxDefaults, slickLightboxSettings);
|
134
|
+
slickOptions = $.extend(true, {}, slickDefaults, slickSettings);
|
123
135
|
|
124
136
|
// -----------------------------------------------------------------------
|
125
137
|
// Global variable settings
|
126
138
|
// -----------------------------------------------------------------------
|
127
|
-
_this
|
128
|
-
logger
|
139
|
+
_this = j1.adapter.slick;
|
140
|
+
logger = log4javascript.getLogger('j1.adapter.slick');
|
129
141
|
|
130
142
|
_this.setState('started');
|
131
143
|
logger.debug('\n' + 'state: ' + _this.getState());
|
132
144
|
logger.info('\n' + 'module is being initialized');
|
133
145
|
|
134
|
-
// load HTML portion for all
|
135
|
-
console.debug('loading HTML portion for all
|
136
|
-
_this.
|
146
|
+
// load HTML portion for all carousels
|
147
|
+
console.debug('loading HTML portion for all carousels configured');
|
148
|
+
_this.loadCarouselHTML(slickOptions, slickOptions.carousels);
|
149
|
+
|
150
|
+
// Re-Init all carousels in a page if window is resized (if enabled)
|
151
|
+
if (reload_on_resize) {
|
152
|
+
window.onresize = function() {
|
153
|
+
location.reload();
|
154
|
+
}
|
155
|
+
}
|
137
156
|
|
138
157
|
// -----------------------------------------------------------------------
|
139
158
|
// initializer
|
@@ -144,175 +163,257 @@ j1.adapter.slick = (function (j1, window) {
|
|
144
163
|
|
145
164
|
if ( j1.getState() === 'finished' && pageVisible ) {
|
146
165
|
|
147
|
-
{% for
|
148
|
-
logger.info('\n' + '
|
166
|
+
{% for carousel in slick_settings.carousels %} {% if carousel.enabled %}
|
167
|
+
logger.info('\n' + 'carousel is being initialized on id: ' + '{{carousel.id}}');
|
149
168
|
|
150
|
-
{% if
|
151
|
-
logger.info('\n' + 'collect responsive settings for
|
152
|
-
// collect breakpoint settings from
|
153
|
-
responsiveSettings = $.extend({}, {{
|
154
|
-
// generate
|
155
|
-
|
169
|
+
{% if carousel.options.responsive %}
|
170
|
+
logger.info('\n' + 'collect responsive settings for carousel on id: ' + '{{carousel.id}}');
|
171
|
+
// collect breakpoint settings from carousel config
|
172
|
+
responsiveSettings = $.extend({}, {{carousel.responsive | replace: 'nil', 'null' | replace: '=>', ':' }});
|
173
|
+
// generate carousel breakpoint settings as YAML data structure
|
174
|
+
carouselResponsiveSettings = '[' ;
|
156
175
|
for (const [obj_key, obj_value] of Object.entries(responsiveSettings)) {
|
157
176
|
var length = Object.keys(obj_value.settings).length;
|
158
177
|
var count = 0;
|
159
178
|
for (const [key, value] of Object.entries(obj_value.settings)) {
|
160
179
|
count++;
|
161
180
|
if (key == 'breakOn' && count == 1) {
|
162
|
-
|
163
|
-
|
164
|
-
|
181
|
+
carouselResponsiveSettings += ' {' ;
|
182
|
+
carouselResponsiveSettings += ' breakpoint: ' + value + ',' ;
|
183
|
+
carouselResponsiveSettings += ' settings: {' ;
|
165
184
|
} else {
|
166
|
-
|
185
|
+
carouselResponsiveSettings += ' ' + key + ': ' + value + ',' ;
|
167
186
|
}
|
168
187
|
// close current breakpoint element
|
169
188
|
if (count == length) {
|
170
|
-
|
171
|
-
|
189
|
+
carouselResponsiveSettings += ' }' ;
|
190
|
+
carouselResponsiveSettings += ' },' ;
|
172
191
|
}
|
173
192
|
}
|
174
193
|
} // End generate breakpoint YAML elements
|
175
194
|
|
176
195
|
// close breakpoint YAML data
|
177
|
-
|
196
|
+
carouselResponsiveSettings += ']';
|
178
197
|
{% endif %}
|
179
198
|
|
180
199
|
// create dynamic loader variable|s
|
181
|
-
dependency = 'dependencies_met_html_loaded_{{
|
200
|
+
dependency = 'dependencies_met_html_loaded_{{carousel.id}}';
|
182
201
|
load_dependencies[dependency] = '';
|
183
202
|
|
184
|
-
// initialize
|
185
|
-
load_dependencies['dependencies_met_html_loaded_{{
|
186
|
-
// check if HTML portion of the
|
187
|
-
xhrLoadState = j1.xhrDOMState['#{{
|
203
|
+
// initialize carousel if HTML portion successfully loaded
|
204
|
+
load_dependencies['dependencies_met_html_loaded_{{carousel.id}}'] = setInterval (function (options) {
|
205
|
+
// check if HTML portion of the carousel is loaded successfully (loadcarouselHTML)
|
206
|
+
xhrLoadState = j1.xhrDOMState['#{{carousel.id}}_parent'];
|
188
207
|
if ( xhrLoadState === 'success' ) {
|
189
208
|
|
190
|
-
// collect general
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
// convert
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
logger.debug('\n' + 'responsive settings on
|
199
|
-
|
200
|
-
$('.{{
|
201
|
-
logger.info('\n' + '
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
209
|
+
// collect general carousel settings
|
210
|
+
carouselOptions = $.extend({}, {{carousel.options | replace: 'nil', 'null' | replace: '=>', ':' }});
|
211
|
+
carouselSettings = $.extend(true, {}, slickDefaults, carouselOptions );
|
212
|
+
|
213
|
+
// convert carousel responsive settings to object (carouselResponsiveSettingsOBJ)
|
214
|
+
carouselResponsiveSettingsYAML = yaml.loadAll(carouselResponsiveSettings, 'utf8');
|
215
|
+
carouselResponsiveSettingsOBJ = carouselResponsiveSettingsYAML[0];
|
216
|
+
carouselResponsiveSettingsSTRING = JSON.stringify(carouselResponsiveSettingsOBJ, null, 4);
|
217
|
+
logger.debug('\n' + 'responsive settings on carousel id #{{carousel.id}}: ' + '\n' + carouselResponsiveSettingsSTRING);
|
218
|
+
|
219
|
+
$('.{{carousel.id | replace: '_','-' }}').on('init', function(event, slick) {
|
220
|
+
logger.info('\n' + 'carousel initialized on id: {{carousel.id}}');
|
221
|
+
|
222
|
+
slick_lightbox_enabled = '{{carousel.lightbox.enabled}}';
|
223
|
+
|
224
|
+
// check if a lightbox is used|enabled
|
225
|
+
if ( slick_lightbox_enabled !== '' && slick_lightbox_enabled == 'true' ) {
|
226
|
+
slick_lightbox_enabled = true;
|
227
|
+
} else {
|
228
|
+
slick_lightbox_enabled = false;
|
229
|
+
}
|
230
|
+
|
231
|
+
if (slick_lightbox_enabled) {
|
232
|
+
logger.info('\n' + 'initialize lightbox on id: {{carousel.id}}');
|
233
|
+
|
234
|
+
// See: http://mreq.github.io/slick-lightbox/demo/
|
235
|
+
$('#{{carousel.id}}').slickLightbox({
|
236
|
+
caption: slickLightboxOptions.caption,
|
237
|
+
useHistoryApi: slickLightboxOptions.useHistoryApi,
|
238
|
+
background: slickLightboxOptions.background,
|
239
|
+
closeOnEscape: slickLightboxOptions.closeOnEscape,
|
240
|
+
closeOnBackdropClick: slickLightboxOptions.closeOnBackdropClick,
|
241
|
+
navigateByKeyboard: slickLightboxOptions.navigateByKeyboard,
|
242
|
+
destroyTimeout: slickLightboxOptions.destroyTimeout,
|
243
|
+
imageMaxHeight: slickLightboxOptions.imageMaxHeight,
|
244
|
+
lazy: slickLightboxOptions.lazy,
|
245
|
+
});
|
246
|
+
} // END carousel lightbox enabled
|
247
|
+
|
248
|
+
logger.info('\n' + 'adjust positions of arrows on id: {{carousel.id}}');
|
249
|
+
var buttons = $("#{{carousel.id}} > button");
|
250
|
+
|
251
|
+
// recalculate right arrow position based on gutter settings
|
252
|
+
//
|
253
|
+
var percentage_right = 3 + carouselSettings.gutters;
|
254
|
+
$.each($(buttons), function(index, button) {
|
255
|
+
if (button.textContent.includes("Next")) {
|
256
|
+
$(button).attr('style','right: ' + percentage_right + '%');
|
257
|
+
}
|
258
|
+
});
|
259
|
+
|
260
|
+
// add CSS style for individual top position for all carousels
|
261
|
+
//
|
262
|
+
if ($('#{{carousel.id}}_caption')) {
|
263
|
+
logger.info('\n' + 'adjust top position of arrows on id: {{carousel.id}}');
|
264
|
+
var buttons = $("#{{carousel.id}} > button");
|
265
|
+
$.each($(buttons), function(index, button) {
|
266
|
+
$(button).addClass('slick-arrow-{{carousel.id}}');
|
214
267
|
});
|
215
268
|
}
|
216
|
-
});
|
217
269
|
|
218
|
-
//
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
270
|
+
}); // END on carousel init
|
271
|
+
|
272
|
+
function debounce(callback, timeout = 300) {
|
273
|
+
let timer;
|
274
|
+
var buttons = $("#{{carousel.id}} > button");
|
275
|
+
|
276
|
+
$.each($(buttons), function(index, button) {
|
277
|
+
$(button).addClass('slick-arrow-{{carousel.id}}');
|
278
|
+
});
|
279
|
+
|
280
|
+
return (...args) => {
|
281
|
+
clearTimeout(timer);
|
282
|
+
timer = setTimeout(() => { callback.apply(this, args); }, timeout);
|
283
|
+
};
|
284
|
+
}
|
285
|
+
|
286
|
+
// calculate individual arrow positions for all carousels
|
287
|
+
//
|
288
|
+
function positionSlickArrows (e) {
|
289
|
+
var dependencies_met_page_ready = setInterval (function (options) {
|
290
|
+
var pageState = $('#no_flicker').css('display');
|
291
|
+
var pageVisible = (pageState == 'block') ? true: false;
|
292
|
+
var slideImageHeight;
|
293
|
+
if ( j1.getState() === 'finished' && pageVisible ) {
|
294
|
+
const carousel_type = '{{carousel.type}}';
|
295
|
+
const $slick = $('.{{carousel.id | replace: '_','-' }}');
|
296
|
+
const $slides = $slick.find('.slick-slide');
|
297
|
+
const $currentSlide = $slides.filter((index, slide) => $(slide).hasClass('slick-current'));
|
298
|
+
|
299
|
+
if (carousel_type == 'example') {
|
300
|
+
slideImageHeight = ($currentSlide.find('{{carousel.style}}').height() / 2) - 25;
|
301
|
+
} else {
|
302
|
+
slideImageHeight = ($currentSlide.find('img').height() / 2) - 20;
|
303
|
+
}
|
304
|
+
|
305
|
+
logger.info('\n' + 'adjust top arrow position (centered) by ' + slideImageHeight + ' on id: {{carousel.id}}');
|
306
|
+
$('.slick-arrow-{{carousel.id}}').css('top', slideImageHeight + 'px');
|
307
|
+
clearInterval(dependencies_met_page_ready);
|
308
|
+
}
|
309
|
+
}, 25);
|
310
|
+
}
|
311
|
+
|
312
|
+
// set individual arrow positions for a carousel
|
313
|
+
//
|
314
|
+
$('.{{carousel.id | replace: '_','-' }}').on('init afterChange', positionSlickArrows);
|
315
|
+
|
316
|
+
// setup the carousel
|
317
|
+
logger.info('\n' + 'carousel is being setup on id: ' + '{{carousel.id}}');
|
318
|
+
$('.{{carousel.id | replace: '_','-' }}').slick({
|
319
|
+
accessibility: carouselSettings.accessibility,
|
320
|
+
adaptiveHeight: carouselSettings.adaptiveHeight,
|
321
|
+
arrows: carouselSettings.arrows,
|
322
|
+
autoplay: carouselSettings.autoplay,
|
323
|
+
autoplaySpeed: carouselSettings.autoplaySpeed,
|
324
|
+
centerMode: carouselSettings.centerMode,
|
325
|
+
centerPadding: carouselSettings.centerPadding,
|
326
|
+
cssEase: carouselSettings.cssEase,
|
327
|
+
dots: carouselSettings.dots,
|
328
|
+
dotsClass: carouselSettings.dotsClass,
|
329
|
+
draggable: carouselSettings.draggable,
|
330
|
+
easing: carouselSettings.easing,
|
331
|
+
edgeFriction: carouselSettings.edgeFriction,
|
332
|
+
fade: carouselSettings.fade,
|
333
|
+
focusOnSelect: carouselSettings.focusOnSelect,
|
334
|
+
focusOnChange: carouselSettings.focusOnChange,
|
335
|
+
infinite: carouselSettings.infinite,
|
336
|
+
initialSlide: carouselSettings.initialSlide,
|
337
|
+
lazyLoad: carouselSettings.lazyLoad,
|
338
|
+
mobileFirst: carouselSettings.mobileFirst,
|
339
|
+
pauseOnDotsHover: carouselSettings.pauseOnDotsHover,
|
340
|
+
pauseOnFocus: carouselSettings.pauseOnFocus,
|
341
|
+
pauseOnHover: carouselSettings.pauseOnHover,
|
342
|
+
respondTo: carouselSettings.respondTo,
|
343
|
+
rows: carouselSettings.rows,
|
344
|
+
rtl: carouselSettings.rtl,
|
345
|
+
slide: carouselSettings.slide,
|
346
|
+
slidesPerRow: carouselSettings.slidesPerRow,
|
347
|
+
slidesToScroll: carouselSettings.slidesToScroll,
|
348
|
+
slidesToShow: carouselSettings.slidesToShow,
|
349
|
+
speed: carouselSettings.speed,
|
350
|
+
swipe: carouselSettings.swipe,
|
351
|
+
swipeToSlide: carouselSettings.swipeToSlide,
|
352
|
+
touchMove: carouselSettings.touchMove,
|
353
|
+
touchThreshold: carouselSettings.touchThreshold,
|
354
|
+
useCSS: carouselSettings.useCSS,
|
355
|
+
useTransform: carouselSettings.useTransform,
|
356
|
+
variableWidth: carouselSettings.variableWidth,
|
357
|
+
vertical: carouselSettings.vertical,
|
358
|
+
verticalSwiping: carouselSettings.verticalSwiping,
|
359
|
+
waitForAnimate: carouselSettings.waitForAnimate,
|
360
|
+
zIndex: carouselSettings.zIndex,
|
361
|
+
responsive: carouselResponsiveSettingsOBJ
|
264
362
|
});
|
265
|
-
|
363
|
+
|
364
|
+
// NOT issued correctly (disabled for now)
|
365
|
+
// $(window).resize(debounce(positionSlickArrows, 100));
|
366
|
+
|
367
|
+
clearInterval(load_dependencies['dependencies_met_html_loaded_{{carousel.id}}']);
|
266
368
|
}
|
267
369
|
}, 25); // END
|
268
|
-
{% endif %} {% endfor %} // ENDFOR (all)
|
370
|
+
{% endif %} {% endfor %} // ENDFOR (all) carousels
|
269
371
|
|
270
372
|
_this.setState('finished');
|
271
373
|
logger.debug('\n' + 'state: ' + _this.getState());
|
272
374
|
logger.info('\n' + 'module initialization finished');
|
273
375
|
|
274
376
|
clearInterval(dependencies_met_page_ready);
|
275
|
-
|
276
377
|
}
|
277
378
|
}, 25);
|
278
379
|
|
279
380
|
}, // END init
|
280
381
|
|
281
382
|
// -------------------------------------------------------------------------
|
282
|
-
//
|
283
|
-
// load all Slick
|
383
|
+
// loadcarouselHTML()
|
384
|
+
// load all Slick carousels (HTML portion) dynanically configured
|
284
385
|
// and enabled (AJAX) from YAMLdata file
|
285
386
|
// NOTE: Make sure the placeholder is available in the content page
|
286
|
-
// eg. using the asciidoc extension
|
387
|
+
// eg. using the asciidoc extension mastercarousel::
|
287
388
|
// -------------------------------------------------------------------------
|
288
|
-
|
289
|
-
var
|
290
|
-
var
|
389
|
+
loadCarouselHTML: function (options, carousel) {
|
390
|
+
var numcarousels = Object.keys(carousel).length;
|
391
|
+
var active_carousels = numcarousels;
|
291
392
|
var xhr_data_path = options.xhr_data_path + '/index.html';
|
292
393
|
var xhr_container_id;
|
293
394
|
|
294
|
-
// console.debug('load HTML portion of all
|
295
|
-
console.debug('number of
|
395
|
+
// console.debug('load HTML portion of all carousels configured found in page');
|
396
|
+
console.debug('number of carousels found: ' + numcarousels);
|
296
397
|
|
297
398
|
_this.setState('load_data');
|
298
|
-
Object.keys(
|
299
|
-
if (
|
300
|
-
xhr_container_id =
|
399
|
+
Object.keys(carousel).forEach(function(key) {
|
400
|
+
if (carousel[key].enabled) {
|
401
|
+
xhr_container_id = carousel[key].id + '_parent';
|
301
402
|
|
302
|
-
console.debug('load HTML data on
|
403
|
+
console.debug('load HTML data on carousel id: ' + carousel[key].id);
|
303
404
|
j1.loadHTML({
|
304
405
|
xhr_container_id: xhr_container_id,
|
305
406
|
xhr_data_path: xhr_data_path,
|
306
|
-
xhr_data_element:
|
407
|
+
xhr_data_element: carousel[key].id
|
307
408
|
});
|
308
409
|
} else {
|
309
|
-
console.debug('
|
310
|
-
|
410
|
+
console.debug('carousel found disabled on id: ' + carousel[key].id);
|
411
|
+
active_carousels--;
|
311
412
|
}
|
312
413
|
});
|
313
|
-
console.debug('
|
414
|
+
console.debug('carousels loaded in page enabled|all: ' + active_carousels + '|' + numcarousels);
|
314
415
|
_this.setState('data_loaded');
|
315
|
-
}, // END
|
416
|
+
}, // END loadcarouselHTML
|
316
417
|
|
317
418
|
// -------------------------------------------------------------------------
|
318
419
|
// messageHandler: MessageHandler for J1 CookieConsent module
|
@@ -361,5 +462,9 @@ j1.adapter.slick = (function (j1, window) {
|
|
361
462
|
})(j1, window);
|
362
463
|
|
363
464
|
{% endcapture %}
|
364
|
-
{
|
465
|
+
{% if production %}
|
466
|
+
{{ cache | minifyJS }}
|
467
|
+
{% else %}
|
468
|
+
{{ cache | strip_empty_lines }}
|
469
|
+
{% endif %}
|
365
470
|
{% assign cache = nil %}
|