1 /*
  2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
  3 For licensing, see LICENSE.html or http://ckeditor.com/license
  4 */
  5
  6 /**
  7  * @file Image plugin
  8  */
  9
 10 CKEDITOR.plugins.add( 'image',
 11 {
 12 	init : function( editor )
 13 	{
 14 		var pluginName = 'image';
 15
 16 		// Register the dialog.
 17 		CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/image.js' );
 18
 19 		// Register the command.
 20 		editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
 21
 22 		// Register the toolbar button.
 23 		editor.ui.addButton( 'Image',
 24 			{
 25 				label : editor.lang.common.image,
 26 				command : pluginName
 27 			});
 28
 29 		// If the "menu" plugin is loaded, register the menu items.
 30 		if ( editor.addMenuItems )
 31 		{
 32 			editor.addMenuItems(
 33 				{
 34 					image :
 35 					{
 36 						label : editor.lang.image.menu,
 37 						command : 'image',
 38 						group : 'image'
 39 					}
 40 				});
 41 		}
 42
 43 		// If the "contextmenu" plugin is loaded, register the listeners.
 44 		if ( editor.contextMenu )
 45 		{
 46 			editor.contextMenu.addListener( function( element, selection )
 47 				{
 48 					if ( !element || !element.is( 'img' ) || element.getAttribute( '_cke_realelement' ) )
 49 						return;
 50
 51 					return { image : CKEDITOR.TRISTATE_OFF };
 52 				});
 53 		}
 54 	}
 55 } );
 56
 57 /**
 58  * Show Browse Server button.
 59  * @type Boolean
 60  * @default true
 61  */
 62 CKEDITOR.config.image_browseServer = true;
 63
 64 /**
 65  * Upload action attribute.
 66  * @type URL
 67  */
 68 CKEDITOR.config.image_uploadAction = 'nowhere.php';
 69
 70 CKEDITOR.config.image_removeLinkByEmptyURL = true;
 71