mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Compare commits
2 commits
9a81e354ea
...
22d3e5e494
Author | SHA1 | Date | |
---|---|---|---|
|
22d3e5e494 | ||
|
178cefede9 |
3 changed files with 17 additions and 4 deletions
|
@ -553,7 +553,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.audioEntry .buttons .report-icon {
|
.audioEntry .buttons .report-icon {
|
||||||
background-position: -50px -67px;
|
background-position: -51px -67px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audioEntry .buttons .remove-icon {
|
.audioEntry .buttons .remove-icon {
|
||||||
|
|
|
@ -409,6 +409,10 @@ window.player = new class {
|
||||||
return u('.bigPlayer').length > 0
|
return u('.bigPlayer').length > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isAtCurrentContextPage() {
|
||||||
|
return this.isAtAudiosPage() && this.context.object.url == location.pathname + location.search
|
||||||
|
}
|
||||||
|
|
||||||
dump() {
|
dump() {
|
||||||
const final = {
|
const final = {
|
||||||
context: this.context,
|
context: this.context,
|
||||||
|
@ -434,7 +438,9 @@ window.player = new class {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dump_object.time) {
|
if(dump_object.time) {
|
||||||
this.audioPlayer.currentTime = dump_object.time
|
setTimeout(() => {
|
||||||
|
this.audioPlayer.currentTime = dump_object.time
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -757,6 +763,9 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||||
try {
|
try {
|
||||||
parsed = JSON.parse(localStorage.getItem('audio.lastDump'))
|
parsed = JSON.parse(localStorage.getItem('audio.lastDump'))
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
if(window.openvk.current_id == 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if(parsed) {
|
if(parsed) {
|
||||||
await window.player.init(null)
|
await window.player.init(null)
|
||||||
|
@ -771,6 +780,10 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.addEventListener('beforeunload', (e) => {
|
||||||
|
window.player.dump()
|
||||||
|
})
|
||||||
|
|
||||||
u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
|
u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
|
||||||
const audioPlayer = u(e.target).closest('.audioEmbed')
|
const audioPlayer = u(e.target).closest('.audioEmbed')
|
||||||
const id = Number(audioPlayer.attr('data-realid'))
|
const id = Number(audioPlayer.attr('data-realid'))
|
||||||
|
@ -1976,6 +1989,7 @@ u(document).on('click', '.upload_container_element #small_remove_button', (e) =>
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1984
|
||||||
const element = u(e.target).closest('.upload_container_element')
|
const element = u(e.target).closest('.upload_container_element')
|
||||||
const element_index = Number(element.attr('data-index'))
|
const element_index = Number(element.attr('data-index'))
|
||||||
|
|
||||||
|
@ -2044,7 +2058,6 @@ u(document).on("drop", "#upload_container", function (e) {
|
||||||
})
|
})
|
||||||
|
|
||||||
u(document).on('click', '#_playlistAppendTracks', (e) => {
|
u(document).on('click', '#_playlistAppendTracks', (e) => {
|
||||||
// 1984
|
|
||||||
showAudioAttachment('playlist', u('.PE_wrapper').nodes[0])
|
showAudioAttachment('playlist', u('.PE_wrapper').nodes[0])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -2360,7 +2360,7 @@ async function __processPaginatorNextPage(page)
|
||||||
container.nodes[0].append(u(`.paginator:not(.paginator-at-top)`).nodes[0].parentNode)
|
container.nodes[0].append(u(`.paginator:not(.paginator-at-top)`).nodes[0].parentNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(window.player) {
|
if(window.player && window.player.isAtAudiosPage() && window.player.isAtCurrentContextPage()) {
|
||||||
window.player.loadContext(page)
|
window.player.loadContext(page)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue