Files

1 line
121 KiB
JavaScript
Raw Permalink Normal View History

2026-04-07 02:04:22 +05:30
var bt_file={area:[],loadT:null,loadY:null,vscode:null,file_table_arry:[],timerM:null,is_update_down_list:true,is_recycle:false,is_editor:false,file_header:{file_checkbox:40,file_name:"auto",file_accept:120,file_size:90,file_mtime:145,file_ps:"auto",file_operation:350,file_tr:0,file_list_header:0},file_operating:[],file_pointer:-1,file_path:"C:/",file_page_num:bt.get_storage("local","showRow")||100,file_list:[],file_store_list:[],file_store_current:0,file_images_list:[],file_drop:null,file_present_task:null,file_selection_operating:{},file_share_list:[],scroll_width:(function(){var c,a,b=document.createElement("DIV");b.style.cssText="position:absolute; top:-1000px; width:100px; height:100px; overflow:hidden;";c=document.body.appendChild(b).clientWidth;b.style.overflowY="scroll";a=b.clientWidth;document.body.removeChild(b);return c-a}()),is_mobile:function(){if(navigator.userAgent.match(/mobile/i)||/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)){layer.msg(navigator.userAgent.match(/mobile/i),{icon:2,time:0});return true}return false},method_list:{GetFileBody:"获取文件内容",DeleteDir:"删除文件目录",DeleteFile:"删除文件",GetDiskInfo:["system","获取磁盘列表"],CheckExistsFiles:"检测同名文件是否存在",GetFileAccess:"获取文件权限信息",SetFileAccess:lan["public"].config,DelFileAccess:"正在删除用户",get_path_size:"获取文件目录大小",add_files_store_types:"创建收藏夹分类",get_files_store:"获取收藏夹列表",del_files_store:"取消文件收藏",dir_webshell_check:"目录查杀",file_webshell_check:"查杀文件",get_download_url_list:"获取外链分享列表",get_download_url_find:"获取指定外链分享信息",create_download_url:"创建外链分享",remove_download_url:"取消外链分享",add_files_store:"添加文件收藏",CopyFile:"复制文件",MvFile:"剪切文件",SetBatchData:"执行批量操作",Get_Recycle_bin:"回收站列表",BatchPaste:"粘贴中"},file_drop:{f_path:null,startTime:0,endTime:0,uploadLength:0,splitSize:1024*1024*2,splitEndTime:0,splitStartTime:0,fileSize:0,speedLastTime:0,filesList:[],errorLength:0,isUpload:true,uploadSuspend:[],isUploadNumber:800,uploadAllSize:0,uploadedSize:0,updateedSizeLast:0,topUploadedSize:0,uploadExpectTime:0,initTimer:0,speedInterval:null,timerSpeed:0,isLayuiDrop:false,uploading:false,is_webkit:(function(){if(navigator.userAgent.indexOf("WebKit")>-1){return true}return false})(),init:function(){if($("#mask_layer").length==0){window.UploadFiles=function(){bt_file.file_drop.dialog_view()};$("body").append($('<div class="mask_layer" id="mask_layer" style="position:fixed;top:0;left:0;right:0;bottom:0; background:rgba(255,255,255,0.6);border:3px #ccc dashed;z-index:99999999;display:none;color:#999;font-size:40px;text-align:center;overflow:hidden;"><span style="position: absolute;top: 50%;left: 50%;margin-left: -300px;margin-top: -40px;">'+(!this.is_webkit?'<i style="font-size:20px;font-style:normal;display:block;margin-top:15px;color:red;">当前浏览器暂不支持拖动上传推荐使用Chrome浏览器或WebKit内核的浏览器。</i>':"上传文件到当前目录下")+"</span></div>"));this.event_relation(document.querySelector("#container"),document,document.querySelector("#mask_layer"))}},event_relation:function(f,b,a){var d=this,e=Object.keys(arguments);for(var c in arguments){if(typeof arguments[c]=="object"&&typeof arguments[c].nodeType!="undefined"){arguments[c]={el:arguments[c],callback:null}}}b.el.addEventListener("dragleave",(b.callback!=null)?b.callback:function(g){if(g.x==0&&g.y==0){$("#mask_layer").hide()}g.preventDefault()},false);f.el.addEventListener("dragenter",(f.callback!=null)?f.callback:function(g){if(g.dataTransfer.items[0].kind=="string"){return false}$("#mask_layer").show();d.isLayuiDrop=false;g.preventDefault()},false);a.el.addEventListener("dragover",function(g){g.preventDefault()},false);a.el.addEventListener("drop",(f.callback!=null)?a.callback:d.ev_drop,false)},ev_drop:function(g){if(g.dataTransfer.items[0].kind=="string"){return false}if(!bt_file.file_drop.is_webkit){