Hi Mark,

Thanks for the reply.

I did not explain my goals properly. I would basically like to create a new 
EditorToolbar button similar to bold, italic etc. but with custom 
functionality.

I have successfully created buttons that can edit the text in normal 
Tiddlers but I cannot do the same when the Tiddler is in draft mode. Would 
there be an easy way to do this?

I have added a picture to help illustrate my goal. Just as an example, what 
I could do is that when the circled button is pressed, the text before " xx 
" would be a new field, the text after it would become the field content. 
The text would then be removed from the text area. All this should happen 
while the Tiddler is in draft mode. 

Hope this clarifies my goals. Thanks!

Pekka

On Thursday, September 16, 2021 at 7:23:59 PM UTC+3 Mark S. wrote:

> It sounds like you would like to edit javascript in a mode similar to a 
> code editor.
>
> You can use the code mirror plugin and the javascript for codemirror 
> plugin to edit javascript text.
>
> You can get the plugins from the stand-alone TW by going to 
>
> control panel (cog wheel) --> plugins (tab) --> official plugins (button)
>
> Search for codemirror and javascript .
>
> On Wednesday, September 15, 2021 at 11:46:54 PM UTC-7 Pekka wrote:
>
>> How can Drafts be edited with JavaScript? 
>>
>> I would like to parse the text in a draft according to more complicated 
>> rules than what is currently possible with existing widgets, e.g. 
>> tm-edit-text-operation. 
>>
>> I have tried *this.wiki.setText(...)*, but it doesn't work. 
>>
>> What would be the easiest way to change the text field in a Draft Tiddler 
>> according to arbitrary rules?
>>
>>
>> Pekka
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/520780e9-606f-4900-ba60-831c4c4ebd6fn%40googlegroups.com.

Reply via email to