2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
10 CKEDITOR.plugins.add( 'image',
\r
12 init : function( editor )
\r
14 var pluginName = 'image';
\r
16 // Register the dialog.
\r
17 CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/image.js' );
\r
19 // Register the command.
\r
20 editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
\r
22 // Register the toolbar button.
\r
23 editor.ui.addButton( 'Image',
\r
25 label : editor.lang.common.image,
\r
26 command : pluginName
\r
29 // If the "menu" plugin is loaded, register the menu items.
\r
30 if ( editor.addMenuItems )
\r
32 editor.addMenuItems(
\r
36 label : editor.lang.image.menu,
\r
43 // If the "contextmenu" plugin is loaded, register the listeners.
\r
44 if ( editor.contextMenu )
\r
46 editor.contextMenu.addListener( function( element, selection )
\r
48 if ( !element || !element.is( 'img' ) || element.getAttribute( '_cke_realelement' ) )
\r
51 return { image : CKEDITOR.TRISTATE_OFF };
\r
58 * Whether to remove links when emptying the link URL field in the image dialog.
\r
62 * config.image_removeLinkByEmptyURL = false;
\r
64 CKEDITOR.config.image_removeLinkByEmptyURL = true;
\r