ckeditor

CKEditor issue with Bootstrap modal

☆樱花仙子☆ 提交于 2019-12-01 20:31:38
I am having the same issue as pointed on How to use CKEditor in a Bootstrap Modal? The problem however is that the fix doesnt seem to work any more. <button type="button" data-toggle="modal" data-target="#modalAddBrand">Launch modal</button> <div class="modal fade" id="modalAddBrand" tabindex="-1" role="dialog" aria-labelledby="modalAddBrandLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="modalAddBrandLabel">add<

CKEditor: set cursor/caret positon

这一生的挚爱 提交于 2019-12-01 20:20:43
How can I position the caret in CKEditor3.x? I have 2 positions and I want use insertHTML() on both positions. Pseudo-code: editor.setCaret(20); // function does not exists editor.insertHtml('::'); editor.setCaret(40); // function does not exists editor.insertHtml('::'); I have tried (to set caret to position: 20): var ranges = []; var range = new CKEDITOR.dom.range( this.document ); range.startOffset = 20; range.endOffset = 20; ranges.push( range ); editor.getSelection().selectRanges( ranges ); This is not working. Can anybody help me please? To insert text or do something with html in the

How to force CKEditor to preserve <br> tags

*爱你&永不变心* 提交于 2019-12-01 19:23:36
I am using the latest version of CKEditor (4.7 to date) with the standard package, and I want to be able to force it to preserve line break elements ( <br> ). I have attempted to use the following config, without success: CKEDITOR.replace('ck', { allowedContent: true, enterMode: CKEDITOR.ENTER_BR }); As you can see in this jsfiddle , when you open Source mode, <br> tags have been replaced with a   . How do you achieve that? A workaround (or at least partial workaround) was given on this CKEditor ticket , which forces the CKEditor to preserve <br> tags: editor.on( 'pluginsLoaded', function( evt

CKEditor粘贴图片上传功能

狂风中的少年 提交于 2019-12-01 19:14:04
很多时候我们用一些管理系统的时候,发布新闻、公告等文字类信息时,希望能很快的将word里面的内容直接粘贴到富文本编辑器里面,然后发布出来。减少排版复杂的工作量。 下面是借用百度doc 来快速实现这个word 粘贴到 富文本编辑器里面 方法一: 工具/原料 百度doc 任意富文本编辑器,以UEDdito为例 方法/步骤 登录,http://word.baidu.com 点击右上角 导入文档,如图所示 导入后,系统会自动将word的内容加载进去。此时 点击右上角编辑,Ctrl+A复制所有内容 打开UEditor,Ctrl+V 粘贴,搞定~ 注意事项 建议使用Chrome浏览器操作 方法二: 分享一个更为强大的控件,详细内容可参考我写的这篇文章: http://blog.ncmem.com/wordpress/2019/10/19/ckeditor%e7%b2%98%e8%b4%b4%e5%9b%be%e7%89%87%e4%b8%8a%e4%bc%a0%e5%8a%9f%e8%83%bd/ 来源: https://www.cnblogs.com/songsu/p/11713855.html

How to get ckeditor resources to compile and load in Rails 3.1 asset pipeline

纵饮孤独 提交于 2019-12-01 18:18:17
I'm trying to use CKEditor in a Rails 3.1 app. I have the ckeditor directory in app/assets/javascripts/ckeditor/, with extraneous stuff like the uncompressed and modularized source removed. It works fine in development. In production or staging environments, ckeditor can't find it's own files: config.js, lang/en.js skins/kama/editor.css. I can see that these files are not being precompiled, which makes sense since the asset pipeline by default won't include or precompile anything that matches /.css/ or /.js/. According to the rails docs and previous answers like this one , adding the files I

在Django项目中使用富文本编辑器

丶灬走出姿态 提交于 2019-12-01 18:16:33
1 开发要点 现在网上有很多的富文本编辑器,包括Markdown、tinymce、UEditor、KindEditor、ckeditor等等。在项目中使用这些编辑器主要有以下几个问题: 编辑页面 在HTML页面渲染编辑器; 定制编辑器的功能,比如有哪些文本样式、图片上传、代码插入; 定制编辑器的样式,指的是编辑器整体的样式,比如高度、宽度、显示位置等等; 预览内容; 获取内容; 显示页面 显示内容; 2 Django APP 下表列出一些常用的APP,它们都可以在GitHub上找的到,链接见下文。 APP django-ckeditor django-tinymce django-markdown-denx django-wmd-editor 编辑器 ckeditor tinymce markdown markdown models.Field fields.RichTextField HTMLField N models.MarkDownField forms.Field fields.RichTextFormField N N N widget widgets.CKEditorWiget wigets.TinyMEC widgets.AdminTinyMEC N widgets.MarkDownInput wigets.AdminMarkDownInput

CKEditor and escaping elements

妖精的绣舞 提交于 2019-12-01 18:09:48
I've using CKEditor for updating CMS content on my website. I also using FontAwesome, which includes set of fancy icons, that can be displayed like this <i class="icon-envelope"></i> The problem is that CKEditor escapes this i tag on client side, and I can't see it in source mode. How I can allow this tag? I have tried CONFIG.removeFormatTags = '' , but it dies not help. It is removed because it is empty. Put some non-breaking space   or zero-width space ​ within it to preserve your tag. You can also remove i from CKEDITOR.dtd.$removeEmpty object. This may, however, break other empty <i> tags

How change the CKEditor text using jQuery?

痴心易碎 提交于 2019-12-01 18:01:35
I have a textarea with CKEditor (bbCode Plugin). <textarea id="editor1" name="conteudo" class="form-control" rows="3" required></textarea> This is my CKEditor instance: $( document ).ready( function() { $( 'textarea#editor1' ).ckeditor(); } ); I'm making a JSON request that takes a value and I want this value to be modified in this textarea , I tried with jQuery but not worked ! Below is my attempt: video_id = "lLi1Lx2xTKI"; $.getJSON('http://gdata.youtube.com/feeds/api/videos/'+video_id+'?v=2&alt=jsonc',function(data,status,xhr){ description = data.data.description; // Attempt here $("

How to add a custom paragraph format in CKEditor

大兔子大兔子 提交于 2019-12-01 17:29:32
In my project I have a requirement to remove the paragraph format like "Address" and "Formatted" from the drop down and to add a new custom format called "Links" which would be Arial, 14px, bold, red. Is it possible to add custom paragraph format in CKEditor? Use CKEDITOR.config.formatTags to specify some new formatting: CKEDITOR.replace( 'editor1', { format_tags: 'p;h2;h3;pre;links', // entries is displayed in "Paragraph format" format_links: { name: 'Links', element: 'span', styles: { color: 'red', 'font-family': 'arial', 'font-weight': 'bold' } } } ); To know more about styles see how

CKEditor and escaping elements

北慕城南 提交于 2019-12-01 17:16:45
问题 I've using CKEditor for updating CMS content on my website. I also using FontAwesome, which includes set of fancy icons, that can be displayed like this <i class="icon-envelope"></i> The problem is that CKEditor escapes this i tag on client side, and I can't see it in source mode. How I can allow this tag? I have tried CONFIG.removeFormatTags = '' , but it dies not help. 回答1: It is removed because it is empty. Put some non-breaking space   or zero-width space ​ within it to preserve your tag.