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.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_collection.html +2 -3
  3. data/assets/data/banner.html +8 -6
  4. data/assets/data/masonry.html +263 -73
  5. data/assets/data/slick.html +155 -59
  6. data/assets/error_pages/HTTP204.html +1 -1
  7. data/assets/error_pages/HTTP400.html +1 -1
  8. data/assets/error_pages/HTTP401.html +1 -1
  9. data/assets/error_pages/HTTP403.html +1 -1
  10. data/assets/error_pages/HTTP404.html +1 -1
  11. data/assets/error_pages/HTTP444.html +1 -1
  12. data/assets/error_pages/HTTP445.html +1 -1
  13. data/assets/error_pages/HTTP446.html +1 -1
  14. data/assets/error_pages/HTTP447.html +1 -1
  15. data/assets/error_pages/HTTP448.html +1 -1
  16. data/assets/error_pages/HTTP500.html +1 -1
  17. data/assets/error_pages/HTTP501.html +1 -1
  18. data/assets/error_pages/HTTP502.html +1 -1
  19. data/assets/error_pages/HTTP503.html +1 -1
  20. data/assets/themes/j1/adapter/js/masonry.js +9 -1
  21. data/assets/themes/j1/adapter/js/slick.js +239 -134
  22. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +247 -0
  23. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  24. data/assets/themes/j1/core/js/template.js +55 -57
  25. data/assets/themes/j1/core/js/template.min.js +6 -6
  26. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  27. data/assets/themes/j1/modules/masonry/css/theme/uno.css +1 -1
  28. data/assets/themes/j1/modules/masonry/css/theme/uno.min.css +1 -1
  29. data/assets/themes/j1/modules/slick/lightbox/README.md +6 -1
  30. data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.css +36 -0
  31. data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.min.css +15 -0
  32. data/assets/themes/j1/modules/slick/lightbox/js/slick-lightbox.js +1 -1
  33. data/assets/themes/j1/modules/slick/slider/css/theme/uno.css +173 -137
  34. data/assets/themes/j1/modules/slick/slider/css/theme/uno.min.css +1 -1
  35. data/assets/themes/j1/modules/slick/slider/js/slick.js +2970 -2233
  36. data/assets/themes/j1/modules/translator/css/translator.css +3 -19
  37. data/assets/themes/j1/modules/translator/css/translator.min.css +1 -1
  38. data/lib/j1/version.rb +1 -1
  39. data/lib/starter_web/Gemfile +1 -1
  40. data/lib/starter_web/README.md +5 -5
  41. data/lib/starter_web/_config.yml +25 -1
  42. data/lib/starter_web/_data/blocks/banner.yml +45 -46
  43. data/lib/starter_web/_data/blocks/panel.yml +9 -9
  44. data/lib/starter_web/_data/layouts/home.yml +39 -21
  45. data/lib/starter_web/_data/modules/defaults/slick.yml +2 -2
  46. data/lib/starter_web/_data/modules/masonry.yml +155 -41
  47. data/lib/starter_web/_data/modules/navigator_menu.yml +632 -591
  48. data/lib/starter_web/_data/modules/scroller.yml +1 -1
  49. data/lib/starter_web/_data/modules/slick.yml +260 -54
  50. data/lib/starter_web/_data/puma/config.rb +10 -0
  51. data/lib/starter_web/_data/resources.yml +1 -0
  52. data/lib/starter_web/_data/templates/feed.xml +1 -1
  53. data/lib/starter_web/_includes/attributes.asciidoc +24 -0
  54. data/lib/starter_web/_includes/custom/static/readme +1 -1
  55. data/lib/starter_web/_includes/custom/templates/collection_panel.html +131 -0
  56. data/lib/starter_web/_includes/custom/templates/custom_header.html +98 -76
  57. data/lib/starter_web/_includes/custom/templates/people_panel.html +144 -0
  58. data/lib/starter_web/_includes/custom/templates/readme +1 -1
  59. data/lib/starter_web/_plugins/asciidoctor/carousel-block.rb +1 -1
  60. data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +1 -1
  61. data/lib/starter_web/_plugins/asciidoctor/gist-block.rb +1 -1
  62. data/lib/starter_web/_plugins/asciidoctor/lightbox-block.rb +1 -1
  63. data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +1 -1
  64. data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +1 -1
  65. data/lib/starter_web/_plugins/asciidoctor/mdil-icon-inline.rb +10 -0
  66. data/lib/starter_web/_plugins/asciidoctor/placeholder-inline.rb +44 -0
  67. data/lib/starter_web/_plugins/asciidoctor/slick-block.rb +1 -1
  68. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  69. data/lib/starter_web/assets/images/collections/people/diana-petersen.jpg +0 -0
  70. data/lib/starter_web/assets/images/collections/people/larry-parker.jpg +0 -0
  71. data/lib/starter_web/assets/images/collections/people/parveen-anand.jpg +0 -0
  72. data/lib/starter_web/assets/images/modules/attics/1920x1280/kelly-sikkemal.jpg +0 -0
  73. data/lib/starter_web/assets/images/modules/attics/1920x1280/kira-auf-der-heide.jpg +0 -0
  74. data/lib/starter_web/assets/images/modules/gallery/old_times/image_02.jpg +0 -0
  75. data/lib/starter_web/collections/_biography/a-life-in-questions.adoc +5 -5
  76. data/lib/starter_web/collections/_biography/becoming.adoc +5 -5
  77. data/lib/starter_web/collections/_biography/born-to-run.adoc +5 -5
  78. data/lib/starter_web/collections/_biography/forty-autumns.adoc +5 -5
  79. data/lib/starter_web/collections/_biography/not-dead-yet.adoc +5 -6
  80. data/lib/starter_web/collections/_biography/princess-diarist-the.adoc +5 -5
  81. data/lib/starter_web/collections/_biography/when-breath-becomes-air.adoc +6 -7
  82. data/lib/starter_web/collections/_fantasy/harry-potter-deathly-hallows.adoc +14 -4
  83. data/lib/starter_web/collections/_fantasy/harry-potter-philosophers-stone.adoc +13 -3
  84. data/lib/starter_web/collections/_fantasy/mistborn-trilogy.adoc +11 -3
  85. data/lib/starter_web/collections/_fantasy/ready-player-one.adoc +15 -3
  86. data/lib/starter_web/collections/_fantasy/sword-of-destiny.adoc +11 -3
  87. data/lib/starter_web/collections/_fantasy/terry-pratchet-diary-2017.adoc +11 -3
  88. data/lib/starter_web/collections/_people/diana-petersen.adoc +167 -0
  89. data/lib/starter_web/collections/_people/larry-parker.adoc +167 -0
  90. data/lib/starter_web/collections/_people/parveen-anand.adoc +167 -0
  91. data/lib/starter_web/collections/_portfolio/branding.adoc +97 -0
  92. data/lib/starter_web/collections/_portfolio/graphic_design.adoc +97 -0
  93. data/lib/starter_web/collections/_portfolio/identity.adoc +99 -0
  94. data/lib/starter_web/collections/_portfolio/illustration.adoc +101 -0
  95. data/lib/starter_web/collections/_portfolio/photography.adoc +100 -0
  96. data/lib/starter_web/collections/_portfolio/web_design.adoc +109 -0
  97. data/lib/starter_web/collections/_romance/breath-of-snow-and-ashes-a.adoc +12 -3
  98. data/lib/starter_web/collections/_romance/dressmaker-the.adoc +10 -3
  99. data/lib/starter_web/collections/_romance/fiery-cross-the.adoc +13 -3
  100. data/lib/starter_web/collections/_romance/it-ends-with-us.adoc +11 -3
  101. data/lib/starter_web/collections/_romance/outlander-novel.adoc +12 -3
  102. data/lib/starter_web/collections/_romance/virgins-outlander-short-story.adoc +16 -4
  103. data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-static-site-generators.adoc +2 -2
  104. data/lib/starter_web/collections/posts/public/featured/_posts/_includes/attributes.asciidoc +2 -2
  105. data/lib/starter_web/collections/posts/public/series/_posts/2022-08-01-organize-your-life.adoc +4 -4
  106. data/lib/starter_web/collections/posts/public/series/_posts/2022-08-02-organize-your-life.adoc +4 -4
  107. data/lib/starter_web/collections/posts/public/series/_posts/2022-08-03-organize-your-life.adoc +4 -4
  108. data/lib/starter_web/collections/posts/public/series/_posts/2022-09-01-organize-your-life.adoc +4 -4
  109. data/lib/starter_web/collections/posts/public/series/_posts/2022-09-02-organize-your-life.adoc +4 -4
  110. data/lib/starter_web/index.html +129 -129
  111. data/lib/starter_web/package.json +1 -1
  112. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_all_books.adoc +107 -0
  113. data/lib/starter_web/pages/public/{bookshelf → learn/bookshelf}/article_previewer/viewer_biography.adoc +21 -12
  114. data/lib/starter_web/pages/public/{bookshelf → learn/bookshelf}/article_previewer/viewer_fantasy.adoc +11 -6
  115. data/lib/starter_web/pages/public/{bookshelf → learn/bookshelf}/article_previewer/viewer_romance.adoc +11 -5
  116. data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +2 -2
  117. data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +53 -4
  118. data/lib/starter_web/pages/public/plans/plans.adoc +25 -12
  119. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  120. data/lib/starter_web/utilsrv/package.json +1 -1
  121. metadata +59 -79
  122. data/assets/data/masonry.4.html +0 -213
  123. data/assets/themes/j1/adapter/js/slick.3.js +0 -365
  124. data/lib/starter_web/assets/images/collections/blog/wikipedia/columbia-river.1200x400.jpg +0 -0
  125. data/lib/starter_web/assets/images/collections/blog/wikipedia/minneapolis.1200x400.jpg +0 -0
  126. data/lib/starter_web/assets/images/collections/blog/wikipedia/narcise-snake-pits.1200x400.jpg +0 -0
  127. data/lib/starter_web/assets/images/parsa/customers/200x150/img1.png +0 -0
  128. data/lib/starter_web/assets/images/parsa/customers/200x150/img2.png +0 -0
  129. data/lib/starter_web/assets/images/parsa/customers/200x150/img3.png +0 -0
  130. data/lib/starter_web/assets/images/parsa/customers/200x150/img4.png +0 -0
  131. data/lib/starter_web/assets/images/parsa/customers/200x150/img5.png +0 -0
  132. data/lib/starter_web/assets/images/parsa/customers/200x150/img6.png +0 -0
  133. data/lib/starter_web/assets/images/parsa/customers/200x150/img7.png +0 -0
  134. data/lib/starter_web/assets/images/parsa/customers/200x150/img8.png +0 -0
  135. data/lib/starter_web/assets/images/parsa/customers/200x150/img9.png +0 -0
  136. data/lib/starter_web/assets/images/parsa/customers/client-1.png +0 -0
  137. data/lib/starter_web/assets/images/parsa/customers/client-2.png +0 -0
  138. data/lib/starter_web/assets/images/parsa/customers/client-3.png +0 -0
  139. data/lib/starter_web/assets/images/parsa/customers/client-4.png +0 -0
  140. data/lib/starter_web/assets/images/parsa/customers/client-5.png +0 -0
  141. data/lib/starter_web/assets/images/parsa/customers/client-6.png +0 -0
  142. data/lib/starter_web/assets/images/parsa/customers/client-7.png +0 -0
  143. data/lib/starter_web/assets/images/parsa/icons/favicon.ico +0 -0
  144. data/lib/starter_web/assets/images/parsa/icons/icon.png +0 -0
  145. data/lib/starter_web/assets/images/parsa/icons/icon.svg +0 -152
  146. data/lib/starter_web/assets/images/parsa/icons/logo.svg +0 -172
  147. data/lib/starter_web/assets/images/parsa/masthead/19-02-_2023_09-05-46.jpg +0 -0
  148. data/lib/starter_web/assets/images/parsa/masthead/banner-img.png +0 -0
  149. data/lib/starter_web/assets/images/parsa/pages/1920x1280/author.jpg +0 -0
  150. data/lib/starter_web/assets/images/parsa/pages/1920x1280/contact.jpg +0 -0
  151. data/lib/starter_web/assets/images/parsa/pages/author.jpg +0 -0
  152. data/lib/starter_web/assets/images/parsa/pages/contact.jpg +0 -0
  153. data/lib/starter_web/assets/images/parsa/partners/scalable/facebook.svg +0 -34
  154. data/lib/starter_web/assets/images/parsa/partners/scalable/google.svg +0 -35
  155. data/lib/starter_web/assets/images/parsa/partners/scalable/ibm.svg +0 -24
  156. data/lib/starter_web/assets/images/parsa/partners/scalable/microsoft.svg +0 -42
  157. data/lib/starter_web/assets/images/parsa/posts/1280x1024/post-img.jpg +0 -0
  158. data/lib/starter_web/assets/images/parsa/posts/1280x1024/post-single.jpg +0 -0
  159. data/lib/starter_web/assets/images/parsa/promo/home/screenshot.jpg +0 -0
  160. data/lib/starter_web/pages/public/previewer/preview_masonry.adoc +0 -361
  161. data/lib/starter_web/pages/public/previewer/preview_slick_slider.adoc +0 -375
  162. /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/1.jpg +0 -0
  163. /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/2.jpg +0 -0
  164. /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/3.jpg +0 -0
  165. /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/4.jpg +0 -0
  166. /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/5.jpg +0 -0
  167. /data/lib/starter_web/assets/images/{parsa → collections}/portfolio/6.jpg +0 -0
  168. /data/lib/starter_web/assets/images/{parsa/icons → icons/controls}/close-icon.svg +0 -0
  169. /data/lib/starter_web/assets/images/{parsa/icons → icons/controls}/up.svg +0 -0
  170. /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/dynamic-web-access.png +0 -0
  171. /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/jamstack-generators.png +0 -0
  172. /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/jekyll.1200x400.png +0 -0
  173. /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/jekyll.png +0 -0
  174. /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-1.jpg +0 -0
  175. /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-2.jpg +0 -0
  176. /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-3.jpg +0 -0
  177. /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-4.jpg +0 -0
  178. /data/lib/starter_web/assets/images/{parsa/posts → posts}/featured/post-5.jpg +0 -0
  179. /data/lib/starter_web/assets/images/{collections/blog → posts}/featured/static-web-access.png +0 -0
  180. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-1.jpg +0 -0
  181. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-10.jpg +0 -0
  182. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-11.jpg +0 -0
  183. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-12.jpg +0 -0
  184. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-13.jpg +0 -0
  185. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-2.jpg +0 -0
  186. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-3.jpg +0 -0
  187. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-4.jpg +0 -0
  188. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-5.jpg +0 -0
  189. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-6.jpg +0 -0
  190. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-7.jpg +0 -0
  191. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-8.jpg +0 -0
  192. /data/lib/starter_web/assets/images/{parsa/posts → posts}/natural_food/post-9.jpg +0 -0
  193. /data/lib/starter_web/assets/images/{parsa/posts → posts}/post-img.jpg +0 -0
  194. /data/lib/starter_web/assets/images/{parsa/posts → posts}/post-single.jpg +0 -0
  195. /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 = site.environment %}
