ckeditor

Get CKEditor content? - jQuery

霸气de小男生 提交于 2019-12-03 12:23:55
问题 My CKEditor code is window.onload = function() { var editor = CKEDITOR.replace( \'big_info\' ); CKEDITOR.config.height = \'330px\'; CKEDITOR.config.toolbar_Full = [ [\'Source\',\'-\',\'Templates\'], [\'Maximize\', \'ShowBlocks\'], [\'Cut\',\'Copy\',\'Paste\',\'PasteText\',\'PasteFromWord\',\'-\',\'SpellChecker\', \'Scayt\'], [\'Undo\',\'Redo\',\'-\',\'Find\',\'Replace\',\'-\',\'SelectAll\',\'RemoveFormat\'], [\'TextColor\',\'BGColor\'], [\'NumberedList\',\'BulletedList\',\'-\',\'Outdent\',\

How to prevent CKEditor replacing spaces with  ?

烂漫一生 提交于 2019-12-03 12:20:15
I'm facing an issue with CKEditor 4 , I need to have an output without any html entity so I added config.entities = false; in my config, but some   appear when an inline tag is inserted: the space before is replaced with   text is pasted: every space is replaced with   even with config.forcePasteAsPlainText = true; You can check that on any demo by typing test test eg. Do you know how I can prevent this behaviour? Thanks! Reinmar These entities: // Base HTML entities. var htmlbase = 'nbsp,gt,lt,amp'; Are an exception. To get rid of them you can set basicEntities: false . But as docs mention

How to detect CKEditor source mode on change event

偶尔善良 提交于 2019-12-03 12:09:52
In CKEditor, I know that in the "normal mode", we can detect any content change using the following code: ckeditor.on('change',function(e){ console.log("ckeditor on change"); }); But if I switch over to the source mode, the event does not fire. How can I detect the on change event for source view? Instead of using "change" event, the "key" event does fire on the source view. Thanks for Kicker's hint The CKEditor 4 documentation tells that the change event won't be fired in source mode. The example from the documentation worked for me. It binds a listener to the mode event. That's fired when

How to disable CKeditor with jQuery

别等时光非礼了梦想. 提交于 2019-12-03 12:04:12
问题 I am using CKEditor in my web application and need to disable/enable the editor from javascript. I know that there is an option called readOnly but I don't know how to set it from jQuery. Does anybody know how to disable and enable back the CKEditor using jQuery please? 回答1: The easiest way: To disable CKEditor: CKEDITOR.instances['TEXTAREA_NAME'].setReadOnly(true); To enable CKEditor: CKEDITOR.instances['TEXTAREA_NAME'].setReadOnly(false); 回答2: I am using it in codeigniter. In the view file

django-ckeditor to Django admin

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've installed django-ckeditor on django 1.5 as instructed in the docs . I've changed TextField in my applications models.py to RichTextField as said in the docs. However I still see blank textarea in the Django admin instead of the ckeditor. This question was asked 3 years ago and none of the answers worked for me. The ckeditor.js loads just fine when I get the page. Any suggestions? my app name is newsfeed. models.py: from cms.models.pluginmodel import CMSPlugin from cms.models import Page from django.db import models from time import time

新闻管理功能

萝らか妹 提交于 2019-12-03 09:27:16
一、业务功能分析   1.业务需求分析     新闻的增删改查   2.功能分析     新闻列表     查询      新增     修改 二、接口设计   1.接口说明:   类目        说明   请求方法      GET   url定义       /admin/newses/   参数格式      查询参数   2.参数说明:   参数名      类型        是否必须      描述   title       字符串        否        要查询的新闻标题   tag        整数         否        要查询的tag_id   is_delete     整数         否        新闻是否可用   3.返回数据    html 三、新闻详情页   1.业务流程分析   根据提供的新闻id,返回新闻的详细,渲染新闻页面。   这里新闻编写部分,我们引入富文本编辑器,所以、引入django-ckeditor插件   2.django-ckeditor     1.介绍     django-ckeditor是一个集成了富文本编辑器ckeditor的插件,利用它可以在django项目中     快速集成富文本编辑器的相关功能。 安装命令: pip install django-ckedito   

How to customize CK-Editor's tools menu?

浪子不回头ぞ 提交于 2019-12-03 08:49:56
I would like to change tool menu optons on ck-editor. for example I remove some of them that I dont need to use. How can I do that ? There's a configuration setting that allows you to set which buttons will appear. You just create your own toolbar layout. I've included the default full toolbar code, you can remove the buttons that you don't want to appear. It's best to copy the default config.js file and rename it, then call your custom config file and the custom toolbar when you load the editor: CKEDITOR.replace( 'xxx_textarea_id_xxx', { customConfig : 'xxx_name_of_custom_config_file_xxx.js',

CkEditor - Template loaded from AJAX

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using CkEditor and would like to define a custom template, that uses an AJAX function to load a HTML string. I have been able to define custom templates, but if I use a function for the html property of the template object the function is never exectuted. Is it possible to load a template using AJAX with the default template plugin or do I need to write my own? config.js CKEDITOR.editorConfig = function (config) { config.templates_files = ['/pathtomyfile/custom.js']; }; custom.js (defining my custom templates) CKEDITOR.addTemplates(

Ckeditor Link with basepath

匿名 (未验证) 提交于 2019-12-03 08:42:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Im using CKeditor however i test it on a staging environment. Then i move it to production. The problem is when im linking i dont want to use mysite.com because then it will only work on staging or production but not on both. Instead i would like to use my basepath php variable which will auto determine to use mysite.com/ or staging.mysite.com Is there any way to do this with the CKeditor URL link option. I have tried setting it to: /myfolder/mypage.php Using the other protocol, however it sets the URL as http///myfolder/mypage.php Is this

CKEditor add CSS styling to Preview and Editor

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to add CSS to style the Editor text as well as the Preview? The CMS has a different set of CSS files from the public part of the website and I want the editor to try (at least) and reflect the way it would look in the site. For example, all tags with a class of .floatLeft{float:left;margin:0 10px 10px 0;} I want to look the same in the Editor. Thank you. 回答1: Setup CKEDITOR.config.contentsCss variable. CKEDITOR.config.bodyClass and CKEDITOR.config.bodyId could help too. These are only options you have (i think). 回答2: To be