Commit 8524d06d authored by Medicean's avatar Medicean

(Enhancement:Modules:FileManager) 编辑文件窗口将「编码」按钮替换为「用此编码打开」

parent 33a8c3ba
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
* 优化返回包解码流程,增加自动猜解编码功能,该功能在中文较少时容易出错,出错了使用用户设置的字符编码 * 优化返回包解码流程,增加自动猜解编码功能,该功能在中文较少时容易出错,出错了使用用户设置的字符编码
### 文件管理
* 编辑文件窗口将「编码」按钮替换为「用此编码打开」, 若打开文件之后乱码,不妨试试切换编码
### Other ### Other
* 新增 Python2 Custom CGI shell 示例 * 新增 Python2 Custom CGI shell 示例
......
# AntSword [![release](https://img.shields.io/badge/release-v2.0.3.1-blue.svg?style=flat-square)][url-release] # AntSword [![release](https://img.shields.io/badge/release-v2.0.3.2-blue.svg?style=flat-square)][url-release]
> AntSword in your hands, no worries in your mind! > AntSword in your hands, no worries in your mind!
......
# 中国蚁剑 [![release](https://img.shields.io/badge/release-v2.0.3.1-blue.svg?style=flat-square)][url-release] # 中国蚁剑 [![release](https://img.shields.io/badge/release-v2.0.3.2-blue.svg?style=flat-square)][url-release]
> 一剑在手,纵横无忧! > 一剑在手,纵横无忧!
......
{ {
"name": "antsword", "name": "antsword",
"version": "2.0.3.1", "version": "2.0.3.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "antsword", "name": "antsword",
"version": "2.0.3.1", "version": "2.0.3.2",
"description": "中国蚁剑是一款跨平台的开源网站管理工具", "description": "中国蚁剑是一款跨平台的开源网站管理工具",
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
......
...@@ -333,7 +333,7 @@ module.exports = { ...@@ -333,7 +333,7 @@ module.exports = {
toolbar: { toolbar: {
save: 'Save', save: 'Save',
mode: 'Mode', mode: 'Mode',
encode: 'Encode' encode: 'Open with Encoding'
}, },
loadErr: (err) => antSword.noxss(`Load file error!\n${err}`), loadErr: (err) => antSword.noxss(`Load file error!\n${err}`),
success: (path) => antSword.noxss(`Save the file success!\n${path}`), success: (path) => antSword.noxss(`Save the file success!\n${path}`),
......
...@@ -334,7 +334,7 @@ module.exports = { ...@@ -334,7 +334,7 @@ module.exports = {
toolbar: { toolbar: {
save: '保存', save: '保存',
mode: '高亮', mode: '高亮',
encode: '编码' encode: '用此编码打开'
}, },
loadErr: (err) => antSword.noxss(`加载文件出错!\n${err}`), loadErr: (err) => antSword.noxss(`加载文件出错!\n${err}`),
success: (path) => antSword.noxss(`保存文件成功!\n${path}`), success: (path) => antSword.noxss(`保存文件成功!\n${path}`),
......
...@@ -881,7 +881,7 @@ class FileManager { ...@@ -881,7 +881,7 @@ class FileManager {
editor.session.setMode(`ace/mode/${mode}`); editor.session.setMode(`ace/mode/${mode}`);
}else if (id.startsWith('encode_')) { }else if (id.startsWith('encode_')) {
let encode = id.split('_')[1]; let encode = id.split('_')[1];
editor.session.setValue(iconv.encode(codes, encode).toString()); editor.session.setValue(iconv.decode(new Buffer(codes), encode).toString());
}else{ }else{
console.info('toolbar.onClick', id); console.info('toolbar.onClick', id);
} }
...@@ -894,7 +894,7 @@ class FileManager { ...@@ -894,7 +894,7 @@ class FileManager {
}) })
).then((res) => { ).then((res) => {
let ret = res['text']; let ret = res['text'];
codes = ret; codes = res['buff'];
let encoding = res['encoding'] || this.opts['encode']; let encoding = res['encoding'] || this.opts['encode'];
if(encoding.toUpperCase() == "UTF-8") { if(encoding.toUpperCase() == "UTF-8") {
encoding = "UTF8"; encoding = "UTF8";
......
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