2 Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
6 CKEDITOR.plugins.add( 'table',
\r
8 requires : [ 'dialog' ],
\r
9 init : function( editor )
\r
11 var table = CKEDITOR.plugins.table,
\r
12 lang = editor.lang.table;
\r
14 editor.addCommand( 'table', new CKEDITOR.dialogCommand( 'table' ) );
\r
15 editor.addCommand( 'tableProperties', new CKEDITOR.dialogCommand( 'tableProperties' ) );
\r
17 editor.ui.addButton( 'Table',
\r
19 label : lang.toolbar,
\r
23 CKEDITOR.dialog.add( 'table', this.path + 'dialogs/table.js' );
\r
24 CKEDITOR.dialog.add( 'tableProperties', this.path + 'dialogs/table.js' );
\r
26 // If the "menu" plugin is loaded, register the menu items.
\r
27 if ( editor.addMenuItems )
\r
29 editor.addMenuItems(
\r
34 command : 'tableProperties',
\r
41 label : lang.deleteTable,
\r
42 command : 'tableDelete',
\r
49 editor.on( 'doubleclick', function( evt )
\r
51 var element = evt.data.element;
\r
53 if ( element.is( 'table' ) )
\r
54 evt.data.dialog = 'tableProperties';
\r
57 // If the "contextmenu" plugin is loaded, register the listeners.
\r
58 if ( editor.contextMenu )
\r
60 editor.contextMenu.addListener( function( element, selection )
\r
62 if ( !element || element.isReadOnly() )
\r
65 var isTable = element.hasAscendant( 'table', 1 );
\r
70 tabledelete : CKEDITOR.TRISTATE_OFF,
\r
71 table : CKEDITOR.TRISTATE_OFF
\r