feat: the panel's own confirm and prompt dialogs everywhere; the assistant's field is one line with a square send button
This commit is contained in:
1 parent
3f113ce8d6
commit
1f930e5aea
13 files changed
+104
-41
No files matched your search
@@ -552,8 +552,8 @@
|
||||
});
|
||||
|
||||
// Closing: Esc first closes the search; unsaved changes are asked about.
|
||||
function closeViewer() {
|
||||
if (V.dirty && !confirm('Есть несохранённые изменения. Закрыть без сохранения?')) return;
|
||||
async function closeViewer() {
|
||||
if (V.dirty && !await UI.confirm('Есть несохранённые изменения. Закрыть без сохранения?', {ok: 'Закрыть', danger: true})) return;
|
||||
stopMedia(); closeFind();
|
||||
H.data = H.orig = null;
|
||||
V.kind = ''; V.dirty = false;
|
||||
@@ -619,7 +619,7 @@
|
||||
if (group && (group !== o.group || rec)) args.group = group;
|
||||
if (rec) { args.recursive = true; args.only = $('pp-only').value; }
|
||||
if (Object.keys(args).length === 1) { toast('ничего не изменено'); return; }
|
||||
if (rec && !confirm('Применить к «' + P.path + '» и всему, что внутри?')) return;
|
||||
if (rec && !await UI.confirm('Применить к «' + P.path + '» и всему, что внутри?', {ok: 'Применить'})) return;
|
||||
const btn = $('pp-apply');
|
||||
btn.disabled = true;
|
||||
const r = await api('chmod', args);
|
||||
@@ -634,15 +634,12 @@
|
||||
$('vprops').onclick = () => { if (V.path) openProps(V.path); };
|
||||
|
||||
async function del(e) {
|
||||
if (e.is_dir) {
|
||||
if (!confirm('Рекурсивно удалить каталог "'+e.name+'" со всем содержимым?')) return;
|
||||
const r = await api('deltree', {path: join(cur.cwd, e.name)});
|
||||
r.ok ? (toast('удалено'), cur.go(cur.cwd)) : toast(r.error||'ошибка', true);
|
||||
} else {
|
||||
if (!confirm('Удалить файл "'+e.name+'"?')) return;
|
||||
const r = await api('delete', {path: join(cur.cwd, e.name)});
|
||||
r.ok ? (toast('удалено'), cur.go(cur.cwd)) : toast(r.error||'ошибка', true);
|
||||
}
|
||||
// The pane asked about, whatever another pane does meanwhile.
|
||||
const pane = cur;
|
||||
const ok = await UI.confirm(e.is_dir ? 'Удалить папку «' + e.name + '» со всем содержимым?' : 'Удалить файл «' + e.name + '»?', {ok: 'Удалить', danger: true});
|
||||
if (!ok) return;
|
||||
const r = await pane.src.op(e.is_dir ? 'deltree' : 'delete', {path: join(pane.cwd, e.name)});
|
||||
r.ok ? (toast('удалено'), pane.go(pane.cwd)) : toast(r.error||'ошибка', true);
|
||||
}
|
||||
|
||||
// ---------- Move or copy ----------
|
||||
|
||||
Reference in new issue
Block a user