Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1123caa5
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,发现更多精彩内容 >>
提交
1123caa5
编写于
12月 19, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null check feedback
上级
f903e6d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
48 addition
and
26 deletion
+48
-26
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+3
-0
src/vs/workbench/parts/feedback/electron-browser/feedback.ts
src/vs/workbench/parts/feedback/electron-browser/feedback.ts
+41
-22
src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts
.../parts/feedback/electron-browser/feedbackStatusbarItem.ts
+4
-4
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
1123caa5
...
...
@@ -619,6 +619,9 @@
"./vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts"
,
"./vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts"
,
"./vs/workbench/parts/extensions/test/common/extensionQuery.test.ts"
,
"./vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts"
,
"./vs/workbench/parts/feedback/electron-browser/feedback.ts"
,
"./vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts"
,
"./vs/workbench/parts/files/common/explorerModel.ts"
,
"./vs/workbench/parts/files/common/files.ts"
,
"./vs/workbench/parts/files/electron-browser/views/explorerDecorationsProvider.ts"
,
...
...
src/vs/workbench/parts/feedback/electron-browser/feedback.ts
浏览文件 @
1123caa5
...
...
@@ -47,10 +47,10 @@ export class FeedbackDropdown extends Dropdown {
private
readonly
feedbackDelegate
:
IFeedbackDelegate
;
private
feedbackForm
:
HTMLFormElement
;
private
feedbackDescriptionInput
:
HTMLTextAreaElement
;
private
smileyInput
:
HTMLElement
;
private
frownyInput
:
HTMLElement
;
private
feedbackForm
:
HTMLFormElement
|
null
;
private
feedbackDescriptionInput
:
HTMLTextAreaElement
|
null
;
private
smileyInput
:
HTMLElement
|
null
;
private
frownyInput
:
HTMLElement
|
null
;
private
sendButton
:
Button
;
private
hideButton
:
HTMLInputElement
;
private
remainingCharacterCount
:
HTMLElement
;
...
...
@@ -108,7 +108,7 @@ export class FeedbackDropdown extends Dropdown {
dom
.
addClass
(
container
,
'
monaco-menu-container
'
);
// Form
this
.
feedbackForm
=
dom
.
append
(
container
,
dom
.
$
(
'
form.feedback-form
'
));
this
.
feedbackForm
=
dom
.
append
<
HTMLFormElement
>
(
container
,
dom
.
$
(
'
form.feedback-form
'
));
this
.
feedbackForm
.
setAttribute
(
'
action
'
,
'
javascript:void(0);
'
);
// Title
...
...
@@ -133,7 +133,13 @@ export class FeedbackDropdown extends Dropdown {
}
if
(
darkenFactor
)
{
closeBtn
.
style
.
backgroundColor
=
darken
(
theme
.
getColor
(
editorWidgetBackground
),
darkenFactor
)(
theme
).
toString
();
const
backgroundBaseColor
=
theme
.
getColor
(
editorWidgetBackground
);
if
(
backgroundBaseColor
)
{
const
backgroundColor
=
darken
(
backgroundBaseColor
,
darkenFactor
)(
theme
);
if
(
backgroundColor
)
{
closeBtn
.
style
.
backgroundColor
=
backgroundColor
.
toString
();
}
}
}
}));
...
...
@@ -242,7 +248,7 @@ export class FeedbackDropdown extends Dropdown {
this
.
remainingCharacterCount
.
textContent
=
this
.
getCharCountText
(
0
);
// Feedback Input Form
this
.
feedbackDescriptionInput
=
dom
.
append
(
this
.
feedbackForm
,
dom
.
$
(
'
textarea.feedback-description
'
));
this
.
feedbackDescriptionInput
=
dom
.
append
<
HTMLTextAreaElement
>
(
this
.
feedbackForm
,
dom
.
$
(
'
textarea.feedback-description
'
));
this
.
feedbackDescriptionInput
.
rows
=
3
;
this
.
feedbackDescriptionInput
.
maxLength
=
this
.
maxFeedbackCharacters
;
this
.
feedbackDescriptionInput
.
textContent
=
this
.
feedback
;
...
...
@@ -278,9 +284,10 @@ export class FeedbackDropdown extends Dropdown {
this
.
sendButton
.
onDidClick
(()
=>
this
.
onSubmit
());
disposables
.
push
(
attachStylerCallback
(
this
.
themeService
,
{
widgetShadow
,
editorWidgetBackground
,
inputBackground
,
inputForeground
,
inputBorder
,
editorBackground
,
contrastBorder
},
colors
=>
{
this
.
feedbackForm
.
style
.
backgroundColor
=
colors
.
editorWidgetBackground
?
colors
.
editorWidgetBackground
.
toString
()
:
null
;
this
.
feedbackForm
.
style
.
boxShadow
=
colors
.
widgetShadow
?
`0 0 8px
${
colors
.
widgetShadow
}
`
:
null
;
if
(
this
.
feedbackForm
)
{
this
.
feedbackForm
.
style
.
backgroundColor
=
colors
.
editorWidgetBackground
?
colors
.
editorWidgetBackground
.
toString
()
:
null
;
this
.
feedbackForm
.
style
.
boxShadow
=
colors
.
widgetShadow
?
`0 0 8px
${
colors
.
widgetShadow
}
`
:
null
;
}
if
(
this
.
feedbackDescriptionInput
)
{
this
.
feedbackDescriptionInput
.
style
.
backgroundColor
=
colors
.
inputBackground
?
colors
.
inputBackground
.
toString
()
:
null
;
this
.
feedbackDescriptionInput
.
style
.
color
=
colors
.
inputForeground
?
colors
.
inputForeground
.
toString
()
:
null
;
...
...
@@ -313,27 +320,39 @@ export class FeedbackDropdown extends Dropdown {
}
private
updateCharCountText
():
void
{
this
.
remainingCharacterCount
.
innerText
=
this
.
getCharCountText
(
this
.
feedbackDescriptionInput
.
value
.
length
);
this
.
sendButton
.
enabled
=
this
.
feedbackDescriptionInput
.
value
.
length
>
0
;
if
(
this
.
feedbackDescriptionInput
)
{
this
.
remainingCharacterCount
.
innerText
=
this
.
getCharCountText
(
this
.
feedbackDescriptionInput
.
value
.
length
);
this
.
sendButton
.
enabled
=
this
.
feedbackDescriptionInput
.
value
.
length
>
0
;
}
}
private
setSentiment
(
smile
:
boolean
):
void
{
if
(
smile
)
{
dom
.
addClass
(
this
.
smileyInput
,
'
checked
'
);
this
.
smileyInput
.
setAttribute
(
'
aria-checked
'
,
'
true
'
);
dom
.
removeClass
(
this
.
frownyInput
,
'
checked
'
);
this
.
frownyInput
.
setAttribute
(
'
aria-checked
'
,
'
false
'
);
if
(
this
.
smileyInput
)
{
dom
.
addClass
(
this
.
smileyInput
,
'
checked
'
);
this
.
smileyInput
.
setAttribute
(
'
aria-checked
'
,
'
true
'
);
}
if
(
this
.
frownyInput
)
{
dom
.
removeClass
(
this
.
frownyInput
,
'
checked
'
);
this
.
frownyInput
.
setAttribute
(
'
aria-checked
'
,
'
false
'
);
}
}
else
{
dom
.
addClass
(
this
.
frownyInput
,
'
checked
'
);
this
.
frownyInput
.
setAttribute
(
'
aria-checked
'
,
'
true
'
);
dom
.
removeClass
(
this
.
smileyInput
,
'
checked
'
);
this
.
smileyInput
.
setAttribute
(
'
aria-checked
'
,
'
false
'
);
if
(
this
.
frownyInput
)
{
dom
.
addClass
(
this
.
frownyInput
,
'
checked
'
);
this
.
frownyInput
.
setAttribute
(
'
aria-checked
'
,
'
true
'
);
}
if
(
this
.
smileyInput
)
{
dom
.
removeClass
(
this
.
smileyInput
,
'
checked
'
);
this
.
smileyInput
.
setAttribute
(
'
aria-checked
'
,
'
false
'
);
}
}
this
.
sentiment
=
smile
?
1
:
0
;
this
.
maxFeedbackCharacters
=
this
.
feedbackDelegate
.
getCharacterLimit
(
this
.
sentiment
);
this
.
updateCharCountText
();
this
.
feedbackDescriptionInput
.
maxLength
=
this
.
maxFeedbackCharacters
;
if
(
this
.
feedbackDescriptionInput
)
{
this
.
feedbackDescriptionInput
.
maxLength
=
this
.
maxFeedbackCharacters
;
}
}
private
invoke
(
element
:
HTMLElement
,
disposables
:
IDisposable
[],
callback
:
()
=>
void
):
HTMLElement
{
...
...
@@ -392,7 +411,7 @@ export class FeedbackDropdown extends Dropdown {
}
private
onSubmit
():
void
{
if
((
this
.
feedbackForm
.
checkValidity
&&
!
this
.
feedbackForm
.
checkValidity
()))
{
if
(
!
this
.
feedbackForm
||
!
this
.
feedbackDescriptionInput
||
(
this
.
feedbackForm
.
checkValidity
&&
!
this
.
feedbackForm
.
checkValidity
()))
{
return
;
}
...
...
src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts
浏览文件 @
1123caa5
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IStatusbarItem
}
from
'
vs/workbench/browser/parts/statusbar/statusbar
'
;
import
{
FeedbackDropdown
,
IFeedback
,
IFeedbackDelegate
,
FEEDBACK_VISIBLE_CONFIG
,
IFeedbackDropdownOptions
}
from
'
vs/workbench/parts/feedback/electron-browser/feedback
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
...
@@ -52,7 +52,7 @@ class TwitterFeedbackService implements IFeedbackDelegate {
}
export
class
FeedbackStatusbarItem
extends
Themable
implements
IStatusbarItem
{
private
dropdown
:
FeedbackDropdown
;
private
dropdown
:
FeedbackDropdown
|
undefined
;
private
enabled
:
boolean
;
private
container
:
HTMLElement
;
private
hideAction
:
HideAction
;
...
...
@@ -89,7 +89,7 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem {
protected
updateStyles
():
void
{
super
.
updateStyles
();
if
(
this
.
dropdown
)
{
if
(
this
.
dropdown
&&
this
.
dropdown
.
label
)
{
this
.
dropdown
.
label
.
style
.
backgroundColor
=
(
this
.
getColor
(
this
.
contextService
.
getWorkbenchState
()
!==
WorkbenchState
.
EMPTY
?
STATUS_BAR_FOREGROUND
:
STATUS_BAR_NO_FOLDER_FOREGROUND
));
}
}
...
...
@@ -148,7 +148,7 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem {
clearNode
(
this
.
container
);
}
return
null
;
return
Disposable
.
None
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录