plugin.js 560 B

123456789101112131415161718192021
  1. (function(){
  2. //Section 1 : 按下自定义按钮时执行的代码
  3. var a= {
  4. exec:function(editor){
  5. var imgHtml = '#tagpage#';
  6. editor.insertHtml(imgHtml);
  7. }
  8. },
  9. //Section 2 : 创建自定义按钮、绑定方法
  10. b='page';
  11. CKEDITOR.plugins.add(b,{
  12. init:function(editor){
  13. editor.addCommand(b,a);
  14. editor.ui.addButton('page',{
  15. label:'插入分页',
  16. icon: this.path + 'pagebreak.gif',
  17. command:b
  18. });
  19. }
  20. });
  21. })();