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>
{.if|{.get|can archive.}|
<button id='archiveBtn' title="{.!Download selected files as a single archive.}"
onclick='ask("{.!Download these files as a single archive?.}", ()=> submit({ files: getSelectedItemsName() }, "{.get|url|mode=archive|recursive.}") )'>
<button id='archiveBtn' title="{.!Download selected files as a single archive.}" onclick='
ask("{.!Download these files as a single archive?.}", ()=>
submit({ selection: getSelectedItemsName() }, "{.get|url|mode=archive|recursive.}") )'>
<i class="fa fa-file-archive"></i>
<span>{.!Archive.}</span>
</button>
@ -688,7 +689,6 @@ function submit(data, url) {
f.append("<input type='hidden' name='"+k+"' value='"+v2+"' />")
})
}
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) {

View File

@ -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