KISSY.Editor.add("pagebreak",function(f){f.addPlugin("pagebreak",function(){var e=KISSY,i=e.Editor,j=e.Node,g=f.htmlDataProcessor;(e=g&&g.dataFilter)&&e.addRules({elements:{div:function(b){var c=b.attributes;var a=(c=c&&c.style)&&b.children.length==1&&b.children[0];if((a=a&&a.name=="span"&&a.attributes.style)&&/page-break-after\s*:\s*always/i.test(c)&&/display\s*:\s*none/i.test(a))return g.createFakeParserElement(b,"ke_pagebreak","div")}}});var k=f.addButton("page-break",{title:"\u5206\u9875",mode:i.WYSIWYG_MODE,
contentCls:"ke-toolbar-pagebreak",offClick:function(){var b=this.editor,c=new j('<div style="page-break-after: always; "><span style="DISPLAY:none">&nbsp;</span></div>',null,b.document);c=b.createFakeElement?b.createFakeElement(c,"ke_pagebreak","div",false,'<div style="page-break-after: always; "><span style="DISPLAY:none">&nbsp;</span></div>'):c;var a=b.getSelection();if(a=a&&a.getRanges()[0]){b.fire("save");for(var d=a.startContainer,h=d;d._4e_name()!=="body";){h=d;d=d.parent()}a.collapse(true);
a.splitElement(h);c.insertAfter(h);b.fire("save")}}});this.destroy=function(){k.destroy()}})},{attach:false,requires:["fakeobjects"]});