32
- {% assign blocks = site.data.blocks %}
33
- {% assign modules = site.data.modules %}
34
- {% assign template_config = site.data.j1_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 = modules.defaults.slick.defaults %}
39
- {% assign slick_settings = modules.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 sliderResponsiveSettings = [];
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 sliderOptions;
89
- var sliderSettings;
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 = 'pending'; // (initial) load state for the HTML portion of the slider
105
- var load_dependencies = {}; // dynamic variable
106
- var sliderResponsiveSettingsOBJ = {}; // initial object for responsive settings
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 sliderResponsiveSettingsYAML;
109
- var sliderResponsiveSettingsSTRING;
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 = $.extend({}, {{slick_defaults | replace: 'nil', 'null' | replace: '=>', ':' }});
121
- slickSettings = $.extend({}, {{slick_settings | replace: 'nil', 'null' | replace: '=>', ':' }});
122
- slickOptions = $.extend(true, {}, slickDefaults, slickSettings);
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 = j1.adapter.slick;
128
- logger = log4javascript.getLogger('j1.adapter.slick');
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 sliders
135
- console.debug('loading HTML portion for all sliders configured');
136
- _this.loadSliderHTML(slickOptions, slickOptions.sliders);
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 slider in slick_settings.sliders %} {% if slider.enabled %}
148
- logger.info('\n' + 'slider is being initialized on id: ' + '{{slider.id}}');
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 slider.options.responsive %}
151
- logger.info('\n' + 'collect responsive settings for slider on id: ' + '{{slider.id}}');
152
- // collect breakpoint settings from slider config
153
- responsiveSettings = $.extend({}, {{slider.responsive | replace: 'nil', 'null' | replace: '=>', ':' }});
154
- // generate slider breakpoint settings as YAML data structure
155
- sliderResponsiveSettings = '[' ;
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
- sliderResponsiveSettings += ' {' ;
163
- sliderResponsiveSettings += ' breakpoint: ' + value + ',' ;
164
- sliderResponsiveSettings += ' settings: {' ;
181
+ carouselResponsiveSettings += ' {' ;
182
+ carouselResponsiveSettings += ' breakpoint: ' + value + ',' ;
183
+ carouselResponsiveSettings += ' settings: {' ;
165
184
  } else {
166
- sliderResponsiveSettings += ' ' + key + ': ' + value + ',' ;
185
+ carouselResponsiveSettings += ' ' + key + ': ' + value + ',' ;
167
186
  }
