Commit 087b20fe authored by Medicean's avatar Medicean

(Enhance:ShellManager) 复制 Shell URL #144

parent d0c5b3d0
......@@ -6,6 +6,7 @@
* 主窗口增加 CSP 策略
* Fix self-xss in database config #151 (thx @miaochiahao)
* Fix #153 (thx @ViCrack)
* 复制 Shell URL #144
## `v(2.0.7.2)`
......
......@@ -68,7 +68,8 @@ module.exports = {
pluginStore: 'Plugin Store',
clearCache: 'Clear cache',
clearAllCache: 'Clear all cache',
viewsite: 'View Site'
viewsite: 'View Site',
copyurl: 'Copy URL'
},
category: {
title: 'Category',
......
......@@ -69,7 +69,8 @@ module.exports = {
pluginStore: '插件市场',
clearCache: '清空缓存',
clearAllCache: '清空所有缓存',
viewsite: '浏览网站'
viewsite: '浏览网站',
copyurl: '复制URL'
},
category: {
title: '分类目录',
......
......@@ -69,7 +69,8 @@ module.exports = {
pluginStore: '插件市場',
clearCache: '清空緩存',
clearAllCache: '清空所有緩存',
viewsite: '瀏覽網站'
viewsite: '瀏覽網站',
copyurl: '複製URL'
},
category: {
title: '分類目錄',
......
......@@ -69,7 +69,8 @@ module.exports = {
pluginStore: '插件市場',
clearCache: '清空緩存',
clearAllCache: '清空所有緩存',
viewsite: '瀏覽網站'
viewsite: '瀏覽網站',
copyurl: '複製URL'
},
category: {
title: '分類目錄',
......
......@@ -8,6 +8,7 @@ const ViewSite = require('../../viewsite/');
const Terminal = require('../../terminal/');
const Database = require('../../database/');
const FileManager = require('../../filemanager/');
const clipboard = require('electron').clipboard;
const LANG = antSword['language']['shellmanager'];
const LANG_T = antSword['language']['toastr'];
......@@ -38,6 +39,7 @@ class ContextMenu {
['viewsite', 'chrome', selectedData, () => {
new ViewSite(data[0]);
}],
['copyurl', 'copy', selectedData, this.copyUrl.bind(this, data[0])],
false,
['plugin', 'folder-o', selectedMultiData, null, this.parsePlugContextMenu(data)],
[
......@@ -351,6 +353,20 @@ class ContextMenu {
}
});
}
/**
* 复制URL
* @param {opt} info
*/
copyUrl(info) {
let url = info['url'];
clipboard.writeText(url);
let txt = clipboard.readText();
if(txt == url) {
toastr.success('Copy Success', LANG_T['success']);
}else{
toastr.error('Copy Failed', LANG_T['error']);
}
}
}
module.exports = ContextMenu;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment