mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
linkable search results
This commit is contained in:
parent
452885c271
commit
c02920607f
|
@ -1439,12 +1439,7 @@ function play(tid, is_ev, seek, call_depth) {
|
||||||
if (!seek) {
|
if (!seek) {
|
||||||
var o = ebi(oid);
|
var o = ebi(oid);
|
||||||
o.setAttribute('id', 'thx_js');
|
o.setAttribute('id', 'thx_js');
|
||||||
if (window.history && history.replaceState) {
|
sethash(oid);
|
||||||
hist_replace(document.location.pathname + '#' + oid);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
document.location.hash = oid;
|
|
||||||
}
|
|
||||||
o.setAttribute('id', oid);
|
o.setAttribute('id', oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1516,9 +1511,12 @@ function autoplay_blocked(seek) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function play_linked() {
|
function eval_hash() {
|
||||||
var v = location.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('&');
|
var id = v.slice(2).split('&');
|
||||||
if (id[0].length != 10)
|
if (id[0].length != 10)
|
||||||
return;
|
return;
|
||||||
|
@ -1532,6 +1530,13 @@ function play_linked() {
|
||||||
|
|
||||||
return play(id[0], false, parseInt(m[1] || 0) * 60 + parseInt(m[2] || 0));
|
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 () {
|
(function () {
|
||||||
var sconf = [
|
var sconf = [
|
||||||
["size",
|
["size",
|
||||||
["szl", "sz_min", "minimum MiB", ""],
|
["szl", "sz_min", "minimum MiB", "16"],
|
||||||
["szu", "sz_max", "maximum MiB", ""]
|
["szu", "sz_max", "maximum MiB", "16"]
|
||||||
],
|
],
|
||||||
["date",
|
["date",
|
||||||
["dtl", "dt_min", "min. iso8601", ""],
|
["dtl", "dt_min", "min. iso8601", "16"],
|
||||||
["dtu", "dt_max", "max. iso8601", ""]
|
["dtu", "dt_max", "max. iso8601", "16"]
|
||||||
],
|
],
|
||||||
["path",
|
["path",
|
||||||
["path", "path", "path contains (space-separated)", "46"]
|
["path", "path", "path contains (space-separated)", "34"]
|
||||||
],
|
],
|
||||||
["name",
|
["name",
|
||||||
["name", "name", "name contains (negate with -nope)", "46"]
|
["name", "name", "name contains (negate with -nope)", "34"]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
var oldcfg = [];
|
var oldcfg = [];
|
||||||
|
|
||||||
if (QS('#srch_form.tags')) {
|
if (QS('#srch_form.tags')) {
|
||||||
sconf.push(["tags",
|
sconf.push(["tags",
|
||||||
["tags", "tags", "tags contains (^=start, end=$)", "46"]
|
["tags", "tags", "tags contains (^=start, end=$)", "34"]
|
||||||
]);
|
]);
|
||||||
sconf.push(["adv.",
|
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(
|
html.push(
|
||||||
'<td colspan="' + csp + '"><input id="' + hn + 'c" type="checkbox">\n' +
|
'<td colspan="' + csp + '"><input id="' + hn + 'c" type="checkbox">\n' +
|
||||||
'<label for="' + hn + 'c">' + sconf[a][b][2] + '</label>\n' +
|
'<label for="' + hn + 'c">' + sconf[a][b][2] + '</label>\n' +
|
||||||
'<br /><input id="' + hn + 'v" type="text" size="' + sconf[a][b][3] +
|
'<br /><input id="' + hn + 'v" type="text" style="width:' + sconf[a][b][3] +
|
||||||
'" name="' + sconf[a][b][1] + '" /></td>');
|
'em" name="' + sconf[a][b][1] + '" /></td>');
|
||||||
if (csp == 2)
|
if (csp == 2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2976,6 +2981,7 @@ document.onkeydown = function (e) {
|
||||||
reload_browser();
|
reload_browser();
|
||||||
filecols.set_style(['File Name']);
|
filecols.set_style(['File Name']);
|
||||||
|
|
||||||
|
sethash('q=' + uricom_enc(this.q_raw));
|
||||||
ebi('unsearch').onclick = unsearch;
|
ebi('unsearch').onclick = unsearch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2985,6 +2991,7 @@ document.onkeydown = function (e) {
|
||||||
ebi('files').innerHTML = orig_html;
|
ebi('files').innerHTML = orig_html;
|
||||||
ebi('files').removeAttribute('q_raw');
|
ebi('files').removeAttribute('q_raw');
|
||||||
orig_html = null;
|
orig_html = null;
|
||||||
|
sethash('');
|
||||||
reload_browser();
|
reload_browser();
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
@ -4447,4 +4454,4 @@ function reload_browser(not_mp) {
|
||||||
}
|
}
|
||||||
reload_browser(true);
|
reload_browser(true);
|
||||||
mukey.render();
|
mukey.render();
|
||||||
play_linked();
|
setTimeout(eval_hash, 1);
|
||||||
|
|
|
@ -723,6 +723,15 @@ function hist_replace(url) {
|
||||||
history.replaceState(url, url, url);
|
history.replaceState(url, url, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sethash(hv) {
|
||||||
|
if (window.history && history.replaceState) {
|
||||||
|
hist_replace(document.location.pathname + '#' + hv);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.location.hash = hv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var timer = (function () {
|
var timer = (function () {
|
||||||
var r = {};
|
var r = {};
|
||||||
|
|
Loading…
Reference in a new issue