back to 'selection' for submitting files, to facilitate tpls compatible with 2.3

This commit is contained in:
Massimo Melina 2020-06-13 21:04:14 +02:00
parent d6d5b8f493
commit db092e5eab
2 changed files with 10 additions and 8 deletions

View File

@ -107,8 +107,9 @@ def 3.0
</button> </button>
{.if|{.get|can archive.}| {.if|{.get|can archive.}|
<button id='archiveBtn' title="{.!Download selected files as a single archive.}" <button id='archiveBtn' title="{.!Download selected files as a single archive.}" onclick='
onclick='ask("{.!Download these files as a single archive?.}", ()=> submit({ files: getSelectedItemsName() }, "{.get|url|mode=archive|recursive.}") )'> ask("{.!Download these files as a single archive?.}", ()=>
submit({ selection: getSelectedItemsName() }, "{.get|url|mode=archive|recursive.}") )'>
<i class="fa fa-file-archive"></i> <i class="fa fa-file-archive"></i>
<span>{.!Archive.}</span> <span>{.!Archive.}</span>
</button> </button>
@ -688,7 +689,6 @@ function submit(data, url) {
f.append("<input type='hidden' name='"+k+"' value='"+v2+"' />") f.append("<input type='hidden' name='"+k+"' value='"+v2+"' />")
}) })
} }
showLoading()
f.submit() f.submit()
}//submit }//submit
@ -805,9 +805,11 @@ function getSelectedItemsName() {
}//getSelectedItemsName }//getSelectedItemsName
function deleteFiles(files) { function deleteFiles(files) {
ask("{.!confirm.}", ()=> ask("{.!confirm.}", ()=>{
submit({ action:'delete', files })) submit({ action:'delete', selection:files })
} showLoading()
})
}//deleteFiles
function moveFiles(files) { function moveFiles(files) {
ask("{.!Enter the destination folder.}", 'text', function(dst) { ask("{.!Enter the destination folder.}", 'text', function(dst) {

View File

@ -4473,7 +4473,7 @@ end; // apacheLogCb
procedure removeFilesFromComments(files:TStringDynArray); procedure removeFilesFromComments(files:TStringDynArray);
var var
fn, lastPath, path: string; 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; ss: TstringList;
procedure doTheTranche(); procedure doTheTranche();
@ -5038,7 +5038,7 @@ var
begin begin
result:=NIL; result:=NIL;
for i:=0 to data.postvars.count-1 do 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 addString(getTill('#', data.postvars.valueFromIndex[i]), result) // omit #anchors
end; // getFilesSelection end; // getFilesSelection