source: trunk/admin/inc/ckeditor/_source/plugins/image/plugin.js@ 239

Last change on this file since 239 was 239, checked in by luc, 9 years ago

Admin: correzione visulaizzazione immissione dati spoglio per Chrome e Safari - Aggiornamento dell'editor da FCKeditor a CKeditor , accessibili anche a Chrome e Safari.

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1/*
2Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3For licensing, see LICENSE.html or http://ckeditor.com/license
4*/
5
6/**
7 * @file Image plugin
8 */
9
10CKEDITOR.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 editor.on( 'doubleclick', function( evt )
30 {
31 var element = evt.data.element;
32
33 if ( element.is( 'img' ) && !element.data( 'cke-realelement' ) && !element.isReadOnly() )
34 evt.data.dialog = 'image';
35 });
36
37 // If the "menu" plugin is loaded, register the menu items.
38 if ( editor.addMenuItems )
39 {
40 editor.addMenuItems(
41 {
42 image :
43 {
44 label : editor.lang.image.menu,
45 command : 'image',
46 group : 'image'
47 }
48 });
49 }
50
51 // If the "contextmenu" plugin is loaded, register the listeners.
52 if ( editor.contextMenu )
53 {
54 editor.contextMenu.addListener( function( element, selection )
55 {
56 if ( !element || !element.is( 'img' ) || element.data( 'cke-realelement' ) || element.isReadOnly() )
57 return null;
58
59 return { image : CKEDITOR.TRISTATE_OFF };
60 });
61 }
62 }
63} );
64
65/**
66 * Whether to remove links when emptying the link URL field in the image dialog.
67 * @type Boolean
68 * @default true
69 * @example
70 * config.image_removeLinkByEmptyURL = false;
71 */
72CKEDITOR.config.image_removeLinkByEmptyURL = true;
73
74/**
75 * Padding text to set off the image in preview area.
76 * @name CKEDITOR.config.image_previewText
77 * @type String
78 * @default "Lorem ipsum dolor..." placehoder text.
79 * @example
80 * config.image_previewText = CKEDITOR.tools.repeat( '___ ', 100 );
81 */
Note: See TracBrowser for help on using the repository browser.