Widget:File upload: verschil tussen versies

Uit Dorpsbelang Den Hout
Ga naar:navigatie, zoeken
Regel 180: Regel 180:
 
         counter = counter + 1;
 
         counter = counter + 1;
  
        document.getElementById("widget-file-upload-preview").innerHTML = document.getElementById("widget-file-upload-preview").innerHTML+'<div class="upload-group">'+newImage.outerHTML+'<input data="'+dt.name+'" type="text" placeholder="caption" class="form-control"  /></div>';
+
          if(settingsCaption){
 
+
           
 +
          document.getElementById("widget-file-upload-preview").innerHTML = document.getElementById("widget-file-upload-preview").innerHTML+'<div class="upload-group">'+newImage.outerHTML+'<input data="'+dt.name+'" type="text" placeholder="caption" class="form-control"  /></div>';
 +
 
 +
            }else{
 +
        document.getElementById("widget-file-upload-preview").innerHTML = document.getElementById("widget-file-upload-preview").innerHTML+'<div class="upload-group">'+newImage.outerHTML+'</div>';
 +
            }
 
         }
 
         }
 
        
 
        
Regel 192: Regel 197:
 
function editFilePage(file){
 
function editFilePage(file){
  
 
+
if(settingsCaption){
var caption = document.querySelector('[data="'+file+'"]').value;
+
    var caption = document.querySelector('[data="'+file+'"]').value;
 
+
    var newWikitextEdit = createWikitext(file, caption);
 
+
}else{
 
+
    var newWikitextEdit = createWikitext(file);
var newWikitextEdit = createWikitext(file, caption);
+
}
 
 
  
 
     var params = {
 
     var params = {

Versie van 7 sep 2020 09:51

Sjabloon:Managed

This is the Widget:Multi upload page. It should be called in the following format:

{{#widget:Multi upload }}