plugin.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. CKEDITOR.plugins.add( 'seting', {
  2. icons: 'seting',
  3. init: function( editor ) {
  4. editor.addCommand( 'seting', new CKEDITOR.dialogCommand( 'setingDialog' ) );
  5. editor.ui.addButton( 'seting', {
  6. label: 'Áëîê íàñòðîåê',
  7. command: 'seting',
  8. toolbar: 'insert'
  9. });
  10. if ( editor.contextMenu ) {
  11. editor.addMenuGroup( 'setingGroup' );
  12. editor.addMenuItem( 'setingItem', {
  13. label: 'Ðåäàêòèðîâàòü íàñòðîéêè ',
  14. icon: this.path + 'icons/seting.png',
  15. command: 'seting',
  16. group: 'setingGroup'
  17. });
  18. editor.on( 'doubleclick', function( evt ) {
  19. var element = evt.data.element;
  20. if ( element.getAttribute('id') == 'widgetseting' )
  21. evt.data.dialog = 'setingDialog';
  22. } );
  23. editor.contextMenu.addListener( function( element ) {
  24. if ( element.getAscendant( 'seting', true ) ) {
  25. return { setingItem: CKEDITOR.TRISTATE_OFF };
  26. }
  27. });
  28. }
  29. CKEDITOR.dialog.add( 'setingDialog', this.path + 'dialogs/seting.js' );
  30. }
  31. });