A substitute for the javascript Confirm and Alert boxes?
69 views
Skip to first unread message
Stephen Kimmel
unread,
Apr 26, 2016, 9:02:11 AM4/26/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to TiddlyWiki
Has someone come up a substitute for the javascript confirm and alert boxes that can be styled? My understanding is that the functions built into the browser's javascript can not be styled at all and I find them too bright for the color palettes I'm using. What I like is something where I could edit navigator.js, change the references from confirm(whatever) to something like tbconfirm(whatever). Then I could add some css to a stylesheet and change the colors or fonts of the confirm dialog boxes.
Has someone done something like that with TW5?
Devin Weaver
unread,
Apr 26, 2016, 5:54:13 PM4/26/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to TiddlyWiki
I have looked into this. The problem is that any type of user themed confirmation prompt is asynchronous. But the browser built in version actually blocks code execution. In the places that TiddlyWiki needs a confirmation it depends on that code blocking. In other words the need to use the browsers built in confirm dialog is deeply embedded in the TW code and would require significant work to change the core design and support asynchronous user input.
Sadly, I don't think Jeremey nor any of the contributors are up to the task with everything else going on.
But one could dream because I would love this feature.
Jeremy Ruston
unread,
Apr 27, 2016, 9:21:41 AM4/27/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tiddl...@googlegroups.com
Thanks Devin, I was going to reply to make the same point.
In practice, I think all of the alert()'s in the core could actually be replaced; I don't think any of them rely on the synchronous behaviour.
It's the confirm()s and prompt()s that are the difficulty; they are used freely in navigator.js in a manner which requires them to be synchronous. But I've always considered that to be a bit of a hack, and I'd be delighted to wake up and find that they had been refactored away. But I think it would be quite tricky: we'd have to completely change how we handle the associated messages in navigator.js.