Widget:File upload: verschil tussen versies

Uit Dorpsbelang Den Hout
Ga naar:navigatie, zoeken
Regel 24: Regel 24:
  
 
<!--{if (isset($drop) && $drop=="true")}--><div id="drop-area"><div><!--{/if}-->
 
<!--{if (isset($drop) && $drop=="true")}--><div id="drop-area"><div><!--{/if}-->
     <label for="widget-file-upload-files" ><!--{if (isset($button) && $button!="")}--><!--{$button}--><!--{else}--><button>Upload</button><!--{/if}--><input type="file" id="widget-file-upload-files" name="files[]" style="display:none"  <!--{if (isset($multiple) && $multiple=="false")}--><!--{else}-->multiple<!--{/if}--> /></label>
+
     <label for="widget-file-upload-files" >
 +
<!--{if (isset($button) && $button!="")}--><!--{$button}--><!--{else}--><button>Upload</button><!--{/if}-->
 +
<input type="file" id="widget-file-upload-files" name="files[]" style="display:none"   
 +
<!--{if (isset($multiple) && $multiple=="false")}--><!--{else}-->multiple<!--{/if}-->  
 +
<!--{if (isset($preview) && $preview!="")}-->data-preview="<!--{$preview}-->"<!--{/if}-->
 +
<!--{if (isset($caption) && $caption!="")}-->data-caption="<!--{$caption}-->"<!--{/if}-->
 +
<!--{if (isset($drop) && $drop!="")}-->data-drop="<!--{$drop}-->"<!--{/if}-->
 +
<!--{if (isset($filepagetemplate) && $filepagetemplate!="")}--> data-filepagetemplate="<!--{$filepagetemplate}-->"<!--{/if}-->
 +
<!--{if (isset($filepageparameters) && $filepageparameters!="")}--> data-filepageparameters="<!--{$filepageparameters}-->"<!--{/if}-->
 +
<!--{if (isset($filename) && $filename!="")}--> data-filename="<!--{$filename}-->"<!--{/if}-->
 +
/>
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
</label>
 
<!--{if (isset($drop) && $drop=="true")}--></div ></div><!--{/if}-->
 
<!--{if (isset($drop) && $drop=="true")}--></div ></div><!--{/if}-->
  
Regel 33: Regel 50:
 
var dropped;
 
var dropped;
  
var settingsPreview<!--{if (isset($preview) && $preview!="")}--> = "<!--{$preview}-->"<!--{/if}-->;
+
var fileInput = document.getElementById('widget-file-upload-files');                                                                                             
var settingsCaption<!--{if (isset($caption) && $caption!="")}--> = <!--{$caption}--><!--{/if}-->;
+
 
var settingsDrop<!--{if (isset($drop) && $drop!="")}--> = <!--{$drop}--><!--{/if}-->;
+
var settingsPreview = fileInput.getAttribute('data-preview');
var settingsFilepagetemplate<!--{if (isset($filepagetemplate) && $filepagetemplate!="")}--> = "<!--{$filepagetemplate}-->"<!--{/if}-->;
+
var settingsCaption = fileInput.getAttribute('data-caption');
var settingsFilepageparameters<!--{if (isset($filepageparameters) && $filepageparameters!="")}--> = "<!--{$filepageparameters}-->"<!--{/if}-->;
+
var settingsDrop = fileInput.getAttribute('data-drop');
var settingsFilename<!--{if (isset($filename) && $filename!="")}--> = "<!--{$filename}-->"<!--{/if}-->;
+
var settingsFilepagetemplate = fileInput.getAttribute('data-filepagetemplate');
 +
var settingsFilepageparameters = fileInput.getAttribute('data-filepageparameters');
 +
var settingsFilename = fileInput.getAttribute('data-filename');
  
var fileInput = document.getElementById('widget-file-upload-files');                                                                                             
 
 
                                                                                                
 
                                                                                                
 
                                                                                        
 
                                                                                        

Versie van 8 sep 2020 08:02

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