I have upgraded my vbulletin to version 4.2.0 and I successfully added a custom button to its editor following this tutorial:
Now, I am trying to incorporate a syntax highlighter code using this button.
When I use the code provided below, it works perfectly fine;
CKEDITOR.plugins.add( 'YourPluginName',
{
init: function( editor )
{
editor.addCommand( 'SayHello',
{
exec : function( editor )
{
editor.insertHtml( "Hello from my plugin" );
}
});
editor.ui.addButton( 'YourPluginName',
{
label: 'My Button Tooltip',
command: 'SayHello',
icon: this.path + 'YourPluginImage.png'
} );
}
} );
However, I modified the code to the following in order to add specific text like so;
CKEDITOR.plugins.add( 'DKODU',
{
init: function( editor )
{
editor.addCommand( 'SayHello',
{
exec : function( editor )
{
editor.insertHtml( '[kod=delphi][/kod]' );
}
});
editor.ui.addButton( 'DKODU',
{
label: 'My Button Tooltip',
command: 'SayHello',
icon: this.path + 'star.png'
} );
}
} );
After updating the code, pressing the button does not produce any results. I have searched on Google and various sites but failed to identify the issue. I believe I may have made a mistake with special characters, but I am unable to pinpoint the problem.
If there are any errors in my question, I apologize. Additionally, forgive my poor English. Thank you.