mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
replace the mediaplayer modal with malert
This commit is contained in:
parent
5c242a07b6
commit
452885c271
|
@ -289,40 +289,6 @@ html.light #ggrid>a.sel {
|
||||||
#files tr:focus+tr td {
|
#files tr:focus+tr td {
|
||||||
border-top: 1px solid transparent;
|
border-top: 1px solid transparent;
|
||||||
}
|
}
|
||||||
#blocked {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: #333;
|
|
||||||
font-size: 2.5em;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
#blk_play,
|
|
||||||
#blk_abrt {
|
|
||||||
position: fixed;
|
|
||||||
display: table;
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
#blk_play {
|
|
||||||
height: 60%;
|
|
||||||
left: 10%;
|
|
||||||
top: 5%;
|
|
||||||
}
|
|
||||||
#blk_abrt {
|
|
||||||
height: 25%;
|
|
||||||
left: 10%;
|
|
||||||
bottom: 5%;
|
|
||||||
}
|
|
||||||
#blk_play a,
|
|
||||||
#blk_abrt a {
|
|
||||||
display: table-cell;
|
|
||||||
vertical-align: middle;
|
|
||||||
text-align: center;
|
|
||||||
background: #444;
|
|
||||||
border-radius: 2em;
|
|
||||||
}
|
|
||||||
#widget {
|
#widget {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
|
@ -1240,14 +1206,6 @@ html.light tr.play a {
|
||||||
html.light #files th:hover .cfg {
|
html.light #files th:hover .cfg {
|
||||||
background: #ccc;
|
background: #ccc;
|
||||||
}
|
}
|
||||||
html.light #blocked {
|
|
||||||
background: #eee;
|
|
||||||
}
|
|
||||||
html.light #blk_play a,
|
|
||||||
html.light #blk_abrt a {
|
|
||||||
background: #fff;
|
|
||||||
box-shadow: 0 .2em .4em #ddd;
|
|
||||||
}
|
|
||||||
html.light #widget a {
|
html.light #widget a {
|
||||||
color: #06a;
|
color: #06a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1492,44 +1492,14 @@ function evau_error(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// show a fullscreen message
|
|
||||||
function show_modal(html) {
|
|
||||||
var body = document.body || document.getElementsByTagName('body')[0],
|
|
||||||
div = mknod('div');
|
|
||||||
|
|
||||||
div.setAttribute('id', 'blocked');
|
|
||||||
div.innerHTML = html;
|
|
||||||
unblocked();
|
|
||||||
body.appendChild(div);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// hide fullscreen message
|
|
||||||
function unblocked(e) {
|
|
||||||
ev(e);
|
|
||||||
var dom = ebi('blocked');
|
|
||||||
if (dom)
|
|
||||||
dom.parentNode.removeChild(dom);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// show ui to manually start playback of a linked song
|
// show ui to manually start playback of a linked song
|
||||||
function autoplay_blocked(seek) {
|
function autoplay_blocked(seek) {
|
||||||
show_modal(
|
var tid = mp.au.tid,
|
||||||
'<div id="blk_play"><a href="#" id="blk_go"></a></div>' +
|
|
||||||
'<div id="blk_abrt"><a href="#" id="blk_na">Cancel<br />(show file list)</a></div>');
|
|
||||||
|
|
||||||
var go = ebi('blk_go'),
|
|
||||||
na = ebi('blk_na'),
|
|
||||||
tid = mp.au.tid,
|
|
||||||
fn = mp.tracks[tid].split(/\//).pop();
|
fn = mp.tracks[tid].split(/\//).pop();
|
||||||
|
|
||||||
fn = uricom_dec(fn.replace(/\+/g, ' '))[0];
|
fn = uricom_dec(fn.replace(/\+/g, ' '))[0];
|
||||||
|
|
||||||
go.textContent = 'Play "' + fn + '"';
|
modal.confirm('<h6>play this audio file?</h6>\n«' + esc(fn) + '»', function () {
|
||||||
go.onclick = function (e) {
|
|
||||||
unblocked(e);
|
|
||||||
toast.hide();
|
|
||||||
if (mp.au !== mp.au_ogvjs)
|
if (mp.au !== mp.au_ogvjs)
|
||||||
// chrome 91 may permanently taint on a failed play()
|
// chrome 91 may permanently taint on a failed play()
|
||||||
// depending on win10 settings or something? idk
|
// depending on win10 settings or something? idk
|
||||||
|
@ -1542,8 +1512,7 @@ function autoplay_blocked(seek) {
|
||||||
|
|
||||||
play(tid, true, seek);
|
play(tid, true, seek);
|
||||||
mp.fade_in();
|
mp.fade_in();
|
||||||
};
|
}, null);
|
||||||
na.onclick = unblocked;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue