How to set ckeditor configuration when using jquery version?

I am using the jQuery version of ckeditor, for example:

$(".textarea").ckeditor();

I need to specify buttons on the toolbar, but I do not know how to do this. All the help I found here on stackoverflow or using google was for the old version of jQuery ckeditor, or I don't know how to use it with jquery (code above).

Also, how to specify the location of the css file so that ckeditor downloads my css and displays the data the same way it will be displayed on the site?

Can anyone help with this mess?

+3
source share
3 answers
$(".textarea").ckeditor(function() { 
   // Instance loaded callback.
}, {
   // Config here.
});
+3
source

, CKEDITOR, ( , , ):

$("textarea.youreditor").ckeditor
(
    {
        customConfig: "/path/to/custom/config.js"
    }
);

... ( config.js:

CKEDITOR.editorConfig = function(config)
{
    config.toolbar_Full =
    [
        { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
        { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] },
        { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] },
        { name: 'colors', items : [ 'TextColor','BGColor' ] }
    ];  
};    

** : CKEditor jQuery?

+1

This is how I set the configuration using jQuery ....

var config = {
              toolbar: [ /* Whatever toolbars you wish go here. */ ],
              height: 250,
              width: 500,
              align: "left",
              contentsCss: ["body { /* Style your body any way you like */ } otherCSSStuff { /* Style away. */} "]
              /*and whatever other options you wish to config... */
             };

$( 'textarea.editor' ).ckeditor( config, function() { /* Your callback function. */ } );
0
source

All Articles