diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 88b86a97..dfd0905f 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -559,6 +559,11 @@ input[type="radio"]:checked+label, input[type="checkbox"]:checked+label { color: #fc5; } +.opwide div>span>input+label { + padding: .3em 0 .3em .3em; + margin: 0 0 0 -.3em; + cursor: pointer; +} .opview input.i { width: calc(100% - 16.2em); } diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index dc822d9f..41f92069 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -11,9 +11,9 @@ function dbg(msg) { ebi('ops').innerHTML = ( '--\n' + (have_up2k_idx ? ( - '🔎\n' + + '🔎\n' + (have_del && have_unpost ? '🧯\n' : '') + - '🚀\n' + '🚀\n' ) : ( '🚀\n' )) + @@ -245,8 +245,7 @@ function goto(dest) { clmod(obj[a], 'act'); if (dest) { - var ui = ebi('op_' + dest), - lnk = QS('#ops>a[data-dest=' + dest + ']'), + var lnk = QS('#ops>a[data-dest=' + dest + ']'), nps = lnk.getAttribute('data-perm'); nps = nps && nps.length ? nps.split(' ') : []; @@ -259,8 +258,8 @@ function goto(dest) { if (!has(perms, 'read') && !has(perms, 'write') && (dest == 'up2k')) return; - clmod(ui, 'act', true); - lnk.className += " act"; + clmod(ebi('op_' + dest), 'act', 1); + clmod(lnk, 'act', 1); var fn = window['goto_' + dest]; if (fn) @@ -334,7 +333,7 @@ var mpl = (function () { ) : '') + '

tint

' + - '' + + '' + '
' + '

audio equalizer

'); @@ -1147,11 +1146,6 @@ function ev_play(e) { } -function setclass(id, clas) { - ebi(id).setAttribute('class', clas); -} - - var need_ogv = true; try { need_ogv = new Audio().canPlayType('audio/ogg; codecs=opus') !== 'probably'; @@ -1261,12 +1255,15 @@ var audio_eq = (function () { if (!Ctx) bcfg_set('au_eq', false); - if (!Ctx || !mp.au || mp.au === mp.au_ogvjs) + if (!Ctx || !mp.au) return; if (!r.en && !mp.ac) return; + if (mp.au === mp.au_ogvjs) + return toast.warn(10, "apple devices can't equalize ogg/opus audio"); + if (mp.ac) { for (var a = 0; a < r.filters.length; a++) r.filters[a].disconnect(); @@ -1477,7 +1474,7 @@ function play(tid, is_ev, seek, call_depth) { if (mp.au) { mp.au.pause(); - setclass('a' + mp.au.tid, 'play'); + clmod(ebi('a' + mp.au.tid), 'act'); } // ogv.js breaks on .play() unless directly user-triggered @@ -1556,13 +1553,13 @@ function play(tid, is_ev, seek, call_depth) { mp.au.tid = tid; mp.au.volume = mp.expvol(mp.vol); - var oid = 'a' + tid; - setclass(oid, 'play act'); - var trs = ebi('files').getElementsByTagName('tbody')[0].getElementsByTagName('tr'); - for (var a = 0, aa = trs.length; a < aa; a++) { + var trs = QSA('#files tr.play'); + for (var a = 0, aa = trs.length; a < aa; a++) clmod(trs[a], 'play'); - } - ebi(oid).parentElement.parentElement.className += ' play'; + + var oid = 'a' + tid; + clmod(ebi(oid), 'act', 1); + clmod(ebi(oid).closest('tr'), 'play', 1); clmod(ebi('wtoggle'), 'np', mpl.clip); if (window.thegrid) thegrid.loadsel(); @@ -1592,7 +1589,7 @@ function play(tid, is_ev, seek, call_depth) { catch (ex) { toast.err(0, esc('playback failed: ' + basenames(ex))); } - setclass(oid, 'play'); + clmod(ebi(oid), 'act'); setTimeout(next_song, 500); } @@ -1648,7 +1645,11 @@ function autoplay_blocked(seek) { play(tid, true, seek); mp.fade_in(); - }, null); + }, function () { + sethash(''); + clmod(QS('#files tr.play'), 'play'); + return reload_mp(); + }); } @@ -3047,16 +3048,19 @@ document.onkeydown = function (e) { if (QS('#bbox-overlay.visible') || modal.busy) return; - var k = e.code + '', - pos = -1, - n, + var k = e.code + '', pos = -1, n, ae = document.activeElement, aet = ae && ae != document.body ? ae.nodeName.toLowerCase() : ''; if (k == 'Escape') { + ae && ae.blur(); + if (QS('.opview.act')) return QS('#ops>a').click(); + if (QS('#unsearch')) + return QS('#unsearch').click(); + if (widget.is_open) return widget.close(); @@ -3202,28 +3206,28 @@ document.onkeydown = function (e) { (function () { var sconf = [ ["size", - ["szl", "sz_min", "minimum MiB", "16"], - ["szu", "sz_max", "maximum MiB", "16"] + ["szl", "sz_min", "minimum MiB", "14"], + ["szu", "sz_max", "maximum MiB", "14"] ], ["date", - ["dtl", "dt_min", "min. iso8601", "16"], - ["dtu", "dt_max", "max. iso8601", "16"] + ["dtl", "dt_min", "min. iso8601", "14"], + ["dtu", "dt_max", "max. iso8601", "14"] ], ["path", - ["path", "path", "path contains   (space-separated)", "34"] + ["path", "path", "path contains   (space-separated)", "30"] ], ["name", - ["name", "name", "name contains   (negate with -nope)", "34"] + ["name", "name", "name contains   (negate with -nope)", "30"] ] ]; var oldcfg = []; if (QS('#srch_form.tags')) { sconf.push(["tags", - ["tags", "tags", "tags contains   (^=start, end=$)", "34"] + ["tags", "tags", "tags contains   (^=start, end=$)", "30"] ]); sconf.push(["adv.", - ["adv", "adv", "key>=1A  key<=2B  .bpm>165", "34"] + ["adv", "adv", "key>=1A  key<=2B  .bpm>165", "30"] ]); } diff --git a/copyparty/web/ui.css b/copyparty/web/ui.css index 5182bba4..a0da1e34 100644 --- a/copyparty/web/ui.css +++ b/copyparty/web/ui.css @@ -133,7 +133,8 @@ html { } #modalc code, #tt code { - background: #3c3c3c; + color: #eee; + background: #444; padding: .1em .3em; border-top: 1px solid #777; border-radius: .3em;