Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this_select.open(name);
}).on('click','a[data-action="createDir"]',function(){
//创建新的文件夹
UI.ask('新目录叫什么呢?', function(txt){
this_select.createDir(txt);
});
}).on('click','a[data-action="back"]',function(){
//后退
this_select.back();
}).on('click','a[data-action="changeLayout"]',function(){
//改变布局
this_select.layout();
});
//空白处绑定右键
var fileMenu = panel({
targets: '.gP_cnt'
});
fileMenu.add('mkdir',{txt:'新建目录'},function(){
//创建新的文件夹
UI.ask('新目录叫什么呢?', function(txt){
this_select.createDir(txt);
});
});
//文件右键菜单
var fileMenu = panel({
targets: '.gP_item[data-type="file"]'
});
//指定类型
fileMenu.type = 'menu';
ready() {
panel = new Panel('poster', this)
},
});
//空白处绑定右键
var fileMenu = panel({
targets: '.gP_cnt'
});
fileMenu.add('mkdir',{txt:'新建目录'},function(){
//创建新的文件夹
UI.ask('新目录叫什么呢?', function(txt){
this_select.createDir(txt);
});
});
//文件右键菜单
var fileMenu = panel({
targets: '.gP_item[data-type="file"]'
});
//指定类型
fileMenu.type = 'menu';
//增删菜单条目
fileMenu.add('rename',{txt:'重命名'},function(){
//重命名
var fullname = $(this).attr('data-fullname');
var file = this_select.get(fullname,'file');
file && file.rename();
});
fileMenu.add('delete',{txt:'删除'},function(){
//删除
var fullname = $(this).attr('data-fullname');
var file = this_select.get(fullname,'file');
file && file.del();
var fullname = $(this).attr('data-fullname');
var file = this_select.get(fullname,'file');
file && file.del();
});
fileMenu.add('showurl',{txt:'url地址'},function(){
//显示绝对地址
var fullname = $(this).attr('data-fullname');
var file = this_select.get(fullname,'file');
UI.confirm({
text: '<a href="' + file.url + '">' + file.url + '</a>'
})
});
//文件夹右键菜单
var folderMenu = panel({
targets: '.gP_item[data-type="folder"]'
});
//指定类型
folderMenu.type = 'menu';
//增删菜单条目
folderMenu.add('open',{
txt: '打开'
},function(){
//重命名
var fullname = $(this).attr('data-fullname');
this_select.open(fullname);
});
folderMenu.add('rename',{
txt: '重命名'
},function(){
//重命名