Hi. S.orry for my english.
Używam pluginu Geshi do kolorowania składni. So far I have used CKEditor 3.x, I wanted to go to a newer version. I've encountered a problem when adapting the code. My current code:
CKEDITOR.plugins.add( 'geshi',
{
requires : [ 'styles', 'button' ],
init : function( editor )
{
// All buttons use the same code to register. So, to avoid
// duplications, let's use this tool function.
var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton )
{
var style = new CKEDITOR.style( styleDefiniton );
editor.attachStyleStateChange( style, function( state )
{
editor.getCommand( commandName ).setState( state );
});
editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) );
editor.ui.addButton( buttonName,
{
label : buttonLabel,
command : commandName
});
};
var config = editor.config;
// var lang = editor.lang;
addButtonCommand( 'Geshi-code' , 'code' , 'Geshi-code' , config.coreStyles_code );
addButtonCommand( 'Geshi-php' , 'php' , 'Geshi-php' , config.coreStyles_php );
addButtonCommand( 'Geshi-mysql' , 'mysql' , 'Geshi-mysql' , config.coreStyles_mysql );
addButtonCommand( 'Geshi-html' , 'html' , 'Geshi-html' , config.coreStyles_html );
addButtonCommand( 'Geshi-xml' , 'xml' , 'Geshi-xml' , config.coreStyles_xml );
addButtonCommand( 'Geshi-css' , 'css' , 'Geshi-css' , config.coreStyles_css );
addButtonCommand( 'Geshi-js' , 'js' , 'Geshi-js' , config.coreStyles_js );
addButtonCommand( 'Geshi-jquery', 'jquery' , 'Geshi-jquery' , config.coreStyles_jquery );
addButtonCommand( 'Geshi-smarty', 'smarty' , 'Geshi-smarty' , config.coreStyles_smarty );
addButtonCommand( 'Geshi-text' , 'text' , 'Geshi-text' , config.coreStyles_text );
}
});
//CKEDITOR.buttonLabel_code = {'code'};
// Basic Inline Styles.
CKEDITOR.config.coreStyles_code = { element : 'pre' };
CKEDITOR.config.coreStyles_php = { element : 'pre', attributes : { 'lang' : 'php' } };
CKEDITOR.config.coreStyles_mysql = { element : 'pre', attributes : { 'lang' : 'mysql' } };
CKEDITOR.config.coreStyles_html = { element : 'pre', attributes : { 'lang' : 'html4strict' } };
CKEDITOR.config.coreStyles_xml = { element : 'pre', attributes : { 'lang' : 'xml' } };
CKEDITOR.config.coreStyles_css = { element : 'pre', attributes : { 'lang' : 'css' } };
CKEDITOR.config.coreStyles_js = { element : 'pre', attributes : { 'lang' : 'Javascript' } };
CKEDITOR.config.coreStyles_jquery = { element : 'pre', attributes : { 'lang' : 'jquery' } };
CKEDITOR.config.coreStyles_smarty = { element : 'pre', attributes : { 'lang' : 'smarty' } };
CKEDITOR.config.coreStyles_text = { element : 'pre', attributes : { 'lang' : 'text' } };
Problem with the line:
requires : [ 'styles', 'button' ],
So far, the plugin file fetch styles styles such as kama / editor.css. It crashes the code.
.cke_skin_kama .cke_button_Geshi-code span.cke_icon,
.cke_skin_kama .cke_button_Geshi-php span.cke_icon,
.cke_skin_kama .cke_button_Geshi-mysql span.cke_icon,
.cke_skin_kama .cke_button_Geshi-html span.cke_icon,
.cke_skin_kama .cke_button_Geshi-xml span.cke_icon,
.cke_skin_kama .cke_button_Geshi-css span.cke_icon,
.cke_skin_kama .cke_button_Geshi-js span.cke_icon,
.cke_skin_kama .cke_button_Geshi-jquery span.cke_icon,
.cke_skin_kama .cke_button_Geshi-smarty span.cke_icon,
.cke_skin_kama .cke_button_Geshi-text span.cke_icon
{
display: none !important;
}
.cke_skin_kama .cke_button_Geshi-code span.cke_label,
.cke_skin_kama .cke_button_Geshi-php span.cke_label,
.cke_skin_kama .cke_button_Geshi-mysql span.cke_label,
.cke_skin_kama .cke_button_Geshi-html span.cke_label,
.cke_skin_kama .cke_button_Geshi-xml span.cke_label,
.cke_skin_kama .cke_button_Geshi-css span.cke_label,
.cke_skin_kama .cke_button_Geshi-js span.cke_label,
.cke_skin_kama .cke_button_Geshi-jquery span.cke_label,
.cke_skin_kama .cke_button_Geshi-smarty span.cke_label,
.cke_skin_kama .cke_button_Geshi-text span.cke_label
{
display: inline;
font-size: 90%;
}
ow, do not show me buttons without labels.
toolbar : [
{ name: 'geshi', items : [ 'Geshi-code','-','Geshi-php','-','Geshi-mysql','-','Geshi-html','-','Geshi-xml','-','Geshi-css','-','Geshi-js','-','Geshi-jquery','-','Geshi-smarty','-','Geshi-text' ] }
],
Please kindly help.

Nobody has an idea? Do not
Nobody has an idea? Do not display etykiery (name) buttons.
Quite a few things changed in
Quite a few things changed in v4 and the page where you seem to have gotten this info is 4 years old. Maybe you should go over the CKEditor 4 plugin documentation.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
The problem lies with the:
The problem lies with the:
it does not allow to assign styles. I told myself otherwise, changed:
var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton ) {it:
var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton, imgPath ) {and this:
editor.ui.addButton( buttonName, { label : buttonLabel, command : commandName });it:
editor.ui.addButton( buttonName, { label : buttonLabel, icon : imgPath, command : commandName });ant this:
it:
Thak all...