mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
js cfg
This commit is contained in:
parent
24fdada0a0
commit
2381692aba
|
@ -37,7 +37,11 @@ class U2idx(object):
|
|||
fsize = body["size"]
|
||||
fhash = body["hash"]
|
||||
wark = up2k_wark_from_hashlist(self.args.salt, fsize, fhash)
|
||||
return self.run_query(vols, "w = ?", [wark], "", [])[0]
|
||||
|
||||
uq = "substr(w,1,16) = ? and w = ?"
|
||||
uv = [wark[:16], wark]
|
||||
|
||||
return self.run_query(vols, uq, uv, "", [])[0]
|
||||
|
||||
def get_cur(self, ptop):
|
||||
cur = self.cur.get(ptop)
|
||||
|
|
|
@ -590,7 +590,7 @@ function autoplay_blocked() {
|
|||
|
||||
if (document.querySelector('#srch_form.tags'))
|
||||
sconf.push(["tags",
|
||||
["tags", "tags", "tags contains", "46"]
|
||||
["tags", "tags", "tags contains (^=start, end=$)", "46"]
|
||||
]);
|
||||
|
||||
var html = [];
|
||||
|
@ -654,7 +654,7 @@ function autoplay_blocked() {
|
|||
return;
|
||||
|
||||
if (this.status !== 200) {
|
||||
alert('ah fug\n' + this.status + ": " + this.responseText);
|
||||
alert("http " + this.status + ": " + this.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -729,7 +729,7 @@ function autoplay_blocked() {
|
|||
var treedata = null;
|
||||
var dyn = bcfg_get('dyntree', true);
|
||||
var treesz = icfg_get('treesz', 16);
|
||||
treesz = isNaN(treesz) ? 16 : Math.min(Math.max(treesz, 4), 50);
|
||||
treesz = Math.min(Math.max(treesz, 4), 50);
|
||||
console.log('treesz [' + treesz + ']');
|
||||
|
||||
function entree(e) {
|
||||
|
@ -764,7 +764,7 @@ function autoplay_blocked() {
|
|||
return;
|
||||
|
||||
if (this.status !== 200) {
|
||||
alert('ah fug\n' + this.status + ": " + this.responseText);
|
||||
alert("http " + this.status + ": " + this.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -870,7 +870,7 @@ function autoplay_blocked() {
|
|||
return;
|
||||
|
||||
if (this.status !== 200) {
|
||||
alert('ah fug\n' + this.status + ": " + this.responseText);
|
||||
alert("http " + this.status + ": " + this.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ function opclick(e) {
|
|||
var dest = this.getAttribute('data-dest');
|
||||
goto(dest);
|
||||
|
||||
swrite('opmode', dest || undefined);
|
||||
swrite('opmode', dest || null);
|
||||
|
||||
var input = document.querySelector('.opview.act input:not([type="hidden"])')
|
||||
if (input)
|
||||
|
@ -262,12 +262,12 @@ function sread(key) {
|
|||
if (window.localStorage)
|
||||
return localStorage.getItem(key);
|
||||
|
||||
return '';
|
||||
return null;
|
||||
}
|
||||
|
||||
function swrite(key, val) {
|
||||
if (window.localStorage) {
|
||||
if (val === undefined)
|
||||
if (val === undefined || val === null)
|
||||
localStorage.removeItem(key);
|
||||
else
|
||||
localStorage.setItem(key, val);
|
||||
|
@ -293,7 +293,7 @@ function icfg_get(name, defval) {
|
|||
var o = ebi(name);
|
||||
|
||||
var val = parseInt(sread(name));
|
||||
if (val === null)
|
||||
if (isNaN(val))
|
||||
return parseInt(o ? o.value : defval);
|
||||
|
||||
if (o)
|
||||
|
|
Loading…
Reference in a new issue