Jump to content

Customize CKEDITOR toolbars


tsdevelopment

Recommended Posts

Is there any possibility to customize the CKEDITOR toolbar? I only want to display the emoticon button. If I reinitialize the editor after it is ready and resize the window the old toolbar will be shown. I tried to delete the old editor, replace it, and so much more. But none of my solutions works properly.

Currently I try to override the replace function. But the following code give me a duplicate editor. Is the a working solution?

CKEDITOR.replace = function (node, conf) {
	conf.enterMode = CKEDITOR.ENTER_BR;
	conf.height = 50;
	conf.toolbar = [{
		name: 'row1',
		items: ['ipsEmoticon'],
	}];

	return oldReplace(node, conf);
};

CKEDITOR.once('instanceReady', function(event) {
	var editor = event.editor;
	var name = editor.name;

	// Modify editor
	var conf = editor.config;

	conf.enterMode = CKEDITOR.ENTER_BR;
	conf.height = 50;
	conf.toolbar = [{
		name: 'row1',
		items: ['ipsEmoticon'],
	}];

	editor.destroy();

	this.editorInstance = CKEDITOR.replace(name, conf);
	this.editorInstance.on('key', this.onKeyDown.bind(this));
});

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...