6 ms·
It's dismissible, try showCloseButton. It's an alternative to alert in the sense that you can use it to provide a better experience than {error: alert}. It's
by zackbloom 14y ago
It's dismissible, try showCloseButton.
It's an alternative to alert in the sense that you can use it to provide a better experience than {error: alert}. It's not a great option for modal alerts.
What browser does it not work on? We'll file an issue.
- rush340 14y agoIt did strike me as odd that showCloseButton isn't true by default. I can't see many scenarios where you would want to force the user to leave their screen obstructed after they've seen the message.
- zackbloom 14y ago{hideAfter: 10} is default, meaning it will hide in 10 seconds without intervention.
- rush340 14y agoThat's a good default for expiration, but I always expect to be able to dismiss notifications early to get them out the way. It definitely makes sense to hide the dismissal button when there are interactions prompted that would get rid of it (Retry/Cancel), but the default case is a plain text message to the user. By the way, I like it, thanks for putting it out there! A more unique name might help me find it for future projects :)
- bjourne 14y agoMost people only use alert() for debugging. It blocks the thread of execution until dismissed which is a nice feature. However, alert() is almost never used to display user-visible messages, which one definitely would use your nice looking plugin for. The concept is called "flash messages" and there are some other plugins that also implement them, but they are not as sophisticated as yours.
- bitdestroyer 14y agoThey are also known as Toasts. I believe that's what the Android SDK refers to that concept as, as well as many other libraries.
- masklinn 14y agoYeah: http://en.wikipedia.org/wiki/Toast_(computing) http://en.wikipedia.org/wiki/Toast_(computing) Though they're often known as merely "notifications", that's how Growl calls them and libnotify... well no need to spell it out.
- zackbloom 14y agoI had no idea they had a name, thanks!
- asveikau 14y agoI remember this as a Microsoft term, based on notifications from Outlook and MSN Messenger. The analogy is that it pops up like toast from a toaster.
- derefr 14y ago> It blocks the thread of execution until dismissed which is a nice feature. I've wanted a "just wait a minute, Javascript engine; let me look at what you're doing!" API call for quite a while. Turns out there is one: you can put "debugger;" in any JS code, and (if you have Webkit Devtools or Firebug or what-have-you) it will act as if you had set a breakpoint right at that statement. Much less diddling with the mouse to set a breakpoint in code you already had open in a text editor. Good complement to console.log :)
- 0x0 14y agoThis is one of most important things I've learned this whole month! Thanks for the tip! :)
- ams6110 14y ago> alert() is almost never used to display user-visible messages What bank do you use?
- emilv 14y agoWhile it technically works in Opera Mobile 12.10, it is just not giving me a good user experience. It is down in the lower right corner of the phone and I need to zoom in to be able to read it (which takes effort and time since my phone/handheld computer is not that fast). That is a lot different from an alert() box which integrates with the UI on the device to instantly give me an actual popup. I also had a general problem with boxes disappearing. I tried opening a box with autohide after 10 seconds, then a box with a button. I positioned my mouse over the button but then the autohide box disappeared and the button moved away from my mouse! I seriously hate such UIs. Stuff should not move on a page, especially not if they are meant to be clicked. And text boxes should not disappear when I am half-way through reading them.
- snowwrestler 14y agoI'm on the latest Firefox on Mac 10.8. The "run" buttons do not show up at all...I had no clue what I was supposed to be looking for.
- zackbloom 14y agoYep, we just discovered that bug in the underlying doc library (https://github.com/HubSpot/executr/issues/1 https://github.com/HubSpot/executr/issues/1), thanks!
- deleted 14y ago[deleted]