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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Scrub values in JavaScript live

128 点作者 nornagon超过 12 年前

9 条评论

spicyj超过 12 年前
Very cool. Just wanted to mention that we've had the same capability in the Khan Academy CS environment for a few months now:<p><a href="http://www.khanacademy.org/cs/gear/1178931559" rel="nofollow">http://www.khanacademy.org/cs/gear/1178931559</a><p>Read John Resig's blog post for more details: <a href="http://news.ycombinator.com/item?id=4382076" rel="nofollow">http://news.ycombinator.com/item?id=4382076</a>
评论 #4841855 未加载
pbiggar超过 12 年前
This is very impressive and cool. However I really don't think that parsing source code and manipulating is a very maintainable way to do this (and this as someone who writes Clojure for a living).<p>You could do exactly the same using very simple Knockout. It wouldn't be as funky, but it would be something you'd be happy to use in production.
评论 #4842174 未加载
评论 #4842173 未加载
评论 #4841558 未加载
enjalot超过 12 年前
Interesting implementation! I'm using CodeMirror tokens and regexs to make numbers scrubbable and hex colors pickable: <a href="http://tributary.io/tributary/2958568/" rel="nofollow">http://tributary.io/tributary/2958568/</a><p>I've been wanting to explore the route you took more, especially for doing even more code modification. I'd like to let users click on a number and turn it into a variable, or have a special object where members are added to the global table. You can then create controls external to the code with that table and hide the code (good for presenting after you're done coding). Looking forward to checking out your code!<p>my project: <a href="http://tributary.io" rel="nofollow">http://tributary.io</a>
egdelwonk超过 12 年前
I forked your code and implemented one of your todos: Added the ability to input values when double clicking a scrubber.<p><a href="https://github.com/nornagon/scrubby/pull/1/files" rel="nofollow">https://github.com/nornagon/scrubby/pull/1/files</a>
评论 #4845696 未加载
shakeel_mohamed超过 12 年前
Nice! Just a thought, values can go beyond the valid range. For example: dividing by zero, having negative values for RGB, and negative height/widths.
评论 #4841607 未加载
stuaxo超过 12 年前
Does anyone know if there is a similar editor component for Gtk, QT or Wx ?<p>EDIT: Ideally for python.
Skalman超过 12 年前
It doesn't work in Firefox 19.
评论 #4841578 未加载
mcrider超过 12 年前
What would be the use cases for this, other than education?
评论 #4841561 未加载
评论 #4842106 未加载
评论 #4842205 未加载
ashcairo超过 12 年前
Very clever.