1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00

Add hex colours to tag manager

Fixes #597
This commit is contained in:
Jermolene 2014-05-05 18:42:25 +01:00
parent e58e68fa7c
commit ffb6c8ab81
3 changed files with 8 additions and 3 deletions

View File

@ -45,6 +45,9 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
if(editInfo.value === "" && this.editPlaceholder) {
domNode.setAttribute("placeholder",this.editPlaceholder);
}
if(this.editSize) {
domNode.setAttribute("size",this.editSize);
}
// Assign classes
if(this.editClass) {
domNode.className = this.editClass;
@ -133,6 +136,7 @@ EditTextWidget.prototype.execute = function() {
this.editDefault = this.getAttribute("default");
this.editClass = this.getAttribute("class");
this.editPlaceholder = this.getAttribute("placeholder");
this.editSize = this.getAttribute("size");
this.editFocusPopup = this.getAttribute("focusPopup");
// Get the editor element tag and type
var tag,type;

View File

@ -2,7 +2,7 @@ title: $:/TagManager
\define lingo-base() $:/language/TagManager/
\define iconEditor(title)
<$edit-text field="icon" tag="input"/> <$button popup=<<qualify "$:/state/iconDropdown/$title$">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<$edit-text field="icon" tag="input" size="20"/> <$button popup=<<qualify "$:/state/iconDropdown/$title$">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/iconDropdown/$title$">> type="nomatch" text="" default="">
<$linkcatcher to="$title$!!icon">
@ -29,7 +29,7 @@ title: $:/TagManager
<tr>
<td><$transclude tiddler="$:/core/ui/TagTemplate"/></td>
<td><$count filter="[all[current]tagging[]]"/></td>
<td><$edit-text field="color" tag="input" type="color"/></td>
<td><$edit-text field="color" tag="input" type="text" size="9"/> <$edit-text field="color" tag="input" type="color"/></td>
<td><$macrocall $name="iconEditor" title={{!!title}}/></td>
</tr>
</$list>

View File

@ -1,6 +1,6 @@
title: EditTextWidget
created: 201310241419
modified: 201310300837
modified: 201405050837
tags: widget
! Introduction
@ -22,4 +22,5 @@ The content of the `<$edit-text>` widget is ignored.
|placeholder |Placeholder text to be displayed when the edit field is empty |
|focusPopup |Title of a state tiddler for a popup that is displayed when the editing element has focus |
|tag |Overrides the generated HTML editing element tag |
|size |The size of the input field (in characters) |
|type |Overrides the generated HTML editing element `type` attribute |