plugin.js 767 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.html or http://ckeditor.com/license
  4. */
  5. /**
  6. * @file template plugin.
  7. */
  8. (function()
  9. {
  10. var templateCmd =
  11. {
  12. modes : { wysiwyg:1, source:1 },
  13. canUndo : false,
  14. readOnly : 1,
  15. exec : function( editor )
  16. {
  17. FormDef.showSelectTemplate('selectTemplate.ht?tableId=' + tableId +"&isSimple=1");
  18. }
  19. };
  20. var pluginName = 'template';
  21. // Register a plugin named "template".
  22. CKEDITOR.plugins.add( pluginName,
  23. {
  24. init : function( editor )
  25. {
  26. editor.addCommand( pluginName, templateCmd );
  27. editor.ui.addButton( 'Template',
  28. {
  29. label : '重选模板',
  30. icon: 'custom/template/cab.png',
  31. command : pluginName
  32. });
  33. }
  34. });
  35. })();