That just sticks the hyphen on the end of the document right? It doesn't actually insert it at the insertion point?
It looks like the insertSpecialChar function in specialchar/dialogs/specialchar.js properly inserts the character and handles the selection... but that's quite a bit of code!
Re: How can I add a new customize control in the toolbar?
you must create a new plugin for ckeditor. In the plugin you use addButton (http://docs.cksource.com/ckeditor_api/s ... #addButton).
And you included your custom plugin in your config file with extraPlugins ((http://docs.cksource.com/ckeditor_api/s ... traPlugins)
Re: How can I add a new customize control in the toolbar?
I like to create a button "Hyphen" which inserts the code (entity) '­' into a document. When I apply what I read I would write:
// Add a new button named "Hyphen". editorInstance.ui.add( 'Hyphen', CKEDITOR.UI_BUTTON, { label : 'Hyphen', command : '­' });into a new file with the name plugins.js in a new folder with the name panel?
In the config.js I would add:
Would that work? How would that button get an image?
Please advise.
Kind regards,
Frank
Re: How can I add a new customize control in the toolbar?
ckeditor/
config.js
plugin/
hyphen/
plugin.js
images/
icon.gif
plugin.js
CKEDITOR.plugins.add('hyphen',{ init:function(editor){ editor.addCommand( 'hyphen', { exec : function(editor) { editor.insertHtml('-'); } }); editor.ui.addButton('Hyphen',{ label : 'Hyphen', command : 'hyphen', icon : this.path + 'images/icon.gif' }); } });config.js
CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'hyphen'; }; CKEDITOR.config.toolbar_Basic = [ ['Source','Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink'],['Hyphen'] ];Re: How can I add a new customize control in the toolbar?
editor.setData(editor.getData()+'-');
That just sticks the hyphen on the end of the document right? It doesn't actually insert it at the insertion point?
It looks like the insertSpecialChar function in specialchar/dialogs/specialchar.js properly inserts the character and handles the selection... but that's quite a bit of code!
Re: How can I add a new customize control in the toolbar?
by
editor.insertHtml('-');