Special Characters in JS, how to use "/" character
Posted
by
user1461222
on Stack Overflow
See other posts from Stack Overflow
or by user1461222
Published on 2012-11-06T22:45:23Z
Indexed on
2012/11/06
23:00 UTC
Read the original article
Hit count: 240
I've vbulletin 4.2.0 i added an special button to it's editor with this article;
http://www.vbulletinguru.com/2012/add-a-new-toolbar-button-to-ckeditor-tutorial/
The thing i want to do is add an syntax highlighter code with this button.
When i use below code it's working 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'
} );
}
} );
so i changed this code to this, because i wannt to add specific text like below;
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 update the code when i press the button nothings happen, i checked with google and this site but i couldn't figure it out i think i made mistake with some special characters but i couldn't find what's the problem.
If i made some mistakes when i publish this question forgive me and also forgive me for my bad english, thanks.
© Stack Overflow or respective owner