Live data from Hacker News

Alertify.js

github.com

41–50 of 79 posts

Re: Alertify.js

#41
post #33

Since nobody seems to have noticed yet: bonus points for using native methods and not using JQuery.

Indeed, I like the fact that it doesn't have dependencies. And is using html5 tags which is useful too.

Re: Alertify.js

#42
Great work, but one suggestion:

Make the alert notification go away when ESC is pressed, like the Confirmation and Prompt notifications.

Re: Alertify.js

#43

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,…

IMHO, no modern JS developer should ever need to create a blocking alert or prompt; the reason the native alert or prompt functions block is because, well, they are not designed for what the web is today.

Re: Alertify.js

#45

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,…

[deleted]

Re: Alertify.js

#46
post #42

Great work, but one suggestion: Make the alert notification go away when ESC is pressed, like the Confirmation and Prompt notifications.

I'd also suggest that clicking anywhere on the body should dismiss it, and behave like cancelling.

Re: Alertify.js

#47
post #43

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,…

IMHO, no modern JS developer should ever need to create a blocking alert or prompt; the reason the native alert or prompt functions block is because, well, they are not designed for what the web is today.

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?

Re: Alertify.js

#48
post #8

Really nice smooth animation. It would be nice if the alerts appeared in the centre of the screen though... I find that jerking my eyes up to the top of the screen and then back down to what I was looking at quite intrusive.

Ideally you could specify an HTML element to place the notification near, and then pass whatever element the user activated to trigger the notification. Or you could specify target coordinates, and compute the desired location yourself. Both of those ought to use optional parameters, though; defaulting to center seems reasonable.

If you look on the demo page (http://fabien-d.github.com/alertify.js/), all of the alerts get injected into #alertifylogs.alertify-logs which is positioned by css and therefore should be easy to overwrite:

    .alertify-logs {
        position: fixed;
        z-index: 5000;
        bottom: 10px;
        right: 10px;
        width: 300px;
    }

Re: Alertify.js

#49
post #43

Earlier quoted context omitted.

IMHO, no modern JS developer should ever need to create a blocking alert or prompt; the reason the native alert or prompt functions block is because, well, they are not designed for what the web is today.

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?

Save it in drafts and notify them when they come back.

Re: Alertify.js

#50

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,…

I'm not going to down- or up-vote you. But wanting something to block a UI execution thread is...novel. Thousands of man-years have been spent creating non-blocking systems for the simple reason that it opens up a lot of options.

But I guess in some circumstances having a UI-updating callback called when a modal dialog is up might be a little confusing for the user. And setting (and checking!) a global everywhere is rather messy. So I see your pain.

Ha, one way I just thought of to get frozen behavior is to take a snapshot of the screen, then overlay a canvas element with that image. As an added bonus you can do some transform on the image to make the effect look more native. When the dialog box goes away, the canvas goes away, and your updated state is presented as if it just executed.

Post reply on HN