Hi,
Just wondering if anyone could tell me why the following code doesn't work correctly? It adds the div, but without the class.. I've also tried cb.addClass('callout');
Thanks!
Just wondering if anyone could tell me why the following code doesn't work correctly? It adds the div, but without the class.. I've also tried cb.addClass('callout');
CKEDITOR.plugins.add('callout',
{
init: function(editor)
{
var pluginName = 'callout';
editor.ui.addButton( 'callout',
{
label : Drupal.t('Insert a callout box'),
icon : this.path + 'images/icon.png',
command : pluginName
});
editor.addCommand( pluginName,
{
exec : function()
{
var cb = editor.document.createElement( 'div' );
cb.setAttribute('class', 'callout');
editor.insertElement( cb );
}
});
}
});
Thanks!

Re: Why doesn't this work?
label : Drupal.t('Insert a callout box'),http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#addClass