plugin.js 794 B

123456789101112131415161718192021222324252627282930313233343536
  1. (function(){
  2. //Section 1 : 按下自定义按钮时执行的代码
  3. var a= {
  4. exec:function(editor)
  5. {
  6. //addClick();
  7. editor.insertHtml("${收件人}");
  8. }
  9. },
  10. //Section 2 : 创建自定义按钮、绑定方法
  11. b='readperson';
  12. CKEDITOR.plugins.add(b,{
  13. init:function(editor){
  14. editor.addCommand(b,a);
  15. editor.ui.addButton('readperson',{
  16. label:'插入收件人',
  17. icon: this.path + 'users.png',
  18. command:b
  19. });
  20. }
  21. });
  22. function addClick(){
  23. var urDlg=new UserDialog(
  24. {
  25. callback:dlgCallBack,
  26. isSingle:false
  27. }
  28. );
  29. urDlg.show();
  30. };
  31. function dlgCallBack(userIds,fullnames)
  32. {
  33. editor.insertHtml(fullnames);
  34. };
  35. })();