compat + perf + ux

This commit is contained in:
ed 2021-08-08 04:02:58 +02:00
parent 953183f16d
commit ee86b06676
5 changed files with 35 additions and 25 deletions

View file

@ -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))

View file

@ -1568,7 +1568,10 @@ var fileman = (function () {
r = {};
r.clip = null;
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,6 +1939,7 @@ var fileman = (function () {
if (!sel.length)
return toast.err(3, 'select at least 1 item to cut');
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,
@ -2021,6 +2025,7 @@ var fileman = (function () {
}, null);
};
if (r.bus)
r.bus.onmessage = function (e) {
r.clip = null;
r.render();
@ -2030,6 +2035,9 @@ var fileman = (function () {
};
r.tx = function (msg) {
if (!r.bus)
return;
r.bus.postMessage(msg);
r.bus.onmessage();
};

View file

@ -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;

View file

@ -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 {

View file

@ -733,15 +733,10 @@ var modal = (function () {
if (a)
a.onclick = ng;
var a = ebi('modal-ok');
if (a) {
a = ebi('modal-ok');
a.onclick = ok;
a.focus();
}
var a = ebi('modali');
if (a)
a.focus();
(ebi('modali') || a).focus();
};
r.hide = function () {