Ticket #7038 (confirmed New Feature)
Possibility to automatically switch toolbars on a maximize/minimize of ckeditor
| Reported by: | pauljvrw | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | UI : Toolbar | Version: | 3.5 |
| Keywords: | Cc: |
Description
Then a minimalistic toolbar could be shown when the ckeditor is a (small) component of some window and an elaborate toolbar when maximized/full screen.
The advantage would be having as much workspace as possible in a small editor instance where mostly text is typed. And not having to manually select a larger toolbar when clicking 'maximize' when a larger workspace and more toolbar options are required.
Change History
comment:2 Changed 2 years ago by pauljvrw
The above plugin now works in combination with the latest patch (the 3rd) in #7080. The patch in #7080 does however have regression: concat a special char in the config no longer works afterward.
If you do not add special chars the code block here is all you need. Simply add it as an external plugin and a patched version of ckeditor and your done :)

When the runtime setToolbar from #7280 works correctly you can make a plugin with the code below to create a plugin.
CKEDITOR.plugins.add( 'toolbarswitch', { init: function( editor ) { var _initialToolbar = editor.config.toolbar; editor.on('beforeCommandExec',function(e){ if (e.data.name != 'maximize') { return; } if (editor.config.toolbar == _initialToolbar ) { editor.setToolbar( CKEDITOR.config.maximizedToolbar ); } else { editor.setToolbar( _initialToolbar ); } }); } }); CKEDITOR.config.maximizedToolbar = 'largetoolbarname';