mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
fix default upload expiration + ux
This commit is contained in:
parent
e60ec94d35
commit
b8a93e74bf
|
@ -2315,7 +2315,7 @@ class Up2k(object):
|
|||
flt = job["life"]
|
||||
vfs = self.asrv.vfs.all_vols[job["vtop"]]
|
||||
vlt = vfs.flags["lifetime"]
|
||||
if vlt and flt < vlt:
|
||||
if vlt and flt > 1 and flt < vlt:
|
||||
upt -= vlt - flt
|
||||
wake_sr = True
|
||||
t = "using client lifetime; at={:.0f} ({}-{})"
|
||||
|
|
|
@ -246,12 +246,18 @@ window.baguetteBox = (function () {
|
|||
}
|
||||
|
||||
function keyDownHandler(e) {
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing || modal.busy)
|
||||
if (anymod(e, true) || modal.busy)
|
||||
return;
|
||||
|
||||
var k = e.code + '', v = vid(), pos = -1;
|
||||
|
||||
if (k == "ArrowLeft" || k == "KeyJ")
|
||||
if (k == "BracketLeft")
|
||||
setloop(1);
|
||||
else if (k == "BracketRight")
|
||||
setloop(2);
|
||||
else if (e.shiftKey)
|
||||
return;
|
||||
else if (k == "ArrowLeft" || k == "KeyJ")
|
||||
showPreviousImage();
|
||||
else if (k == "ArrowRight" || k == "KeyL")
|
||||
showNextImage();
|
||||
|
@ -289,10 +295,6 @@ window.baguetteBox = (function () {
|
|||
rotn(e.shiftKey ? -1 : 1);
|
||||
else if (k == "KeyY")
|
||||
dlpic();
|
||||
else if (k == "BracketLeft")
|
||||
setloop(1);
|
||||
else if (k == "BracketRight")
|
||||
setloop(2);
|
||||
}
|
||||
|
||||
function anim() {
|
||||
|
@ -406,7 +408,7 @@ window.baguetteBox = (function () {
|
|||
}
|
||||
|
||||
function keyUpHandler(e) {
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing)
|
||||
if (anymod(e))
|
||||
return;
|
||||
|
||||
var k = e.code + '';
|
||||
|
|
|
@ -2497,7 +2497,7 @@ function up2k_init(subtle) {
|
|||
tt.att(QS('#u2conf'));
|
||||
|
||||
function bumpthread2(e) {
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing)
|
||||
if (anymod(e))
|
||||
return;
|
||||
|
||||
if (e.code == 'ArrowUp')
|
||||
|
@ -2571,6 +2571,7 @@ function up2k_init(subtle) {
|
|||
el.innerHTML = '<div>' + L.u_life_cfg + '</div><div>' + L.u_life_est + '</div><div id="undor"></div>';
|
||||
set_life(Math.min(lifetime, icfg_get('lifetime', lifetime)));
|
||||
ebi('lifem').oninput = ebi('lifeh').oninput = mod_life;
|
||||
ebi('lifem').onkeydown = ebi('lifeh').onkeydown = kd_life;
|
||||
tt.att(ebi('u2life'));
|
||||
}
|
||||
draw_life();
|
||||
|
@ -2596,12 +2597,23 @@ function up2k_init(subtle) {
|
|||
set_life(v);
|
||||
}
|
||||
|
||||
function kd_life(e) {
|
||||
var el = e.target,
|
||||
d = e.code == 'ArrowUp' ? 1 : e.code == 'ArrowDown' ? -1 : 0;
|
||||
|
||||
if (anymod(e) || !d)
|
||||
return;
|
||||
|
||||
el.value = parseInt(el.value) + d;
|
||||
mod_life(e);
|
||||
}
|
||||
|
||||
function set_life(v) {
|
||||
//ebi('lifes').value = v;
|
||||
ebi('lifem').value = parseInt(v / 60);
|
||||
ebi('lifeh').value = parseInt(v / 3600);
|
||||
|
||||
var undo = have_unpost - (v || lifetime);
|
||||
var undo = have_unpost - (v ? lifetime - v : 0);
|
||||
ebi('undor').innerHTML = undo <= 0 ?
|
||||
L.u_unp_ng : L.u_unp_ok.format(lhumantime(undo));
|
||||
|
||||
|
|
|
@ -239,6 +239,11 @@ function ctrl(e) {
|
|||
}
|
||||
|
||||
|
||||
function anymod(e, shift_ok) {
|
||||
return e && (e.ctrlKey || e.altKey || e.metaKey || e.isComposing || (!shift_ok && e.shiftKey));
|
||||
}
|
||||
|
||||
|
||||
function ev(e) {
|
||||
e = e || window.event;
|
||||
if (!e)
|
||||
|
|
Loading…
Reference in a new issue