Custom edit button

66 views
Skip to first unread message

Dave

unread,
Feb 3, 2019, 4:35:24 PM2/3/19
to TiddlyWiki
Just wondering, is it possible to create a custom edit button?

I really like how you can highlight a whole block of text in edit mode and then click the bullet button and instantly have each line you highlighted suddenly become a bulleted list.

I'm imagining the ability to highlight a few words and then click a custom button that wraps the text in, e.g. a comment macro (something like "the rain in Spain" becoming <<myMacro "the rain in Spain">> which would function to e.g. highlight the text and create some sort of popup to see or edit notes about the text)

Is this currently possible?

TonyM

unread,
Feb 3, 2019, 6:23:19 PM2/3/19
to TiddlyWiki
Dave,

This is more than possible, it is a common addition people make. What you are in fact talking about is the editor toolbar buttons (don confuse with edit toolbar). If you go into edit mode you will see a Stamp icon, this allows you to create your own stamps of text see add your own at the bottom, however, these do not wrap the text like you wish to. The best way to learn and modify tiddlywiki is to look at how it already works. 

In advanced search Shadows search on $:/core/ui/EditorToolbar/ and all the default editor toolbar buttons will be listed. Open them and edit to see their content and return to the editor and review what they do. You will quickly learn how the send messages are used for these buttons. See also tiddlywiki.com https://tiddlywiki.com/#ActionSendMessageWidget  and https://tiddlywiki.com/#Messages

You can clone the existing buttons and edit them to create new ones. Note the different fields in the tiddler including caption, condition and icon especially, you will need to change these. Condition describes on what kind of tiddlers the button should be displayed. Keep the default to start with should be fine.

Remember control panel appearance toolbars editor toolbar.

There is a little more complexity if you want do build your own drop down lists of buttons (other than the existing more button)

Regards
Tony

Dave

unread,
Feb 4, 2019, 12:34:45 AM2/4/19
to TiddlyWiki
Thank you! That sounds easier than i thought :)
Reply all
Reply to author
Forward
0 new messages