show upload eta in window title

This commit is contained in:
ed 2021-11-28 04:05:16 +01:00
parent f6c7e49eb8
commit 00c177fa74
2 changed files with 15 additions and 4 deletions

View file

@ -3929,8 +3929,7 @@ var treectl = (function () {
if (res.readme) if (res.readme)
show_readme(res.readme); show_readme(res.readme);
document.title = '⇆🎉 ' + uricom_dec(document.location.pathname.slice(1, -1))[0]; wintitle();
filecols.set_style(); filecols.set_style();
showfile.mktree(); showfile.mktree();
mukey.render(); mukey.render();
@ -4979,6 +4978,11 @@ function goto_unpost(e) {
} }
function wintitle(txt) {
document.title = (txt ? txt : '') + get_vpath().slice(1, -1).split('/').pop();
}
ebi('files').onclick = ebi('docul').onclick = function (e) { ebi('files').onclick = ebi('docul').onclick = function (e) {
var tgt = e.target.closest('a[id]'); var tgt = e.target.closest('a[id]');
if (tgt && tgt.getAttribute('id').indexOf('f-') === 0 && tgt.textContent.endsWith('/')) { if (tgt && tgt.getAttribute('id').indexOf('f-') === 0 && tgt.textContent.endsWith('/')) {

View file

@ -525,13 +525,15 @@ function Donut(uc, st) {
} }
r.on = function (ya) { r.on = function (ya) {
r.fc = 99; r.fc = r.tc = 99;
r.eta = null; r.eta = null;
r.base = pos(); r.base = pos();
optab.innerHTML = ya ? svg() : optab.getAttribute('ico'); optab.innerHTML = ya ? svg() : optab.getAttribute('ico');
el = QS('#ops a .donut'); el = QS('#ops a .donut');
if (!ya) if (!ya) {
favico.upd(); favico.upd();
wintitle();
}
}; };
r.do = function () { r.do = function () {
if (!el) if (!el)
@ -541,6 +543,11 @@ function Donut(uc, st) {
v = pos() - r.base, v = pos() - r.base,
ofs = el.style.strokeDashoffset = o - o * v / t; ofs = el.style.strokeDashoffset = o - o * v / t;
if (++r.tc >= 10) {
wintitle(f2f(v * 100 / t, 1) + '%, ' + r.eta + 's, ', true);
r.tc = 0;
}
if (favico.txt) { if (favico.txt) {
if (++r.fc < 10 && r.eta && r.eta > 99) if (++r.fc < 10 && r.eta && r.eta > 99)
return; return;