1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

BrowseWidget: Add "accepts" attribute

And add docs for the 'message' and 'param' attributes
This commit is contained in:
jeremy@jermolene.com 2020-04-21 22:18:34 +01:00
parent 3a20fb1e3a
commit c86a621d5d
2 changed files with 8 additions and 2 deletions

View File

@ -46,6 +46,9 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
if(this.nwsaveas) {
domNode.setAttribute("nwsaveas",this.nwsaveas);
}
if(this.accept) {
domNode.setAttribute("accept",this.accept);
}
// Nw.js supports "webkitdirectory" and "nwdirectory" to allow a directory to be selected
if(this.webkitdirectory) {
domNode.setAttribute("webkitdirectory",this.webkitdirectory);
@ -83,6 +86,7 @@ BrowseWidget.prototype.execute = function() {
this.param = this.getAttribute("param");
this.tooltip = this.getAttribute("tooltip");
this.nwsaveas = this.getAttribute("nwsaveas");
this.accept = this.getAttribute("accept");
this.webkitdirectory = this.getAttribute("webkitdirectory");
this.nwdirectory = this.getAttribute("nwdirectory");
};

View File

@ -1,6 +1,6 @@
caption: browse
created: 20131024141900000
modified: 20170718142410367
modified: 20200421221304177
tags: Widgets
title: BrowseWidget
type: text/vnd.tiddlywiki
@ -17,7 +17,9 @@ The content of the `<$browse>` widget is ignored.
|multiple |Set to "multiple" to select multiple file upload |
|deserializer |<<.from-version "5.1.15">> Optional name of deserializer to be used (by default the deserializer is derived from the file extension or type) |
|tooltip |Optional tooltip text |
|message |Optional override of widget message to be generated. The parameter for the message will be the JavaScript object `event.target.files` |
|accepts |<<.from-version "5.1.23">> Optional comma delimited [[list of file accepted extensions|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers]] and/or MIME types |
|message |Optional override of widget message to be generated. The files will be passed in the JavaScript object `event.target.files` |
|param |Optional parameter to be passed with the custom message |
On iPhone/iPad choosing the multiple option will remove the ability to take photographs/videos directly into TiddlyWiki.