Alert Function - Tiddlywiki

152 views
Skip to first unread message

pan...@askpundit.com

unread,
Mar 15, 2018, 12:46:28 AM3/15/18
to TiddlyWiki
Hi,

How to create alert function, whenever we create new tiddler / Delete Tiddler? And where to place it!

Thank You.

PMario

unread,
Mar 15, 2018, 4:18:29 AM3/15/18
to TiddlyWiki
On Thursday, March 15, 2018 at 5:46:28 AM UTC+1, pan...@askpundit.com wrote:
How to create alert function, whenever we create new tiddler / Delete Tiddler? And where to place it!

What do you mean by "alert function" ... Can you be a bit more specific?

-m

Jed Carty

unread,
Mar 15, 2018, 4:20:21 AM3/15/18
to TiddlyWiki
I think that you need to write a javascript plugin for this. The navigator widget has hooks that you can use to do something during different events. You can see some examples of how to use hooks

Then you put your definition of the hook into a startup module (the file I linked to above is also a startup module)

pan...@askpundit.com

unread,
Mar 15, 2018, 4:54:08 AM3/15/18
to TiddlyWiki
Hi,

I need a custom function, whenever we create new tiddler using that function I will make alert message.

Thank You

Jed Carty

unread,
Mar 15, 2018, 5:30:45 AM3/15/18
to TiddlyWiki
When you say custom function do you just mean something like a form you fill out? And what type of alert message?

I think that we need more context to give a useful answer.

pan...@askpundit.com

unread,
Mar 15, 2018, 5:37:26 AM3/15/18
to TiddlyWiki

Hi,

In tiddlywiki, I create a new tiddler(Each Time), Then click that (tick icon), it will say as popup like "new tiddler is created".

How to do?

Thank You.

Jed Carty

unread,
Mar 15, 2018, 6:57:06 AM3/15/18
to TiddlyWiki
Open the tiddler $:/core/ui/Buttons/save and replace the contents with this:


<$fieldmangler><$button tooltip={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/>
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
<$action-sendmessage $message="tm-add-field" $name={{$:/temp/newfieldname}} $value={{$:/temp/newfieldvalue}}/>
<$action-deletetiddler $tiddler="$:/temp/newfieldname"/>
<$action-deletetiddler $tiddler="$:/temp/newfieldvalue"/>
<$action-sendmessage $message="tm-save-tiddler"/>
<$action-createtiddler $basetitle="$:/temp/alerts/New Tiddler" tags="$:/tags/Alert" text="Created New Tiddler"/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/done-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Save/Caption}}/></span>
</$list>
</$button></$fieldmangler>


Reply all
Reply to author
Forward
0 new messages