/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.editor.plugins.PageBreak"],["require","dijit._editor.html"],["require","dijit._editor._Plugin"],["require","dojo.i18n"],["requireLocalization","dojox.editor.plugins","PageBreak",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw","ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.editor.plugins.PageBreak"]){_4._hasResource["dojox.editor.plugins.PageBreak"]=true;_4.provide("dojox.editor.plugins.PageBreak");_4.require("dijit._editor.html");_4.require("dijit._editor._Plugin");_4.require("dojo.i18n");_4.declare("dojox.editor.plugins.PageBreak",_5._editor._Plugin,{useDefaultCommand:false,iconClassPrefix:"dijitAdditionalEditorIcon",_unbreakableNodes:["li","ul","ol"],_pbContent:"<hr style='page-break-after: always;' class='dijitEditorPageBreak'>",_initButton:function(){var ed=this.editor;var _7=_4.i18n.getLocalization("dojox.editor.plugins","PageBreak");this.button=new _5.form.Button({label:_7["pageBreak"],showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"PageBreak",tabIndex:"-1",onClick:_4.hitch(this,"_insertPageBreak")});ed.onLoadDeferred.addCallback(_4.hitch(this,function(){ed.addKeyHandler(_4.keys.ENTER,true,true,_4.hitch(this,this._insertPageBreak));if(_4.isWebKit||_4.isOpera){this.connect(this.editor,"onKeyDown",_4.hitch(this,function(e){if((e.keyCode===_4.keys.ENTER)&&e.ctrlKey&&e.shiftKey){this._insertPageBreak();}}));}}));},updateState:function(){this.button.set("disabled",this.get("disabled"));},setEditor:function(_8){this.editor=_8;this._initButton();},_style:function(){if(!this._styled){this._styled=true;var _9=this.editor.document;var _a=".dijitEditorPageBreak {\n"+"\tborder-top-style: solid;\n"+"\tborder-top-width: 3px;\n"+"\tborder-top-color: #585858;\n"+"\tborder-bottom-style: solid;\n"+"\tborder-bottom-width: 1px;\n"+"\tborder-bottom-color: #585858;\n"+"\tborder-left-style: solid;\n"+"\tborder-left-width: 1px;\n"+"\tborder-left-color: #585858;\n"+"\tborder-right-style: solid;\n"+"\tborder-right-width: 1px;\n"+"\tborder-right-color: #585858;\n"+"\tcolor: #A4A4A4;\n"+"\tbackground-color: #A4A4A4;\n"+"\theight: 10px;\n"+"\tpage-break-after: always;\n"+"\tpadding: 0px 0px 0px 0px;\n"+"}\n\n"+"@media print {\n"+"\t.dijitEditorPageBreak { page-break-after: always; "+"background-color: rgba(0,0,0,0); color: rgba(0,0,0,0); "+"border: 0px none rgba(0,0,0,0); display: hidden; "+"width: 0px; height: 0px;}\n"+"}";if(!_4.isIE){var _b=_9.createElement("style");_b.appendChild(_9.createTextNode(_a));_9.getElementsByTagName("head")[0].appendChild(_b);}else{var ss=_9.createStyleSheet("");ss.cssText=_a;}}},_insertPageBreak:function(){try{if(!this._styled){this._style();}if(this._allowBreak()){this.editor.execCommand("inserthtml",this._pbContent);}}catch(e){console.warn(e);}},_allowBreak:function(){var ed=this.editor;var _c=ed.document;var _d=ed._sCall("getSelectedElement",null)||ed._sCall("getParentElement",null);while(_d&&_d!==_c.body&&_d!==_c.html){if(ed._sCall("isTag",[_d,this._unbreakableNodes])){return false;}_d=_d.parentNode;}return true;}});_4.subscribe(_5._scopeName+".Editor.getPlugin",null,function(o){if(o.plugin){return;}var _e=o.args.name.toLowerCase();if(_e==="pagebreak"){o.plugin=new _6.editor.plugins.PageBreak({});}});}}};});