KISSY.Editor.add("overlay",function(){function c(){}var d=KISSY,b=d.UA,f=d.Editor,g=f.focusManager;f.namespace("UIBase");if(f.UIBase.Focus)d.log("ke uibase focus attach more","warn");else{c.ATTRS={focus4e:{value:true}};c.prototype={_uiSetFocus4e:function(a){if(a){this.on("show",this._show4FocusExt,this);this.on("hide",this._hide4FocusExt,this)}else{this.detach("show",this._show4FocusExt,this);this.detach("hide",this._hide4FocusExt,this)}},__syncUI:function(){},__renderUI:function(){},__bindUI:function(){this._focus4e=
(new d.Node("<a href='#' class='ke-focus' style='width:0;height:0;margin:0;padding:0;overflow:hidden;outline:none;font-size:0;'></a>")).appendTo(this.get("el"))},_show4FocusExt:function(){var a=this._focusEditor=g.currentInstance();if(b.ie&&a){window.focus();document.body.focus();this._focus4e[0].focus();var e=a.document.selection.createRange();if(e)if(e.item&&e.item(0).ownerDocument==a.document){a=document.body.createTextRange();a.moveToElementText(this.get("el")._4e_first()[0]);a.collapse(true);
a.select()}}},_hide4FocusExt:function(){var a=this._focusEditor;a&&a.focus()}};f.UIBase.Focus=c}},{attach:false});
KISSY.Editor.add("overlay",function(){var c=KISSY,d=c.UIBase,b=c.Editor;if(b.Overlay)c.log("ke overlay attach more");else{var f=d.create(c.Overlay,[b.UIBase.Focus],{syncUI:function(){b.Utils.preventFocus(this.get("contentEl"))}},{ATTRS:{zIndex:{value:b.baseZIndex(b.zIndexManager.OVERLAY)}}}),g=d.create(c.Dialog,[b.UIBase.Focus],{show:function(){this.center();var e=this.get("y");if(e-c.DOM.scrollTop()>200){e=c.DOM.scrollTop()+200;this.set("y",e)}g.superclass.show.call(this)}},{ATTRS:{constrain:{value:true},
zIndex:{value:b.baseZIndex(b.zIndexManager.OVERLAY)}}});b.Overlay=f;b.Dialog=g;var a;b.Overlay.loading=function(){a||(a=new b.Overlay({x:0,focus4e:false,width:c.UA.ie==6?c.DOM.docWidth():"100%",y:0,zIndex:b.baseZIndex(b.zIndexManager.LOADING),elCls:"ke-global-loading"}));a.set("height",c.DOM.docHeight());a.show();a.loading()};b.Overlay.unloading=function(){a&&a.hide()}}});
