assets/theme/j1/modules/amplitudejs/js/amplitude.js in j1-template-2024.3.13 vs assets/theme/j1/modules/amplitudejs/js/amplitude.js in j1-template-2024.3.14

- old
+ new

@@ -7406,11 +7406,12 @@ */ if (!_config2.default.is_touch_moving) { /* Gets the playlist attribute from the element. */ - var playlist = this.getAttribute("data-amplitude-playlist"); + var playlist = this.getAttribute("data-amplitude-playlist"); + var source = this.getAttribute("data-amplitude-source"); /* If the playlist is null, we handle the global next. */ if (playlist == null) { @@ -7419,11 +7420,15 @@ /* If the playlist is set, we handle the playlist next. */ if (playlist != null) { - handlePlaylistNext(playlist); + if (source === 'youtube' ) { + return false; + } else { + handlePlaylistNext(playlist); + } } } } /** @@ -8094,16 +8099,17 @@ If the touch is moving, we do not want to accidentally touch the play pause element and fire an event. */ if (!_config2.default.is_touch_moving) { /* - Get the playlist and song from the element. It's alright if these - are null. + Get the playlist and song from the element. It's alright if these are null. */ - var playlist = this.getAttribute("data-amplitude-playlist"); - var song = this.getAttribute("data-amplitude-song-index"); + var playlist = this.getAttribute("data-amplitude-playlist"); + var source = this.getAttribute("data-amplitude-source"); + var song = this.getAttribute("data-amplitude-song-index"); + /* Handle a global play pause button */ if (playlist == null && song == null) { handleGlobalPlayPause(); @@ -8111,11 +8117,15 @@ /* Handle a playlist play pause button */ if (playlist != null && song == null) { - handlePlaylistPlayPause(playlist); + if (source === 'youtube' ) { + return false; + } else { + handlePlaylistPlayPause(playlist); + } } /* Handle a song play pause button */ @@ -8125,11 +8135,15 @@ /* Handle a song in playlist play pause button */ if (playlist != null && song != null) { - handleSongInPlaylistPlayPause(playlist, song); + if (source === 'youtube' ) { + return false; + } else { + handleSongInPlaylistPlayPause(playlist, song); + } } } } /** @@ -8498,11 +8512,12 @@ */ if (!_config2.default.is_touch_moving) { /* Gets the playlist attribute from the element. */ - var playlist = this.getAttribute("data-amplitude-playlist"); + var playlist = this.getAttribute("data-amplitude-playlist"); + var source = this.getAttribute("data-amplitude-source"); /* If the playlist is null, we handle the global prev. */ if (playlist == null) { @@ -8511,11 +8526,15 @@ /* If the playlist is set, we handle the playlist prev. */ if (playlist != null) { - handlePlaylistPrev(playlist); + if (source === 'youtube' ) { + return false; + } else { + handlePlaylistPrev(playlist); + } } } } /** @@ -8701,11 +8720,12 @@ */ if (!_config2.default.is_touch_moving) { /* Gets the playlist attribute from the element. */ - var playlist = this.getAttribute("data-amplitude-playlist"); + var playlist = this.getAttribute("data-amplitude-playlist"); + var source = this.getAttribute("data-amplitude-source"); /* If the playlist is null, we handle the global repeat. */ if (playlist == null) { @@ -8714,11 +8734,15 @@ /* If the playlist is set, we handle the playlist repeat. */ if (playlist != null) { - handlePlaylistRepeat(playlist); + if (source === 'youtube' ) { + return false; + } else { + handlePlaylistRepeat(playlist); + } } } } /** @@ -8909,19 +8933,24 @@ */ if (!_config2.default.is_touch_moving) { /* Get the playlist attribute */ - var playlist = this.getAttribute("data-amplitude-playlist"); + var playlist = this.getAttribute("data-amplitude-playlist"); + var source = this.getAttribute("data-amplitude-source"); /* Check to see if the shuffle button belongs to a playlist */ if (playlist == null) { handleGlobalShuffle(); } else { - handlePlaylistShuffle(playlist); + if (source === 'youtube' ) { + return false; + } else { + handlePlaylistShuffle(playlist); + } } } } /** @@ -9051,13 +9080,15 @@ */ if (!_config2.default.is_touch_moving) { /* Extracts the needed attributes from the element. */ - var playlist = this.getAttribute("data-amplitude-playlist"); + var playlist = this.getAttribute("data-amplitude-playlist"); + var source = this.getAttribute("data-amplitude-source"); + var songIndex = this.getAttribute("data-amplitude-song-index"); - var location = this.getAttribute("data-amplitude-location"); + var location = this.getAttribute("data-amplitude-location"); /* If the location is null, write a message. We can't skip to a location that is null */ @@ -9081,11 +9112,15 @@ Determines if the skip to button is in the scope of a playlist. */ if (playlist == null) { handleSkipToSong(parseInt(songIndex), parseInt(location)); } else { - handleSkipToPlaylist(playlist, parseInt(songIndex), parseInt(location)); + if (source === 'youtube' ) { + return false; + } else { + handleSkipToPlaylist(playlist, parseInt(songIndex), parseInt(location)); + } } } } } @@ -9240,12 +9275,13 @@ var computedTime = _config2.default.audio.duration * (locationPercentage / 100); /* Gets the attributes for playlist and index for the element. */ - var playlist = this.getAttribute("data-amplitude-playlist"); - var song = this.getAttribute("data-amplitude-song-index"); + var playlist = this.getAttribute("data-amplitude-playlist"); + var source = this.getAttribute("data-amplitude-source"); + var song = this.getAttribute("data-amplitude-song-index"); /* If no playlist or song is defined, then it's a global song slider. */ if (playlist == null && song == null) { @@ -9254,11 +9290,15 @@ /* If a playlist but no song is defined, then it's playlist slider. */ if (playlist != null && song == null) { - handlePlaylistSongSlider(computedTime, locationPercentage, playlist); + if (source === 'youtube' ) { + return false; + } else { + handlePlaylistSongSlider(computedTime, locationPercentage, playlist); + } } /* If no playlist but a song is defined, then it's a song slider. */ @@ -9269,10 +9309,14 @@ /* If playlist and song are defined then it's a song in a playlist slider. */ if (playlist != null && song != null) { - handleSongInPlaylistSongSlider(computedTime, locationPercentage, playlist, song); + if (source === 'youtube' ) { + return false; + } else { + handleSongInPlaylistSongSlider(computedTime, locationPercentage, playlist, song); + } } } /** * Handles a change on a global audio slider