Well this seems simple, i want to add a <strike> before the selection and add /by User</strike> after the selection..
This is what i got so far:
CKEDITOR.plugins.add('test',
{
init: function (editor) {
editor.addCommand('inserttest',
{
exec: function (editor) {
var selection = editor.getSelection();
if (!selection) {
return;
}
var text = selection.getSelectedText();editor.insertHtml('<strike>' + text + ' /By User </strike>');
}
});editor.ui.addButton('test',
{
label: 'Insert test',
command: 'inserttest',
icon: this.path + 'images/test.png'
});
}
});
This works somewhat but it has a few quirks it removes all html and also it does not verify that we aren't inside a strike already..
So how would i do this without loosing html? and verifying that im not inside a strike tag already?
I have tried to analyze the source code of plugins but found it confusing to say the least...
Note im using the asp.net control witch seems to use the version 3.6.4 of CKEditor.