!function(e,t){if("function"==typeof define&&define.amd)define(["elfinder"],e);else if(t){var n=t.prototype._options.commandsOptions.edit.editors;t.prototype._options.commandsOptions.edit.editors=n.concat(e(t))}}(function(e){"use strict";var t=window.location.search.match(/getfile=([a-z]+)/),n=e.hasRequire,i=function(){var e;try{e=!!new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){e=!!("undefined"==typeof window.orientation||navigator&&navigator.mimeTypes["application/x-shockwave-flash"])}return e}(),o=function(e,t,n,i){var o=$(this).children("img:first"),a=$("
").css({position:"absolute",top:"50%",textAlign:"center",width:"100%",fontSize:"16pt"}).html(i.i18n("ntfloadimg")).hide().appendTo(this);o.attr("id",e+"-img").attr("src",n).css({height:"","max-width":"100%","max-height":"100%",cursor:"pointer"}).data("loading",function(e){var t=o.closest(".elfinder-dialog").find("button,.elfinder-titlebar-button");return t.prop("disabled",!e)[e?"removeClass":"addClass"]("ui-state-disabled"),o.css("opacity",e?"":"0.3"),a[e?"hide":"show"](),o})},a=function(e,t){var n,i,o,a=e.attr("style");try{e.attr("style",""),n=e.get(0),i=document.createElement("canvas"),i.width=n.width,i.height=n.height,e.attr("style",a),i.getContext("2d").drawImage(n,0,0),o=i.toDataURL(t)}catch(r){o=e.attr("src")}return o},r=function(){if(i&&window.parent!==window){var e,t,n,o,a=window.location.search.match(/[?&]pixlr=([^&]+)/),r=window.location.search.match(/[?&]image=([^&]+)/);a&&(e=window.parent,t=e.$("#"+a[1]+"iframe").hide(),o=e.$("#"+a[1]).data("resizeoff")(),"http"===r[1].substr(0,4)?(n=r[1],"https:"===window.location.protocol&&(n=n.replace(/^http:/,"https:")),o.on("load error",function(){o.data("loading")(!0)}).attr("src",n).data("loading")()):o.data("loading")(!0),t.remove())}},c=function(e,t){i&&!t.UA.ltIE8||(this.disabled=!0)},s=function(e,t){var n,i=this.fm,o=$(t).children("img:first").data("loading")().data("resizeoff",function(){return $(window).off("resize."+o.attr("id")),o}).on("click",function(){m()}),a=i.getUI(),r=$('',setup:function(e,t){(t.UA.Mobile||t.UA.ltIE8)&&(this.disabled=!0)},prepare:function(e,t,n){var i=e.editor.fm.getUI();$(e).height(i.height()),t.width=Math.max(t.width||0,.8*i.width())},init:function(e,t,n,i){var o=this,a=$(this).hide(),r=$("
").css({position:"absolute",top:"50%",textAlign:"center",width:"100%",fontSize:"16pt"}).html(i.i18n("nowLoading")+'').appendTo(a.parent()),c=function(){var e="";return $.each(i.customData,function(t,n){e+="&"+encodeURIComponent(t)+"="+encodeURIComponent(n)}),e};$(o).data("xhr",i.request({data:{cmd:"editor",name:"ZohoOffice",method:"init","args[target]":t.hash,"args[lang]":i.lang,"args[cdata]":c},preventDefault:!0}).done(function(e){e.zohourl?a.attr("src",e.zohourl).show().height("100%"):(e.error&&i.error(e.error),o.elfinderdialog("destroy"))}).fail(function(e){e&&i.error(e),o.elfinderdialog("destroy")}).always(function(){r.remove()}))},load:function(){},getContent:function(){},save:function(){},beforeclose:function(e){var t=$.Deferred(),n="about:blank";return e.src=n,setTimeout(function(){var i;try{i=e.contentWindow.location.href}catch(o){i=null}i===n?t.resolve():t.reject()},10),t},close:function(e){var t=this.fm,n=$(e).data("xhr");"pending"===n.state()?n.reject():t.sync(t.cwd().hash)}},{info:{name:"TextArea",useTextAreaEvent:!0},load:function(){},save:function(){}}]},window.elFinder);