Friday, 13 September 2013

CKEdtor 4: How to add CSS stylesheet from plugin?

CKEdtor 4: How to add CSS stylesheet from plugin?

Tried this for now, but no luck
editor.addCss(this.path + 'tabber.css');
editor.document.appendStyleSheet(this.path + 'tabber.css');
Full code
(function () {
CKEDITOR.plugins.add('tabber', {
init: function (editor) {
editor.ui.addButton('addTab', {
command: 'addTab',
icon: this.path + 'icons/tabber.png',
label: Drupal.t('Insert tabs')
});
editor.addCss(this.path + 'tabber.css');
editor.document.appendStyleSheet(this.path + 'tabber.css');
editor.addCommand('addTab', {
exec: function (editor) {
editor.insertHtml('<dl>' +
'<dt>Tab title 1</dt>' +
'<dd><p>Tab content 1.</p></dd>' +
'<dt>Tab title 2</dt>' +
'<dd><p>Tab content 2.</p></dd>' +
'</dl>');
}
});
}
});
})();

No comments:

Post a Comment