j1-template 2024.3.13 → 2024.3.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +1 -1
  3. data/_includes/themes/j1/layouts/layout_resource_generator.html +1 -4
  4. data/_includes/themes/j1/procedures/blocks/footer/boxes/social_media_icons.proc +24 -23
  5. data/_includes/themes/j1/procedures/layouts/content_writer.proc +4 -3
  6. data/_includes/themes/j1/procedures/layouts/default_writer.proc +37 -6
  7. data/_includes/themes/j1/procedures/layouts/module_writer.proc +31 -95
  8. data/_includes/themes/j1/procedures/layouts/resource_writer.proc +51 -29
  9. data/assets/data/amplitude.28.html +887 -0
  10. data/assets/data/amplitude.29.html +923 -0
  11. data/assets/data/amplitude.html +311 -46
  12. data/assets/data/banner.html +9 -7
  13. data/assets/data/masterslider.html +128 -7
  14. data/assets/data/panel.html +16 -65
  15. data/assets/theme/j1/adapter/js/amplitude.23.js +1165 -0
  16. data/assets/theme/j1/adapter/js/amplitude.24.js +1164 -0
  17. data/assets/theme/j1/adapter/js/amplitude.25.js +1268 -0
  18. data/assets/theme/j1/adapter/js/amplitude.js +294 -117
  19. data/assets/theme/j1/adapter/js/attic.js +14 -11
  20. data/assets/theme/j1/adapter/js/docsearch.js +2 -2
  21. data/assets/theme/j1/adapter/js/fab.js +2 -2
  22. data/assets/theme/j1/adapter/js/j1.js +8 -8
  23. data/assets/theme/j1/adapter/js/lazyLoader.js +60 -10
  24. data/assets/theme/j1/adapter/js/masonry.js +1 -1
  25. data/assets/theme/j1/adapter/js/masterslider.js +2 -2
  26. data/assets/theme/j1/adapter/js/particles.js +2 -2
  27. data/assets/theme/j1/adapter/js/scroller.js +2 -2
  28. data/assets/theme/j1/adapter/js/slick.js +2 -2
  29. data/assets/theme/j1/adapter/js/themes.js +1 -1
  30. data/assets/theme/j1/adapter/js/translator.js +2 -2
  31. data/assets/theme/j1/adapter/js/waves.js +1 -1
  32. data/assets/theme/j1/core/css/animate.css +1634 -1070
  33. data/assets/theme/j1/core/css/animate.css.map +1 -0
  34. data/assets/theme/j1/core/css/animate.min.css +2 -1
  35. data/assets/theme/j1/core/css/animate.min.css.map +1 -0
  36. data/assets/theme/j1/core/css/icon-fonts/fontawesome.css +3060 -1538
  37. data/assets/theme/j1/core/css/icon-fonts/fontawesome.css.map +1 -0
  38. data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css +2 -1
  39. data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css.map +1 -0
  40. data/assets/theme/j1/core/css/icon-fonts/iconify.css +2308 -1153
  41. data/assets/theme/j1/core/css/icon-fonts/iconify.css.map +1 -0
  42. data/assets/theme/j1/core/css/icon-fonts/iconify.min.css +2 -1
  43. data/assets/theme/j1/core/css/icon-fonts/iconify.min.css.map +1 -0
  44. data/assets/theme/j1/core/css/icon-fonts/mdi.css +16716 -8423
  45. data/assets/theme/j1/core/css/icon-fonts/mdi.css.map +1 -0
  46. data/assets/theme/j1/core/css/icon-fonts/mdi.min.css +2 -1
  47. data/assets/theme/j1/core/css/icon-fonts/mdi.min.css.map +1 -0
  48. data/assets/theme/j1/core/css/icon-fonts/mdib.css +5554 -2766
  49. data/assets/theme/j1/core/css/icon-fonts/mdib.css.map +1 -0
  50. data/assets/theme/j1/core/css/icon-fonts/mdib.min.css +2 -1
  51. data/assets/theme/j1/core/css/icon-fonts/mdib.min.css.map +1 -0
  52. data/assets/theme/j1/core/css/icon-fonts/mdil.css +742 -441
  53. data/assets/theme/j1/core/css/icon-fonts/mdil.css.map +1 -0
  54. data/assets/theme/j1/core/css/icon-fonts/mdil.min.css +2 -1
  55. data/assets/theme/j1/core/css/icon-fonts/mdil.min.css.map +1 -0
  56. data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css +6552 -3980
  57. data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css.map +1 -0
  58. data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css +2 -5
  59. data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css.map +1 -0
  60. data/assets/theme/j1/core/css/themes/unodark/bootstrap.css +6818 -4131
  61. data/assets/theme/j1/core/css/themes/unodark/bootstrap.css.map +1 -0
  62. data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css +2 -5
  63. data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css.map +1 -0
  64. data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +18568 -11577
  65. data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -0
  66. data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +2 -35
  67. data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -0
  68. data/assets/theme/j1/core/css/vendor.css +1771 -1043
  69. data/assets/theme/j1/core/css/vendor.css.map +1 -0
  70. data/assets/theme/j1/core/css/vendor.min.css +2 -1
  71. data/assets/theme/j1/core/css/vendor.min.css.map +1 -0
  72. data/assets/theme/j1/core/js/template.js +399 -447
  73. data/assets/theme/j1/core/js/template.min.js +7 -7
  74. data/assets/theme/j1/core/js/template.min.js.map +1 -1
  75. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +4 -2
  76. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +39 -4
  77. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
  78. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +57 -17
  79. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +1 -1
  80. data/assets/theme/j1/modules/amplitudejs/icons/player/blue/pause.png +0 -0
  81. data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.png +0 -0
  82. data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.svg +87 -0
  83. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +60 -0
  84. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +59 -0
  85. data/assets/theme/j1/modules/amplitudejs/js/amplitude.js +65 -21
  86. data/assets/theme/j1/modules/amplitudejs/js/amplitude.min.js +1 -1
  87. data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +113 -0
  88. data/assets/theme/j1/modules/iconPicker/js/universal-icon-picker.js +471 -471
  89. data/assets/theme/j1/modules/j1LazyLoader/LICENSE +21 -0
  90. data/assets/theme/j1/modules/j1LazyLoader/js/j1Lazy.js +870 -0
  91. data/assets/theme/j1/modules/js-cookies/js/js.cookie.js +3 -3
  92. data/assets/theme/j1/modules/lazyCssLoader/js/main.0.js +166 -0
  93. data/assets/theme/j1/modules/lazyCssLoader/js/main.1.js +65 -0
  94. data/assets/theme/j1/modules/lazyCssLoader/js/main.js +66 -0
  95. data/assets/theme/j1/modules/lazyCssLoader/js/plugins/examplePlugin.js +13 -0
  96. data/assets/theme/j1/modules/lazyCssLoader/js/plugins/my-plugin.js +25 -0
  97. data/assets/theme/j1/modules/lazyCssLoader/js/plugins/plugin-interface.js +9 -0
  98. data/assets/theme/j1/modules/lazyCssLoader/js/plugins/pluginA.js +46 -0
  99. data/assets/theme/j1/modules/lazyLoader/js/plugins/README.md +324 -0
  100. data/assets/theme/j1/modules/lazyLoader/js/plugins/jquery.lazy.picture.js +188 -0
  101. data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +1 -1
  102. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +794 -0
  103. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +151 -67
  104. data/assets/theme/j1/modules/slimSelect/js/select.js +1 -1
  105. data/assets/theme/j1/modules/slimSelect/js/select.min.js +3 -3
  106. data/assets/theme/j1/modules/themeSwitcher/js/switcher.js +2 -1
  107. data/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.min.js +1 -1
  108. data/assets/theme/j1/modules/videojs/js/plugins/players/dm/icon/scalable/dailymotion.svg +62 -0
  109. data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.js +832 -0
  110. data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.min.js +17 -0
  111. data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.min.js +1 -1
  112. data/assets/theme/j1/modules/videojs/js/video.js +2 -2
  113. data/lib/j1/version.rb +1 -1
  114. data/lib/starter_web/README.md +577 -560
  115. data/lib/starter_web/_config.yml +2 -2
  116. data/lib/starter_web/_data/blocks/footer.yml +10 -5
  117. data/lib/starter_web/_data/blocks/panel.yml +2 -2
  118. data/lib/starter_web/_data/layouts/default.yml +14 -3
  119. data/lib/starter_web/_data/modules/amplitude.yml +145 -0
  120. data/lib/starter_web/_data/modules/defaults/amplitude.yml +29 -7
  121. data/lib/starter_web/_data/modules/defaults/lazyLoader.yml +2 -2
  122. data/lib/starter_web/_data/modules/gallery.yml +136 -0
  123. data/lib/starter_web/_data/modules/lazyLoader.0.yml +118 -0
  124. data/lib/starter_web/_data/modules/lazyLoader.yml +68 -31
  125. data/lib/starter_web/_data/modules/masonry.yml +4 -4
  126. data/lib/starter_web/_data/modules/masterslider.yml +118 -12
  127. data/lib/starter_web/_data/modules/navigator_menu.yml +831 -803
  128. data/lib/starter_web/_data/resources.yml +154 -190
  129. data/lib/starter_web/_data/templates/feed.xml +1 -1
  130. data/lib/starter_web/_includes/attributes.asciidoc +1 -0
  131. data/lib/starter_web/_plugins/asciidoctor/amplitude-block.rb +1 -1
  132. data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +1 -1
  133. data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +4 -2
  134. data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +1 -1
  135. data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +58 -46
  136. data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +26 -19
  137. data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +30 -40
  138. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  139. data/lib/starter_web/assets/image/icons/lanus/favicon.ico +0 -0
  140. data/lib/starter_web/assets/image/icons/lanus/lanus-512x512.png +0 -0
  141. data/lib/starter_web/assets/image/icons/lanus/lanus.ico +0 -0
  142. data/lib/starter_web/assets/image/icons/lanus/lanus.png +0 -0
  143. data/lib/starter_web/assets/image/icons/lanus/scalable/lanus.svg +76 -0
  144. data/lib/starter_web/assets/image/icons/lanus/scalable/lanus_sw.svg +62 -0
  145. data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28 - social.svg +86 -0
  146. data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28.svg +64 -0
  147. data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x.svg +1 -0
  148. data/lib/starter_web/assets/image/modules/icons/social/twitter_x.png +0 -0
  149. data/lib/starter_web/package.json +7 -18
  150. data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +218 -0
  151. data/lib/starter_web/pages/public/features/template.adoc +18 -8
  152. data/lib/starter_web/pages/public/features/template.asciidoc +758 -0
  153. data/lib/starter_web/pages/public/lazy_loader_tester.adoc +402 -0
  154. data/lib/starter_web/pages/public/manuals/ytdl/man.adoc +3020 -0
  155. data/lib/starter_web/pages/public/manuals/ytdl/man.md +2378 -0
  156. data/lib/starter_web/pages/public/tools/previewer/_includes/attributes.asciidoc +0 -16
  157. data/lib/starter_web/pages/public/tools/previewer/_includes/documents/amplitudejs.large.css.asciidoc +505 -0
  158. data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.hover.html +69 -0
  159. data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.nested.html +75 -0
  160. data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.textarea.html +57 -0
  161. data/lib/starter_web/pages/public/tools/previewer/_includes/documents/my.content.html +112 -0
  162. data/lib/starter_web/pages/public/tools/previewer/preview_amplitudejs.adoc +172 -0
  163. data/lib/starter_web/pages/public/tour/_includes/attributes.asciidoc +2 -2
  164. data/lib/starter_web/pages/public/tour/_includes/documents/419_advanced_modals_demo.asciidoc +16 -16
  165. data/lib/starter_web/pages/public/tour/asciidoc_extensions.adoc +13 -3
  166. data/lib/starter_web/pages/public/tour/bootstrap_themes.adoc +12 -3
  167. data/lib/starter_web/pages/public/tour/highlghter_rouge.adoc +13 -3
  168. data/lib/starter_web/pages/public/tour/icon_fonts.adoc +12 -3
  169. data/lib/starter_web/pages/public/tour/modal_extentions.adoc +12 -6
  170. data/lib/starter_web/pages/public/tour/{playback_audio.adoc → play_audio.adoc} +207 -188
  171. data/lib/starter_web/pages/public/tour/{playback_video.adoc → play_video.adoc} +49 -51
  172. data/lib/starter_web/pages/public/tour/present_images.adoc +27 -5
  173. data/lib/starter_web/pages/public/tour/quicksearch.adoc +13 -3
  174. data/lib/starter_web/pages/public/tour/responsive_tables.adoc +13 -4
  175. data/lib/starter_web/pages/public/tour/typography.adoc +12 -3
  176. metadata +90 -22
  177. /data/assets/theme/j1/modules/{lazyLoader → j1LazyLoader/js}/plugins/README.md +0 -0
  178. /data/assets/theme/j1/modules/{lazyLoader/plugins/jquery.lazy.picture.js → j1LazyLoader/js/plugins/picture.js} +0 -0
  179. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.js +0 -0
  180. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.min.js +0 -0
  181. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.js +0 -0
  182. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.min.js +0 -0
  183. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.js +0 -0
  184. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.min.js +0 -0
  185. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.js +0 -0
  186. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.min.js +0 -0
  187. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.picture.min.js +0 -0
  188. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.js +0 -0
  189. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.min.js +0 -0
  190. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.js +0 -0
  191. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.min.js +0 -0
  192. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.youtube.js +0 -0
  193. /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.youtube.min.js +0 -0
