V3 : ToolbarSet feature
Currently, CKEditor offers a way to provide the toolbar definition by setting it directly to the "toolbar" setting.
While that is useful, it would be still nice to have more than one toolbar definitions in the configuration file, making it possible switching them with a simple setting, just like V2.
The idea would be introducing the "toolbarSets" object setting, which accepts several definitions, and then make the "toolbar" setting smart. If it receives a string, its the toolbarSet name, otherwise it's a toolbar definition.
Change History (9)
Owner: |
set to Artur Formella
|
Status: |
new →
assigned
|
Keywords: |
Review- added; Review? removed
|
Keywords: |
Review? added; Review- removed
|
Keywords: |
Review+ added; Review? removed
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
There is a simpler solution, which would also bring the possibility of having different toolbarsets sharing the same name in different instances (I know, a rare situation, but people is quite creative out there, so why not?).
Instead of creating a specific object to define toolbarsets, let's leave it all inside the config object as independent properties, to be sure we'll not having one instance mixing things with others. For example:
So, when loading the toolbar, we simply take
editor[ 'toolbar_' + editor.config.toolbar ]
.Btw, let's take the opportunity to rename the "Default" toobarset to "Full". We'll have more on this later.
Also, do not change the editor.config.toolbar property to the relative toolbarset on init. Just put it in a local variable when needed. Who knows how the config properties can be used elsewhere.
KISS!