Hi Mohammad

> 
> When you want to delete a tiddler via Tiddler view toolbar, delete button
> a nice local (tm-modal) is appeared and says
>  Do you wish to delete the tiddler "HelloThere"?
> 
> I want to know how I can duplicate this for other purpose!
> 
> I dont want to develop from scarctch and wish to use it for other purpose!

That modal dialogue is a browser feature called “confirm()”:

https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm 
<https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm>

It presents a simple text based dialogue to the user with optional “OK” and 
“cancel” buttons. It’s unusual amongst web DOM features in that it pauses 
execution of the script until the user responds.

Making it available as a generic wikitext feature is tricky, however. For 
example, we could make a “tm-confirm” message. The easy part is to give it a 
parameter containing the message to be displayed. For the users response, one 
could imagine a parameter specifying the name of a tiddler to receive the text 
“ok” or “cancel” according to the response of the user.

The gotcha is that that updated tiddler value wouldn’t be available to any 
further actions in an action string; they would have been compiled with the 
previous value of that tiddler.

Making a <$action-confirm> widget instead of a message doesn’t help, sadly.

On the bright side, some people people consider the Window.confirm() to be a 
bad idea because of the way that it blocks access to the rest of the page. The 
alternative is to construct a non-modal confirmation system — for example, the 
“delete” button in advanced search “Filter” tab.

Best wishes

Jeremy

> 
> --Mohammad 
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywiki 
> <https://groups.google.com/group/tiddlywiki>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/9f618915-4e42-4e09-80f7-f3f3f00835f5%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/9f618915-4e42-4e09-80f7-f3f3f00835f5%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4A3005CB-68CB-4BEF-B672-F21934F95724%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to