Update files.js

pull/675/head
Mr Chen 5 months ago
parent 6286f03432
commit 1360d2d066
  1. 66
      web/static/app/files.js

@ -156,14 +156,14 @@ function recycleBin(type){
var tablehtml = '<div class="re-head">\ var tablehtml = '<div class="re-head">\
<div style="margin-left: 3px;" class="ss-text">\ <div style="margin-left: 3px;" class="ss-text">\
<em>文件回收站</em>\ <em>文件回收站</em>\
<div class="ssh-item">\ <div class="ssh-item">\
<input class="btswitch btswitch-ios" id="setRecycleBin" type="checkbox" '+(rdata.status?'checked':'')+'>\ <input class="btswitch btswitch-ios" id="setRecycleBin" type="checkbox" '+(rdata.status?'checked':'')+'>\
<label class="btswitch-btn" for="setRecycleBin" onclick="setRecycleBin()"></label>\ <label class="btswitch-btn" for="setRecycleBin" onclick="setRecycleBin()"></label>\
</div>\ </div>\
</div>\ </div>\
<span style="line-height: 32px; margin-left: 30px;">注意关闭回收站删除的文件无法恢复</span>\ <span style="line-height: 32px; margin-left: 30px;">注意关闭回收站删除的文件无法恢复</span>\
<button style="float: right" class="btn btn-default btn-sm" onclick="closeRecycleBin();">清空回收站</button>\ <button style="float: right" class="btn btn-default btn-sm" onclick="closeRecycleBin();">清空回收站</button>\
</div>\ </div>\
<div class="re-con">\ <div class="re-con">\
<div class="re-con-menu">\ <div class="re-con-menu">\
@ -290,7 +290,7 @@ function openFilename(obj){
} }
if (inArray(ext,['png','jpeg','jpg','gif','webp','bmp','ico'])){ if (inArray(ext,['png','jpeg','jpg','gif','webp','bmp','ico'])){
getImage(path); getImage(path);
} }
if (inArray(ext,['svg'])){ if (inArray(ext,['svg'])){
@ -303,19 +303,19 @@ function openFilename(obj){
maxmin:true, maxmin:true,
shadeClose: true, shadeClose: true,
content: '<iframe width="100%" height="100%"\ content: '<iframe width="100%" height="100%"\
src="'+url+'"\ src="'+url+'"\
frameborder="0"\ frameborder="0"\
border="0"\ border="0"\
marginwidth="0"\ marginwidth="0"\
marginheight="0"\ marginheight="0"\
scrolling="yes"\ scrolling="yes"\
noresize=""\ noresize=""\
allowfullscreen="allowfullscreen"\ allowfullscreen="allowfullscreen"\
mozallowfullscreen="mozallowfullscreen"\ mozallowfullscreen="mozallowfullscreen"\
msallowfullscreen="msallowfullscreen"\ msallowfullscreen="msallowfullscreen"\
oallowfullscreen="oallowfullscreen"\ oallowfullscreen="oallowfullscreen"\
webkitallowfullscreen="webkitallowfullscreen"\ webkitallowfullscreen="webkitallowfullscreen"\
allowfullscreen="true"></iframe>' allowfullscreen="true"></iframe>'
}); });
} }
} }
@ -374,16 +374,15 @@ function getFiles(Path) {
Path = getCookie('open_dir_path'); Path = getCookie('open_dir_path');
} }
var args = {};
args['p'] = p;
var post = {}; var post = {};
post['path'] = Path; post['path'] = Path;
post['p'] = p;
var file_row = $.cookie('file_row'); var file_row = $.cookie('file_row');
if(!file_row) { if(!file_row) {
file_row = '100'; file_row = '100';
} }
args['row'] = file_row; post['row'] = file_row;
var body = ''; var body = '';
var totalSize = 0; var totalSize = 0;
@ -392,13 +391,13 @@ function getFiles(Path) {
var search_file = $("#search_file").val(); var search_file = $("#search_file").val();
if(search_file.length > 0){ if(search_file.length > 0){
args['search'] = search_file; post['search'] = search_file;
} }
var search_all = ''; var search_all = '';
var all = $('#search_all').hasClass('active'); var all = $('#search_all').hasClass('active');
if(all){ if(all){
args['all'] = 'yes'; post['all'] = 'yes';
} }
var file_order = $.cookie('file_order'); var file_order = $.cookie('file_order');
@ -406,10 +405,9 @@ function getFiles(Path) {
post['order'] = file_order.replace('|',' '); post['order'] = file_order.replace('|',' ');
} }
var query_str = toUrlParam(args);
var loadT = layer.load(); var loadT = layer.load();
$.post('/files/get_dir?' + query_str, post, function(rdata) { $.post('/files/get_dir', post, function(rdata) {
layer.close(loadT); layer.close(loadT);
//构建分页 //构建分页
@ -1428,9 +1426,9 @@ function isCompressFile(fileName){
var extName = ext[ext.length-1].toLowerCase(); var extName = ext[ext.length-1].toLowerCase();
var support = ['zip','gz','tgz','rar']; var support = ['zip','gz','tgz','rar'];
for (x in support) { for (x in support) {
if (support[x]==extName){ if (support[x]==extName){
return true; return true;
} }
} }
return false; return false;
} }
@ -1638,8 +1636,8 @@ function setChmod(action,fileName){
</select></span></div>\ </select></span></div>\
<div class="bt-form-submit-btn">\ <div class="bt-form-submit-btn">\
<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">关闭</button>\ <button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">关闭</button>\
<button type="button" class="btn btn-success btn-sm btn-title" onclick="'+toExec+'" >确定</button>\ <button type="button" class="btn btn-success btn-sm btn-title" onclick="'+toExec+'" >确定</button>\
</div>\ </div>\
</div>' </div>'
}); });
@ -1717,7 +1715,7 @@ function rightMenuClick(type,path,name){
{text: "剪切", onclick: function() {cutFile(path)}}, {text: "剪切", onclick: function() {cutFile(path)}},
{text: "重命名", onclick: function() {reName(0,name)}}, {text: "重命名", onclick: function() {reName(0,name)}},
{text: lan.files.file_menu_auth, onclick: function() {setChmod(0,path)}}, {text: lan.files.file_menu_auth, onclick: function() {setChmod(0,path)}},
{text: lan.files.file_menu_zip, onclick: function() {zip(path)}}, {text: lan.files.file_menu_zip, onclick: function() {zip(path)}},
]}; ]};
if(type == "dir"){ if(type == "dir"){
options.items.push({text: lan.files.file_menu_del, onclick: function() { options.items.push({text: lan.files.file_menu_del, onclick: function() {

Loading…
Cancel
Save