Creating custom excise dropdown

47 views
Skip to first unread message

Louis Davout

unread,
Nov 8, 2021, 7:23:10 PM11/8/21
to TiddlyWiki
Hi,

I would like to create a custom excise dropdown. I'd rather not modify anything related to core. So I cloned:
  • $:/core/ui/EditorToolbar/excise-dropdown to $:/davout/ui/EditorToolbar/excise-dropdown
    • Came up with:
  • $:/core/ui/EditorToolbar/excise to $:/davout/ui/EditorToolbar/excise
    • changed dropdown to $:/davout/ui/EditorToolbar/excise-dropdown
  • $:/core/modules/editor/operations/text/excise.js to $:/davout/modules/editor/operations/text/excise.js
A few questions. (BTW, I'm using 5.2.0)
  1. Am I going about this the right way? If this is even possible?
  2. How can get my button to use my $:/davout/modules/editor/operations/text/excise.js rather than the default  $:/core/modules/editor/operations/text/excise.js
  3. In  $:/core/ui/EditorToolbar/excise-dropdown what is $config-title$ referring to?
Thanks.

Mark S.

unread,
Nov 10, 2021, 9:28:58 AM11/10/21
to TiddlyWiki
It looks like you're doing well. It might help if you explained what you want your new excise to do. It might not require a new js script. 

Louis Davout

unread,
Nov 10, 2021, 4:47:09 PM11/10/21
to TiddlyWiki
Thanks for the reply.

I see that my post did not include my image. Let's try this https://github.com/davout1806/temp/blob/main/excise-dropdown.png

Say we have the following tiddler ABC with Tags: Example, Contrived

Line 1

Line 2

Line 3
-------------

I select Line 2 and click my new excise button with the new form.

If the first checkbox ("Prepend Title of this tiddler + '/' to Title of new tiddler ") is checked then the name of the new tiddler would be prepended with 'ABC/'. Whether the script puts that string into form field "Title of new tiddler" or only in the background, does not matter to me.

If the third checkbox ("Tag new tiddler with the same Tags as this tiddler") is checked then the tags Example and Contrived will be added to the new tiddler. I realize this may be more difficult especially if tiddler ABC is new and has yet to be saved.

Thanks.
Reply all
Reply to author
Forward
0 new messages