feat: 后端全量更新 - 含所有本次需求
- Contract.php: 返回合约账户余额(balance_contract) - My.php: 地址管理增加BTC/ETH - AppContract.php: 一键平仓(closeall) - AppProxy.php: 代理专属注册链接 + 分级权限(L1/L2) - site.php: 手续费减半(0.018→0.009) - agent_permission_setup.sql: 代理权限SQL - crypto_news_crawler.py: 新闻自动采集脚本
This commit is contained in:
+103
@@ -0,0 +1,103 @@
|
||||
define(function(require, exports) {
|
||||
if(!core.authCheck('explorer.fileDownload')){
|
||||
$(".context-menu-list .open-browser").remove();
|
||||
}
|
||||
var menuAction = function(action,option){
|
||||
//console.log(action,option);
|
||||
var zip = function(fileType){
|
||||
var oprate = ui.path.pathOperate;
|
||||
oprate.zip(ui.path.makeParam(true),ui.path.refreshCallback,fileType);
|
||||
};
|
||||
var unZip = function(createFolder){
|
||||
if(!ui.path.checkSystemPath()) return;
|
||||
var oprate = ui.path.pathOperate;
|
||||
oprate.unZip(ui.path.makeParam().path,ui.f5,createFolder);
|
||||
};
|
||||
switch(action){
|
||||
case 'zip-zip': zip();break;
|
||||
case 'zip-tar': zip('tar');break;
|
||||
case 'zip-tgz': zip('tar.gz');break;
|
||||
case 'unzip-folder':unZip();break;
|
||||
case 'unzip-this':unZip('toThis');break;
|
||||
case 'unzip-to':unZip('toFolder');break;
|
||||
}
|
||||
}
|
||||
var option = {//file;
|
||||
"unzip":{
|
||||
name:LNG.unzip,
|
||||
className:"unzip",
|
||||
icon:"icon-folder-open-alt",
|
||||
items:{
|
||||
"unzip-this":{name:LNG.unzip_this,className:"unzip-this",icon:"icon-external-link",callback:menuAction},
|
||||
"unzip-folder":{name:LNG.unzip_folder,className:"unzip-folder",icon:"icon-external-link",callback:menuAction},
|
||||
"unzip-to":{name:LNG.unzip_to,className:"unzip-to",icon:"icon-external-link",callback:menuAction}
|
||||
}
|
||||
},
|
||||
"zip":{
|
||||
name:LNG.zip,
|
||||
className:"zip",
|
||||
icon:"icon-external-link",
|
||||
items:{
|
||||
"zip-zip":{name:"ZIP "+LNG.file,className:"zip-zip",icon:"icon-external-link",callback:menuAction},
|
||||
"sep109":"--------",
|
||||
"zip-tar":{name:"TAR "+LNG.file,className:"zip-tar",icon:"icon-external-link",callback:menuAction},
|
||||
"zip-tgz":{name:"GZIP "+LNG.file,className:"zip-tgz",icon:"icon-external-link",callback:menuAction}
|
||||
}
|
||||
}
|
||||
}
|
||||
var menuAdd = function(){
|
||||
if (!core.authCheck('explorer.zip')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.contextMenu.menuAdd({zip:option.zip},'.menu-more',false,'.clone');
|
||||
$.contextMenu.menuAdd(option,'.menu-file',false,'.open-browser');
|
||||
$.contextMenu.menuAdd({zip:option.zip},'.menu-folder',false,'.open-browser');
|
||||
$.contextMenu.menuAdd(option,'.toolbar-path-more',false,'.others');
|
||||
}
|
||||
|
||||
Hook.bind('rightMenu.show.menu-file,rightMenu.show.menu-tree-file',function($menuAt,$theMenu){
|
||||
if($('.context-menu-active').hasClass('menu-tree-file') ){
|
||||
var param = ui.tree.makeParam();
|
||||
}else{
|
||||
var param = ui.path.makeParam();
|
||||
}
|
||||
var ext = core.pathExt(param.path);
|
||||
var hideClass = 'hidden';
|
||||
if ( kodApp.appSupportCheck('zipView',ext) ) {
|
||||
$theMenu.find('.unzip').removeClass(hideClass);
|
||||
}else{
|
||||
$theMenu.find('.unzip').addClass(hideClass);
|
||||
}
|
||||
});
|
||||
|
||||
//解压缩对话框菜单
|
||||
Hook.bind('rightMenu.show',function(selector,$menuAt,$theMenu){
|
||||
var menuArr = [
|
||||
".menu-folder",
|
||||
".menu-file",
|
||||
".menu-tree-folder",
|
||||
".menu-tree-file",
|
||||
]
|
||||
if(!_.include(menuArr,selector)){
|
||||
return;
|
||||
}
|
||||
var disableClass = 'disabled';
|
||||
var menuNotWrite = '.zip';
|
||||
var menuNotRead = '.zip,.unzip-this,.unzip-folder';
|
||||
//不可读写
|
||||
if($menuAt.hasClass('file-not-readable')){
|
||||
$theMenu.find(menuNotRead).addClass(disableClass);
|
||||
}else{
|
||||
$theMenu.find(menuNotRead).removeClass(disableClass);
|
||||
}
|
||||
//只读
|
||||
if($menuAt.hasClass('file-not-writeable')){
|
||||
$theMenu.find(menuNotWrite).addClass(disableClass);
|
||||
}else{
|
||||
$theMenu.find(menuNotWrite).removeClass(disableClass);
|
||||
}
|
||||
});
|
||||
menuAdd();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user