芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.9/plg_editors_tinymce/js/plugins/dragdrop/plugin.min.js
!function(){"use strict";tinymce.PluginManager.add("jdragndrop",(function(t){var e;function a(a){var n=new FileReader;n.onload=function(n){var o=n.target.result,r=o.indexOf("base64")+7,i=o.slice(r,o.length);!function(a,n){var o,r=t.settings.uploadUri+"&path="+t.settings.comMediaAdapter,i=((o={})[t.settings.csrfToken]="1",o.name=a,o.content=n,o.parent=t.settings.parentUploadFolder,o);Joomla.request({url:r,method:"POST",data:JSON.stringify(i),headers:{"Content-Type":"application/json"},onSuccess:function(a){var n;try{n=JSON.parse(a)}catch(e){t.windowManager.alert(Joomla.Text._("ERROR")+": {e}")}if(n.data&&n.data.path){var o;if(e=n.data,/local-/.test(e.adapter)){var r=Joomla.getOptions("system.paths").rootFull;o=""+n.data.thumb_path.split(r)[1]}else e.thumb_path&&(o=e.thumb_path);var i=function(a){var n=a.getData(),r=n.altEmpty?' alt=""':"",i=n.altText?' alt="'+n.altText+'"':r,l=n.isLazy?' loading="lazy"':"",s=n.isLazy?' width="'+e.width+'"':"",d=n.isLazy?' height="'+e.height+'"':"";t.execCommand("mceInsertContent",!1,'
")};t.windowManager.open({title:Joomla.Text._("PLG_TINY_DND_ADDITIONALDATA"),body:{type:"panel",items:[{type:"input",name:"altText",label:Joomla.Text._("PLG_TINY_DND_ALTTEXT")},{type:"checkbox",name:"altEmpty",label:Joomla.Text._("PLG_TINY_DND_EMPTY_ALT")},{type:"checkbox",name:"isLazy",label:Joomla.Text._("PLG_TINY_DND_LAZYLOADED")}]},buttons:[{type:"cancel",text:"Cancel"},{type:"submit",name:"submitButton",text:"Save",primary:!0}],initialData:{altText:"",isLazy:!0,altEmpty:!1},onSubmit:function(t){i(t),t.close()},onCancel:function(t){i(t)}})}},onError:function(e){t.windowManager.alert("Error: "+e.statusText)}})}(a.name,i)},n.readAsDataURL(a)}tinyMCE.DOM.bind(document,"dragleave",(function(e){return e.stopPropagation(),e.preventDefault(),t.contentAreaContainer.style.borderWidth="1px 0 0",!1})),t.on("dragenter",(function(t){return t.stopPropagation(),!1})),t.on("dragover",(function(e){return e.preventDefault(),t.contentAreaContainer.style.borderStyle="dashed",t.contentAreaContainer.style.borderWidth="5px",!1})),"undefined"!=typeof FormData?t.on("drop",(function(e){(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length>0)&&[].slice.call(e.dataTransfer.files).forEach((function(t){t.name.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)&&a(t)}));t.contentAreaContainer.style.borderWidth="1px 0 0"})):(Joomla.renderMessages({error:[Joomla.Text._("PLG_TINY_ERR_UNSUPPORTEDBROWSER")]}),t.on("drop",(function(t){return t.preventDefault(),!1})))}))}();