X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ftable%2Fplugin.js;fp=_source%2Fplugins%2Ftable%2Fplugin.js;h=7aab3cc1ee725a2fffe9d4d77e9394c216a9d761;hb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;hp=0000000000000000000000000000000000000000;hpb=b93873b6532ee7515fb0d6f8b73176c44fad28f7;p=ckeditor.git diff --git a/_source/plugins/table/plugin.js b/_source/plugins/table/plugin.js new file mode 100644 index 0000000..7aab3cc --- /dev/null +++ b/_source/plugins/table/plugin.js @@ -0,0 +1,70 @@ +/* +Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.add( 'table', +{ + init : function( editor ) + { + var table = CKEDITOR.plugins.table, + lang = editor.lang.table; + + editor.addCommand( 'table', new CKEDITOR.dialogCommand( 'table' ) ); + editor.addCommand( 'tableProperties', new CKEDITOR.dialogCommand( 'tableProperties' ) ); + + editor.ui.addButton( 'Table', + { + label : lang.toolbar, + command : 'table' + }); + + CKEDITOR.dialog.add( 'table', this.path + 'dialogs/table.js' ); + CKEDITOR.dialog.add( 'tableProperties', this.path + 'dialogs/table.js' ); + + // If the "menu" plugin is loaded, register the menu items. + if ( editor.addMenuItems ) + { + editor.addMenuItems( + { + table : + { + label : lang.menu, + command : 'tableProperties', + group : 'table', + order : 5 + }, + + tabledelete : + { + label : lang.deleteTable, + command : 'tableDelete', + group : 'table', + order : 1 + } + } ); + } + + // If the "contextmenu" plugin is loaded, register the listeners. + if ( editor.contextMenu ) + { + editor.contextMenu.addListener( function( element, selection ) + { + if ( !element ) + return null; + + var isTable = element.is( 'table' ) || element.hasAscendant( 'table' ); + + if ( isTable ) + { + return { + tabledelete : CKEDITOR.TRISTATE_OFF, + table : CKEDITOR.TRISTATE_OFF + }; + } + + return null; + } ); + } + } +} );