Experiment: more finetuning of the filepickers, see #2202

This commit is contained in:
Pieter Vander Vennet 2024-11-25 18:00:30 +01:00
parent 86baf130f3
commit 6900dedd3e
4 changed files with 17 additions and 11 deletions

View file

@ -38,7 +38,7 @@
let errors = new UIEventSource<Translation[]>([])
async function handleFiles(files: FileList) {
async function handleFiles(files: FileList, ignoreGps: boolean= false) {
const errs = []
for (let i = 0; i < files.length; i++) {
const file = files.item(i)
@ -57,7 +57,8 @@
file,
"image",
noBlur,
feature
feature,
ignoreGps
)
if (!uploadResult) {
return
@ -97,7 +98,8 @@
<Tr t={error} cls="alert" />
{/each}
<FileSelector
accept=".jpg,.jpeg"
accept="image/*"
capture="environment"
cls="button border-2 flex flex-col"
multiple={true}
on:submit={(e) => handleFiles(e.detail)}
@ -112,7 +114,7 @@
{labelText}
{:else}
<div class="flex flex-col">
<Tr t={t.addPicture} />
<Tr t={t.addPicture}/>
{#if noBlur}
<span class="subtle text-sm">
<Tr t={t.upload.noBlur} />
@ -123,12 +125,12 @@
</div>
</FileSelector>
<FileSelector
accept={undefined}
cls="subtle as-link flex justify-center md:hidden"
accept=".jpg, .jpeg"
cls="flex justify-center md:hidden button"
multiple={true}
on:submit={(e) => handleFiles(e.detail)}
on:submit={(e) => handleFiles(e.detail, true)}
>
Use the file selector dialog
<Tr t={t.selectFile}/>
</FileSelector>
<div class="subtle text-xs italic">
<Tr t={Translations.t.general.attribution.panoramaxLicenseCCBYSA} />