168
187
  // close current breakpoint element
169
188
  if (count == length) {
170
- sliderResponsiveSettings += ' }' ;
171
- sliderResponsiveSettings += ' },' ;
189
+ carouselResponsiveSettings += ' }' ;
190
+ carouselResponsiveSettings += ' },' ;
172
191
  }
173
192
  }
174
193
  } // End generate breakpoint YAML elements
175
194
 
176
195
  // close breakpoint YAML data
177
- sliderResponsiveSettings += ']';
196
+ carouselResponsiveSettings += ']';
178
197
  {% endif %}
179
198
 
180
199
  // create dynamic loader variable|s
181
- dependency = 'dependencies_met_html_loaded_{{slider.id}}';
200
+ dependency = 'dependencies_met_html_loaded_{{carousel.id}}';
182
201
  load_dependencies[dependency] = '';
183
202
 
184
- // initialize slider if HTML portion successfully loaded
185
- load_dependencies['dependencies_met_html_loaded_{{slider.id}}'] = setInterval (function (options) {
186
- // check if HTML portion of the slider is loaded successfully (loadSliderHTML)
187
- xhrLoadState = j1.xhrDOMState['#{{slider.id}}_parent'];
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 slider settings
191
- sliderOptions = $.extend({}, {{slider.options | replace: 'nil', 'null' | replace: '=>', ':' }});
192
- sliderSettings = $.extend(true, {}, slickDefaults, sliderOptions );
193
-
194
- // convert slider responsive settings to object (sliderResponsiveSettingsOBJ)
195
- sliderResponsiveSettingsYAML = yaml.loadAll(sliderResponsiveSettings, 'utf8');
196
- sliderResponsiveSettingsOBJ = sliderResponsiveSettingsYAML[0];
197
- sliderResponsiveSettingsSTRING = JSON.stringify(sliderResponsiveSettingsOBJ, null, 4);
198
- logger.debug('\n' + 'responsive settings on slider id #{{slider.id}}: ' + '\n' + sliderResponsiveSettingsSTRING);
199
-
200
- $('.{{slider.id | replace: '_','-' }}').on('init', function(event, slick) {
201
- logger.info('\n' + 'slider initialized on id: {{slider.id}}');
202
- if ({{slider.lightbox.enabled}}) {
203
- logger.info('\n' + 'initialize lightbox on id: {{slider.id}}');
204
- $('#{{slider.id}}').slickLightbox({
205
- background: 'rgba(0,0,0,.8)',
206
- closeOnEscape: true,
207
- closeOnBackdropClick: true,
208
- navigateByKeyboard: true,
209
- destroyTimeout: 500,
210
- src: '{{slider.lightbox.src}}',
211
- itemSelector: '{{slider.lightbox.itemSelector}}',
212
- imageMaxHeight: 0.9,
213
- lazy: false,
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
- // setup the slider
219
- logger.info('\n' + 'slider is being setup on id: ' + '{{slider.id}}');
220
- $('.{{slider.id | replace: '_','-' }}').slick({
221
- accessibility: sliderSettings.accessibility,
222
- adaptiveHeight: sliderSettings.adaptiveHeight,
223
- arrows: sliderSettings.arrows,
224
- autoplay: sliderSettings.autoplay,
225
- autoplaySpeed: sliderSettings.autoplaySpeed,
226
- centerMode: sliderSettings.centerMode,
227
- centerPadding: sliderSettings.centerPadding,
228
- cssEase: sliderSettings.cssEase,
229
- dots: sliderSettings.dots,
230
- dotsClass: sliderSettings.dotsClass,
231
- draggable: sliderSettings.draggable,
232
- easing: sliderSettings.easing,
233
- edgeFriction: sliderSettings.edgeFriction,
234
- fade: sliderSettings.fade,
235
- focusOnSelect: sliderSettings.focusOnSelect,
236
- focusOnChange: sliderSettings.focusOnChange,
237
- infinite: sliderSettings.infinite,
238
- initialSlide: sliderSettings.initialSlide,
239
- lazyLoad: sliderSettings.lazyLoad,
240
- mobileFirst: sliderSettings.mobileFirst,
241
- pauseOnDotsHover: sliderSettings.pauseOnDotsHover,
242
- pauseOnFocus: sliderSettings.pauseOnFocus,
243
- pauseOnHover: sliderSettings.pauseOnHover,
244
- respondTo: sliderSettings.respondTo,
245
- rows: sliderSettings.rows,
246
- rtl: sliderSettings.rtl,
247
- slide: sliderSettings.slide,
248
- slidesPerRow: sliderSettings.slidesPerRow,
249
- slidesToScroll: sliderSettings.slidesToScroll,
250
- slidesToShow: sliderSettings.slidesToShow,
251
- speed: sliderSettings.speed,
252
- swipe: sliderSettings.swipe,
253
- swipeToSlide: sliderSettings.swipeToSlide,
254
- touchMove: sliderSettings.touchMove,
255
- touchThreshold: sliderSettings.touchThreshold,
256
- useCSS: sliderSettings.useCSS,
257
- useTransform: sliderSettings.useTransform,
258
- variableWidth: sliderSettings.variableWidth,
259
- vertical: sliderSettings.vertical,
260
- verticalSwiping: sliderSettings.verticalSwiping,
261
- waitForAnimate: sliderSettings.waitForAnimate,
262
- zIndex: sliderSettings.zIndex,
263
- responsive: sliderResponsiveSettingsOBJ
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
- clearInterval(load_dependencies['dependencies_met_html_loaded_{{slider.id}}']);
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) sliders
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
- // loadSliderHTML()
283
- // load all Slick sliders (HTML portion) dynanically configured
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 masterslider::
387
+ // eg. using the asciidoc extension mastercarousel::
287
388
  // -------------------------------------------------------------------------
288
- loadSliderHTML: function (options, slider) {
289
- var numSliders = Object.keys(slider).length;
290
- var active_sliders = numSliders;
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 sliders configured found in page');
295
- console.debug('number of sliders found: ' + numSliders);
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(slider).forEach(function(key) {
299
- if (slider[key].enabled) {
300
- xhr_container_id = slider[key].id + '_parent';
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 slider id: ' + slider[key].id);
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: slider[key].id
407
+ xhr_data_element: carousel[key].id
307
408
  });
308
409
  } else {
309
- console.debug('slider found disabled on id: ' + slider[key].id);
310
- active_sliders--;
410
+ console.debug('carousel found disabled on id: ' + carousel[key].id);
411
+ active_carousels--;
311
412
  }
312
413
  });
313
- console.debug('sliders loaded in page enabled|all: ' + active_sliders + '|' + numSliders);
414
+ console.debug('carousels loaded in page enabled|all: ' + active_carousels + '|' + numcarousels);
314
415
  _this.setState('data_loaded');
315
- }, // END loadSliderHTML
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
- {{ cache | strip_empty_lines }}
465
+ {% if production %}
466
+ {{ cache | minifyJS }}
467
+ {% else %}
468
+ {{ cache | strip_empty_lines }}
469
+ {% endif %}
365
470
  {% assign cache = nil %}