Question

I am trying to add an external plugin in ckeditor but it looks that I am not registering correctly my plugin and it isn' showing.

1.- I tried adding it directly to the CKEditor config file and it didn't work.

CKEDITOR.editorConfig = function(config) {
config.toolbar = [
['Bold'],['Italic'],['myplugin']
]
};

2.- Tried adding it to the html file when initiating CKEditor and also didn't work.

var editor = CKEDITOR.replace( 'editor1',
{

removePlugins : 'forms,table,tabletools',
extraPlugins : 'msugetprop,msuforms,msutable,msutabletools,msumobile',

toolbar : 
    [
        ['Cut','Copy','PasteText','Preview'],
        ['Undo','Redo','-','SelectAll'],
    ['MsuForm','MsuGetProp','MsuCheckbox', 'MsuRadio', 'MsuTextField',         'MsuTextarea', 'MsuSelect', 'MsuButton', 'MsuTable', 'MsuHiddenField'],
    '/',
    ['Styles','-','NumberedList','BulletedList','-','CreateDiv'],
                                                                                       ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
    ['Link','Unlink','Anchor'],
    ['Source','-','About'],
    ['myplugin'],
    ]
});

3.- My plugin is under /ckeditor/plugins/myplugin with filename plugin.js

(function() {
var o = { exec: function(p) {
url = baseUrl + "/GetSomeData";
$.post(url, function(response) {
alert(response)
});
}
};
CKEDITOR.plugins.add('myplugin', {
init: function(editor) {
editor.addCommand('myplugin', o);
editor.ui.addButton('myplugin', {
label: 'myplugin',
icon: this.path + 'myplugin.png',
command: 'myplugin'
});
}
});
})();

What am I missing ?

No correct solution

OTHER TIPS

Solved.

forgot to add 'myplugin" under extraPlugins.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top