ckeditor

CKEditor. Open image properties window with a default value

元气小坏坏 提交于 2019-12-01 11:45:00
I've been looking at the API and I can not figure out how to open the image dialog with a default url. I use the execCommand function, as follows: var editor = CKEDITOR.instances.editor1; editor.execCommand ('image'); This works fine, but I want to give some value. I tested with: editor.execCommand ('image', { url: myrURL, }); It does not work though. Please, I need help. oleq To set default value, you got to use the dialogDefinition event to modify dialog fields (see this answer: How do I programatically set default table properties for CKEditor? ). To change the value dynamically: CKEDITOR

Ckeditor how to apply keyboard shortcut to a particular style

我们两清 提交于 2019-12-01 11:37:08
问题 Is it possible to apply a keyboard shortcut to a particular style from Styles drom down in CkEditor? I searched their docs but I could not find a solution for my case. Here is screenshot. Here I want to be able to apply a keyboard shortcut to yellow marker from that Styles drop down. Any help will be appreciated. Thanks 回答1: Here you go. This example shows how to attach a style to CTRL+SHIFT+1 keystroke. You can use switch statement for different keystrokes and play with them any way you want

ckeditor content into textarea on change event - beginner

元气小坏坏 提交于 2019-12-01 10:44:09
I am trying to get the contents of my ckeditor to be entered into the associated textarea as the user enters the value into the ckeditor. I have read several helpful threads, namely here and here , but I am going around in circles as my code experience and knowledge is not so great. I understand how the ckeditor works and that I should be using the change event as described in the post . I have managed to add the following jquery code to display the alert message when the user enters value into the ckeditor: for (var i in CKEDITOR.instances) { CKEDITOR.instances[i].on('change', function()

Use my existing Rich Text UI with CKEditor APIs

隐身守侯 提交于 2019-12-01 10:34:31
I have an existing Rich Text UI that I'd like to use with CKEditor. Basically, I want CKEditor to handle the complicated parts of applying styles, formats, filtering, and normalizing inserted content. My existing UI needs to drive the interaction and show state based on selection (ie. selecting bold text should be reflected in the state of my 'Bold' button in the UI. I have got the integration to a point where I can apply bold, italic, and underline formats, change font size, and add styles. For bold, italic, and underline: var editor = this.getEditor(); editor.execCommand('underline'); //

ckeditor content into textarea on change event - beginner

心不动则不痛 提交于 2019-12-01 09:51:59
问题 I am trying to get the contents of my ckeditor to be entered into the associated textarea as the user enters the value into the ckeditor. I have read several helpful threads, namely here and here, but I am going around in circles as my code experience and knowledge is not so great. I understand how the ckeditor works and that I should be using the change event as described in the post. I have managed to add the following jquery code to display the alert message when the user enters value into

How do I get this HTML to display formatted, without tags?

て烟熏妆下的殇ゞ 提交于 2019-12-01 09:17:57
I created a blog (for coding practice). I use a Rich Text Editor (ckeditor) and save the post to a database. When I pull the post out to display in a Label.Text, it shows all the HTML tags: <p><strong>there was</strong> once a fox that lived</p> <p> in the<span style="color: #ff0000"> woods</span></p> How do I get the post to display, with the proper formatting (paragraph, color, etc.), but without the HTML tags? nanonerd FYI: The literal produced the same result as the Label ... but I got my answer, this works: string strHTML = "<p>Hello World!</p>"; Label.Text = Server.HtmlDecode(strHTML);

CKEDITOR.styleSet.add - new style for 'a' element

寵の児 提交于 2019-12-01 09:08:09
问题 For some reason if I change 'p' to 'a' , it no longer appears on the style list. Any reason why? CKEDITOR.stylesSet.add('default',[ { name : 'Wys wiersza 1' , element : 'p', styles : { 'line-height' : '18px' } } ]); -edited the code, I missed some brackets while copying 回答1: Your problem is a bracket mess. This code will work: CKEDITOR.stylesSet.add( 'default', [ { name: 'Wys wiersza 1' , element: 'p', styles: { 'line-height' : '18px' } } ] ); EDIT: Now I see it's a CKEditor bug as it only

changing the background color for ckEditor

ⅰ亾dé卋堺 提交于 2019-12-01 08:54:25
I need to change the background color dynamically on load with my ckEditor the page that it is on is a dynamically loading page where they user has a specific bg color. I can not load a css it has to be just the editor body background color so i tried window.onload=function(){ CKEDITOR.instances.editor_data.addCss( 'body { background-color: #efefef; }' ); } i do not get an error, but also do not get any changes i also tried CKEDITOR.instances.editor_data.addCss( '#cke_editor_data { background-color: #efefef; }' ); If you're calling that during window.load then it's too late, addCss defines

How can i close CKEditor or tinyMCE on a click outside of the editor?

风流意气都作罢 提交于 2019-12-01 08:40:23
I have text widgets that can be added on the page. A click should activate the div into a wysiwyg editor. A click anywhere outside of the editor should destroy the editor with the new content written to the div. in the document on ready callback : var ckeditorConfig = { toolbar : [ [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ], [ 'Font', 'FontSize'] ], toolbarCanCollapse : false, toolbarLocation : 'top', resize_enabled : false, removePlugins : 'maximize,resize', }; window.ckeditorHover = false; $('.we-widget-wrapper').hover( function(){ window.ckeditorHover =

CKEditor - Editor Width Overflows in Webkit Browsers

寵の児 提交于 2019-12-01 08:13:24
I discovered that the toolbars don't automatically wrap in WebKit browswers (Safari, Chrome). There is a three year old bug reported for CKEditor 3, but it was closed. Maybe this is a regression? I'm not setting a width in my configuration. I want the editor to expand to the available width automatically. The editor is inside a div element that has the overflow: hidden; style applied to it. Here's my toolbar configuration: config.toolbar = [ {name:'clipboard', items:['Cut', 'Copy', 'Paste', 'PasteText', '-', 'Undo', 'Redo']}, {name:'insert', items:['Link', 'Unlink', 'Image', 'Table',