+
+
+
+
+
+
-
- {_remove_from_playlist}
+
+
+
+
+
+
+
+ {include 'player.xml', audio => $audio, hideButtons => true}
+
+
-
-
-
-
{/block}
diff --git a/Web/Presenters/templates/Audio/NewPlaylist.xml b/Web/Presenters/templates/Audio/NewPlaylist.xml
index d3d1a281..b28cd4a8 100644
--- a/Web/Presenters/templates/Audio/NewPlaylist.xml
+++ b/Web/Presenters/templates/Audio/NewPlaylist.xml
@@ -19,48 +19,32 @@
{/block}
{block content}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
{/block}
diff --git a/Web/static/css/audios.css b/Web/static/css/audios.css
index 15ecbcdb..cfa50169 100644
--- a/Web/static/css/audios.css
+++ b/Web/static/css/audios.css
@@ -605,6 +605,28 @@
width: 100%;
}
+.PE_playlistEditPage {
+ display: flex;
+ gap: 10px;
+}
+
+.PE_playlistEditPage .PE_playlistInfo {
+ width: 76%;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
+
+.PE_playlistEditPage textarea[name='description'] {
+ padding: 4px;
+ font-size: 11px;
+}
+
+.PE_end {
+ text-align: right;
+ margin-top: 10px;
+}
+
/* playlist listview */
.playlistListView {
diff --git a/Web/static/css/main.css b/Web/static/css/main.css
index 575b95a6..574fd8ef 100644
--- a/Web/static/css/main.css
+++ b/Web/static/css/main.css
@@ -2573,55 +2573,55 @@ a.poll-retract-vote {
border-radius: 3px;
}
-.post-vertical .vertical-attachment {
+.vertical-attachment {
display: grid;
grid-template-columns: 1fr 0fr;
}
-.post-vertical .vertical-attachment:first-of-type {
+.vertical-attachment:first-of-type {
margin-top: 7px;
}
-.post-vertical .vertical-attachment .audioEntry {
+.vertical-attachment .audioEntry {
max-height: 28px;
min-height: 18px;
}
-.post-vertical .vertical-attachment .audioEntry:hover {
+.vertical-attachment .audioEntry:hover {
background: unset !important;
}
-.post-vertical .vertical-attachment .audioEntry .buttons {
+.vertical-attachment .audioEntry .buttons {
display: none;
}
-.post-vertical .vertical-attachment .audioEntry .status {
+.vertical-attachment .audioEntry .status {
margin-top: 1px;
margin-left: 2px;
height: 15px;
}
-.post-vertical .vertical-attachment .audioEntry .nobold {
+.vertical-attachment .audioEntry .nobold {
margin-top: 1px;
}
-.post-vertical .vertical-attachment .audioEntry .subTracks {
- padding-bottom: 2px;
- padding-left: 3px;
+.vertical-attachment .audioEntry .subTracks {
+ padding-left: 0px;
padding-right: 0px;
+ margin-top: 2px;
}
-.post-vertical .vertical-attachment .audioEntry .audioEntryWrapper {
+.vertical-attachment .audioEntry .audioEntryWrapper {
height: 14px;
padding: 0px 4px 0px 0px;
gap: 2px;
}
-.post-vertical .vertical-attachment .vertical-attachment-content {
+.vertical-attachment .vertical-attachment-content {
max-height: 27px;
}
-.post-vertical .vertical-attachment .vertical-attachment-content .overflowedName {
+.vertical-attachment .vertical-attachment-content .overflowedName {
position: initial;
width: 100% !important;
}
diff --git a/Web/static/js/al_music.js b/Web/static/js/al_music.js
index 6cfa1166..8e87e4cc 100644
--- a/Web/static/js/al_music.js
+++ b/Web/static/js/al_music.js
@@ -336,14 +336,14 @@ window.player = new class {
return this.__findTrack(id, true) != -1
}
- play() {
+ async play() {
if(!this.currentTrack) {
return
}
document.querySelectorAll('audio').forEach(el => el.pause())
- this.audioPlayer.play()
+ await this.audioPlayer.play()
this.__setFavicon()
this.__updateFace()
navigator.mediaSession.playbackState = "playing"
@@ -374,7 +374,7 @@ window.player = new class {
this.playPreviousTrack()
}
- this.play()
+ await this.play()
}
async playNextTrack() {
@@ -391,14 +391,14 @@ window.player = new class {
this.playNextTrack()
}
- this.play()
+ await this.play()
}
// fake shuffle
async shuffle() {
this.tracks.sort(() => Math.random() - 0.59)
await this.setTrack(this.tracks.at(0).id)
- this.play()
+ await this.play()
}
isAtAudiosPage() {
@@ -489,15 +489,15 @@ window.player = new class {
}
__setMediaSessionActions() {
- navigator.mediaSession.setActionHandler('play', () => {
- window.player.play()
+ navigator.mediaSession.setActionHandler('play', async () => {
+ await window.player.play()
});
navigator.mediaSession.setActionHandler('pause', () => {
window.player.pause()
});
- navigator.mediaSession.setActionHandler('previoustrack', () => { window.player.playPreviousTrack() });
- navigator.mediaSession.setActionHandler('nexttrack', () => { window.player.playNextTrack() });
- navigator.mediaSession.setActionHandler("seekto", (details) => {
+ navigator.mediaSession.setActionHandler('previoustrack', async () => { await window.player.playPreviousTrack() });
+ navigator.mediaSession.setActionHandler('nexttrack', async () => { await window.player.playNextTrack() });
+ navigator.mediaSession.setActionHandler("seekto", async (details) => {
window.player.audioPlayer.currentTime = details.seekTime
});
}
@@ -560,14 +560,19 @@ window.player = new class {
}
}
- this.uiPlayer.find('.trackInfo .trackName span').html(escapeHtml(_c.name))
- this.uiPlayer.find('.trackInfo .trackPerformers').html('')
- const performers = _c.performer.split(', ')
- const lastPerformer = performers[performers.length - 1]
- performers.forEach(performer => {
- this.uiPlayer.find('.trackInfo .trackPerformers').append(
- `
${performer.escapeHtml()}${(performer != lastPerformer ? ', ' : '')}`)
- })
+ if(_c) {
+ this.uiPlayer.find('.trackInfo .trackName span').html(escapeHtml(_c.name))
+ this.uiPlayer.find('.trackInfo .trackPerformers').html('')
+ const performers = _c.performer.split(', ')
+ const lastPerformer = performers[performers.length - 1]
+ performers.forEach(performer => {
+ this.uiPlayer.find('.trackInfo .trackPerformers').append(
+ `
${performer.escapeHtml()}${(performer != lastPerformer ? ', ' : '')}`)
+ })
+ } else {
+ this.uiPlayer.find('.trackInfo .trackName span').html(tr('track_noname'))
+ this.uiPlayer.find('.trackInfo .trackPerformers').html(`
${tr('track_unknown')}`)
+ }
if(this.ajaxPlayer.length > 0) {
this.ajaxPlayer.find('#aj_player_track_title b').html(escapeHtml(_c.performer))
@@ -637,6 +642,9 @@ window.player = new class {
ajReveal() {
this.is_closed = false
+ if(u('#ajax_audio_player').length == 0) {
+ this.ajCreate()
+ }
u('#ajax_audio_player').removeClass('hidden')
}
@@ -731,8 +739,15 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
} else if(u(e.target).closest('.content_list').length > 0) {
window.player.connectionType = '.content_list'
_nodes = u(e.target).closest('.content_list').find('.audioEmbed').nodes
+ } else if(u(e.target).closest('.generic_audio_list').length > 0) {
+ window.player.connectionType = '.generic_audio_list'
+ _nodes = u(e.target).closest('.generic_audio_list').find('.audioEmbed').nodes
+ } else if(u(e.target).closest('.audiosInsert').length > 0) {
+ window.player.connectionType = '.audiosInsert'
+ _nodes = u(e.target).closest('.audiosInsert').find('.audioEmbed').nodes
}
+ window.player.tracks = []
_nodes.forEach(el => {
const tempAudio = u(el)
const name = tempAudio.attr('data-name').split(' — ')
@@ -753,7 +768,7 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
}
if(window.player.audioPlayer.paused) {
- window.player.play()
+ await window.player.play()
if(!window.player.isAtAudiosPage()) {
u('.audioEntry .playerButton .playIcon.paused').removeClass('paused')
@@ -764,7 +779,7 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
}
if(window.player.isAtAudiosPage()) {
-
+
} else {
window.player.linkPlayer(audioPlayer)
u('.audioEntry .subTracks.shown').removeClass('shown')
@@ -772,9 +787,9 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
}
})
-u(document).on('click', '.bigPlayer .playButton, #ajax_audio_player #aj_player_play_btn', (e) => {
+u(document).on('click', '.bigPlayer .playButton, #ajax_audio_player #aj_player_play_btn', async (e) => {
if(window.player.audioPlayer.paused) {
- window.player.play()
+ await window.player.play()
} else {
window.player.pause()
}
@@ -1066,6 +1081,8 @@ u(document).on('contextmenu', '.bigPlayer, .audioEmbed, #ajax_audio_player', (e)
` : ''}
${tr('audio_ctx_add_to_group')}
${tr('audio_ctx_add_to_playlist')}
+ ${ctx_type == 'main_player' ? `
+
${tr('audio_ctx_clear_context')}` : ''}
${ctx_type == 'main_player' ? `
BigPlayer v1.1 by MrIlyew` : ''}
`)
@@ -1156,6 +1173,13 @@ u(document).on('contextmenu', '.bigPlayer, .audioEmbed, #ajax_audio_player', (e)
moving_track_player.remove()
}
})
+ ctx_u.find('#audio_ctx_clear_context').on('click', (ev) => {
+ const old_url = window.player.context.object.url
+ window.player.pause()
+ window.player.__resetContext()
+ window.player.__updateFace()
+ window.router.route(old_url)
+ })
})
u(document).on("click", ".musicIcon.edit-icon", (e) => {
@@ -1641,9 +1665,11 @@ $(document).on("click", "#_deletePlaylist", (e) => {
}, Function.noop])
})
-$(document).on("click", "#__audioAttachment", (e) => {
- const form = e.target.closest("form")
- let body = `
+function showAudioAttachment(type = 'form', form = null)
+{
+ const msg = new CMessageBox({
+ title: tr("select_audio"),
+ body: `
- `
- MessageBox(tr("select_audio"), body, [tr("close")], [Function.noop])
-
- document.querySelector(".ovk-diag-body").style.padding = "0"
- document.querySelector(".ovk-diag-cont").style.width = "580px"
- document.querySelector(".ovk-diag-body").style.height = "335px"
-
+ `,
+ buttons: [tr('close')],
+ callbacks: [Function.noop],
+ })
+ msg.getNode().find('.ovk-diag-body').attr('style', 'padding:0px;height:335px')
+ msg.getNode().attr('style', 'width:580px')
let searcher = new playersSearcher("entity_audios", 0)
searcher.successCallback = (response, thisc) => {
let domparser = new DOMParser()
@@ -1674,8 +1699,18 @@ $(document).on("click", "#__audioAttachment", (e) => {
}
result.querySelectorAll(".audioEmbed").forEach(el => {
- let id = el.dataset.prettyid
- const is_attached = (u(form).find(`.post-vertical .vertical-attachment[data-id='${id}']`)).length > 0
+ let id = 0
+ if(type == 'form') {
+ id = el.dataset.prettyid
+ } else {
+ id = el.dataset.realid
+ }
+ let is_attached = false
+ if(type == 'form') {
+ is_attached = (u(form).find(`.post-vertical .vertical-attachment[data-id='${id}']`)).length > 0
+ } else {
+ is_attached = (u(form).find(`.PE_audios .vertical-attachment[data-id='${id}']`)).length > 0
+ }
document.querySelector(".audiosInsert").insertAdjacentHTML("beforeend", `