fix: search and archive recently broken

This commit is contained in:
Massimo Melina 2020-08-04 22:39:02 +02:00
parent 6e4dcf5b56
commit e233f6d29a
2 changed files with 9 additions and 5 deletions

View File

@ -227,6 +227,10 @@ $domReady(()=>{
$on('#search-panel', { submit(ev) { $on('#search-panel', { submit(ev) {
var f = $form(ev.target) var f = $form(ev.target)
var s = f.search var s = f.search
if (!s) {
showError(`{.!Search field is mandatory.}`)
return false
}
var folder = '' var folder = ''
var ps = [] var ps = []
switch (f.where) { switch (f.where) {
@ -733,7 +737,7 @@ function $form(form, field) {
return form.elements.namedItem(field).value return form.elements.namedItem(field).value
let ret = {} let ret = {}
for (let e of form.elements) for (let e of form.elements)
if (e.name) { if (e.name && (e.type !== 'radio' || e.checked)) {
let v = e.value let v = e.value
if (field === false) if (field === false)
v = v.trim() v = v.trim()
@ -1081,7 +1085,7 @@ function toggleSelection() {
$toggle('selection-panel') $toggle('selection-panel')
if (multiSelection = !multiSelection) { if (multiSelection = !multiSelection) {
let base = $create('input.selector', { a:{type:'checkbox'} }) let base = $create('input.selector', { a:{type:'checkbox'} })
$msel('.item-selectable a', e=> // having the checkbox inside the A element will put it on the same line of A even with long A, otherwise A will start on a new line. $msel('.item-selectable .item-link a', e=> // having the checkbox inside the A element will put it on the same line of A even with long A, otherwise A will start on a new line.
e.append(base.cloneNode()) ) e.append(base.cloneNode()) )
} }
else else
@ -1340,7 +1344,7 @@ $domReady(()=>{
$toggle('delete-selection', $sel('.can-delete')) $toggle('delete-selection', $sel('.can-delete'))
$click('#archive', ()=> $click('#archive', ()=>
mustSelect() && ask("{.!Downloading many files as archive can be a lengthy operation, and the result is a TAR file. Continue?.}", ()=> mustSelect() && ask("{.!Downloading many files as archive can be a lengthy operation, and the result is a TAR file. Continue?.}", ()=>
submit({ selection: getSelectedItemsName() }, "{.get|url|mode=archive|recursive.}") )) submit({ selection: getSelectedItemsName() }, "?mode=archive") ))
$msel('#files .cannot-access .item-link img', x=> $msel('#files .cannot-access .item-link img', x=>
x.insertAdjacentElement('afterend', $icon('lock', "{.!No access.}") )) x.insertAdjacentElement('afterend', $icon('lock', "{.!No access.}") ))

View File

@ -35,8 +35,8 @@ uses
HSlib, traylib, monoLib, progFrmLib, classesLib; HSlib, traylib, monoLib, progFrmLib, classesLib;
const const
VERSION = '2.4.0 RC7'; VERSION = '2.4.0 RC8';
VERSION_BUILD = '319'; VERSION_BUILD = '320';
VERSION_STABLE = {$IFDEF STABLE } TRUE {$ELSE} FALSE {$ENDIF}; VERSION_STABLE = {$IFDEF STABLE } TRUE {$ELSE} FALSE {$ENDIF};
CURRENT_VFS_FORMAT :integer = 1; CURRENT_VFS_FORMAT :integer = 1;
CRLF = #13#10; CRLF = #13#10;