Where is the source code that implements the "tm-new-tiddler" message?

74 views
Skip to first unread message

joearms

unread,
Jan 12, 2019, 4:40:47 AM1/12/19
to TiddlyWikiDev


I want to find the source code that implements the "tm-new-tiddler" message?

Why do I want it?

I've been looking at the documentation for
tm_new_tiddler at 

Having read this I could not understand what the paramObject was so I experimented a bit and tried this:

<$button>
<$action-sendmessage $message="tm-new-tiddler" title="Comment" tags="comment" text=<<now "Today is DDth, MMM YYYY">>
parent = {{!!title}}
foo = "this"
bar = "that"
paramObject = " 'abc':'two' "
/>
New Comment
</$button>

When I click this a new tiddler is created with fields parent,paramObject,foo and bar

Very strange - the documentation make no mention of that I can add arbitrary additional fields to the command and I still haven't a clue what paramObject is

So I thought to myself "if all else fails read the code" - trouble is I can't find it.


Cheers

/Joe


 

@TiddlyTweeter

unread,
Jan 12, 2019, 7:12:05 AM1/12/19
to TiddlyWikiDev
It is interesting how much you like the Salt Mines.

FrD

unread,
Jan 12, 2019, 9:02:59 AM1/12/19
to TiddlyWikiDev
Hi,

Type "new-tiddler" in the search area in the sidebar.
Then click on advanced search, the on Shadows.
And then open the only ".js" tiddler :

$:/core/modules/widgets/navigator.js


Regards

FrD

joearms

unread,
Jan 12, 2019, 11:43:48 AM1/12/19
to TiddlyWikiDev
Thanks

/Joe

TonyM

unread,
Jan 12, 2019, 11:23:15 PM1/12/19
to TiddlyWikiDev
Joe,

I asked before because the term or format of "hashmap" has not being defined outside of implied javascript. 

So if you can define "
paramObjectOptional hashmap of additional tiddler fields

Please share.

Tony

FrD

unread,
Jan 13, 2019, 3:57:14 AM1/13/19
to TiddlyWikiDev
Hi Tony,

If I read the code right, paramObject is expected to be a javascript object (once evaluated).
So I guess you could use a JSON string representing a javascript object when you invoke the tm-new-tiddler message.

Regards

FrD

Simon Huber

unread,
Jan 14, 2019, 3:57:14 PM1/14/19
to TiddlyWikiDev
Hi all,

how I understand it:
messages have two types of parameters, those that start with a "$" sign and those without

I prefer sending a message through the action-sendmessage widget instead of using the button-widget's message and param attributes for that, because it allows me to distinguish between the message-parameters starting with "$" and the parameters without "$" that go into the paramObject (the action-sendmessage widget does that for us)

<$action-sendmessage $message="tm-new-tiddler" $param="i-dont-know-atm" something="nice" everyone="beautiful"/>

something and everyone will go into the paramObject and then it depends on what happens with those variables
as @FrD said, inspect the message you're interested in through searching for it in the advanced search -> shadows. it's a journey
Reply all
Reply to author
Forward
0 new messages