2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
6 CKEDITOR.plugins.add( 'table',
8 init : function( editor )
10 var table = CKEDITOR.plugins.table,
11 lang = editor.lang.table;
13 editor.addCommand( 'table', new CKEDITOR.dialogCommand( 'table' ) );
14 editor.addCommand( 'tableProperties', new CKEDITOR.dialogCommand( 'tableProperties' ) );
16 editor.ui.addButton( 'Table',
22 CKEDITOR.dialog.add( 'table', this.path + 'dialogs/table.js' );
23 CKEDITOR.dialog.add( 'tableProperties', this.path + 'dialogs/table.js' );
25 // If the "menu" plugin is loaded, register the menu items.
26 if ( editor.addMenuItems )
33 command : 'tableProperties',
40 label : lang.deleteTable,
41 command : 'tableDelete',
48 editor.on( 'doubleclick', function( evt )
50 var element = evt.data.element;
52 if ( element.is( 'table' ) )
53 evt.data.dialog = 'tableProperties';
56 // If the "contextmenu" plugin is loaded, register the listeners.
57 if ( editor.contextMenu )
59 editor.contextMenu.addListener( function( element, selection )
61 if ( !element || element.isReadOnly() )
64 var isTable = element.hasAscendant( 'table', 1 );
69 tabledelete : CKEDITOR.TRISTATE_OFF,
70 table : CKEDITOR.TRISTATE_OFF