Widget:File upload: verschil tussen versies

Uit Dorpsbelang Den Hout
Ga naar:navigatie, zoeken
Regel 115: Regel 115:
 
                                                                                                
 
                                                                                                
 
function handleFileSelect() {
 
function handleFileSelect() {
 +
 
 +
 
 +
 
 +
    if(settingsPreview != "false"){
 +
      createPreviews(fileInput.files);
 +
    }
  
  if(settingsPreview != "false"){
+
 
      createPreviews();
+
    
   }
 
 
    
 
    
 
   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){
  var filesSelected = fileInput.files;
 
 
     if (filesSelected.length > 0) {
 
     if (filesSelected.length > 0) {
  
Regel 277: Regel 281:
  
 
  // handleFiles(files)
 
  // handleFiles(files)
   fileInput.value = files;
+
    if(settingsPreview != "false"){
 +
      createPreviews(files);
 +
    }
 +
 
 +
 
 +
 
 +
 
 +
   fileInput.closest('form').querySelector('[type="submit"]').addEventListener('click', uploadFiles, false)
 
}   
 
}   
 
    
 
    

Versie van 7 sep 2020 10:32

Sjabloon:Managed

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