YUI.add("moodle-atto_managefiles-button",function(i,e){i.namespace("M.atto_managefiles").Button=i.Base.create("button",i.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){var e,t;this.get("disabled")||(t=this.get("host"),e=this.get("area"),(t=t.get("filepickeroptions")).image&&t.image.itemid&&(e.itemid=t.image.itemid,this.set("area",e),this.addButton({icon:"e/manage_files",callback:this._displayDialogue})))},_displayDialogue:function(e){var t;e.preventDefault(),e=this.getDialogue({headerContent:M.util.get_string("managefiles","atto_managefiles"),width:"800px",focusAfterHide:!0}),(t=i.Node.create("<iframe></iframe>")).setStyles({height:"700px",border:"none",width:"100%"}),t.setAttribute("src",this._getIframeURL()),t.on("load",function(e,t){var i=t.getDOMNode().contentDocument.querySelector("#fitem_id_files_filemanager"),a=setInterval(function(){var e;i.querySelector(".fm-loaded")&&((e=i.querySelector(".fp-navbar a:not([disabled])"))&&e.focus(),clearInterval(a))},200)},this,t),e.set("bodyContent",t).show(),this.markUpdated()},_getIframeURL:function(){var e=i.mix({elementid:this.get("host").get("elementid")},this.get("area"));return M.cfg.wwwroot+"/lib/editor/atto/plugins/managefiles/manage.php?"+i.QueryString.stringify(e)}},{ATTRS:{disabled:{value:!0},area:{value:{}}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});