Rails 或 Jquery 所见即所得
我几乎只是在寻找他们在添加评论时使用的与所见即所得非常相似的代码。 我希望他们能够按回车键并自动抛出
标记。 如果他们知道 HTML 标签,我知道让它在文本区域中工作的非常简单的方法,但几乎没有用户会。 所以我只想要一些按钮,如粗体、斜体和链接,并让它在返回时自动执行
操作。 没什么真正花哨的。
它可以是 jquery 或 Rails 解决方案,因为我正在使用两者。 感谢您的任何线索/帮助。 我简单地研究了一些类似 TinyMCE 的工具,但它们所做的事情比我希望用户能够做的要多得多。
I'm pretty much just looking for the code they used that is very similar this this WYSIWYG when adding a comment. I want them to be able to hit return and it automatically throws in a <br />
tag. I know very simple way to get it to work in a text area if they know the HTML tags, but almost no users will. So I just want a few buttons like bold, italic, and link and have it automatically do <br />
's on return. Nothing real fancy.
It can be either a jquery or a rails solution as I am using both. Thanks for any leads/help. I looked briefly into some like TinyMCE, but those do a lot more than I want users to be able to do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用过 fckeditor,相当容易运行:
http://www.fckeditor.net/
但是我的下一个应用程序将考虑雅虎富文本编辑器:
http://developer.yahoo.com/yui /编辑器/
I've used fckeditor, fairly easy to get running:
http://www.fckeditor.net/
but will consider the Yahoo rich text editor for my next app:
http://developer.yahoo.com/yui/editor/
我不确定我是否完全理解你的问题,但你可以看看 wysihat。 我以前没有使用过它,但对于一些基本的“富文本”格式来说,它看起来确实很有前途。
或者,您可以使用 Markdown 来格式化用户输入的副本。 有很多库可以解析 Markdown,我通常使用 RDiscount。
希望这可以帮助。 干杯。
I'm not sure if I completely understand your question, but you could have a look at wysihat. I haven't used it before, but it does look promising for some basic 'rich text' formatting.
Or, you could use Markdown to format the copy that the user inputted. There are a bunch of libraries that will parse Markdown, I typically use RDiscount.
Hope this helps. Cheers.
尝试结合使用 RecCloth 和 TEH。 要让它在输入时显示在文本区域下方,请查看 observe_field< /a>.
Try a combo of RecCloth and TEH. To have it show up under the text area as they type look into observe_field.