TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

100 点作者 js4all将近 14 年前

13 条评论

padolsey将近 14 年前
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 未加载
rgbrgb将近 14 年前
Similar interface <a href="http://thrivingkings.com/apprise/" rel="nofollow">http://thrivingkings.com/apprise/</a>
评论 #2748770 未加载
wulczer将近 14 年前
Looks useful, but why make smoke.confirm work differently from plain confirm? It uglifies the API for no gain, IMHO.
评论 #2747849 未加载
libria将近 14 年前
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_engel将近 14 年前
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 未加载
chime将近 14 年前
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
consultutah将近 14 年前
Doesn't work on ipad
评论 #2749639 未加载
beaumartinez将近 14 年前
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 未加载
taitems将近 14 年前
Show stopper for me is that it breaks the convention of disabling clicking with alerts and confirms.
feydr将近 14 年前
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-id将近 14 年前
It seems to be broken on an iPad.
chopsueyar将近 14 年前
I like the CSS stylings.
jsavimbi将近 14 年前
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 未加载