From db092e5eab73673c4264c9c8f5013a5321d16b03 Mon Sep 17 00:00:00 2001 From: Massimo Melina Date: Sat, 13 Jun 2020 21:04:14 +0200 Subject: [PATCH] back to 'selection' for submitting files, to facilitate tpls compatible with 2.3 --- default.tpl | 14 ++++++++------ main.pas | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/default.tpl b/default.tpl index ce122e6..8c702e0 100644 --- a/default.tpl +++ b/default.tpl @@ -107,8 +107,9 @@ def 3.0 {.if|{.get|can archive.}| - @@ -688,7 +689,6 @@ function submit(data, url) { f.append("") }) } - showLoading() f.submit() }//submit @@ -805,9 +805,11 @@ function getSelectedItemsName() { }//getSelectedItemsName function deleteFiles(files) { - ask("{.!confirm.}", ()=> - submit({ action:'delete', files })) -} + ask("{.!confirm.}", ()=>{ + submit({ action:'delete', selection:files }) + showLoading() + }) +}//deleteFiles function moveFiles(files) { ask("{.!Enter the destination folder.}", 'text', function(dst) { diff --git a/main.pas b/main.pas index c4f2245..c9a9cf5 100644 --- a/main.pas +++ b/main.pas @@ -4473,7 +4473,7 @@ end; // apacheLogCb procedure removeFilesFromComments(files:TStringDynArray); var fn, lastPath, path: string; - trancheStart, trancheEnd: integer; // the tranche is a window within 'files' of items sharing the same path + trancheStart, trancheEnd: integer; // the tranche is a window within 'selection' of items sharing the same path ss: TstringList; procedure doTheTranche(); @@ -5038,7 +5038,7 @@ var begin result:=NIL; for i:=0 to data.postvars.count-1 do - if sameText('files', data.postvars.names[i]) then + if sameText('selection', data.postvars.names[i]) then addString(getTill('#', data.postvars.valueFromIndex[i]), result) // omit #anchors end; // getFilesSelection