Skip to content

Commit

Permalink
(Enhance:ShellManager) 复制 Shell URL #144
Browse files Browse the repository at this point in the history
  • Loading branch information
Medicean committed Apr 21, 2019
1 parent d0c5b3d commit 087b20f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)`

Expand Down
3 changes: 2 additions & 1 deletion source/language/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion source/language/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ module.exports = {
pluginStore: '插件市场',
clearCache: '清空缓存',
clearAllCache: '清空所有缓存',
viewsite: '浏览网站'
viewsite: '浏览网站',
copyurl: '复制URL'
},
category: {
title: '分类目录',
Expand Down
3 changes: 2 additions & 1 deletion source/language/zh_hk.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ module.exports = {
pluginStore: '插件市場',
clearCache: '清空緩存',
clearAllCache: '清空所有緩存',
viewsite: '瀏覽網站'
viewsite: '瀏覽網站',
copyurl: '複製URL'
},
category: {
title: '分類目錄',
Expand Down
3 changes: 2 additions & 1 deletion source/language/zh_tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ module.exports = {
pluginStore: '插件市場',
clearCache: '清空緩存',
clearAllCache: '清空所有緩存',
viewsite: '瀏覽網站'
viewsite: '瀏覽網站',
copyurl: '複製URL'
},
category: {
title: '分類目錄',
Expand Down
16 changes: 16 additions & 0 deletions source/modules/shellmanager/list/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down Expand Up @@ -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)],
[
Expand Down Expand Up @@ -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;

0 comments on commit 087b20f

Please sign in to comment.