Widget:File upload: verschil tussen versies

Uit Dorpsbelang Den Hout
Ga naar:navigatie, zoeken
Regel 31: Regel 31:
  
 
var counter = 0;
 
var counter = 0;
 +
var dropped;
  
 
var settingsPreview<!--{if (isset($preview) && $preview!="")}--> = "<!--{$preview}-->"<!--{/if}-->;
 
var settingsPreview<!--{if (isset($preview) && $preview!="")}--> = "<!--{$preview}-->"<!--{/if}-->;
Regel 131: Regel 132:
 
function uploadFiles(evt){
 
function uploadFiles(evt){
 
   evt.preventDefault();
 
   evt.preventDefault();
var files = fileInput.files;
+
  if(dropped){
 +
var files = dropped;
 +
  }else{
 +
var files = fileInput.files;
 +
  }
 
var proms = [];  
 
var proms = [];  
 
     for(i = 0; i < files.length; ++i){
 
     for(i = 0; i < files.length; ++i){
Regel 279: Regel 284:
 
   var dt = e.dataTransfer
 
   var dt = e.dataTransfer
 
   var files = dt.files
 
   var files = dt.files
 
+
  dropped = files;
 
  // handleFiles(files)
 
  // handleFiles(files)
 
     if(settingsPreview != "false"){
 
     if(settingsPreview != "false"){

Versie van 7 sep 2020 10:37

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