diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 6e688190..41f2226f 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -289,40 +289,6 @@ html.light #ggrid>a.sel { #files tr:focus+tr td { 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 { position: fixed; font-size: 1.4em; @@ -1240,14 +1206,6 @@ html.light tr.play a { html.light #files th:hover .cfg { 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 { color: #06a; } diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 6e793c34..f68d21f5 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -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 function autoplay_blocked(seek) { - show_modal( - '
' + - '
Cancel
(show file list)
'); - - var go = ebi('blk_go'), - na = ebi('blk_na'), - tid = mp.au.tid, + var tid = mp.au.tid, fn = mp.tracks[tid].split(/\//).pop(); fn = uricom_dec(fn.replace(/\+/g, ' '))[0]; - go.textContent = 'Play "' + fn + '"'; - go.onclick = function (e) { - unblocked(e); - toast.hide(); + modal.confirm('
play this audio file?
\n«' + esc(fn) + '»', function () { if (mp.au !== mp.au_ogvjs) // chrome 91 may permanently taint on a failed play() // depending on win10 settings or something? idk @@ -1542,8 +1512,7 @@ function autoplay_blocked(seek) { play(tid, true, seek); mp.fade_in(); - }; - na.onclick = unblocked; + }, null); }