>
> On Wednesday, June 29, 2016 at 8:59:59 AM UTC-7, Chuck R. wrote:
>>
>> I'd like an option in TW5 where, if I am entering a new tag, and I hit
>> ENTER, the new tag is saved. Some people might prefer the old way of saving
>> the tag (clicking the Add button). Would it be possible to add this feature
>> in the future?
>>
>
Currently, the <$edit-text> widget doesn't do anything with the enter key.
It also ignores any 'child content' (i.e., anything between <$edit-text>
and </$edit-text>). If we add a handler
to $:/core/modules/widgets/edit-text.js to catch the enter key, we could
then use it to trigger <$action> widgets defined as content of the
$edit-text widget, just like the content of <$button>...</$button>. If no
action widgets are defined for the edit field, it would still work as it
does today.
With this additional ability for the edit-text widget to invoke actions ,
we could then modify the $:/core/ui/EditTemplate/tags definition, changing
this:
<$edit-text tiddler="$:/temp/NewTagName" .../>
to this:
<$edit-text tiddler="$:/temp/NewTagName" ...>
<$action-sendmessage message="tm-add-tag" param={{$:/temp/NewTagName}}>
<$action-setfield tiddler="$:/temp/NewTagName" text="">
</$edit-text>
Thus, as you type text, it is saved in $:/temp/NewTagName, and 'enter'
invokes the action widgets to set the tag from the temp value, and then
clear the tag input so it is ready to add another tag.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/f7c4158f-2882-4c41-8c9c-29a3e15bc58d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.