I am attempting to creat an extra plugin for ck editor.
I have created a button on the toolbar and am at the stage to do something when this is clicked….
CKEDITOR.plugins.add('enlarge',
{
init: function (editor) {
//Plugin logic goes here.
editor.addCommand('insertenlarge',
{
exec: function (editor) {
}
});
editor.ui.addButton('enlarge',
{
label: 'Insert enlarge',
command: 'insertenlarge',
icon: this.path + 'images/enlarge.png'
});
}
});
What I dont know is how to get the highlighted element. Basically i want the user to click on an image in the editor and click enlarge and it opens the image up in a new pop up, i just want to be able to for now find out how to access the image element so i can place it in a pop up?
This should work for you:
editor.getSelection().getSelectedElement()