Live data from Hacker News

Alertify.js

github.com

61–70 of 79 posts

Re: Alertify.js

#61

Very cool library! The one thing all of these type of things lack (e.g. this, dojo.dialog()) is that they are non-blocking to the execution thread, unlike alert()/confirm()/prompt(). I know it's not their fault, javascript doesn't allow this natively, but i feel like that would be immensely useful for general user input, form validation and the like. Yes, I am aware that it can be done currently through workarounds,…

What you want isn't blocking the UI thread but a stack of states where each state defines the current behaviour of the elements, with bonus points if states can be composed together.

Re: Alertify.js

#62
One concern is the ordering of buttons. Windows users will be used to OK/Cancel whereas on OS X, etc Cancel/OK is the norm. I wonder if this is something this library should handle?

Re: Alertify.js

#63

Earlier quoted context omitted.

Just out of curiosity, if you had a web app like Gmail, and your user accidentally went to close their browser window with an unsaved email half done, how would you plan on warning them without blocking events?

You use the onbeforeunload event, which doesn't block the event thread. (EDIT: actually it does, just not while JS code is executing, unlike alert().) In fact, the HTML5 spec permits browsers to disregard the normal blocking behavior of alert()/confirm()/prompt() (making them no-ops) while this event is being handled: https://developer.mozilla.org/en-US/docs/DOM/window.onbefore... the dialog box is open

I managed to break that link somehow and can no longer edit it, here's the correct one: https://developer.mozilla.org/en-US/docs/DOM/window.onbefore...

Re: Alertify.js

#64
post #7

Pretty slick, animation-wise. If I could make one design-layman suggestion...the thick, black border belies the unobtrusiveness of the plugin. Maybe a lighter, thinner border would be a better fit for the use-case of this plugin?

You can go into the css and for the .alertify {} selector

Remove the border{...} values and change box shadow to:

box-shadow {box-shadow: 0 0px 60px 30px #666;}

Re: Alertify.js

#65

Very cool library! The one thing all of these type of things lack (e.g. this, dojo.dialog()) is that they are non-blocking to the execution thread, unlike alert()/confirm()/prompt(). I know it's not their fault, javascript doesn't allow this natively, but i feel like that would be immensely useful for general user input, form validation and the like. Yes, I am aware that it can be done currently through workarounds,…

There is a method called `showModalDialog` in modern browsers that was supposed to be used for exactly that, blocking interaction. Unfortunately it doesn't actually work consistently.

https://developer.mozilla.org/en-US/docs/DOM/window.showModa...

Re: Alertify.js

#66
In the "prompt dialog" the buttons don't get highlighted when I tab over to them ... so instead my browsers buttons get highlighted, and I end up hitting back instead of Ok or Cancel...
Post reply on HN