@@ -113,6 +113,9 @@ j1.adapter.amplitude = ((j1, window) => {
113
113
 
114
114
  // amplitude api settings
115
115
  // ----------------------
116
+ var ytpSongIndex = "0";
117
+ var ytpAutoPlay = false;
118
+ var ytpLoop = true;
116
119
  var playLists = {};
117
120
  var playersUILoaded = { state: false };
118
121
  var apiInitialized = { state: false };
@@ -125,30 +128,54 @@ j1.adapter.amplitude = ((j1, window) => {
125
128
  var amplitudeDefaults;
126
129
  var amplitudeSettings;
127
130
  var amplitudeOptions;
131
+ var ytPlayer;
132
+ var ytpPlaybackRate
128
133
 
129
134
  // amplitude player (instance) settings
135
+ // NOTE: slider VALUE is set by Adapter|Amplitude API
130
136
  // ------------------------------------
131
137
  var xhrLoadState;
132
138
  var dependency;
133
- var playerCounter = 0;
134
- var load_dependencies = {};
135
- var playersProcessed = [];
136
- var playersHtmlLoaded = false;
137
- var processingPlayersFinished = false;
138
- var playerAudioInfo = ('{{amplitude_defaults.playlist.audio_info}}' === 'true') ? true : false;
139
- var playerDefaultType = '{{amplitude_defaults.player.type}}';
140
- var playerVolumeValue = '{{amplitude_defaults.player.volume.value}}';
141
- var playerVolumeDecrement = '{{amplitude_defaults.player.volume.decrement}}';
142
- var playerVolumeIncrement = '{{amplitude_defaults.player.volume.increment}}';
143
- var playerRepeat = ('{{amplitude_defaults.player.repeat}}' === 'true') ? true : false;
144
- var playerShuffle = ('{{amplitude_defaults.player.shuffle}}' === 'true') ? true : false;
145
- var playerPlayNextTitle = ('{{amplitude_defaults.player.play_next_title}}' === 'true') ? true : false;
146
- var playerPauseNextTitle = ('{{amplitude_defaults.player.pause_next_title}}' === 'true') ? true : false;
147
- var playerDelayNextTitle = '{{amplitude_defaults.player.delay_next_title}}';
139
+ var playerCounter = 0;
140
+ var load_dependencies = {};
141
+ var playersProcessed = [];
142
+ var playersHtmlLoaded = false;
143
+ var processingPlayersFinished = false;
144
+ var playerAudioInfo = ('{{amplitude_defaults.playlist.audio_info}}' === 'true') ? true : false;
145
+ var playerDefaultType = '{{amplitude_defaults.player.type}}';
146
+ var playerVolumeValue = '{{amplitude_defaults.player.volume_slider.preset_value}}';
147
+ var playerVolumeSliderStep = '{{amplitude_defaults.player.volume_slider.slider_step}}';
148
+ var playerRepeat = ('{{amplitude_defaults.player.repeat}}' === 'true') ? true : false;
149
+ var playerShuffle = ('{{amplitude_defaults.player.shuffle}}' === 'true') ? true : false;
150
+ var playerPlayNextTitle = ('{{amplitude_defaults.player.play_next_title}}' === 'true') ? true : false;
151
+ var playerPauseNextTitle = ('{{amplitude_defaults.player.pause_next_title}}' === 'true') ? true : false;
152
+ var playerDelayNextTitle = '{{amplitude_defaults.player.delay_next_title}}';
153
+ var playerForwardBackwardSkipSeconds = '{{amplitude_defaults.player.forward_backward_skip_seconds}}';
148
154
 
149
155
  // unused settings
150
- // var playerWaveformSampleRate = '{{amplitude_defaults.player.waveform_sample_rate}}';
156
+ // ---------------------------------------------------------------------------
157
+ // var playerWaveformSampleRate = '{{amplitude_defaults.player.waveform_sample_rate}}';
151
158
 
159
+ // ---------------------------------------------------------------------------
160
+ // YouTube Player Tech (loaded early, runs on Document Ready)
161
+ // ---------------------------------------------------------------------------
162
+ //
163
+ // $(function() {
164
+ // // Load YTP API code asynchronously and create a player for later use
165
+ // var techScript;
166
+ // var tech = document.createElement('script');
167
+ //
168
+ // tech.id = 'yt_player_init';
169
+ // tech.src = "/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js";
170
+ // techScript = document.getElementsByTagName('script')[0];
171
+ //
172
+ // // Append Tech script
173
+ // techScript.parentNode.insertBefore(tech, techScript);
174
+ // });
175
+
176
+ // ---------------------------------------------------------------------------
177
+ // helper functions
178
+ // ---------------------------------------------------------------------------
152
179
 
153
180
  // ---------------------------------------------------------------------------
154
181
  // main
@@ -189,9 +216,8 @@ j1.adapter.amplitude = ((j1, window) => {
189
216
  var pageState = $('#content').css("display");
190
217
  var pageVisible = (pageState === 'block') ? true : false;
191
218
  var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
192
- var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
193
219
 
194
- if (j1CoreFinished && pageVisible && atticFinished) {
220
+ if (j1CoreFinished && pageVisible) {
195
221
  startTimeModule = Date.now();
196
222
 
197
223
  _this.setState('started');
@@ -217,6 +243,7 @@ j1.adapter.amplitude = ((j1, window) => {
217
243
  var dependencies_met_players_loaded = setInterval (() => {
218
244
  if (playersUILoaded.state) {
219
245
  _this.initApi(songs);
246
+ // var playbackRate = ytPlayer.getPlaybackRate();
220
247
 
221
248
  clearInterval(dependencies_met_players_loaded);
222
249
  } // END if playersUILoaded
@@ -227,38 +254,6 @@ j1.adapter.amplitude = ((j1, window) => {
227
254
  // -------------------------------------------------------------------
228
255
  var dependencies_met_api_initialized = setInterval (() => {
229
256
  if (apiInitialized.state) {
230
-
231
- // click on next button
232
- // -------------------------------------------------------
233
- // var nextButtons = document.getElementsByClassName("amplitude-next");
234
- //
235
- // // add listeners to all next buttonn found
236
- // for (var i=0; i<nextButtons.length; i++) {
237
- // nextButtons[i].addEventListener('click', function(event) {
238
- // event.stopPropagation();
239
- //
240
- // var activeTitleIndex = Amplitude.getActiveIndex();
241
- // var playerState = Amplitude.getPlayerState();
242
- // logger.debug('\n' + 'next player state: ' + playerState + ' on index=' + activeTitleIndex);
243
- // });
244
- // }
245
-
246
- // click on previous button
247
- // -------------------------------------------------------
248
- // var previousButtons = document.getElementsByClassName("amplitude-prev");
249
- //
250
- // // add listeners to all previous buttonn found
251
- // for (var i=0; i<previousButtons.length; i++) {
252
- // previousButtons[i].addEventListener('click', function(event) {
253
- // event.stopPropagation();
254
- //
255
- // var activeTitleIndex = Amplitude.getActiveIndex();
256
- // var playerState = Amplitude.getPlayerState();
257
- // logger.debug('\n' + 'previous player state: ' + playerState + ' on index=' + activeTitleIndex);
258
- //
259
- // });
260
- // }
261
-
262
257
  _this.initPlayerUiEvents();
263
258
 
264
259
  clearInterval(dependencies_met_api_initialized);
@@ -268,6 +263,7 @@ j1.adapter.amplitude = ((j1, window) => {
268
263
  clearInterval(dependencies_met_page_ready);
269
264
  } // END pageVisible
270
265
  }, 10); // END dependencies_met_page_ready
266
+
271
267
  }, // END init
272
268
 
273
269
  // -------------------------------------------------------------------------
@@ -339,42 +335,41 @@ j1.adapter.amplitude = ((j1, window) => {
339
335
  logger.info('\n' + 'loading player HTML components (UI): started');
340
336
 
341
337
  {% for player in amplitude_options.players %} {% if player.enabled %}
342
- {% assign player_id = player.id %}
343
338
  {% assign xhr_data_path = amplitude_options.xhr_data_path %}
344
- {% capture xhr_container_id %}{{player_id}}_parent{% endcapture %}
339
+ {% capture xhr_container_id %}{{player.id}}_parent{% endcapture %}
345
340
 
346
341
  // load players only that are configured in current page
347
342
  //
348
343
  playerExistsInPage = ($('#' + '{{xhr_container_id}}')[0] !== undefined) ? true : false;
349
344
  if (playerExistsInPage) {
350
345
  playerCounter++;
351
- logger.debug('\n' + 'load player UI on ID #{{player_id}}: started');
346
+ logger.debug('\n' + 'load player UI on ID #{{player.id}}: started');
352
347
 
353
348
  j1.loadHTML({
354
349
  xhr_container_id: '{{xhr_container_id}}',
355
350
  xhr_data_path: '{{xhr_data_path}}',
356
- xhr_data_element: '{{player_id}}'
351
+ xhr_data_element: '{{player.id}}'
357
352
  },
358
353
  'j1.adapter.amplitude',
359
354
  'data_loaded'
360
355
  );
361
356
 
362
- // dynamic loader variable to setup the player on ID {{player_id}}
363
- dependency = 'dependencies_met_html_loaded_{{player_id}}';
357
+ // dynamic loader variable to setup the player on ID {{player.id}}
358
+ dependency = 'dependencies_met_html_loaded_{{player.id}}';
364
359
  load_dependencies[dependency] = '';
365
360
 
366
361
  // ---------------------------------------------------------------------
367
362
  // initialize amplitude instance (when player UI loaded)
368
363
  // ---------------------------------------------------------------------
369
- load_dependencies['dependencies_met_html_loaded_{{player_id}}'] = setInterval (() => {
364
+ load_dependencies['dependencies_met_html_loaded_{{player.id}}'] = setInterval (() => {
370
365
  // check if HTML portion of the player is loaded successfully
371
366
  xhrLoadState = j1.xhrDOMState['#' + '{{xhr_container_id}}'];
372
367
 
373
368
  if (xhrLoadState === 'success') {
374
369
  playersProcessed.push('{{xhr_container_id}}');
375
- logger.debug('\n' + 'load player UI on ID #{{player_id}}: finished');
370
+ logger.debug('\n' + 'load player UI on ID #{{player.id}}: finished');
376
371
 
377
- clearInterval(load_dependencies['dependencies_met_html_loaded_{{player_id}}']);
372
+ clearInterval(load_dependencies['dependencies_met_html_loaded_{{player.id}}']);
378
373
  }
379
374
  }, 10); // END dependencies_met_html_loaded
380
375
  } // END if playerExistsInPage
@@ -458,7 +453,8 @@ j1.adapter.amplitude = ((j1, window) => {
458
453
 
459
454
  {% endif %} {% endfor %}
460
455
 
461
- // See: https://521dimensions.com/open-source/amplitudejs/docs
456
+ // See: https://521dimensions.com/open-source/amplitudejs/docs
457
+ // NOTE: slider VALUE (volume) is set by DEFAULT settings (player)
462
458
  Amplitude.init({
463
459
  bindings: {
464
460
  33: 'play_pause',
@@ -539,9 +535,10 @@ j1.adapter.amplitude = ((j1, window) => {
539
535
  // },
540
536
  continue_next: playerPlayNextTitle,
541
537
  volume: playerVolumeValue,
542
- volume_decrement: playerVolumeDecrement,
543
- volume_increment: playerVolumeIncrement
538
+ volume_decrement: playerVolumeSliderStep,
539
+ volume_increment: playerVolumeSliderStep
544
540
  }); // END Amplitude init
541
+
545
542
  }, // END initApi
546
543
 
547
544
  // -------------------------------------------------------------------------
@@ -554,9 +551,8 @@ j1.adapter.amplitude = ((j1, window) => {
554
551
  logger.info('\n' + 'initialize player specific UI events: started');
555
552
 
556
553
  {% for player in amplitude_options.players %} {% if player.enabled %}
557
- {% assign player_id = player.id %}
558
554
  {% assign xhr_data_path = amplitude_options.xhr_data_path %}
559
- {% capture xhr_container_id %}{{player_id}}_parent{% endcapture %}
555
+ {% capture xhr_container_id %}{{player.id}}_parent{% endcapture %}
560
556
 
561
557
  playerID = '{{player.id}}';
562
558
  playerType = '{{player.type}}';
@@ -564,16 +560,16 @@ j1.adapter.amplitude = ((j1, window) => {
564
560
  playListName = '{{player.playlist.name}}'
565
561
  playListTitle = '{{player.playlist.title}}';
566
562
 
567
- logger.debug('\n' + 'set playlist {{player.playlist}} on id #{{player_id}} with title: ' + playListTitle);
563
+ logger.debug('\n' + 'set playlist {{player.playlist}} on id #{{player.id}} with title: ' + playListTitle);
568
564
 
569
- // dynamic loader variable to setup the player on ID {{player_id}}
570
- dependency = 'dependencies_met_player_loaded_{{player_id}}';
565
+ // dynamic loader variable to setup the player on ID {{player.id}}
566
+ dependency = 'dependencies_met_player_loaded_{{player.id}}';
571
567
  load_dependencies[dependency] = '';
572
568
 
573
569
  // -----------------------------------------------------------------
574
570
  // initialize player instance (when player UI is loaded)
575
571
  // -----------------------------------------------------------------
576
- load_dependencies['dependencies_met_player_loaded_{{player_id}}'] = setInterval (() => {
572
+ load_dependencies['dependencies_met_player_loaded_{{player.id}}'] = setInterval (() => {
577
573
  // check if HTML portion of the player is loaded successfully
578
574
  var xhrLoadState = j1.xhrDOMState['#' + '{{xhr_container_id}}'];
579
575
 
@@ -586,14 +582,15 @@ j1.adapter.amplitude = ((j1, window) => {
586
582
  _this.setAudioInfo(infoLinks);
587
583
  }
588
584
 
585
+ // jadams, 2024-10-19: (song) events DISABLED
589
586
  // set song (title) specific UI events
590
587
  // -------------------------------------------------------------
591
- var songElements = document.getElementsByClassName('song');
592
- _this.songEvents(songElements);
588
+ // var songElements = document.getElementsByClassName('song');
589
+ // _this.songEvents(songElements);
593
590
 
594
591
  // player specific UI events
595
592
  // -------------------------------------------------------------
596
- logger.debug('\n' + 'setup player specific UI events on ID #{{player_id}}: started');
593
+ logger.debug('\n' + 'setup player specific UI events on ID #{{player.id}}: started');
597
594
 
598
595
  var dependencies_met_api_initialized = setInterval (() => {
599
596
  if (apiInitialized.state) {
@@ -603,7 +600,7 @@ j1.adapter.amplitude = ((j1, window) => {
603
600
  // ---------------------------------------------------------
604
601
  // START mini player UI events
605
602
  //
606
- if (document.getElementById(playerID) !== null) {
603
+ if (document.getElementById('{{player.id}}') !== null) {
607
604
 
608
605
  // click on progress bar
609
606
  // -------------------------------------------------------
@@ -629,15 +626,16 @@ j1.adapter.amplitude = ((j1, window) => {
629
626
  // ---------------------------------------------------------
630
627
  // START compact player UI events
631
628
  //
632
- if (document.getElementById(playerID) !== null) {
629
+ if (document.getElementById('{{player.id}}') !== null) {
633
630
 
634
631
  // show|hide scrollbar in playlist
635
632
  // -------------------------------------------------------
636
633
  const songsInPlaylist = Amplitude.getSongsInPlaylist(playListName);
637
-
638
634
  if (songsInPlaylist.length <= 8) {
639
635
  const titleListCompactPlayer = document.getElementById('compact_player_title_list_' + playListName);
640
- titleListCompactPlayer.classList.add('hide-scrollbar');
636
+ if (titleListCompactPlayer !== null) {
637
+ titleListCompactPlayer.classList.add('hide-scrollbar');
638
+ }
641
639
  }
642
640
 
643
641
  // show|hide playlist
@@ -645,7 +643,7 @@ j1.adapter.amplitude = ((j1, window) => {
645
643
 
646
644
  // show playlist
647
645
  var showPlaylist = document.getElementById("show_playlist_{{player.id}}");
648
-
646
+ if (showPlaylist !== null) {
649
647
  showPlaylist.addEventListener('click', function(event) {
650
648
  var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
651
649
 
@@ -670,24 +668,26 @@ j1.adapter.amplitude = ((j1, window) => {
670
668
  $('body').addClass('stop-scrolling');
671
669
  }
672
670
  }
673
- }); // END EventListener 'click' (compact player|show playlist)
671
+ }); // END EventListener 'click' (compact player|show playlist)
672
+ }
674
673
 
675
674
  // hide playlist
676
675
  var hidePlaylist = document.getElementById("hide_playlist_{{player.id}}");
676
+ if (hidePlaylist !== null) {
677
+ hidePlaylist.addEventListener('click', function(event) {
678
+ var playlistScreen = document.getElementById("playlist_screen_{{player.id}}");
677
679
 
678
- hidePlaylist.addEventListener('click', function(event) {
679
- var playlistScreen = document.getElementById("playlist_screen_{{player.id}}");
680
-
681
- playlistScreen.classList.remove('slide-in-top');
682
- playlistScreen.classList.add('slislide-out-top');
683
- playlistScreen.style.display = "none";
684
- playlistScreen.style.zIndex = "1";
680
+ playlistScreen.classList.remove('slide-in-top');
681
+ playlistScreen.classList.add('slislide-out-top');
682
+ playlistScreen.style.display = "none";
683
+ playlistScreen.style.zIndex = "1";
685
684
 
686
- // enable scrolling
687
- if ($('body').hasClass('stop-scrolling')) {
688
- $('body').removeClass('stop-scrolling');
689
- }
690
- }); // END EventListener 'click' (compact player|show playlist)
685
+ // enable scrolling
686
+ if ($('body').hasClass('stop-scrolling')) {
687
+ $('body').removeClass('stop-scrolling');
688
+ }
689
+ }); // END EventListener 'click' (compact player|show playlist)
690
+ }
691
691
 
692
692
  // click on progress bar
693
693
  // -------------------------------------------------------
@@ -703,20 +703,64 @@ j1.adapter.amplitude = ((j1, window) => {
703
703
 
704
704
  Amplitude.setSongPlayedPercentage(
705
705
  (parseFloat(xpos)/parseFloat(this.offsetWidth))*100);
706
- });
706
+ }); // END EventListener 'click'
707
707
  }
708
708
 
709
- // click on shuffle icon
710
- document.getElementById('compact_player_shuffle').addEventListener('click', function(event) {
711
- var shuffleState = (document.getElementById('compact_player_shuffle').className.includes('amplitude-shuffle-on')) ? true : false;
712
- Amplitude.setShuffle(shuffleState)
713
- });
709
+ // click on skip forward|backward (compact player)
710
+ // See: https://github.com/serversideup/amplitudejs/issues/384
711
+ // -------------------------------------------------------
714
712
 
715
- // click on repeat icon
716
- document.getElementById('compact_player_repeat').addEventListener('click', function(event) {
717
- var repeatState = (document.getElementById('compact_player_repeat').className.includes('amplitude-repeat-on')) ? true : false;
718
- Amplitude.setRepeat(repeatState)
719
- });
713
+ // add listeners to all SkipForwardButtons found
714
+ var compactPlayerSkipForwardButtons = document.getElementsByClassName("compact-player-skip-forward");
715
+ for (var i=0; i<compactPlayerSkipForwardButtons.length; i++) {
716
+ if (compactPlayerSkipForwardButtons[i].id === 'skip-forward_{{player.id}}') {
717
+ compactPlayerSkipForwardButtons[i].addEventListener('click', function(event) {
718
+ const skipOffset = parseFloat(playerForwardBackwardSkipSeconds);
719
+ const duration = Amplitude.getSongDuration();
720
+ const currentTime = parseFloat(Amplitude.getSongPlayedSeconds());
721
+ const targetTime = parseFloat(currentTime + skipOffset);
722
+
723
+ if (currentTime > 0) {
724
+ Amplitude.setSongPlayedPercentage((targetTime / duration) * 100);
725
+ } // END EventListener 'click'
726
+ });
727
+ } // END if ID
728
+ } // END for SkipForwardButtons
729
+
730
+ // add listeners to all SkipBackwardButtons found
731
+ var compactPlayerSkipBackwardButtons = document.getElementsByClassName("compact-player-skip-backward");
732
+ for (var i=0; i<compactPlayerSkipBackwardButtons.length; i++) {
733
+ if (compactPlayerSkipBackwardButtons[i].id === 'skip-backward_{{player.id}}') {
734
+ compactPlayerSkipBackwardButtons[i].addEventListener('click', function(event) {
735
+ const skipOffset = parseFloat(playerForwardBackwardSkipSeconds);
736
+ const duration = Amplitude.getSongDuration();
737
+ const currentTime = parseFloat(Amplitude.getSongPlayedSeconds());
738
+ const targetTime = parseFloat(currentTime - skipOffset);
739
+
740
+ if (currentTime > 0) {
741
+ Amplitude.setSongPlayedPercentage((targetTime / duration) * 100);
742
+ } // END EventListener 'click'
743
+ });
744
+ } // END if ID
745
+ } // END for SkipBackwardButtons
746
+
747
+ // click on shuffle button
748
+ var compactPlayerShuffleButton = document.getElementById('compact_player_shuffle');
749
+ if (compactPlayerShuffleButton) {
750
+ compactPlayerShuffleButton.addEventListener('click', function(event) {
751
+ var shuffleState = (document.getElementById('compact_player_shuffle').className.includes('amplitude-shuffle-on')) ? true : false;
752
+ Amplitude.setShuffle(shuffleState)
753
+ }); // END EventListener 'click'
754
+ } // END compactPlayerShuffleButton
755
+
756
+ // click on repeat button
757
+ var compactPlayerRepeatButton = document.getElementById('compact_player_repeat');
758
+ if (compactPlayerRepeatButton) {
759
+ compactPlayerRepeatButton.addEventListener('click', function(event) {
760
+ var repeatState = (document.getElementById('compact_player_repeat').className.includes('amplitude-repeat-on')) ? true : false;
761
+ Amplitude.setRepeat(repeatState)
762
+ }); // END EventListener 'click'
763
+ } // END compactPlayerRepeatButton
720
764
 
721
765
  } // END compact player UI events
722
766
  {% endif %}
@@ -724,13 +768,79 @@ j1.adapter.amplitude = ((j1, window) => {
724
768
  {% if player.id contains 'large' %}
725
769
  // START large player UI events
726
770
  //
727
- if (document.getElementById(playerID) !== null) {
771
+ if (document.getElementById('{{player.id}}') !== null) {
728
772
 
729
- // click on progress bar
773
+ // listener overloads for Youtube video (large player)
730
774
  // -------------------------------------------------------
731
- var progressBars = document.getElementsByClassName("large-player-progress");
775
+
776
+ // click on prev button
777
+ var largePlayerPreviousButton = document.getElementById('large_player_previous');
778
+ if (largePlayerPreviousButton && largePlayerPreviousButton.getAttribute("data-amplitude-source") === 'youtube') {
779
+ largePlayerPreviousButton.addEventListener('click', function(event) {
780
+ var playlist = this.getAttribute("data-amplitude-playlist");
781
+ var songIndex = ytpSongIndex; // Amplitude.getActiveIndex();
782
+
783
+ }); // END EventListener 'click'
784
+ }
785
+
786
+ // click on play_pause button
787
+ var largePlayerPlayButton = document.getElementById('large_player_play_pause');
788
+ if (largePlayerPlayButton && largePlayerPlayButton.getAttribute("data-amplitude-source") === 'youtube') {
789
+ largePlayerPlayButton.addEventListener('click', function(event) {
790
+ var playlist = this.getAttribute("data-amplitude-playlist");
791
+ var songMetaData = Amplitude.getSongAtIndex(ytpSongIndex);
792
+ var songURL = songMetaData.url;
793
+ var songIndex = ytpSongIndex;
794
+
795
+ var dependencies_met_ytIframeAPIReady = setInterval (() => {
796
+ if (j1.adapter.amplitude['iframeAPIReady']) {
797
+ ytPlayer = j1.adapter.amplitude['ytPlayer'];
798
+ ytpPlaybackRate = ytPlayer.getPlaybackRate()
799
+
800
+ // ytPlayer.loadVideoById({
801
+ // 'videoId': 'bHQqvYy5KYo',
802
+ // 'startSeconds': 5,
803
+ // 'endSeconds': 60
804
+ // });
805
+
806
+ // ytPlayer.loadVideoByUrl(
807
+ // mediaContentUrl: songURL,
808
+ // startSeconds: 10
809
+ // )
810
+
811
+ // ytPlayer.playVideo();
812
+
813
+ clearInterval(dependencies_met_ytIframeAPIReady);
814
+ } // END if playersUILoaded
815
+ }, 10); // END dependencies_met_ytIframeAPIReady
816
+
817
+ }); // END EventListener 'click'
818
+ }
819
+
820
+ // click on next button
821
+ var largePlayerNextButton = document.getElementById('large_player_next');
822
+ if (largePlayerNextButton && largePlayerPlayButton.getAttribute("data-amplitude-source") === 'youtube') {
823
+ largePlayerNextButton.addEventListener('click', function(event) {
824
+ var playlist = this.getAttribute("data-amplitude-playlist");
825
+ var songIndex = ytpSongIndex; // Amplitude.getActiveIndex();
826
+ }); // END EventListener 'click'
827
+ }
828
+
829
+ // click on song container
830
+ var largetPlayerSongContainer = document.getElementsByClassName("song amplitude-song-container");
831
+ for (var i=0; i<largetPlayerSongContainer.length; i++) {
832
+ if (largetPlayerSongContainer[i].dataset.amplitudeSource === 'youtube') {
833
+ largetPlayerSongContainer[i].addEventListener('click', function(event) {
834
+ var playlist = this.getAttribute("data-amplitude-playlist");
835
+ var playlistLength = largetPlayerSongContainer.length;
836
+ ytpSongIndex = this.getAttribute("data-amplitude-song-index");
837
+ });
838
+ } // END if Attribute
839
+ } // END for
732
840
 
733
841
  // add listeners to all progress bars found
842
+ // -------------------------------------------------------
843
+ var progressBars = document.getElementsByClassName("large-player-progress");
734
844
  for (var i=0; i<progressBars.length; i++) {
735
845
  progressBars[i].addEventListener('click', function(event) {
736
846
  var offset = this.getBoundingClientRect();
@@ -738,20 +848,85 @@ j1.adapter.amplitude = ((j1, window) => {
738
848
 
739
849
  Amplitude.setSongPlayedPercentage(
740
850
  (parseFloat(xpos)/parseFloat(this.offsetWidth))*100);
741
- });
851
+ }); // END EventListener 'click'
742
852
  }
743
853
 
744
- // click on shuffle icon
745
- document.getElementById('large_player_shuffle').addEventListener('click', function(event) {
746
- var shuffleState = (document.getElementById('large_player_shuffle').className.includes('amplitude-shuffle-on')) ? true : false;
747
- Amplitude.setShuffle(shuffleState)
748
- });
854
+ // click on skip forward|backward (large player)
855
+ // See: https://github.com/serversideup/amplitudejs/issues/384
856
+ // -------------------------------------------------------
749
857
 
750
- // click on repeat icon
751
- document.getElementById('repeat_container_large_player').addEventListener('click', function(event) {
752
- var repeatState = (document.getElementById('repeat_container_large_player').className.includes('amplitude-repeat-on')) ? true : false;
753
- Amplitude.setRepeat(repeatState)
754
- });
858
+ // add listeners to all SkipForwardButtons found
859
+ var largePlayerSkipForwardButtons = document.getElementsByClassName("large-player-skip-forward");
860
+ for (var i=0; i<largePlayerSkipForwardButtons.length; i++) {
861
+ if (largePlayerSkipForwardButtons[i].id === 'skip-forward_{{player.id}}') {
862
+ if (largePlayerSkipForwardButtons[i].dataset.amplitudeSource === 'youtube') {
863
+ largePlayerSkipForwardButtons[i].addEventListener('click', function(event) {
864
+ const skipOffset = parseFloat(playerForwardBackwardSkipSeconds);
865
+ //const duration = Amplitude.getSongDuration();
866
+ //const currentTime = parseFloat(Amplitude.getSongPlayedSeconds());
867
+ //const targetTime = parseFloat(currentTime + skipOffset);
868
+
869
+ // if (currentTime > 0) {
870
+ // Amplitude.setSongPlayedPercentage((targetTime / duration) * 100);
871
+ // }
872
+ }); // END EventListener 'click
873
+ } else {
874
+ largePlayerSkipForwardButtons[i].addEventListener('click', function(event) {
875
+ const skipOffset = parseFloat(playerForwardBackwardSkipSeconds);
876
+ const duration = Amplitude.getSongDuration();
877
+ const currentTime = parseFloat(Amplitude.getSongPlayedSeconds());
878
+ const targetTime = parseFloat(currentTime + skipOffset);
879
+
880
+ if (currentTime > 0) {
881
+ Amplitude.setSongPlayedPercentage((targetTime / duration) * 100);
882
+ }
883
+ }); // END EventListener 'click
884
+ }
885
+
886
+ } // END if ID
887
+ } // END for SkipForwardButtons
888
+
889
+ // add listeners to all SkipBackwardButtons found
890
+ var largePlayerSkipBackwardButtons = document.getElementsByClassName("large-player-skip-backward");
891
+ for (var i=0; i<largePlayerSkipBackwardButtons.length; i++) {
892
+ if (largePlayerSkipBackwardButtons[i].id === 'skip-backward_{{player.id}}') {
893
+ if (largePlayerSkipBackwardButtons[i].dataset.amplitudeSource === 'youtube') {
894
+ largePlayerSkipBackwardButtons[i].addEventListener('click', function(event) {
895
+ const skipOffset = parseFloat(playerForwardBackwardSkipSeconds);
896
+ }); // END EventListener 'click'
897
+ } else {
898
+ largePlayerSkipBackwardButtons[i].addEventListener('click', function(event) {
899
+ const skipOffset = parseFloat(playerForwardBackwardSkipSeconds);
900
+ const duration = Amplitude.getSongDuration();
901
+ const currentTime = parseFloat(Amplitude.getSongPlayedSeconds());
902
+ const targetTime = parseFloat(currentTime - skipOffset);
903
+
904
+ if (currentTime > 0) {
905
+ Amplitude.setSongPlayedPercentage((targetTime / duration) * 100);
906
+ }
907
+ }); // END EventListener 'click'
908
+ }
909
+
910
+ } // END if ID
911
+ } // END for SkipBackwardButtons
912
+
913
+ // click on shuffle button
914
+ var largePlayerShuffleButton = document.getElementById('large_player_shuffle');
915
+ if (largePlayerShuffleButton) {
916
+ largePlayerShuffleButton.addEventListener('click', function(event) {
917
+ var shuffleState = (document.getElementById('large_player_shuffle').className.includes('amplitude-shuffle-on')) ? true : false;
918
+ Amplitude.setShuffle(shuffleState)
919
+ }); // END EventListener 'click'
920
+ } // END largePlayerShuffleButton
921
+
922
+ // click on repeat button
923
+ var largePlayerRepeatButton = document.getElementById('large_player_repeat');
924
+ if (largePlayerShuffleButton) {
925
+ largePlayerRepeatButton.addEventListener('click', function(event) {
926
+ var repeatState = (document.getElementById('large_player_repeat').className.includes('amplitude-repeat-on')) ? true : false;
927
+ Amplitude.setRepeat(repeatState)
928
+ }); // END EventListener 'click'
929
+ } // END largePlayerRepeatButton
755
930
 
756
931
  // enable|disable scrolling on playlist
757
932
  // -------------------------------------------------------
@@ -763,7 +938,9 @@ j1.adapter.amplitude = ((j1, window) => {
763
938
 
764
939
  if (songsInPlaylist.length <= 8) {
765
940
  const titleListLargePlayer = document.getElementById('large_player_title_list_' + playListName);
766
- titleListLargePlayer.classList.add('hide-scrollbar');
941
+ if (titleListLargePlayer !== null) {
942
+ titleListLargePlayer.classList.add('hide-scrollbar');
943
+ }
767
944
  }
768
945
 
769
946
  // scroll to player top position
@@ -823,13 +1000,13 @@ j1.adapter.amplitude = ((j1, window) => {
823
1000
  // finished messages
824
1001
  // ---------------------------------------------------------
825
1002
  logger.debug('\n' + 'current player state: ' + amplitudePlayerState);
826
- logger.debug('\n' + 'setup player specific UI events on ID #{{player_id}}: finished');
1003
+ logger.debug('\n' + 'setup player specific UI events on ID #{{player.id}}: finished');
827
1004
 
828
1005
  clearInterval(dependencies_met_api_initialized);
829
1006
  } // END if apiInitialized
830
1007
  }, 10); // END dependencies_met_api_initialized
831
1008
 
832
- clearInterval(load_dependencies['dependencies_met_player_loaded_{{player_id}}']);
1009
+ clearInterval(load_dependencies['dependencies_met_player_loaded_{{player.id}}']);
833
1010
  } // END if xhrLoadState success
834
1011
  }, 10); // END dependencies_met_html_loaded
835
1012