feat: long names in questions cut with … and the window as wide as its words; SSH dialog hides «Вход» for a saved host and says «подключение…» quietly; zip and unzip on SSH hosts without them through Python's zipfile
This commit is contained in:
1 parent
6db78399ac
commit
434900a168
5 files changed
+40
-20
No files matched your search
@@ -16,7 +16,17 @@
|
||||
if (!dlg) make();
|
||||
if (dlg.open) dlg.close('');
|
||||
const input = dlg.querySelector('.ui-input'), yes = dlg.querySelector('.ui-yes');
|
||||
dlg.querySelector('.ui-text').textContent = text;
|
||||
// Long words (a file name) stay on one line, cut with "…"; the window
|
||||
// is as wide as its words, up to the screen's room.
|
||||
const t = dlg.querySelector('.ui-text');
|
||||
t.textContent = '';
|
||||
String(text).split(/(\s+)/).forEach(w => {
|
||||
if (w.length > 28 && !/\s/.test(w)) {
|
||||
const s = document.createElement('span');
|
||||
s.className = 'ui-long'; s.textContent = w; s.title = w;
|
||||
t.appendChild(s);
|
||||
} else t.appendChild(document.createTextNode(w));
|
||||
});
|
||||
input.hidden = !o.input;
|
||||
input.value = o.value || '';
|
||||
yes.textContent = o.ok || 'OK';
|
||||
|
||||
Reference in new issue
Block a user