JavaScript 哪个富文本编辑器好一些?

chinacheng · April 04, 2012 · Last by chinacheng replied at April 19, 2015 · 22528 hits

如题,我想找一个富文本编辑器,FCKedit 太庞大,虽然可以设置,但是不想搞那么多的代码到自己的项目中,网上也找了好几个简约的富文本编辑器,不知道那一个更好一些,希望大家推荐一下。希望简约一点,能实现图文并茂排版最好,谢谢各位

看又有人在这里说话了,补充一下: 现在我们都改用百度的那个富文本编辑器了,其后台生成 html 代码简介,对 word 文档的数据格式支持也很好

kindeditor 国产,兼容 ie6

kindeditor +1 最大好处,兼容万恶的 IE6!

https://github.com/Macrow/rails_kindeditor

#1 楼 @ywencn 在 ITEYE 也见到你的跟帖。。

#3 楼 @ruby_sky 您也推荐一个呗!

#1 楼 @ywencn 谢谢啊,研究一下

#4 楼 @chinacheng https://www.ruby-toolbox.com 搜索 editor 我这里被墙了,你懂的。

ckeditor 这玩意整死人啊

#2 楼 @Macrow 在 rails 里怎么把 kindeditor 设置成英文版?

#8 楼 @boardsky 加入语言参数即可: :langType => 'en'

#form_tag:
<%= kindeditor_tag :content, 'default content value',  :langType => 'en' %>

#form_for:
<%= form_for @article do |f| -%>
  <%= f.kindeditor :content, :langType => 'en' %>
<% end -%>

#simple_form:
<%= form.input :content, :as => :kindeditor, :input_html => { :langType => 'en' } %>

kindeditor + 1,好用

在自己的项目中试了一下百度编辑器,也还不错,提供的功能挺全

@Macrow 谢谢啦,配置起来比 ckeditor 好配置多了。

Unknow user #13 June 17, 2012

#9 楼 @Macrow 能不能配置成简约模式,做评论框用

#13 楼 @sharp 可以直接使用 kindeditor 自身的参数,配置 items 参数就可以了,具体可以看看http://www.kindsoft.net/docs/option.html 里面关于 items 的参数。

比如加载官方的 simple 模式:

<%= f.kindeditor :content, :items => ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'] %>

@sharp 如果是我们程序员用的,建议 ace : https://github.com/ajaxorg/ace 这是一个基于 web 的,高性能的,甚至兼容 VIM, EMACS,TextMate(有 API 可选). 对常用的语言具备高亮。使用也超简单。我不多说了,直接看给的链接吧。

Unknow user #16 June 19, 2012

谢谢两位

#14 楼 @Macrow 准备这么用

#15 楼 @lyfi2003 Ace 太强大了

为什么我上传图片 undefined method `collection_name=' for Kindeditor::Asset:Class 出这个错误,我没看到他有 kindeditor_assets 这个 controller

#17 楼 @sanivbyfish 你看准了,collection 这个单词跟 controller 不一样啊,哈哈。我估计你是缺少 Kindeditor::Asset 这个 model 类吧,rails generate rails_kindeditor:install执行这个命令,会生成以 kindeditor 为命名空间的几个 model

#18 楼 @chinacheng 执行了,他生成 model 了,但是还是报错

#19 楼 @sanivbyfish 应该换成其他错误了吧?

#20 楼 @chinacheng undefined method `collection_name=' for Kindeditor::Asset:Class 就这个错误,我要是不用存数据库,那么就不会有错。。囧

#21 楼 @sanivbyfish 你好好看看他那文档https://github.com/Macrow/rails_kindeditor ,上面写的很详细。我怀疑你是没有建立数据库表吧,另外你用的是 mysql 数据库么?可是我怀疑来怀疑去,都不如你自己把堆栈错误 google 一下

#22 楼 @chinacheng 看过了,他的文档就那么一点,也 google 了,我使用 mongodb 的,用的 mongoid 的 gem,按照他的方式生成了,现在不存数据库了,,反正就学习来说影响不大

@Macrow 下面是我在你的 github 上提的 issue @sanivbyfish 我和你的问题应该类似吧!

I'm working on rails(3.2.6), mongoid(3.0.5), carrierwave(0.6.2), carrierwave-mongoid(0.1.0). I followed your guidance after install rails_kineditor, when I start service using thin(1.4.1), the following error MSGs appears: undefined method 'collection_name=' for Kindeditor::Asset:Class. Then I check there are several model include Kindeditor::Asset in my apps, Why would I see such MSG? Thx!

#21 楼 @sanivbyfish #22 楼 @chinacheng #24 楼 @xranthoar

不好意思,之前没有对 mongodb 数据库存储做充分测试,而且 mongoid 的 api 好像有些更新,我已经对 rails_kindeditor 代码做了更新,经测试,已经修正了错误。

https://github.com/Macrow/rails_kindeditor/issues/13

#25 楼 @Macrow 请问,为什么上传文件的控制器没有呢?

Started POST "/kindeditor/upload?dir=image" for 127.0.0.1 at 2013-02-04 10:45:52 +0800
Processing by Web::ApplicationController#render_not_found as */*
  Parameters: {"Filename"=>"image-1.jpg", "imgFile"=>#<ActionDispatch::Http::UploadedFile:0xc08742c @original_filename="image-1.jpg", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"imgFile\"; filename=\"image-1.jpg\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#<File:/tmp/RackMultipart20130204-4078-1x5t406>>, "Upload"=>"Submit Query", "dir"=>"image", "path"=>"kindeditor/upload"}
28 Floor has deleted

#14 楼 @Macrow :tiem => [xxxxxxxx], 先 mark 一下,嘿嘿

#11 楼 @fresh_fish 百度编辑器服务器端语言可以支持 ruby 么?我看了一下不支持,可以进行移植么?

@Macrow Hello, 这个 gem 支持 active_admin 吗

#30 楼 @lizanle ueedit 支持 ruby,有 gem 包可用

33 Floor has deleted
You need to Sign in before reply, if you don't have an account, please Sign up first.