mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-07 00:54:07 +00:00
Add "multiple" attribute to browse widget
And default to non-multiple upload; that’s enough to enable the ability to take photos/videos directly on iOS
This commit is contained in:
parent
50be85287b
commit
ccd916ca7c
@ -36,7 +36,9 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
// Create element
|
// Create element
|
||||||
var domNode = this.document.createElement("input");
|
var domNode = this.document.createElement("input");
|
||||||
domNode.setAttribute("type","file");
|
domNode.setAttribute("type","file");
|
||||||
domNode.setAttribute("multiple","multiple");
|
if(this.browseMultiple) {
|
||||||
|
domNode.setAttribute("multiple","multiple");
|
||||||
|
}
|
||||||
// Add a click event handler
|
// Add a click event handler
|
||||||
domNode.addEventListener("change",function (event) {
|
domNode.addEventListener("change",function (event) {
|
||||||
self.wiki.readFiles(event.target.files,function(tiddlerFieldsArray) {
|
self.wiki.readFiles(event.target.files,function(tiddlerFieldsArray) {
|
||||||
@ -54,6 +56,7 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
Compute the internal state of the widget
|
Compute the internal state of the widget
|
||||||
*/
|
*/
|
||||||
BrowseWidget.prototype.execute = function() {
|
BrowseWidget.prototype.execute = function() {
|
||||||
|
this.browseMultiple = this.getAttribute("multiple");
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
title: BrowseWidget
|
title: BrowseWidget
|
||||||
created: 201310241419
|
created: 201310241419
|
||||||
modified: 201310300837
|
modified: 20140910200751303
|
||||||
tags: widget
|
tags: widget
|
||||||
|
|
||||||
! Introduction
|
! Introduction
|
||||||
@ -9,4 +9,9 @@ The browse widget displays an HTML file browser button that allows the user to c
|
|||||||
|
|
||||||
! Content and Attributes
|
! Content and Attributes
|
||||||
|
|
||||||
The browse widget has no attributes, and ignores any contained content.
|
The content of the `<$browse>` widget is ignored.
|
||||||
|
|
||||||
|
|!Attribute |!Description |
|
||||||
|
|multiple |Set to "multiple" to select multiple file upload |
|
||||||
|
|
||||||
|
On iPhone/iPad choosing the multiple option will remove the ability to take photographs/videos directly into TiddlyWiki.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user