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
2fc8967b
Commit
2fc8967b
authored
Nov 05, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance:FileManager) 编辑文件新增「刷新」按钮
parent
c5caa683
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
2 deletions
+44
-2
CHANGELOG.md
CHANGELOG.md
+11
-0
en.js
source/language/en.js
+1
-0
zh.js
source/language/zh.js
+1
-0
zh_hk.js
source/language/zh_hk.js
+1
-0
zh_tw.js
source/language/zh_tw.js
+1
-0
index.js
source/modules/filemanager/index.js
+29
-2
No files found.
CHANGELOG.md
View file @
2fc8967b
...
@@ -4,6 +4,12 @@
...
@@ -4,6 +4,12 @@
## `v(2.1.8)`
## `v(2.1.8)`
### 核心
*
修复全局过滤 xss 时 text 和 buff 过滤规则不一致问题
### 数据管理
*
新增「自定义数据分割符」配置
*
新增「自定义数据分割符」配置
> 你可以将任何你喜欢的字符组合定义成数据的「起始符」或「结束符」
> 你可以将任何你喜欢的字符组合定义成数据的「起始符」或「结束符」
...
@@ -12,6 +18,11 @@
...
@@ -12,6 +18,11 @@


### 文件管理
*
编辑文件新增「刷新」按钮
> 如果服务器上的文件内容发生改变, 再也不需要关掉重打开了
## 2019/10/30 `v(2.1.7)`
## 2019/10/30 `v(2.1.7)`
...
...
source/language/en.js
View file @
2fc8967b
...
@@ -420,6 +420,7 @@ Hot Keys:
...
@@ -420,6 +420,7 @@ Hot Keys:
editor
:
{
editor
:
{
title
:
(
path
)
=>
antSword
.
noxss
(
`Edit:
${
path
}
`
),
title
:
(
path
)
=>
antSword
.
noxss
(
`Edit:
${
path
}
`
),
toolbar
:
{
toolbar
:
{
refresh
:
'Refresh'
,
save
:
'Save'
,
save
:
'Save'
,
mode
:
'Mode'
,
mode
:
'Mode'
,
encode
:
'Open with Encoding'
encode
:
'Open with Encoding'
...
...
source/language/zh.js
View file @
2fc8967b
...
@@ -420,6 +420,7 @@ module.exports = {
...
@@ -420,6 +420,7 @@ module.exports = {
editor
:
{
editor
:
{
title
:
(
path
)
=>
`编辑:
${
path
}
`
,
title
:
(
path
)
=>
`编辑:
${
path
}
`
,
toolbar
:
{
toolbar
:
{
refresh
:
'刷新'
,
save
:
'保存'
,
save
:
'保存'
,
mode
:
'高亮'
,
mode
:
'高亮'
,
encode
:
'用此编码打开'
encode
:
'用此编码打开'
...
...
source/language/zh_hk.js
View file @
2fc8967b
...
@@ -419,6 +419,7 @@ module.exports = {
...
@@ -419,6 +419,7 @@ module.exports = {
editor
:
{
editor
:
{
title
:
(
path
)
=>
`編輯:
${
path
}
`
,
title
:
(
path
)
=>
`編輯:
${
path
}
`
,
toolbar
:
{
toolbar
:
{
refresh
:
'刷新'
,
save
:
'保存'
,
save
:
'保存'
,
mode
:
'高亮'
,
mode
:
'高亮'
,
encode
:
'用此編碼打開'
encode
:
'用此編碼打開'
...
...
source/language/zh_tw.js
View file @
2fc8967b
...
@@ -419,6 +419,7 @@ module.exports = {
...
@@ -419,6 +419,7 @@ module.exports = {
editor
:
{
editor
:
{
title
:
(
path
)
=>
`編輯:
${
path
}
`
,
title
:
(
path
)
=>
`編輯:
${
path
}
`
,
toolbar
:
{
toolbar
:
{
refresh
:
'刷新'
,
save
:
'保存'
,
save
:
'保存'
,
mode
:
'高亮'
,
mode
:
'高亮'
,
encode
:
'用此編碼打開'
encode
:
'用此編碼打開'
...
...
source/modules/filemanager/index.js
View file @
2fc8967b
...
@@ -440,7 +440,7 @@ class FileManager {
...
@@ -440,7 +440,7 @@ class FileManager {
this
.
core
.
request
(
this
.
core
.
request
(
this
.
core
.
filemanager
.
create_file
({
this
.
core
.
filemanager
.
create_file
({
path
:
this
.
path
+
value
,
path
:
this
.
path
+
value
,
content
:
'#Halo A
NT
!'
content
:
'#Halo A
ntWord
!'
})
})
).
then
((
res
)
=>
{
).
then
((
res
)
=>
{
let
ret
=
res
[
'text'
];
let
ret
=
res
[
'text'
];
...
@@ -958,6 +958,12 @@ class FileManager {
...
@@ -958,6 +958,12 @@ class FileManager {
{
{
type: '
spacer
'
type: '
spacer
'
},
},
{
id: '
refresh
',
type: '
button
',
icon: '
refresh
',
text: LANG['
editor
']['
toolbar
']['
refresh
']
},
{
{
id: '
save
',
id: '
save
',
type: '
button
',
type: '
button
',
...
@@ -1004,7 +1010,7 @@ class FileManager {
...
@@ -1004,7 +1010,7 @@ class FileManager {
self.core.request(
self.core.request(
self.core.filemanager.create_file({
self.core.filemanager.create_file({
path: path,
path: path,
content: editor.session.getValue() || '
Halo
ANT
!
'
content: editor.session.getValue() || '
#
Halo
AntWord
!
'
})
})
).then((res) => {
).then((res) => {
let ret = res['
text
'];
let ret = res['
text
'];
...
@@ -1025,6 +1031,27 @@ class FileManager {
...
@@ -1025,6 +1031,27 @@ class FileManager {
} else if (id.startsWith('
encode_
')) {
} else if (id.startsWith('
encode_
')) {
let encode = id.split('
_
')[1];
let encode = id.split('
_
')[1];
editor.session.setValue(iconv.decode(Buffer.from(codes), encode).toString());
editor.session.setValue(iconv.decode(Buffer.from(codes), encode).toString());
} else if (id === '
refresh
') {
// 获取文件代码
win.progressOn()
this.core.request(
this.core.filemanager.read_file({
path: path
})
).then((res) => {
win.progressOff();
let ret = antSword.unxss(res['
text
'], false);
codes = Buffer.from(antSword.unxss(res['
buff
'].toString(), false));
let encoding = res['
encoding
'] || this.opts['
encode
'];
if (encoding.toUpperCase() == "UTF-8") {
encoding = "UTF8";
}
toolbar.setListOptionSelected('
encode
', `encode_${encoding}`);
editor.session.setValue(ret);
}).catch((err) => {
toastr.error(LANG['
editor
']['
loadErr
'](err), LANG_T['
error
']);
win.progressOff()
})
} else {
} else {
console.info('
toolbar
.
onClick
', id);
console.info('
toolbar
.
onClick
', id);
}
}
...
...
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