Add tooltip to browse widget

Fixes #1179
print-window-tiddler
Jermolene 2014-12-02 19:16:38 +00:00
rodzic 85217112ad
commit 5154a25ab9
3 zmienionych plików z 36 dodań i 1 usunięć

Wyświetl plik

@ -39,6 +39,9 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
if(this.browseMultiple) {
domNode.setAttribute("multiple","multiple");
}
if(this.tooltip) {
domNode.setAttribute("title",this.tooltip);
}
// Add a click event handler
domNode.addEventListener("change",function (event) {
if(self.message) {
@ -62,6 +65,7 @@ Compute the internal state of the widget
BrowseWidget.prototype.execute = function() {
this.browseMultiple = this.getAttribute("multiple");
this.message = this.getAttribute("message");
this.tooltip = this.getAttribute("tooltip");
};
/*

Wyświetl plik

@ -12,5 +12,5 @@ description: {{$:/language/Buttons/Import/Hint}}
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Import/Caption}}/></span>
</$list>
</$button>
<$browse/>
<$browse title={{$:/language/Buttons/Import/Hint}}/>
</div>

Wyświetl plik

@ -0,0 +1,31 @@
title: BrowseWidget
created: 201310241419
modified: 20141202155353547
tags: Widgets
caption: browse
! Introduction
The browse widget displays an HTML file browser button that allows the user to choose one or more files to import. It sends a [[WidgetMessage: tm-import-tiddlers]] carrying a JSON representation of the tiddlers imported from the files up through its parents. This message usually trapped by the NavigatorWidget which adds the tiddlers to the store and updates the story to display them.
! Content and Attributes
The content of the `<$browse>` widget is ignored.
|!Attribute |!Description |
|multiple |Set to "multiple" to select multiple file upload |
|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` |
On iPhone/iPad choosing the multiple option will remove the ability to take photographs/videos directly into TiddlyWiki.
''e.g.''
```
<$browse>
```
renders as:
<$browse>