langerhans
langerhans

Reputation: 779

CKEditor plugin button disabled in source mode

I was trying to add my own toolbar button in CKEditor (inside vBulletin). Following is my Code:

CKEDITOR.plugins.add( 'app',
{
init: function( editor )
{
    editor.addCommand( 'AppWidget',
        {
            modes : { source : 1, wysiwyg : 1 },
            exec : function( editor )
            {   
                alert("foo");
            }
        });
    editor.ui.addButton( 'app',
    {
        label: 'App Widget',
        command: 'AppWidget',
        icon: this.path + 'app.png'
    } );
}
} );  

Problem is: It will show in WYSIWYG mode, but will be disabled (greyed out) in source mode. But I need this button to be enabled in source mode. If I write:

modes : { source : 1 },

it will be disabled in both modes.

Any hints on this here? Thanks in advance.

Upvotes: 2

Views: 1910

Answers (1)

langerhans
langerhans

Reputation: 779

Problem is solved. I noticed the editor mode should be:

modes : { enhancedsource : 1 }

Upvotes: 2

Related Questions