ckeditor

CKEditor 5 - How to insert some HTML (aka. where's the source mode)?

北慕城南 提交于 2019-12-21 07:34:01
问题 I want to be able to switch from WYSIWYG to plain HTML to e.g. insert IFrame with a Youtube video. So far with the standard CKEditor 5 builds there is no documentation on how to do that. Is there an equivalent of the Source Editing Area plugin but for CKEditor 5? 回答1: Your question touches two complicated topics: Whether source mode makes any sense in general. Whether it is possible to allow inputting (and editing) any HTML to CKEditor 5. They've been already discussed in the "View Source"

How to determine if CKEditor is loaded?

为君一笑 提交于 2019-12-21 06:57:19
问题 How do I find out if CKEditor is loaded? I've looked through the API docs, but could only find the loaded event. I want to check if CKEditor is loaded, because if I load it a second time, my textareas disapears. 回答1: The loaded event didn't work for me. instanceReady worked: CKEDitor_loaded = false; CKEDITOR.on('instanceReady', function(){ CKEditor_loaded = true; }); 回答2: var waitCKEDITOR = setInterval(function() { if (window.CKEDITOR) { clearInterval(waitCKEDITOR); //CKEDITOR.replace(...); }

How to change the editor size of CKEditor?

£可爱£侵袭症+ 提交于 2019-12-21 06:48:46
问题 Since it is a textarea , I tried cols="50" in html attribute but it does not work. Also , I found the answer from the previous question . He said I can do this by adding. CKEDITOR.instances.myinstance.resize(1000, 900); However , the size still has not changed. Here is the code I attempted, thank you. Updated <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script src="../plugin/jquery-1.6.1.min.js"><

how can i disable save button in ckeditor?

*爱你&永不变心* 提交于 2019-12-21 05:09:30
问题 I don't want any ajax functionality currently in ckeditor. How can i remove that button from toolbar? If i do not disable that save button i get strange errors when i click that button. I followed this tutorial :- http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Integration Thanks in advance :) 回答1: In your config file, you can specify your own toolbar (and leave out the save button). For example, my config: CKEDITOR.editorConfig = function( config ) { // Define changes to default

CKEditor 4.5 drag and drop image upload - how to return new dimensions in json response?

你离开我真会死。 提交于 2019-12-21 05:08:38
问题 I have drag and drop image uploads working using CKEditor 4.5.1. Very nice feature! On the server side I am resizing large images. My JSON response returns the resized image url (set by 'url' in the response) and that is the image that is shown in the CKEditor window after the successful file upload. But the img tag inserted has the height and width attributes set with the values from the original image, not my resized image. Is there a way to return the new height and width values? Or does

How to config CKEditor-4 inline editors?

自闭症网瘾萝莉.ら 提交于 2019-12-21 05:07:33
问题 I have a standard installation (like samples): <meta charset="utf-8"></meta> <script src="../ckeditor.js"></script> With HTML content with many <div contenteditable="true"> blocks. I need to configure each editor by local or an external configTypeX.js file, <script> CKEDITOR.on( 'instanceCreated', function( event ) { var editor = event.editor, element = editor.element; if ( element.is( 'h1', 'h2', 'h3' ) ) { editor.on( 'configLoaded', function() { editor.config.toolbar = [ [ 'Source', '-',

CKEditor 4 Inline: How to hide toolbar on demand?

99封情书 提交于 2019-12-21 04:57:45
问题 Normally when you click other place in the page other than the edit area, the toolbar will hide, now i need to hide the toolbar also on user command(such as user press a shortcut). I tried to call jQuery hide method on ckeditor toolbar div, but once hidden, it will never become visible even when user focus on the edit area. Any ideas on how to achieve this? Many thanks. 回答1: did you try to do jQuery Show when the focus comes back in to the edit area? you can also attach to the focus and blur

How can I append text to html source in CKEditor?

两盒软妹~` 提交于 2019-12-21 04:45:19
问题 I use CKEditor in my web-application. By click on one link i appends some text to CKEditor. It works fine. But when I open source tab, i can not append this text to the existing source. Can you help me how can I do it? Thank you in advance. Sorry for my english. 回答1: If you are trying to append HTML text, you could use the createFromHtml method like this for example: var imgHtml = CKEDITOR.dom.element.createFromHtml("<img src=" + imageSrcUrl + " alt='' align='right'/>"); where imageSrcUrl is

CKEditor inline toolbar position

浪尽此生 提交于 2019-12-21 04:27:10
问题 Simple question : how can I make the inline CKEditor toolbar float top right (or bottom right) of my editable element instead of the default top left position ? Have been googling it but no luck so far :( Thank you 回答1: It does not have a configuration option for this. There are only four options for the X,Y offset in pinned and docked modes - e.g. config.floatSpacePinnedOffsetY. The only idea that I have is implementing your own plugin like Floating Space, or modifying the current

How to detect CKEditor source mode on change event

99封情书 提交于 2019-12-21 04:00:33
问题 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? 回答1: Instead of using "change" event, the "key" event does fire on the source view. Thanks for Kicker's hint 回答2: The CKEditor 4 documentation tells that the change event won't be fired in source