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
9713e7ec
Commit
9713e7ec
authored
Jan 30, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance::Module::ViewSite) 新增浏览网站代理开关
parent
0d6dcfbe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
CHANGELOG.md
CHANGELOG.md
+4
-0
en.js
source/language/en.js
+1
-0
zh.js
source/language/zh.js
+1
-0
index.js
source/modules/viewsite/index.js
+25
-4
No files found.
CHANGELOG.md
View file @
9713e7ec
...
@@ -20,6 +20,10 @@
...
@@ -20,6 +20,10 @@
*
支持使用代理访问插件市场,当配置了代理之后,默认开启
*
支持使用代理访问插件市场,当配置了代理之后,默认开启
### 浏览网站
*
新增代理开关, 在配置了代理之后,可通过该开关控制是否使用代理浏览目标网站
### Other
### Other
*
调整 aproxy uri 初始化 URL 格式
*
调整 aproxy uri 初始化 URL 格式
...
...
source/language/en.js
View file @
9713e7ec
...
@@ -707,6 +707,7 @@ module.exports = {
...
@@ -707,6 +707,7 @@ module.exports = {
},
},
viewsite
:
{
viewsite
:
{
toolbar
:
{
toolbar
:
{
useproxy
:
(
s
)
=>
`Proxy:
${
s
?
'ON'
:
'OFF'
}
`
,
save
:
'Save'
,
save
:
'Save'
,
view
:
'View'
view
:
'View'
},
},
...
...
source/language/zh.js
View file @
9713e7ec
...
@@ -707,6 +707,7 @@ module.exports = {
...
@@ -707,6 +707,7 @@ module.exports = {
},
},
viewsite
:
{
viewsite
:
{
toolbar
:
{
toolbar
:
{
useproxy
:
(
s
)
=>
`代理:
${
s
?
'开'
:
'关'
}
`
,
save
:
'保存'
,
save
:
'保存'
,
view
:
'浏览'
view
:
'浏览'
},
},
...
...
source/modules/viewsite/index.js
View file @
9713e7ec
...
@@ -24,7 +24,7 @@ class ViewSite {
...
@@ -24,7 +24,7 @@ class ViewSite {
this
.
opts
=
opts
;
this
.
opts
=
opts
;
this
.
cell
=
tabbar
.
cells
(
`tab_viewsite_
${
hash
}
`
);
this
.
cell
=
tabbar
.
cells
(
`tab_viewsite_
${
hash
}
`
);
this
.
useproxy
=
antSword
.
aproxymode
!==
"noproxy"
;
// 初始化工具栏
// 初始化工具栏
this
.
toolbar
=
this
.
_initToolbar
();
this
.
toolbar
=
this
.
_initToolbar
();
...
@@ -52,10 +52,21 @@ class ViewSite {
...
@@ -52,10 +52,21 @@ class ViewSite {
const
toolbar
=
this
.
cell
.
attachToolbar
();
const
toolbar
=
this
.
cell
.
attachToolbar
();
toolbar
.
loadStruct
([
toolbar
.
loadStruct
([
{
id
:
'url'
,
width
:
400
,
type
:
'buttonInput'
,
value
:
this
.
opts
.
url
||
'loading..'
},
{
id
:
'url'
,
width
:
400
,
type
:
'buttonInput'
,
value
:
this
.
opts
.
url
||
'loading..'
},
{
type
:
'separator'
},
{
id
:
'useproxy'
,
type
:
'buttonTwoState'
,
icon
:
'paper-plane'
,
text
:
LANG
[
'toolbar'
].
useproxy
(
this
.
useproxy
),
pressed
:
this
.
useproxy
,
disabled
:
antSword
.
aproxymode
===
"noproxy"
},
{
type
:
'separator'
},
{
id
:
'view'
,
type
:
'button'
,
icon
:
'chrome'
,
text
:
LANG
[
'toolbar'
].
view
},
{
id
:
'view'
,
type
:
'button'
,
icon
:
'chrome'
,
text
:
LANG
[
'toolbar'
].
view
},
{
type
:
'separator'
},
{
type
:
'separator'
},
{
id
:
'save'
,
type
:
'button'
,
icon
:
'save'
,
text
:
LANG
[
'toolbar'
].
save
},
{
id
:
'save'
,
type
:
'button'
,
icon
:
'save'
,
text
:
LANG
[
'toolbar'
].
save
},
]);
]);
toolbar
.
attachEvent
(
'onStateChange'
,
(
id
,
state
)
=>
{
switch
(
id
)
{
case
'useproxy'
:
this
.
useproxy
=
state
;
toolbar
.
setItemText
(
'useproxy'
,
`<i class="fa fa-paper-plane"></i>
${
LANG
[
'toolbar'
].
useproxy
(
this
.
useproxy
)}
`
);
break
;
}
});
toolbar
.
attachEvent
(
'onClick'
,
(
id
)
=>
{
toolbar
.
attachEvent
(
'onClick'
,
(
id
)
=>
{
switch
(
id
)
{
switch
(
id
)
{
case
'save'
:
case
'save'
:
...
@@ -171,9 +182,19 @@ class ViewSite {
...
@@ -171,9 +182,19 @@ class ViewSite {
},
},
title
:
url
title
:
url
});
});
win
.
loadURL
(
url
);
win
.
on
(
'close'
,
()
=>
{
win
.
show
();
win
=
null
;
win
.
openDevTools
();
});
let
ses
=
win
.
webContents
.
session
;
let
proxyuri
=
""
;
if
(
this
.
useproxy
&&
antSword
.
aproxymode
!=
"noproxy"
)
{
proxyuri
=
antSword
.
aproxyuri
;
}
ses
.
setProxy
({
proxyRules
:
proxyuri
},
()
=>
{
win
.
loadURL
(
url
);
win
.
show
();
win
.
openDevTools
();
});
}
}
}
}
...
...
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