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.
- checksums.yaml +4 -4
- data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +1 -1
- data/_includes/themes/j1/layouts/layout_resource_generator.html +1 -4
- data/_includes/themes/j1/procedures/blocks/footer/boxes/social_media_icons.proc +24 -23
- data/_includes/themes/j1/procedures/layouts/content_writer.proc +4 -3
- data/_includes/themes/j1/procedures/layouts/default_writer.proc +37 -6
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +31 -95
- data/_includes/themes/j1/procedures/layouts/resource_writer.proc +51 -29
- data/assets/data/amplitude.28.html +887 -0
- data/assets/data/amplitude.29.html +923 -0
- data/assets/data/amplitude.html +311 -46
- data/assets/data/banner.html +9 -7
- data/assets/data/masterslider.html +128 -7
- data/assets/data/panel.html +16 -65
- data/assets/theme/j1/adapter/js/amplitude.23.js +1165 -0
- data/assets/theme/j1/adapter/js/amplitude.24.js +1164 -0
- data/assets/theme/j1/adapter/js/amplitude.25.js +1268 -0
- data/assets/theme/j1/adapter/js/amplitude.js +294 -117
- data/assets/theme/j1/adapter/js/attic.js +14 -11
- data/assets/theme/j1/adapter/js/docsearch.js +2 -2
- data/assets/theme/j1/adapter/js/fab.js +2 -2
- data/assets/theme/j1/adapter/js/j1.js +8 -8
- data/assets/theme/j1/adapter/js/lazyLoader.js +60 -10
- data/assets/theme/j1/adapter/js/masonry.js +1 -1
- data/assets/theme/j1/adapter/js/masterslider.js +2 -2
- data/assets/theme/j1/adapter/js/particles.js +2 -2
- data/assets/theme/j1/adapter/js/scroller.js +2 -2
- data/assets/theme/j1/adapter/js/slick.js +2 -2
- data/assets/theme/j1/adapter/js/themes.js +1 -1
- data/assets/theme/j1/adapter/js/translator.js +2 -2
- data/assets/theme/j1/adapter/js/waves.js +1 -1
- data/assets/theme/j1/core/css/animate.css +1634 -1070
- data/assets/theme/j1/core/css/animate.css.map +1 -0
- data/assets/theme/j1/core/css/animate.min.css +2 -1
- data/assets/theme/j1/core/css/animate.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.css +3060 -1538
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/iconify.css +2308 -1153
- data/assets/theme/j1/core/css/icon-fonts/iconify.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/iconify.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/iconify.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdi.css +16716 -8423
- data/assets/theme/j1/core/css/icon-fonts/mdi.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdi.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdi.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdib.css +5554 -2766
- data/assets/theme/j1/core/css/icon-fonts/mdib.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdib.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdib.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdil.css +742 -441
- data/assets/theme/j1/core/css/icon-fonts/mdil.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdil.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdil.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css +6552 -3980
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css +2 -5
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.css +6818 -4131
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css +2 -5
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +18568 -11577
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +2 -35
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/vendor.css +1771 -1043
- data/assets/theme/j1/core/css/vendor.css.map +1 -0
- data/assets/theme/j1/core/css/vendor.min.css +2 -1
- data/assets/theme/j1/core/css/vendor.min.css.map +1 -0
- data/assets/theme/j1/core/js/template.js +399 -447
- data/assets/theme/j1/core/js/template.min.js +7 -7
- data/assets/theme/j1/core/js/template.min.js.map +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +4 -2
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +39 -4
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +57 -17
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/pause.png +0 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.png +0 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.svg +87 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +60 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +59 -0
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.js +65 -21
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +113 -0
- data/assets/theme/j1/modules/iconPicker/js/universal-icon-picker.js +471 -471
- data/assets/theme/j1/modules/j1LazyLoader/LICENSE +21 -0
- data/assets/theme/j1/modules/j1LazyLoader/js/j1Lazy.js +870 -0
- data/assets/theme/j1/modules/js-cookies/js/js.cookie.js +3 -3
- data/assets/theme/j1/modules/lazyCssLoader/js/main.0.js +166 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/main.1.js +65 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/main.js +66 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/examplePlugin.js +13 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/my-plugin.js +25 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/plugin-interface.js +9 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/pluginA.js +46 -0
- data/assets/theme/j1/modules/lazyLoader/js/plugins/README.md +324 -0
- data/assets/theme/j1/modules/lazyLoader/js/plugins/jquery.lazy.picture.js +188 -0
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +794 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +151 -67
- data/assets/theme/j1/modules/slimSelect/js/select.js +1 -1
- data/assets/theme/j1/modules/slimSelect/js/select.min.js +3 -3
- data/assets/theme/j1/modules/themeSwitcher/js/switcher.js +2 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/icon/scalable/dailymotion.svg +62 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.js +832 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.min.js +17 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/video.js +2 -2
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/README.md +577 -560
- data/lib/starter_web/_config.yml +2 -2
- data/lib/starter_web/_data/blocks/footer.yml +10 -5
- data/lib/starter_web/_data/blocks/panel.yml +2 -2
- data/lib/starter_web/_data/layouts/default.yml +14 -3
- data/lib/starter_web/_data/modules/amplitude.yml +145 -0
- data/lib/starter_web/_data/modules/defaults/amplitude.yml +29 -7
- data/lib/starter_web/_data/modules/defaults/lazyLoader.yml +2 -2
- data/lib/starter_web/_data/modules/gallery.yml +136 -0
- data/lib/starter_web/_data/modules/lazyLoader.0.yml +118 -0
- data/lib/starter_web/_data/modules/lazyLoader.yml +68 -31
- data/lib/starter_web/_data/modules/masonry.yml +4 -4
- data/lib/starter_web/_data/modules/masterslider.yml +118 -12
- data/lib/starter_web/_data/modules/navigator_menu.yml +831 -803
- data/lib/starter_web/_data/resources.yml +154 -190
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +1 -0
- data/lib/starter_web/_plugins/asciidoctor/amplitude-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +4 -2
- data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +58 -46
- data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +26 -19
- data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +30 -40
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/image/icons/lanus/favicon.ico +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus-512x512.png +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus.ico +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus.png +0 -0
- data/lib/starter_web/assets/image/icons/lanus/scalable/lanus.svg +76 -0
- data/lib/starter_web/assets/image/icons/lanus/scalable/lanus_sw.svg +62 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28 - social.svg +86 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28.svg +64 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x.svg +1 -0
- data/lib/starter_web/assets/image/modules/icons/social/twitter_x.png +0 -0
- data/lib/starter_web/package.json +7 -18
- data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +218 -0
- data/lib/starter_web/pages/public/features/template.adoc +18 -8
- data/lib/starter_web/pages/public/features/template.asciidoc +758 -0
- data/lib/starter_web/pages/public/lazy_loader_tester.adoc +402 -0
- data/lib/starter_web/pages/public/manuals/ytdl/man.adoc +3020 -0
- data/lib/starter_web/pages/public/manuals/ytdl/man.md +2378 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/attributes.asciidoc +0 -16
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/amplitudejs.large.css.asciidoc +505 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.hover.html +69 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.nested.html +75 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.textarea.html +57 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/my.content.html +112 -0
- data/lib/starter_web/pages/public/tools/previewer/preview_amplitudejs.adoc +172 -0
- data/lib/starter_web/pages/public/tour/_includes/attributes.asciidoc +2 -2
- data/lib/starter_web/pages/public/tour/_includes/documents/419_advanced_modals_demo.asciidoc +16 -16
- data/lib/starter_web/pages/public/tour/asciidoc_extensions.adoc +13 -3
- data/lib/starter_web/pages/public/tour/bootstrap_themes.adoc +12 -3
- data/lib/starter_web/pages/public/tour/highlghter_rouge.adoc +13 -3
- data/lib/starter_web/pages/public/tour/icon_fonts.adoc +12 -3
- data/lib/starter_web/pages/public/tour/modal_extentions.adoc +12 -6
- data/lib/starter_web/pages/public/tour/{playback_audio.adoc → play_audio.adoc} +207 -188
- data/lib/starter_web/pages/public/tour/{playback_video.adoc → play_video.adoc} +49 -51
- data/lib/starter_web/pages/public/tour/present_images.adoc +27 -5
- data/lib/starter_web/pages/public/tour/quicksearch.adoc +13 -3
- data/lib/starter_web/pages/public/tour/responsive_tables.adoc +13 -4
- data/lib/starter_web/pages/public/tour/typography.adoc +12 -3
- metadata +90 -22
- /data/assets/theme/j1/modules/{lazyLoader → j1LazyLoader/js}/plugins/README.md +0 -0
- /data/assets/theme/j1/modules/{lazyLoader/plugins/jquery.lazy.picture.js → j1LazyLoader/js/plugins/picture.js} +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.picture.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.youtube.js +0 -0
- /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
|
134
|
-
var load_dependencies
|
135
|
-
var playersProcessed
|
136
|
-
var playersHtmlLoaded
|
137
|
-
var processingPlayersFinished
|
138
|
-
var playerAudioInfo
|
139
|
-
var playerDefaultType
|
140
|
-
var playerVolumeValue
|
141
|
-
var
|
142
|
-
var
|
143
|
-
var
|
144
|
-
var
|
145
|
-
var
|
146
|
-
var
|
147
|
-
var
|
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
|
-
//
|
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
|
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 %}{{
|
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 #{{
|
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: '{{
|
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 {{
|
363
|
-
dependency = 'dependencies_met_html_loaded_{{
|
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_{{
|
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 #{{
|
370
|
+
logger.debug('\n' + 'load player UI on ID #{{player.id}}: finished');
|
376
371
|
|
377
|
-
clearInterval(load_dependencies['dependencies_met_html_loaded_{{
|
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:
|
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:
|
543
|
-
volume_increment:
|
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 %}{{
|
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 #{{
|
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 {{
|
570
|
-
dependency = 'dependencies_met_player_loaded_{{
|
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_{{
|
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 #{{
|
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(
|
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(
|
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
|
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
|
-
|
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
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
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
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
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
|
710
|
-
|
711
|
-
|
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
|
-
//
|
716
|
-
document.
|
717
|
-
|
718
|
-
|
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(
|
771
|
+
if (document.getElementById('{{player.id}}') !== null) {
|
728
772
|
|
729
|
-
//
|
773
|
+
// listener overloads for Youtube video (large player)
|
730
774
|
// -------------------------------------------------------
|
731
|
-
|
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
|
745
|
-
|
746
|
-
|
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
|
-
//
|
751
|
-
document.
|
752
|
-
|
753
|
-
|
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
|
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 #{{
|
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_{{
|
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
|
|