ckeditor

CKEditor: Allow video embed code

匿名 (未验证) 提交于 2019-12-03 03:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using CKEditor and want to allow the insertion of embed code from YouTube, Vimeo etc. CKEditor turns all tags into HTML Chars equivalent, which is good, but I want it to make exceptions for this kind of content. iFrames seem to be how it's done nowadays, so how can I tell CKEditor to leave iFrame tags alone? Thank you. 回答1: Just found your question while searching for the same solution. Here is what I found. Basically, it adds a button to your toolbar like the Image button, but it pops up a box for you to paste the embed code from

How do I set a value in CKEditor with Javascript?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am wondering how I can set a value in CKEditor using Javascript? I have tried the following, but neither of them work... document .[ form name ].[ textarea name ]. value = data ; $ ( '#textareaID' ). val ( data ); However, both these work without the editor applied. Is there a way I can do this with the editor? 回答1: Use the CKEditor method setData() : CKEDITOR . instances [** fieldname **]. setData (** your data **) 回答2: The insertHtml() and insertText() methods will insert data into the editor window, adding to whatever is there

CKEditor Insert HTML

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a data from database. In my js file, I would like to change my CKEditor text editor's value. My value is raw html. I want this raw value to be written on an empty CKEditor text editor. I tried these but got an undefined function error all the time : CKEDITOR.instances.myEditorID.insertHtml( '<p>This is a new paragraph.</p>' ); CKEDITOR.instances.myEditorID.setData( '<p>This is the editor data.</p>' ); I tried this too but still undefined function error : CKEDITOR.instances.YOUREDITORID.updateElement(); alert( document.getElementById(

CKEditor displaying HTML tags in editor

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using a CKEditor and saving content to a MySQL database. When trying to edit the content again in the editor, I am getting HTML tags displayed as text, for example: my test<br />and second line How can I have it display in the editor correctly again? I have been fiddling with htmlentities and html_entity_decode and CKEditor related settings for over an hour now, with no avail. $config = array(); $config['enterMode'] = 2; $config['shiftEnterMode'] = 1; //$config['basicEntities'] = FALSE; //$config['entities'] = FALSE; //$config['entities

Get CKEditor content? - jQuery

こ雲淡風輕ζ 提交于 2019-12-03 02:49:07
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\',\'Indent\',\'Blockquote\'], \'/\', [\'Bold\',\'Italic\',\'Underline\',\'Strike\',\'-\'], [\'Styles\',\

django-ckeditor 使用

家住魔仙堡 提交于 2019-12-03 02:44:23
昨天在完成微信项目,想通过微信公众号发布通知。然而把通知粘贴到adminsite中后发现所有html标签都被转译了,一堆文字落在一起甚是难看。于是不得不好好使用富文本编辑器。 一、源 pip install django-ckeditor-updated https://github.com/django-ckeditor/django-ckeditor 二、配置方式 其实照着demo做就可以了,不过有几点需要注意的 (1)urls.py中不要忘记配置media路径 from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static urlpatterns = patterns('', # Examples: # url(r'^$', 'rickck.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^ckeditor/', include('ckeditor.urls')), url(r'^admin/', include(admin

我的网站搭建 (第六天) Ckeditor编辑器

不打扰是莪最后的温柔 提交于 2019-12-03 02:44:12
富文本编辑器,Rich Text Editor, 简称 RTE, 是一种可内嵌于浏览器,所见即所得的文本编辑器,这是百度百科的对富文本编辑器的解释。我们可以借助富文本编辑器,编辑出来一个包含html的页面,从而页面的显示效果,可以由网站管理员定义,而不用完全依赖于开发的人员。我之前使用的是一个叫tinymce的富文本编辑,它比较精简,功能不是很丰富。在使用了一段tinymce后,就转用了django-ckeditor,后来发现是真的好用,当然还有一个叫做Ueditor的编辑器,听说也还不错,但我这里就用ckeditor来布置了。 在这里,我会将步骤大致记录下来,但还是要推荐给大家一篇非常棒的关于ckeditor配置的文章,也是我之前参考学习的。 Django博客开发:添加富文本编辑器ckeditor ,网上大部分教程与此类似,但个人感觉都没有这篇写的详细,写的易懂。 安装环境 1.使用pip安装 django-ckeditor 和 pillow,pillow用于生成缩略图,用来在编辑器里浏览上传的图片 pip install django-ckeditor pip install pillow 2.在 project/settings.py 里进行如下设置: INSTALLED_APPS = [ 'ckeditor', 'ckeditor_uploader', ] MEDIA

CKEDITOR toolbar is not showing up fully

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting a weird behavior using CKEDITOR with Rails, I tried both of those gems : ckeditor gem and ckeditor_rails gem in different app I have (Rails v4.2.0 and with Rails v4.2.1 and Rails v4.2.2) I have a text with id="ck" <p contenteditable="true" id="ck">some dummy text</p> and I am using the inline editing option $(document).ready(function(){ CKEDITOR.disableAutoInline = true; CKEDITOR.inline("ck"); }); In my Rails 4.2.1 and 4.2.2 I noticed that the toolbar does not show all buttons, while it show all buttons (I mean full toolbar) for

CKEditor dialogs: referencing input fields by ID

匿名 (未验证) 提交于 2019-12-03 02:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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.setValueof('info','txtUrl',"http://google.com");

using CKEditor with jQuery validation plugin not working

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using CKeditor and the jQuery validation plugin from basistance. My textarea (with the CKEditor on it) is being validated by jQuery, but that only works after the second click on my submit button. In short: the first time I submit the form when data is entered in the CKEditor, it says "field is empty". The second time it says it's ok and the form is being submitted. I read a solution for this: "you could work around this problem by calling CKEDITOR.editor::updateElement right before every validation routine." I cannot find how