var __uploadImageTarget=null;if(window.addEventListener("load",(function(){$(document).ready((function(){$(".upload-image-btn i").on("click",(function(){return $(this).parent().removeClass("fill-image").parent().parent().find("input.upload-image-input").val("").trigger("change"),!1})),$(".upload-image-input").on("change",(function(){if(""!=$.trim(this.value)){if("http"==this.value.substr(0,4))var e=this.value;else e=baseUrl+this.value;$(this).parent().parent().parent().find(".open-upload-image").css("background-image","url("+e+")")}else $(this).parent().parent().parent().find(".open-upload-image").css("background-image","url("+baseUrl+"/images/upload-img.png)")})).val(),$(".upload-image-input").each((function(){if(""!=$.trim(this.value)){if("http"==this.value.substr(0,4))var e=this.value;else e=baseUrl+this.value;$(this).parent().parent().parent().find(".open-upload-image").css("background-image","url("+e+")").parent().addClass("fill-image")}})),$(".open-upload-image").on("click",(function(){__uploadImageTarget=this,void 0==$("#modal-upload-image iframe").attr("src")&&$("#modal-upload-image iframe").attr("src",baseUrl+"/elFinder/elfinder.legacy.php?se_key_t="+__my_uploadToken),$("#modal-upload-image").fadeIn()})),$("#close-modal-upload-image, #modal-upload-image .modal-header .close").on("click",(function(){$("#modal-upload-image").fadeOut()})),$("#select-images-modal").on("click",(function(){$("#modal-upload-image iframe")[0].contentWindow.selectFile()}))}))})),"function"!==typeof onSelectImageFileElFinder)function onSelectImageFileElFinder(e){var a=e.indexOf("php/../files/");-1!==a&&(e="/elFinder"+e.substr(a+6),$(__uploadImageTarget).parent().addClass("fill-image").parent().parent().find(".form-control").val(e).trigger("change"),$("#close-modal-upload-image").trigger("click"))}if("function"!==typeof showElFinderUploadBox)function showElFinderUploadBox(e){if(__uploadImageTarget=e,null!=e.getAttribute("data-suneditor")){var a=$("#suneditor_"+__uploadImageTarget.getAttribute("data-suneditor")+" .editor_image ._se_image_check_caption")[0].checked;e.setAttribute("data-add-caption",a?1:0),$(__uploadImageTarget).parent().parent().parent().parent().parent().find(".se-dialog-header .close").click()}void 0==$("#modal-upload-image iframe").attr("src")&&$("#modal-upload-image iframe").attr("src",baseUrl+"/elFinder/elfinder.legacy.php?se_key_t="+__my_uploadToken),$("#modal-upload-image").fadeIn()}