plugin.js 958 B

123456789101112131415161718192021222324252627282930313233
  1. (function(){
  2. //Section 1 : 按下自定义按钮时执行的代码
  3. var a= {
  4. exec:function(editor)
  5. {
  6. var defId=$("#defId").val();
  7. var taskNameRule=editor.getData();
  8. var data="defId="+defId+"&taskNameRule="+taskNameRule;
  9. $.post("saveTitleRule.ht",data,function(msg){
  10. var obj=new com.hotent.form.ResultMessage(msg);
  11. if(obj.isSuccess()){
  12. $.ligerDialog.success(obj.getMessage(),"操作成功");
  13. }else{
  14. $.ligerDialog.error(obj.getMessage(),"操作失败");
  15. }
  16. });
  17. }
  18. },
  19. //Section 2 : 创建自定义按钮、绑定方法
  20. b='saveRule';
  21. CKEDITOR.plugins.add(b,{
  22. init:function(editor){
  23. editor.addCommand(b,a);
  24. editor.ui.addButton('saveRule',{
  25. label:'保存',
  26. icon: this.path + 'save.png',
  27. command:b
  28. });
  29. }
  30. });
  31. })();