Widget:File upload: verschil tussen versies
Uit Dorpsbelang Den Hout
Regel 115: | Regel 115: | ||
function handleFileSelect() { | function handleFileSelect() { | ||
+ | |||
+ | |||
+ | |||
+ | if(settingsPreview != "false"){ | ||
+ | createPreviews(fileInput.files); | ||
+ | } | ||
− | + | ||
− | + | ||
− | |||
fileInput.closest('form').querySelector('[type="submit"]').addEventListener('click', uploadFiles, false) | fileInput.closest('form').querySelector('[type="submit"]').addEventListener('click', uploadFiles, false) | ||
Regel 174: | Regel 179: | ||
− | function createPreviews(){ | + | function createPreviews(filesSelected){ |
− | |||
if (filesSelected.length > 0) { | if (filesSelected.length > 0) { | ||
Regel 277: | Regel 281: | ||
// handleFiles(files) | // handleFiles(files) | ||
− | fileInput. | + | if(settingsPreview != "false"){ |
+ | createPreviews(files); | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | fileInput.closest('form').querySelector('[type="submit"]').addEventListener('click', uploadFiles, false) | ||
} | } | ||
Versie van 7 sep 2020 10:32
This is the Widget:File upload page. It should be called in the following format:
{{#widget:File upload |multiple=false |preview=true |caption=true |drop=false |button={{fa|upload}} |filepagetemplate=file for test |filepageparameters=filename:<FILENAME><Title>;page:{{FULLPAGENAME}} |filename=<FILENAME><Title> }}