diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index f68d21f5..163ff7ce 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1439,12 +1439,7 @@ function play(tid, is_ev, seek, call_depth) { if (!seek) { var o = ebi(oid); o.setAttribute('id', 'thx_js'); - if (window.history && history.replaceState) { - hist_replace(document.location.pathname + '#' + oid); - } - else { - document.location.hash = oid; - } + sethash(oid); o.setAttribute('id', oid); } @@ -1516,9 +1511,12 @@ function autoplay_blocked(seek) { } -function play_linked() { +function eval_hash() { var v = location.hash; - if (v && v.indexOf('#af-') === 0) { + if (!v) + return; + + if (v.indexOf('#af-') === 0) { var id = v.slice(2).split('&'); if (id[0].length != 10) return; @@ -1532,6 +1530,13 @@ function play_linked() { return play(id[0], false, parseInt(m[1] || 0) * 60 + parseInt(m[2] || 0)); } + + if (v.indexOf('#q=') === 0) { + goto('search'); + var i = ebi('q_raw'); + i.value = uricom_dec(v.slice(3))[0]; + return i.oninput(); + } }; @@ -2725,28 +2730,28 @@ document.onkeydown = function (e) { (function () { var sconf = [ ["size", - ["szl", "sz_min", "minimum MiB", ""], - ["szu", "sz_max", "maximum MiB", ""] + ["szl", "sz_min", "minimum MiB", "16"], + ["szu", "sz_max", "maximum MiB", "16"] ], ["date", - ["dtl", "dt_min", "min. iso8601", ""], - ["dtu", "dt_max", "max. iso8601", ""] + ["dtl", "dt_min", "min. iso8601", "16"], + ["dtu", "dt_max", "max. iso8601", "16"] ], ["path", - ["path", "path", "path contains (space-separated)", "46"] + ["path", "path", "path contains (space-separated)", "34"] ], ["name", - ["name", "name", "name contains (negate with -nope)", "46"] + ["name", "name", "name contains (negate with -nope)", "34"] ] ]; var oldcfg = []; if (QS('#srch_form.tags')) { sconf.push(["tags", - ["tags", "tags", "tags contains (^=start, end=$)", "46"] + ["tags", "tags", "tags contains (^=start, end=$)", "34"] ]); sconf.push(["adv.", - ["adv", "adv", "key>=1A key<=2B .bpm>165", "46"] + ["adv", "adv", "key>=1A key<=2B .bpm>165", "34"] ]); } @@ -2763,8 +2768,8 @@ document.onkeydown = function (e) { html.push( '