TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Smoke.js - A framework-agnostic styled alert/confirm system for javascript

100 pointsby js4allalmost 14 years ago

13 comments

padolseyalmost 14 years ago
I like its simplicity.<p>But, I thought this was dead:<p><pre><code> onClick="javascript:smoke.alert('this is a normal alert');" </code></pre> ... apparently, not.<p>The 'javascript:' (attempted psuedo protocol), is just acting as a pointless label here.<p>I also thought we said goodbye to obtrusive JS altogether.<p>Also, the API isn't great. There's no instance to work with... It doesn't work in IE7 (probably because it doesn't cater for non-W3C events APIs). The source is littered with getElementById calls, and non configurable HTML IDs and classes. And it uses the window's 'load' event to initiate itself, when there's absolutely no need to. There's also 'smoketimeout' polluting the global scope when it could just be a property of the 'smoke' object itself.
评论 #2747924 未加载
评论 #2748129 未加载
rgbrgbalmost 14 years ago
Similar interface <a href="http://thrivingkings.com/apprise/" rel="nofollow">http://thrivingkings.com/apprise/</a>
评论 #2748770 未加载
wulczeralmost 14 years ago
Looks useful, but why make smoke.confirm work differently from plain confirm? It uglifies the API for no gain, IMHO.
评论 #2747849 未加载
libriaalmost 14 years ago
I feel like the alert and confirm modals should not be allowed to be dismissed by clicking outside. Especially confirm: "Destroy all. Yes, No?" -&#62; click outside...nothing.
评论 #2748113 未加载
chris_engelalmost 14 years ago
I wouldn't use it, because it doesn't use the main hotkeys for user interaction on the alert box (enter, space) or the confirm box (enter, space, escape).<p>I also would have liked it better, if the default functions of alert and confirm would have been overwritten, instead of recreated into an object. Overwriting the existent functions would have been made it a snap to integrate smoke.js into existing projects.
评论 #2748722 未加载
chimealmost 14 years ago
I wish it also did prompt(). That would save a lot of work when you just want to input one field or want to let users copy-paste a URL to the page.<p>Edit: rgbrgb posted <a href="http://news.ycombinator.com/item?id=2748038" rel="nofollow">http://news.ycombinator.com/item?id=2748038</a> about Apprise. It does what smoke.js does and then some. Thanks
consultutahalmost 14 years ago
Doesn't work on ipad
评论 #2749639 未加载
beaumartinezalmost 14 years ago
Fly.<p>On the usability tip, why don't you allow making the dialog appear near the user's mouse? Having to move it from the link (or wherever the user's mouse is at the time) to the action buttons is unnecessary.
评论 #2749110 未加载
taitemsalmost 14 years ago
Show stopper for me is that it breaks the convention of disabling clicking with alerts and confirms.
feydralmost 14 years ago
want to get the gold star? make it to where I can have a styled confirmation box when onbeforeunload gets fired and make it have cross-browser support
dav-idalmost 14 years ago
It seems to be broken on an iPad.
chopsueyaralmost 14 years ago
I like the CSS stylings.
jsavimbialmost 14 years ago
Sorry, but this is the latest entry in obsolete and obtrusive functionality. It's useless for mobile (just tested iOS Safari and Opera), which is the platform you should start with, and it's been proven out to be an annoying hindrance to the user on the desktop.<p>Don't interrupt CRUD. If you can't trust the user to not perform an irreversible action, then you're doing it wrong.
评论 #2750277 未加载