mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
compat + perf + ux
This commit is contained in:
parent
953183f16d
commit
ee86b06676
|
@ -1243,7 +1243,7 @@ class Up2k(object):
|
|||
hops = len(ndst[nc:]) - 1
|
||||
lsrc = "../" * hops + "/".join(lsrc)
|
||||
os.symlink(fsenc(lsrc), fsenc(ldst))
|
||||
except (AttributeError, OSError) as ex:
|
||||
except Exception as ex:
|
||||
self.log("cannot symlink; creating copy: " + repr(ex))
|
||||
shutil.copy2(fsenc(src), fsenc(dst))
|
||||
|
||||
|
|
|
@ -1568,7 +1568,10 @@ var fileman = (function () {
|
|||
r = {};
|
||||
|
||||
r.clip = null;
|
||||
r.bus = new BroadcastChannel("fileman_bus");
|
||||
try {
|
||||
r.bus = new BroadcastChannel("fileman_bus");
|
||||
}
|
||||
catch (ex) { }
|
||||
|
||||
r.render = function () {
|
||||
if (r.clip === null)
|
||||
|
@ -1920,7 +1923,7 @@ var fileman = (function () {
|
|||
deleter();
|
||||
}
|
||||
|
||||
modal.confirm('===== DANGER =====\nDELETE these ' + vps.length + ' items?\n\n' + vps.join('\n'), function () {
|
||||
modal.confirm('===== DANGER =====\nDELETE these ' + vps.length + ' items?\n\n' + uricom_adec(vps).join('\n'), function () {
|
||||
modal.confirm('Last chance! Delete?', deleter, null);
|
||||
}, null);
|
||||
};
|
||||
|
@ -1936,14 +1939,15 @@ var fileman = (function () {
|
|||
if (!sel.length)
|
||||
return toast.err(3, 'select at least 1 item to cut');
|
||||
|
||||
for (var a = 0; a < sel.length; a++) {
|
||||
vps.push(sel[a].vp);
|
||||
var cl = ebi(sel[a].id).closest('tr').classList,
|
||||
inv = cl.contains('c1');
|
||||
if (sel.length < 100)
|
||||
for (var a = 0; a < sel.length; a++) {
|
||||
vps.push(sel[a].vp);
|
||||
var cl = ebi(sel[a].id).closest('tr').classList,
|
||||
inv = cl.contains('c1');
|
||||
|
||||
cl.remove(inv ? 'c1' : 'c2');
|
||||
cl.add(inv ? 'c2' : 'c1');
|
||||
}
|
||||
cl.remove(inv ? 'c1' : 'c2');
|
||||
cl.add(inv ? 'c2' : 'c1');
|
||||
}
|
||||
|
||||
toast.inf(1, 'cut ' + sel.length + ' items');
|
||||
jwrite('fman_clip', vps);
|
||||
|
@ -2021,15 +2025,19 @@ var fileman = (function () {
|
|||
}, null);
|
||||
};
|
||||
|
||||
r.bus.onmessage = function (e) {
|
||||
r.clip = null;
|
||||
r.render();
|
||||
var me = get_evpath();
|
||||
if (e && e.data == me)
|
||||
treectl.goto(e.data);
|
||||
};
|
||||
if (r.bus)
|
||||
r.bus.onmessage = function (e) {
|
||||
r.clip = null;
|
||||
r.render();
|
||||
var me = get_evpath();
|
||||
if (e && e.data == me)
|
||||
treectl.goto(e.data);
|
||||
};
|
||||
|
||||
r.tx = function (msg) {
|
||||
if (!r.bus)
|
||||
return;
|
||||
|
||||
r.bus.postMessage(msg);
|
||||
r.bus.onmessage();
|
||||
};
|
||||
|
|
|
@ -18,6 +18,10 @@ html, body {
|
|||
background: #f7f7f7;
|
||||
color: #333;
|
||||
}
|
||||
#toast {
|
||||
bottom: auto;
|
||||
top: 1.4em;
|
||||
}
|
||||
#mn {
|
||||
font-weight: normal;
|
||||
margin: 1.3em 0 .7em 1em;
|
||||
|
|
|
@ -155,6 +155,9 @@ html.light #tt em {
|
|||
padding: 1em 1.1em;
|
||||
border-radius: .6em;
|
||||
box-shadow: 0 .3em 3em rgba(0,0,0,0.5);
|
||||
max-width: 50em;
|
||||
max-height: 30em;
|
||||
overflow: auto;
|
||||
}
|
||||
@media (min-width: 40em) {
|
||||
#modalc {
|
||||
|
|
|
@ -733,15 +733,10 @@ var modal = (function () {
|
|||
if (a)
|
||||
a.onclick = ng;
|
||||
|
||||
var a = ebi('modal-ok');
|
||||
if (a) {
|
||||
a.onclick = ok;
|
||||
a.focus();
|
||||
}
|
||||
a = ebi('modal-ok');
|
||||
a.onclick = ok;
|
||||
|
||||
var a = ebi('modali');
|
||||
if (a)
|
||||
a.focus();
|
||||
(ebi('modali') || a).focus();
|
||||
};
|
||||
|
||||
r.hide = function () {
|
||||
|
|
Loading…
Reference in a new issue