Rails 或 Jquery 所见即所得

发布于 2024-08-01 15:16:09 字数 310 浏览 2 评论 0原文

我几乎只是在寻找他们在添加评论时使用的与所见即所得非常相似的代码。 我希望他们能够按回车键并自动抛出
标记。 如果他们知道 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

瑾夏年华 2024-08-08 15:16:09

我使用过 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/

您的好友蓝忘机已上羡 2024-08-08 15:16:09

我不确定我是否完全理解你的问题,但你可以看看 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.

有木有妳兜一样 2024-08-08 15:16:09

尝试结合使用 RecClothTEH。 要让它在输入时显示在文本区域下方,请查看 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文