ckeditor

How to apply ckeditor css to output

为君一笑 提交于 2019-12-17 21:09:00
问题 Ck-editor works itself good, after i save editet text from ckeditor to database, and then i load it to page. Generated html is unformated, is there any aditional ckeditor js functions that have to be applied to target area, or is there any detault class needed to be added to text container ? I checked ck-editor css files but there is no specific class, like when you check "contents.css" in ckeditor files and there is "img.left{border: 1px solid #ccc; .." thats pretty creepy since there is no

How to find and replace text in CKEditor using Javascript?

房东的猫 提交于 2019-12-17 19:47:41
问题 How could I find and replace text in CKEditor using Javascript? Thanks for your suggestion! 回答1: try this editor = CKEDITOR.instances.fck; //fck is just my instance name you will need to replace that with yours var edata = editor.getData(); var replaced_text = edata.replace("idontwant", "iwant this instead"); // you could also use a regex in the replace editor.setData(replaced_text); you may want to put that in a blur event or soemthing 来源: https://stackoverflow.com/questions/5635118/how-to

CKEditor is escaping html elements

帅比萌擦擦* 提交于 2019-12-17 19:32:31
问题 I am using CKEditor to insert text into a MySQL database. I have noticed that my installed CKEditor is escaping all HTML elements when the data reaches the database. Therefore the following is what I am getting in the database after I have inserted the text with CKEditor: '&' (ampersand) becomes '&' '"' (double quote) becomes '" "'" (single quote) becomes '' '<' (less than) becomes '<' '>' (greater than) becomes '>' I would rather disable the CKEditor HTML escaping completely, and rely on my

CKEditor 5 – get editor instances

丶灬走出姿态 提交于 2019-12-17 16:53:17
问题 I am migrating from CKEditor 4.7 to 5. In CKE4, I would do something like this: CKEDITOR.replace('text_area'); and then in another JS function I could get the data by CKEDITOR.instances.text_area.getData() . But it doesn't appear that CKE5 has a function ClassicEditor.instances or something analogous. I know I can store the editor instance as a global JS variable, but the code I am working with creates the editors in a general function, so I can't just create a global variable since I don't

CKEditor 5 – get editor instances

£可爱£侵袭症+ 提交于 2019-12-17 16:53:01
问题 I am migrating from CKEditor 4.7 to 5. In CKE4, I would do something like this: CKEDITOR.replace('text_area'); and then in another JS function I could get the data by CKEDITOR.instances.text_area.getData() . But it doesn't appear that CKE5 has a function ClassicEditor.instances or something analogous. I know I can store the editor instance as a global JS variable, but the code I am working with creates the editors in a general function, so I can't just create a global variable since I don't

CKEDITOR, Image Upload (filebrowserUploadUrl)

∥☆過路亽.° 提交于 2019-12-17 15:27:08
问题 I'm using CKEDITOR and would like to be able to allow users to upload and embed images in the Text Editor... The following JS is what loads the CKEDITOR: CKEDITOR.replace( 'meeting_notes', { startupFocus : true, toolbar : [ ['ajaxsave'], ['Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ], ['Cut','Copy','Paste','PasteText'], ['Undo','Redo','-','RemoveFormat'], ['TextColor','BGColor'], ['Maximize', 'Image'] ], filebrowserUploadUrl : '/notes/add/ajax

CKEditor: Class or ID for editor body

十年热恋 提交于 2019-12-17 12:47:11
问题 I have an instance of CKEditor on a page. I am trying to give the CKEditor's body a class or ID so it matches some styles I have defined in a stylesheet. There is a API documentation that should give access to the respective DOM elements, but I can't seem to get it working. All objects I try to query that way turn out undefined. Does anybody know how to do this, or how to properly address CKEditor's dom elements? Edit : Thanks folks, nemisj's answer did it for me but for some reason, I don't

Getting selected text with CKEditor Plugin on IE

送分小仙女□ 提交于 2019-12-17 10:42:25
问题 I have made a plugin for CKEditor, but it relies on the currently selected text. In FF and Chrome I can use: var selectedText = editor.getSelection().getNative(); but this doesn't work in IE and I only get [object Object] Any suggestions? 回答1: This is what I use: var mySelection = editor.getSelection(); if (CKEDITOR.env.ie) { mySelection.unlock(true); selectedText = mySelection.getNative().createRange().text; } else { selectedText = mySelection.getNative(); } 回答2: Use: editor.getSelection()

Set cursor to specific position in CKEditor

拜拜、爱过 提交于 2019-12-17 04:58:08
问题 Is there a way to set the cursor position to a known index inside CKEditor? I want to do this because when I change the html inside the editor it resets the cursor to the start of the inserted element, which is a problem as I'm changing the content on the fly as the user types. If I know that I want to set the cursor back to a known character position, say 100, inside the editor, is this possible? (I asked a related question but I think I was overcomplicating the issue with example code.) 回答1

CKEditor doesn't show in laravel 5

二次信任 提交于 2019-12-14 04:11:51
问题 I want to save some data from a webpage and for that i wanted to use CKEditor in my page. But after loading the page it's showing normal textarea instead of showing CKEditor . i followed the following process to use it: 1 Download the ckeditor.zip file, uncompressed it and placed it in public > js folder 2.then in my master page in HEAD tag i have used the following line to link it: <script type="text/javascript" src="{{ URL::asset('assets/js/ckeditor/ckeditor.js') }}"></script`> 3 after that