ckeditor

CKEditor key event not updating text properly

南笙酒味 提交于 2020-01-02 07:19:21
问题 I have the following code to automatically update the content inside a div when the user types it inside a CKEditor textarea: CKEDITOR.instances.editor.on("key", function(e) { var preview = document.getElementById('some-div'); preview.innerHTML = CKEDITOR.instances.editor.getData(); }); The problem is that if I type in "Hello world", in the div it appears "Hello worl" and the "d" doesn't appear until another key is pressed. And I would want the same content in both places. Thanks in advance!

ckeditor removes <br/> when br is in allowed content

安稳与你 提交于 2020-01-02 06:51:44
问题 When I add br to ckeditor allowed content and adding <br> tag it is being changed into <br /> But when I add <br/> it is being removed. Why is it being removed when br is in allowed content? Any suggestions? 回答1: There are some bits missing from your post, not sure why, or what you were trying to say. If what you were saying is that you wanted to add, say, clear="all" to your <br /> tags, you can use this to update your allowed content: config.AllowedContent = "br[clear]"; Separate individual

CKEditor ReadOnly

女生的网名这么多〃 提交于 2020-01-02 05:56:30
问题 I got a problem since I use the CKEditor (http://ckeditor.com/). The problem is that I can't find a way to make the editor ReadOnly and I can't just use a textarea since I want to keep consistency. I've already seen lots og questions like this at StackOwerflow, but none of them work or are too old. My code so far is only to display/initialize the editor: $(document).ready(function(){ CKEDITOR.replace( 'ckeditor', { on: { // Check for availability of corresponding plugins. pluginsLoaded:

CKEditor: Apply removeFormat on paste

只愿长相守 提交于 2020-01-02 02:04:06
问题 I have successfully managed to set up an on paste event to capture the HTML pasted into the text area as it is pasted. I need to automatically apply the removeFormat command to that HTML before or at the time it is pasted into the text area, so that I can strip it of classes, various tags, and other attributes. Could somebody point me in the right direction to apply the removeFormat command correctly? Here's my code so far: $(function(){ $('textarea').ckeditor( function( textarea ){ var

How to add additional menu item in right click in CkEditor?

风格不统一 提交于 2020-01-01 18:59:30
问题 In CKeditor, when we right click on image, there are four menu items that appear. cut copy paste image properties I would like to add two more menu items, test1 test2 -> subtest2 subtest3 test1 will be one menu and test2 will have two sub menus. Also, how can I add action to this new menu item? For example, click on test1 should draw a border on right side. clicking on subtest2 will add image shadow and so on. In addition to this. I would like to do similar when we right-click on div and

CKEditor - remove script tag with data processor

这一生的挚爱 提交于 2020-01-01 14:20:10
问题 I am quite new with CKEditor (starting to use it 2 days ago) and I am still fighting with some configuration like removing the tag from editor. So for example, if a user type in source mode the following: <script type="text/javascript">alert('hello');</script> I would like to remove it. Looking the documentation, I found that this can be done using an HTML filter. I so defined it but it does not work. var editor = ev.editor; var dataProcessor = editor.dataProcessor; var htmlFilter =

How can I highlight elements that match a regex in CKeditor?

╄→гoц情女王★ 提交于 2020-01-01 08:36:09
问题 I want to be able to highlight (i.e. wrap in a span with a color, or some other way) all text that matches a regex in CKEditor. I'd probably add a button to do this, and a button to remove highlighting. My specific use case is to highlight all mustache variables in my HTML templates (make it really easy to see where there are mustache variables). I've implemented a version where I replace a regex matching mustaches with a span and then the capture group. This appears to break on some

Specifying a custom configuration file for CKEditor

元气小坏坏 提交于 2020-01-01 05:30:39
问题 I am trying to add the CKEditor to a page I am currently developing but am having problems getting it to pick up my custom configuration file? I am using CKEditor in Visual Studio.NET 2008. I need to customize the toolbars that are displayed, as Basic is too minimal and Full would give an overwhelming amount of buttons to the user. I am declaring the editor in the aspx page as follows: <script type="text/javascript"> CKEDITOR.replace(document.getElementById("<%= txtTourItinerary.ClientID %>")

ckeditor add event handler to dialog element

末鹿安然 提交于 2020-01-01 05:25:06
问题 I'm writing a custom dialog/plugin for ckeditor . What I want to know is how I can add an eventlistener to a select box in the dialog, to alert when the selected value has been changed. How can I do this? I've looked at the API and I've come across some useful information but it is not detailed enough. I can't make a connection between the API information and what I am trying to implement. 回答1: The select elements in the dialogs automatically fire a change event when they are changed. You can

Does anyone know of a spell checker plugin for ckeditor that uses aspell or a similar local service instead of spellchecker.net? [closed]

↘锁芯ラ 提交于 2020-01-01 04:52:08
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . We are using CkEditor on our CMS product and does not want to use the built in spell checker from spellchecker.net. Does anyone know