Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
8692ee55
Commit
8692ee55
authored
Dec 30, 2018
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhancement:Module:FileManager) 新增「复制文件名」和「复制文件路径」功能 #109
parent
8524d06d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
16 deletions
+49
-16
CHANGELOG.md
CHANGELOG.md
+1
-0
README.md
README.md
+1
-1
README_CN.md
README_CN.md
+1
-1
package-lock.json
package-lock.json
+1
-1
package.json
package.json
+1
-1
en.js
source/language/en.js
+4
-0
zh.js
source/language/zh.js
+4
-0
files.js
source/modules/filemanager/files.js
+36
-12
No files found.
CHANGELOG.md
View file @
8692ee55
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
### 文件管理
### 文件管理
*
编辑文件窗口将「编码」按钮替换为「用此编码打开」, 若打开文件之后乱码,不妨试试切换编码
*
编辑文件窗口将「编码」按钮替换为「用此编码打开」, 若打开文件之后乱码,不妨试试切换编码
*
新增「复制文件名」和「复制文件路径」功能,目标复制文件名或路径到剪贴板
### Other
### Other
...
...
README.md
View file @
8692ee55
# AntSword [][url-release]
# AntSword [][url-release]
> AntSword in your hands, no worries in your mind!
> AntSword in your hands, no worries in your mind!
...
...
README_CN.md
View file @
8692ee55
# 中国蚁剑 [][url-release]
# 中国蚁剑 [][url-release]
> 一剑在手,纵横无忧!
> 一剑在手,纵横无忧!
...
...
package-lock.json
View file @
8692ee55
{
{
"name"
:
"antsword"
,
"name"
:
"antsword"
,
"version"
:
"2.0.3.
2
"
,
"version"
:
"2.0.3.
3
"
,
"lockfileVersion"
:
1
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"requires"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
...
...
package.json
View file @
8692ee55
{
{
"name"
:
"antsword"
,
"name"
:
"antsword"
,
"version"
:
"2.0.3.
2
"
,
"version"
:
"2.0.3.
3
"
,
"description"
:
"中国蚁剑是一款跨平台的开源网站管理工具"
,
"description"
:
"中国蚁剑是一款跨平台的开源网站管理工具"
,
"main"
:
"app.js"
,
"main"
:
"app.js"
,
"dependencies"
:
{
"dependencies"
:
{
...
...
source/language/en.js
View file @
8692ee55
...
@@ -317,6 +317,10 @@ module.exports = {
...
@@ -317,6 +317,10 @@ module.exports = {
chmod
:
'Chmod'
,
chmod
:
'Chmod'
,
copy
:
{
copy
:
{
title
:
'Copy'
,
title
:
'Copy'
,
copyname
:
'Copy FileName'
,
copypath
:
'Copy FilePath'
,
copysuccess
:
'Copy to clipboard successfully!'
,
copyfail
:
'Copy to clipboard failed!'
,
warning
:
(
id
)
=>
antSword
.
noxss
(
`Already add to clipboard!\n
${
id
}
`
),
warning
:
(
id
)
=>
antSword
.
noxss
(
`Already add to clipboard!\n
${
id
}
`
),
info
:
(
id
)
=>
antSword
.
noxss
(
`Add file to the clipboard.\n
${
id
}
`
)
info
:
(
id
)
=>
antSword
.
noxss
(
`Add file to the clipboard.\n
${
id
}
`
)
},
},
...
...
source/language/zh.js
View file @
8692ee55
...
@@ -318,6 +318,10 @@ module.exports = {
...
@@ -318,6 +318,10 @@ module.exports = {
chmod
:
'更改权限'
,
chmod
:
'更改权限'
,
copy
:
{
copy
:
{
title
:
'复制文件'
,
title
:
'复制文件'
,
copyname
:
'复制文件名'
,
copypath
:
'复制文件路径'
,
copysuccess
:
'复制到剪贴板成功!'
,
copyfail
:
'复制到剪贴板失败!'
,
warning
:
(
id
)
=>
antSword
.
noxss
(
`已经添加到剪贴板!\n
${
id
}
`
),
warning
:
(
id
)
=>
antSword
.
noxss
(
`已经添加到剪贴板!\n
${
id
}
`
),
info
:
(
id
)
=>
antSword
.
noxss
(
`添加文件到剪贴板\n
${
id
}
`
)
info
:
(
id
)
=>
antSword
.
noxss
(
`添加文件到剪贴板\n
${
id
}
`
)
},
},
...
...
source/modules/filemanager/files.js
View file @
8692ee55
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
const
LANG_T
=
antSword
[
'language'
][
'toastr'
];
const
LANG_T
=
antSword
[
'language'
][
'toastr'
];
const
LANG
=
antSword
[
'language'
][
'filemanager'
][
'files'
];
const
LANG
=
antSword
[
'language'
][
'filemanager'
][
'files'
];
const
clipboard
=
require
(
'electron'
).
clipboard
;
class
Files
{
class
Files
{
...
@@ -293,18 +294,41 @@ class Files {
...
@@ -293,18 +294,41 @@ class Files {
manager
.
downloadFile
(
id
,
this
.
getRowAttribute
(
_ids
[
0
],
'fsize'
));
manager
.
downloadFile
(
id
,
this
.
getRowAttribute
(
_ids
[
0
],
'fsize'
));
}
},
}
},
{
divider
:
true
},
{
divider
:
true
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'title'
],
icon
:
'fa fa-copy'
,
disabled
:
!
id
,
action
:
()
=>
{
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'title'
],
icon
:
'fa fa-copy'
,
subMenu
:
[
// 如果只有一个id,则显示id名称,否则显示ids数量
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'title'
],
icon
:
'fa fa-copy'
,
disabled
:
!
id
,
action
:
()
=>
{
ids
.
map
(
(
id
)
=>
{
// 如果只有一个id,则显示id名称,否则显示ids数量
let
path
=
manager
.
path
+
id
;
ids
.
map
(
(
id
)
=>
{
// 判断是否已经复制
let
path
=
manager
.
path
+
id
;
if
(
id
in
self
.
Clipboard
)
{
// 判断是否已经复制
return
toastr
.
warning
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'warning'
](
id
),
LANG_T
[
'warning'
]);
if
(
id
in
self
.
Clipboard
)
{
};
return
toastr
.
warning
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'warning'
](
id
),
LANG_T
[
'warning'
]);
self
.
Clipboard
[
id
]
=
path
;
};
toastr
.
info
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'info'
](
id
),
LANG_T
[
'info'
]);
self
.
Clipboard
[
id
]
=
path
;
}
);
toastr
.
info
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'info'
](
id
),
LANG_T
[
'info'
]);
}
},
}
);
}
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'copyname'
],
icon
:
'fa fa-file-word-o'
,
disabled
:
!
id
||
ids
.
length
>
1
,
action
:
()
=>
{
clipboard
.
writeText
(
id
);
// 检测是否复制成功
let
txt
=
clipboard
.
readText
();
if
(
txt
==
id
){
toastr
.
success
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'copysuccess'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
error
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'copyfail'
],
LANG_T
[
'error'
]);
}
}},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'copypath'
],
icon
:
'fa fa-file-powerpoint-o'
,
disabled
:
!
id
||
ids
.
length
>
1
,
action
:()
=>
{
let
txt
=
`
${
self
.
manager
.
path
}${
id
}
`
;
clipboard
.
writeText
(
txt
);
// 检测是否复制成功
let
cptxt
=
clipboard
.
readText
();
if
(
cptxt
==
txt
){
toastr
.
success
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'copysuccess'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
error
(
LANG
[
'grid'
][
'contextmenu'
][
'copy'
][
'copyfail'
],
LANG_T
[
'error'
]);
}
}}
]},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'paste'
][
'title'
],
icon
:
'fa fa-paste'
,
disabled
:
_Clipboard_num
===
0
,
subMenu
:
_Clipboard
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'paste'
][
'title'
],
icon
:
'fa fa-paste'
,
disabled
:
_Clipboard_num
===
0
,
subMenu
:
_Clipboard
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'preview'
],
icon
:
'fa fa-eye'
,
disabled
:
!
id
||
ids
.
length
>
1
||
!
self
.
checkPreview
(
id
),
action
:
()
=>
{
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'preview'
],
icon
:
'fa fa-eye'
,
disabled
:
!
id
||
ids
.
length
>
1
||
!
self
.
checkPreview
(
id
),
action
:
()
=>
{
manager
.
previewFile
(
id
,
this
.
getRowAttribute
(
_ids
[
0
],
'fsize'
));
manager
.
previewFile
(
id
,
this
.
getRowAttribute
(
_ids
[
0
],
'fsize'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment