Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f863c055
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f863c055
编写于
5月 04, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use button widget in issue reporter, fixes #46490
上级
7980812a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
47 deletion
+21
-47
src/vs/code/electron-browser/issue/issueReporterMain.ts
src/vs/code/electron-browser/issue/issueReporterMain.ts
+15
-18
src/vs/code/electron-browser/issue/issueReporterPage.ts
src/vs/code/electron-browser/issue/issueReporterPage.ts
+0
-2
src/vs/code/electron-browser/issue/media/issueReporter.css
src/vs/code/electron-browser/issue/media/issueReporter.css
+6
-27
未找到文件。
src/vs/code/electron-browser/issue/issueReporterMain.ts
浏览文件 @
f863c055
...
...
@@ -41,6 +41,8 @@ import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log
import
{
ILogService
,
getLogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
OcticonLabel
}
from
'
vs/base/browser/ui/octiconLabel/octiconLabel
'
;
import
{
normalizeGitHubIssuesUrl
}
from
'
vs/code/electron-browser/issue/issueReporterUtil
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
const
MAX_URL_LENGTH
=
platform
.
isWindows
?
2081
:
5400
;
...
...
@@ -72,6 +74,8 @@ export class IssueReporter extends Disposable {
private
receivedPerformanceInfo
=
false
;
private
shouldQueueSearch
=
false
;
private
previewButton
:
Button
;
constructor
(
configuration
:
IssueReporterConfiguration
)
{
super
();
...
...
@@ -86,6 +90,12 @@ export class IssueReporter extends Disposable {
extensionsDisabled
:
this
.
environmentService
.
disableExtensions
,
});
this
.
previewButton
=
new
Button
(
document
.
getElementById
(
'
issue-reporter
'
),
{
buttonBackground
:
Color
.
fromHex
(
configuration
.
data
.
styles
.
buttonBackground
),
buttonForeground
:
Color
.
fromHex
(
configuration
.
data
.
styles
.
buttonForeground
),
buttonHoverBackground
:
Color
.
fromHex
(
configuration
.
data
.
styles
.
buttonHoverBackground
)
});
ipcRenderer
.
on
(
'
issuePerformanceInfoResponse
'
,
(
event
,
info
)
=>
{
this
.
logService
.
trace
(
'
issueReporter: Received performance data
'
);
this
.
issueReporterModel
.
update
(
info
);
...
...
@@ -171,18 +181,6 @@ export class IssueReporter extends Disposable {
content
.
push
(
`a, .workbenchCommand { color:
${
styles
.
textLinkColor
}
; }`
);
}
if
(
styles
.
buttonBackground
)
{
content
.
push
(
`button { background-color:
${
styles
.
buttonBackground
}
; }`
);
}
if
(
styles
.
buttonForeground
)
{
content
.
push
(
`button { color:
${
styles
.
buttonForeground
}
; }`
);
}
if
(
styles
.
buttonHoverBackground
)
{
content
.
push
(
`#github-submit-btn:hover:enabled, #github-submit-btn:focus:enabled { background-color:
${
styles
.
buttonHoverBackground
}
; }`
);
}
if
(
styles
.
textLinkColor
)
{
content
.
push
(
`a { color:
${
styles
.
textLinkColor
}
; }`
);
}
...
...
@@ -385,7 +383,7 @@ export class IssueReporter extends Disposable {
}
});
this
.
addEventListener
(
'
github-submit-btn
'
,
'
click
'
,
()
=>
this
.
createIssue
());
this
.
previewButton
.
onDidClick
(
()
=>
this
.
createIssue
());
this
.
addEventListener
(
'
disableExtensions
'
,
'
click
'
,
()
=>
{
ipcRenderer
.
send
(
'
workbenchCommand
'
,
'
workbench.action.reloadWindowWithExtensionsDisabled
'
);
...
...
@@ -421,13 +419,12 @@ export class IssueReporter extends Disposable {
}
private
updatePreviewButtonState
()
{
const
submitButton
=
<
HTMLButtonElement
>
document
.
getElementById
(
'
github-submit-btn
'
);
if
(
this
.
isPreviewEnabled
())
{
submitButton
.
disabled
=
false
;
submitButton
.
textContent
=
localize
(
'
previewOnGitHub
'
,
"
Preview on GitHub
"
)
;
this
.
previewButton
.
label
=
localize
(
'
previewOnGitHub
'
,
"
Preview on GitHub
"
)
;
this
.
previewButton
.
enabled
=
true
;
}
else
{
submitButton
.
disabled
=
tru
e
;
submitButton
.
textContent
=
localize
(
'
loadingData
'
,
"
Loading data...
"
);
this
.
previewButton
.
enabled
=
fals
e
;
this
.
previewButton
.
label
=
localize
(
'
loadingData
'
,
"
Loading data...
"
);
}
}
...
...
src/vs/code/electron-browser/issue/issueReporterPage.ts
浏览文件 @
f863c055
...
...
@@ -126,6 +126,4 @@ export default (): string => `
</div>
</div>
</div>
<button id="github-submit-btn" disabled>
${
escape
(
localize
(
'
loadingData
'
,
"
Loading data...
"
))}
</button>
</div>`
;
\ No newline at end of file
src/vs/code/electron-browser/issue/media/issueReporter.css
浏览文件 @
f863c055
...
...
@@ -48,7 +48,6 @@ input[type="text"], textarea {
line-height
:
1.5
;
color
:
#495057
;
background-color
:
#fff
;
border-radius
:
.25rem
;
border
:
1px
solid
#ced4da
;
}
...
...
@@ -60,19 +59,12 @@ textarea {
/**
* Button
*/
button
{
display
:
inline-block
;
font-weight
:
400
;
line-height
:
1.25
;
text-align
:
center
;
white-space
:
nowrap
;
vertical-align
:
middle
;
user-select
:
none
;
padding
:
.5rem
1rem
;
font-size
:
1rem
;
border-radius
:
.25rem
;
background
:
none
;
border
:
1px
solid
transparent
;
.monaco-text-button
{
display
:
block
;
width
:
auto
;
padding
:
4px
10px
;
align-self
:
flex-end
;
}
select
{
...
...
@@ -129,14 +121,6 @@ pre code {
font-family
:
'Menlo'
,
'Courier New'
,
'Courier'
,
monospace
;
}
button
:hover:enabled
{
cursor
:
pointer
;
}
button
:disabled
{
cursor
:
auto
;
}
#issue-reporter
{
max-width
:
85vw
;
margin-left
:
auto
;
...
...
@@ -257,11 +241,6 @@ a {
color
:
#be1100
;
}
button
{
background-color
:
#007ACC
;
color
:
#fff
;
}
.section
.input-group
.validation-error
{
margin-left
:
13%
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录