Hi,
I've trying to create my first plugin for ckeditor. What I want it to do is show the user a list of pages available on their site (from a database), allow them to select a page, and then create a link to that page in the editor.
So far I've managed to get an icon to appear on the toolbar. I've tried to create a dialog, but nothing happens when I click the icon.
This is the code for the plugin.js file
and this is the code I've got for the dialogs/pagelist.js file (very basic)
At the moment I just want to get something to appear when you click the button so I can progress from there.
Can anyone see where I might be going wrong with this?
I've trying to create my first plugin for ckeditor. What I want it to do is show the user a list of pages available on their site (from a database), allow them to select a page, and then create a link to that page in the editor.
So far I've managed to get an icon to appear on the toolbar. I've tried to create a dialog, but nothing happens when I click the icon.
This is the code for the plugin.js file
CKEDITOR.plugins.add('pagelist',
{
init: function(editor)
{
var pluginName = 'pagelist';
CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/pagelist.js');
editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
editor.ui.addButton('PageList',
{
label: 'Page list',
icon: this.path + 'icon.png',
command: pluginName
});
}
});and this is the code I've got for the dialogs/pagelist.js file (very basic)
( function(){
var plagelistDialog = function(editor){
return {
title : 'A sample title',
minWidth : 300,
minHeight : 300,
onOk: function() {
alert('OK');
},
onLoad: function() {
alert('Load');
},
onShow: function() {
alert('Show');
},
onHide: function() {
alert('Hide');
},
onCancel: function() {
alert('Cancel');
},
resizable: 'both'
}
}
CKEDITOR.dialog.add('pageList', function(editor) {
return pagelistDialog(editor);
});
})();At the moment I just want to get something to appear when you click the button so I can progress from there.
Can anyone see where I might be going wrong with this?
