2 Copyright (c) 2003-2011, 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 editor.on( 'doubleclick', function( evt )
\r
31 var element = evt.data.element;
\r
33 if ( element.is( 'img' ) && !element.data( 'cke-realelement' ) && !element.isReadOnly() )
\r
34 evt.data.dialog = 'image';
\r
37 // If the "menu" plugin is loaded, register the menu items.
\r
38 if ( editor.addMenuItems )
\r
40 editor.addMenuItems(
\r
44 label : editor.lang.image.menu,
\r
51 // If the "contextmenu" plugin is loaded, register the listeners.
\r
52 if ( editor.contextMenu )
\r
54 editor.contextMenu.addListener( function( element, selection )
\r
56 if ( !element || !element.is( 'img' ) || element.data( 'cke-realelement' ) || element.isReadOnly() )
\r
59 return { image : CKEDITOR.TRISTATE_OFF };
\r
66 * Whether to remove links when emptying the link URL field in the image dialog.
\r
70 * config.image_removeLinkByEmptyURL = false;
\r
72 CKEDITOR.config.image_removeLinkByEmptyURL = true;
\r
75 * Padding text to set off the image in preview area.
\r
76 * @name CKEDITOR.config.image_previewText
\r
78 * @default "Lorem ipsum dolor..." placehoder text.
\r
80 * config.image_previewText = CKEDITOR.tools.repeat( '___ ', 100 );
\r