mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Allows adding a new tag name by typing enter (#2592)
* allows to add a new tagname hitting enter see: https://groups.google.com/forum/#!topic/tiddlywiki/wqQ8jPYG-X4 * revert changes to vanilla/base * added "Special Keys" to KeyboardShortcuts * added info to Creating and editing tiddlers did not add current version of <<.from-version "5.1.14">> because it would interrupt the flow. When changed from a noisy "New in 5.1.14" to "(new in 5.1.14)" we might add the version info here * revert setText & added inline styles to vanilla base * remove fieldmangler * commit initial edittemplate tags to merge master * ok, now really revert to initial edittemplate tags * move add tag via enter into tag-picker macro(s)
This commit is contained in:
parent
e1053bf014
commit
15c7d24eaa
@ -1,6 +1,11 @@
|
||||
title: $:/core/macros/tag-picker
|
||||
tags: $:/tags/Macro
|
||||
|
||||
\define add-tag-actions()
|
||||
<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/>
|
||||
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
|
||||
\end
|
||||
|
||||
\define tag-button()
|
||||
<$button class="tc-btn-invisible" tag="a">
|
||||
$(actions)$
|
||||
@ -13,7 +18,9 @@ $(actions)$
|
||||
<$set name="actions" value="""$actions$""">
|
||||
<div class="tc-edit-add-tag">
|
||||
<span class="tc-add-tag-name">
|
||||
<$keyboard key="ENTER" actions=<<add-tag-actions>>>
|
||||
<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify "$:/state/popup/tags-auto-complete">> class="tc-edit-texteditor tc-popup-handle"/>
|
||||
</$keyboard>
|
||||
</span> <$button popup=<<qualify "$:/state/popup/tags-auto-complete">> class="tc-btn-invisible" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button> <span class="tc-add-tag-button">
|
||||
<$set name="tag" value={{$:/temp/NewTagName}}>
|
||||
<$button set="$:/temp/NewTagName" setTo="" class="">
|
||||
|
@ -10,4 +10,9 @@ Keyboard shortcuts are available for common editing operations:
|
||||
* Abandoning changes to the draft tiddler containing the keyboard focus (defaults to <kbd>escape</kbd>)
|
||||
* Formatting operations from the tiddler editing toolbar (see the tooltips)
|
||||
|
||||
The current shortcuts can be inspected and customised in the "Keyboard Shortcuts" tab of [[control panel|$:/ControlPanel]] {{$:/core/images/options-button}}.
|
||||
The current shortcuts can be inspected and customised in the "Keyboard Shortcuts" tab of [[control panel|$:/ControlPanel]] {{$:/core/images/options-button}}.
|
||||
|
||||
!! Special Keys
|
||||
|
||||
; adding tags in the editor
|
||||
: <<.from-version 5.1.14>>: if you hit <kbd>escape</kbd> in the new tag input, the tag will be added
|
@ -21,7 +21,7 @@ To edit an existing tiddler, click the {{$:/core/images/edit-button}} button at
|
||||
When you create a new tiddler or edit an existing one, the tiddler will go into draft mode. This presents a control panel for modifying the tiddler in various ways. It has several parts, from top to bottom:
|
||||
|
||||
*''The title field'' - Use this to change the title of the tiddler
|
||||
*''The tag selector'' - Use this to add or remove tags. As you type a tag name in the box, a dropdown list will show you any existing tags that match. You can pick from this list or create a completely new tag. Then click the ''add'' button to add the tag to the tiddler. Each tag is shown as a coloured pill. Click the "×" on a pill to remove that tag
|
||||
*''The tag selector'' - Use this to add or remove tags. As you type a tag name in the box, a dropdown list will show you any existing tags that match. You can pick from this list or create a completely new tag. Then click the ''add'' button or hit the <kbd>Enter</kbd> key to add the tag to the tiddler. Each tag is shown as a coloured pill. Click the "×" on a pill to remove that tag
|
||||
*''The text area'' - Use this to edit the main content of the tiddler. Click the ''preview'' button ({{$:/core/images/preview-closed}} / {{$:/core/images/preview-open}}) to see what your changes will look like
|
||||
*''The type selector'' - Use this when a tiddler needs to be displayed in a special way, such as an image. See ContentType for a list of the options. The default is `text/vnd.tiddlywiki`, which means the tiddler contains WikiText
|
||||
*''The field selector'' - Use this to add or remove fields on the tiddler. For example, if you are editing a tiddler that's being used to tag other tiddlers, you can add a [[''list'' field|ListField]] to change the order in which those tiddlers will be listed
|
||||
|
@ -1159,6 +1159,10 @@ html body.tc-body.tc-single-tiddler-window {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.tc-edit-add-tag .tc-keyboard {
|
||||
display:inline;
|
||||
}
|
||||
|
||||
.tc-edit-tags .tc-tag-label {
|
||||
display: inline-block;
|
||||
}
|
||||
@ -2318,4 +2322,4 @@ body.tc-dirty span.tc-dirty-indicator, body.tc-dirty span.tc-dirty-indicator svg
|
||||
.tc-error {
|
||||
background: #f00;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user