芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/wpdiscuz/assets/js/wpdiscuz-mu-frontend.min.js
jQuery(document).ready((function(e){const a=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled,10);function t(a,t={}){console.log("init: "+JSON.stringify(t));let o=wpdiscuzAjaxObj.previewTemplate;o=o.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t.type),o=o.replace("[PREVIEW_TITLE]",t.fullname),o=o.replace("[PREVIEW_TYPE]",t.type),o=o.replace("[PREVIEW_ID]",t.id),o=o.replace("[PREVIEW_ICON]",t.icon),o=o.replace("[PREVIEW_FILENAME]",t.shortname),e(".wmu-action-wrap .wmu-"+t.type+"-tab",a).removeClass("wmu-hide").append(o)}function o(e){let a=e;return void 0!==e&&e.length&&e.length>40&&(a=e.substring(e.length-40),a="..."+a),a}if(e("body").on("click","#wpdcom .wmu-upload-wrap",(function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)})),e(document).delegate(".wmu-add-files","change",(function(){const a=e(this),n=a.closest(".wpd_comm_form"),i=a[0].files?a[0].files:[];i.length&&(e(".wmu-action-wrap .wmu-tabs",n).html(""),e.each(i,(function(e,a){let i=a.type,c={id:"",icon:"",fullname:a.name,shortname:o(a.name),type:""};if(i.match(/^image/)){if(c.type="images",window.FileReader){const e=new FileReader;e.readAsDataURL(a),e.onloadend=function(){c.icon=this.result,c.shortname="",t(n,c)}}}else i.match(/^video/)||i.match(/^audio/)?(c.type="videos",c.icon=wpdiscuzAjaxObj.wmuIconVideo,t(n,c)):(c.type="files",c.icon=wpdiscuzAjaxObj.wmuIconFile,t(n,c))})))})),e("body").on("click",".wmu-attachment-delete",(function(t){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){const t=e(this),o=t.data("wmu-attachment"),n=new FormData;n.append("action","wmuDeleteAttachment"),n.append("attachmentId",o),wpdiscuzAjaxObj.getAjaxObj(a,!0,n).done((function(a){if(a.success){var o=t.parents(".wmu-comment-attachments");t.parent(".wmu-attachment").remove(),e(".wmu-attached-images *",o).length||e(".wmu-attached-images",o).remove(),e(".wmu-attached-videos *",o).length||e(".wmu-attached-videos",o).remove(),e(".wmu-attached-files *",o).length||e(".wmu-attached-files",o).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,o),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)})).fail((function(a,t,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}else console.log("canceled")})),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function n(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}n(),wpdiscuzAjaxObj.wmuAddLightBox=n}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}}));