Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pass in config info to CKEditor using the jQuery adapter?

Tags:

I'm using the latest CKeditor with jQuery adapter.

I have successfully got it to work, and display.

However, as I am completely new to CKeditor, how do I pass in config variables using the jQuery method?

This is what I've got

$( '#input-content' ).ckeditor('', {     toolbar: 'basic' }); 

I think from what I've read, the first argument is meant to be a callback, and the 2nd the config. But doing this has not changed the editor at all.

How do I use these config properties etc using the jQuery adapter?

like image 821
alex Avatar asked Feb 03 '10 04:02

alex


1 Answers

I have accomplished this using this code. Hopefully this helps.

Here is the html:

<textarea id="txtMessage" class="editor"></textarea> 

and here is the javascript:

try {         var config =             {                 height: 180,                 width: 515,                 linkShowAdvancedTab: false,                 scayt_autoStartup: true,                 enterMode: Number(2),                 toolbar_Full: [['Styles', 'Bold', 'Italic', 'Underline', 'SpellChecker', 'Scayt', '-', 'NumberedList', 'BulletedList'],                                 ['Link', 'Unlink'], ['Undo', 'Redo', '-', 'SelectAll']]              };          $('textarea.editor').ckeditor(config);   } 
like image 140
Greg Randall Avatar answered Oct 13 '22 23:10

Greg Randall