Ticket #7038 (confirmed New Feature)

Opened 3 years ago

Last modified 10 months ago

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:1 Changed 3 years ago by pauljvrw

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';

comment:2 Changed 3 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 :)

comment:3 Changed 3 years ago by pauljvrw

Above I meant #7280 not #7080 (typo).

comment:4 Changed 2 years ago by j.swiderski

  • Status changed from new to confirmed

The idea of having minimalistic toolbar is great in my opinion.

I'm not only sure if it should be joined with maximize button.
Perhaps a better option would be adding new functionality to show/hide toolbar button.

comment:5 Changed 10 months ago by pauljvrw

I'm not only sure if it should be joined with maximize button.

As a plug-in it would be optional.

It seems others have been wanting this as well: http://ckeditor.com/forums/CKEditor-3.x/Changing-toolbars-MaximizeMinimize http://ckeditor.com/forums/CKEditor/how-to-switch-toolbar-config-between-maximizeminimize-modes

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy