ckeditor

CKEDITOR, AutoFocus on the text editor onLoad

岁酱吖の 提交于 2020-01-01 02:44:14
问题 Anyone know how to autofocus on the CKEDITOR text area on page load? Currently the user has to click in the text area before they can start typing. Like Google, I'd like the page to load and the user can immediately start typing w/o having to click the text area. Here is the current code that initiated CKEDITOR <script type="text/javascript"> CKEDITOR.replace( 'meeting_notes', { toolbar : [ [ 'Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ], ['Cut',

Remove all CKEditor instances

我与影子孤独终老i 提交于 2020-01-01 01:25:24
问题 I have a form in which I have CKEditor replacing my <textarea> s (multiple). I want to remove all CKEditor instances from the page before submitting the form. How can I accomplish this? I've looked at Remove CKEdit Instance but it didn't help me at all. NOTE: All my CKEditors have a class "ckedit" 回答1: This will destroy all CKEDITOR instances on a page: for(name in CKEDITOR.instances) { CKEDITOR.instances[name].destroy(true); } 回答2: you can make use of .remove() of jquery, before submitting.

CKEditor富文本插件怎么用咧

浪子不回头ぞ 提交于 2019-12-31 15:21:41
这应该是2019最后一篇文章了,相较于去年来说写的东西少了一些,懈怠了。年末总得总结一下,尤其是最近工作中接触到内容愈发的复杂困难,当然收获学习到也很多。 首先是,刚刚完成一个富文本组件开发,涉及到插件使用,从了解背景到研究文档到逐步实施,最大感触是英文的重要性,光光是熟悉代码英文还不够,要有足够的能力阅读英文文档。 先来感受一哈冰山一角 ckeditor作为封装好的插件,直接下载配置部署即可。在官方文档中找到下载地址 官方推荐标准版本,解压缩到本地之后,进入文件夹打开samples中index.html,那么长代码中最关键的只有 <div id="editor"></div> 但还需要打开这个文档,因为这里有富文本配置按钮 进去之后的页面 手动选择需要的配置,或者调整顺序,修改完成之后点击右上角按钮生成相应的配置文档,复制到项目的config.js中。 认真看过文档之后会发现官方提供的code demo中,JS部分最关键的并不是下载来下的demo里面的initSample(),而是 CKEDITOR.replace( 'editor' ); 没错,这里的editor就是上面的div的id,调用类库的方法创建了一个富文本实例,那多写几个不同id的div,调用这个方法就可以生成多个富文本。 因为我开发的需求是3个tab切换不同文本输入,最后提交三个页面的输入内容到后端

How exactly DO you integrate ckeditor with Paperclip so it can upload image files?

你离开我真会死。 提交于 2019-12-31 09:05:36
问题 How do you get http://github.com/galetahub/rails-ckeditor working so you can upload image files? I don't think I'll use the s3 storage... any help would be appreciated. 回答1: Yes you can. I assume that you have paperclip already set up for S3. So you have only edit the picture.rb and attachement_file.rb in you model directory (app/model/ckeditor/) and replace these lines has_attached_file :data, :url => "/ckeditor_assets/attachments/:id/:filename", :path => ":rails_root/public/ckeditor_assets

How exactly DO you integrate ckeditor with Paperclip so it can upload image files?

╄→尐↘猪︶ㄣ 提交于 2019-12-31 09:04:12
问题 How do you get http://github.com/galetahub/rails-ckeditor working so you can upload image files? I don't think I'll use the s3 storage... any help would be appreciated. 回答1: Yes you can. I assume that you have paperclip already set up for S3. So you have only edit the picture.rb and attachement_file.rb in you model directory (app/model/ckeditor/) and replace these lines has_attached_file :data, :url => "/ckeditor_assets/attachments/:id/:filename", :path => ":rails_root/public/ckeditor_assets

Preventing CKEditor from removing classes assigned in source mode?

泪湿孤枕 提交于 2019-12-31 05:41:08
问题 I want to be able to add a class attribute to a UL in source mode of CKEditor. When I do that and switch back to the normal editor mode the <ul class="xxxx"> becomes <ul> How can I get it to not remove the class tag? 回答1: This happens because of Advanced Content Filter (ACF). You need to use extraAllowedContent like this: config.extraAllowedContent = 'ul(*)'; to allow any CSS class for ul element. You can be more specific and allow only certain CSS classes, like this: config

CKeditor rich text editor displaying html tags in browser

好久不见. 提交于 2019-12-31 05:22:19
问题 I've just installed CKeditor rich text WYSIWYG editor on a site I'm building and it seems to be working ok except for the fact that it inserts text into my mysql database as encoded html rather than regular html and then when the browser outputs this text it converts the encoded data into regular html that then displays in the browser showing the html tags and none of the styling!? eg I type: "This is text" into the editor and it then inserts <p>This is text</p> into the database. Then when

How do I allow the tabs of a bootstrap tab to work within the ckeditor editor?

我的未来我决定 提交于 2019-12-31 04:07:10
问题 Here is the challenge I'm struggling with. I have a user that wants to be able to tab through the different tabs with bootstrap tabs that are in a single ckeditor instance. I understand the reasons why links are disabled for most a tags, but would like to allow the event to occur for just these tab links. I've attached a screenshot showing the editor with a bootstrap tab region in the content. Basically, if the user hits "Facilities", "Products", "Partners" or "Sustainability" I would like

CKEditor dialogs: referencing input fields by ID

天大地大妈咪最大 提交于 2019-12-31 03:55:09
问题 Each input field in the CKEditor dialogs are renamed with a unique number, but the number changes depending on what options are visible. I need to reference 'txtUrl' which has an id something like #35_textInput. So far I have discovered that something like this should work: alert(CKEDITOR.instances.myElement.document.$.body.getId('txtUrl')); But it doesn't. Please help. 回答1: @Rio, your solution was really close! This was the final solution: var dialog = CKEDITOR.dialog.getCurrent(); dialog

CKEditor classes being stripped

主宰稳场 提交于 2019-12-31 03:43:46
问题 I have a custom plugin that adds a link with a class attached. When I view this using the Source button it shows the class and looks as it should. However, when I go back to WYSYWIG view and then view the source again the class has been stripped out. Any idea how to stop this happening? Thanks in advance for your help. 回答1: Check this blog post. In CKEditor 4.1 RC we've introduced ACF - Advanced Content Filter. You need to integrate your plugin with it, because otherwise special content