Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
fbc8616c
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fbc8616c
编写于
3月 26, 2018
作者:
K
Kumar Harsh
提交者:
Benjamin Pasero
3月 26, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(feedback): use the Button widget in Feedback form (#46503)
上级
a918e7b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
38 deletion
+28
-38
src/vs/workbench/parts/feedback/electron-browser/feedback.ts
src/vs/workbench/parts/feedback/electron-browser/feedback.ts
+24
-12
src/vs/workbench/parts/feedback/electron-browser/media/feedback.css
...kbench/parts/feedback/electron-browser/media/feedback.css
+4
-26
未找到文件。
src/vs/workbench/parts/feedback/electron-browser/feedback.ts
浏览文件 @
fbc8616c
...
...
@@ -17,10 +17,11 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
IIntegrityService
}
from
'
vs/platform/integrity/common/integrity
'
;
import
{
IThemeService
,
registerThemingParticipant
,
ITheme
,
ICssStyleCollector
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
attach
ButtonStyler
,
attach
StylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
editorWidgetBackground
,
widgetShadow
,
inputBorder
,
inputForeground
,
inputBackground
,
inputActiveOptionBorder
,
editorBackground
,
buttonBackground
,
contrastBorder
,
darken
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IWorkspaceConfigurationService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IAnchor
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
export
const
FEEDBACK_VISIBLE_CONFIG
=
'
workbench.statusBar.feedback.visible
'
;
...
...
@@ -61,7 +62,8 @@ export class FeedbackDropdown extends Dropdown {
private
feedbackDescriptionInput
:
HTMLTextAreaElement
;
private
smileyInput
:
Builder
;
private
frownyInput
:
Builder
;
private
sendButton
:
Builder
;
private
sendButton
:
Button
;
private
$sendButton
:
Builder
;
private
hideButton
:
HTMLInputElement
;
private
remainingCharacterCount
:
Builder
;
...
...
@@ -110,6 +112,7 @@ export class FeedbackDropdown extends Dropdown {
this
.
frownyInput
=
null
;
this
.
sendButton
=
null
;
this
.
$sendButton
=
null
;
this
.
requestFeatureLink
=
product
.
sendASmile
.
requestFeatureUrl
;
}
...
...
@@ -246,11 +249,17 @@ export class FeedbackDropdown extends Dropdown {
$
(
'
label
'
).
attr
(
'
for
'
,
'
hide-button
'
).
text
(
nls
.
localize
(
'
showFeedback
'
,
"
Show Feedback Smiley in Status Bar
"
)).
appendTo
(
$hideButtonContainer
);
this
.
sendButton
=
this
.
invoke
(
$
(
'
input.send
'
).
type
(
'
button
'
).
attr
(
'
disabled
'
,
''
).
value
(
nls
.
localize
(
'
tweet
'
,
"
Tweet
"
)).
appendTo
(
$buttons
),
()
=>
{
this
.
sendButton
=
new
Button
(
$buttons
);
this
.
sendButton
.
enabled
=
false
;
this
.
sendButton
.
label
=
nls
.
localize
(
'
tweet
'
,
"
Tweet
"
);
this
.
$sendButton
=
new
Builder
(
this
.
sendButton
.
element
);
this
.
$sendButton
.
addClass
(
'
send
'
);
this
.
toDispose
.
push
(
attachButtonStyler
(
this
.
sendButton
,
this
.
themeService
));
this
.
invoke
(
this
.
$sendButton
,
()
=>
{
if
(
this
.
isSendingFeedback
)
{
return
;
}
this
.
onSubmit
();
});
...
...
@@ -289,7 +298,7 @@ export class FeedbackDropdown extends Dropdown {
private
updateCharCountText
():
void
{
this
.
remainingCharacterCount
.
text
(
this
.
getCharCountText
(
this
.
feedbackDescriptionInput
.
value
.
length
));
this
.
feedbackDescriptionInput
.
value
?
this
.
sendButton
.
removeAttribute
(
'
disabled
'
)
:
this
.
sendButton
.
attr
(
'
disabled
'
,
''
)
;
this
.
sendButton
.
enabled
=
this
.
feedbackDescriptionInput
.
value
.
length
>
0
;
}
private
setSentiment
(
smile
:
boolean
):
void
{
...
...
@@ -386,25 +395,28 @@ export class FeedbackDropdown extends Dropdown {
switch
(
event
)
{
case
FormEvent
.
SENDING
:
this
.
isSendingFeedback
=
true
;
this
.
sendButton
.
setClass
(
'
send in-progress
'
);
this
.
sendButton
.
value
(
nls
.
localize
(
'
feedbackSending
'
,
"
Sending
"
)
);
this
.
sendButton
.
label
=
nls
.
localize
(
'
feedbackSending
'
,
"
Sending
"
);
this
.
$sendButton
.
addClass
(
'
in-progress
'
);
break
;
case
FormEvent
.
SENT
:
this
.
isSendingFeedback
=
false
;
this
.
sendButton
.
setClass
(
'
send success
'
).
value
(
nls
.
localize
(
'
feedbackSent
'
,
"
Thanks
"
));
this
.
sendButton
.
label
=
nls
.
localize
(
'
feedbackSent
'
,
"
Thanks
"
);
this
.
$sendButton
.
addClass
(
'
success
'
);
this
.
resetForm
();
this
.
autoHideTimeout
=
setTimeout
(()
=>
{
this
.
hide
();
},
1000
);
this
.
sendButton
.
off
([
'
click
'
,
'
keypress
'
]);
this
.
invoke
(
this
.
sendButton
,
()
=>
{
this
.
$
sendButton
.
off
([
'
click
'
,
'
keypress
'
]);
this
.
invoke
(
this
.
$
sendButton
,
()
=>
{
this
.
hide
();
this
.
sendButton
.
off
([
'
click
'
,
'
keypress
'
]);
this
.
$sendButton
.
off
([
'
click
'
,
'
keypress
'
]);
this
.
$sendButton
.
removeClass
(
'
in-progress
'
);
});
break
;
case
FormEvent
.
SEND_ERROR
:
this
.
isSendingFeedback
=
false
;
this
.
sendButton
.
setClass
(
'
send error
'
).
value
(
nls
.
localize
(
'
feedbackSendingError
'
,
"
Try again
"
));
this
.
$sendButton
.
addClass
(
'
error
'
);
this
.
sendButton
.
label
=
nls
.
localize
(
'
feedbackSendingError
'
,
"
Try again
"
);
break
;
}
}
...
...
src/vs/workbench/parts/feedback/electron-browser/media/feedback.css
浏览文件 @
fbc8616c
...
...
@@ -100,23 +100,6 @@
text-align
:
right
;
}
.monaco-shell
.feedback-form
.send
{
padding
:
.5em
1.5em
;
font-size
:
1.1em
;
margin
:
0
;
box-sizing
:
border-box
;
transition
:
width
200ms
ease-out
;
}
.monaco-shell
.feedback-form
.send.in-progress
{
width
:
22%
;
}
.monaco-shell
.feedback-form
.send.success
,
.monaco-shell
.feedback-form
.send.error
{
width
:
20%
;
}
.monaco-shell
.feedback-form
.sentiment
{
height
:
32px
;
width
:
32px
;
...
...
@@ -165,19 +148,14 @@
}
.monaco-shell
.feedback-form
.form-buttons
.send
{
color
:
white
;
border
:
none
;
cursor
:
pointer
;
width
:
auto
;
background-image
:
url('twitter.svg')
;
background-color
:
#007ACC
;
background-position
:
left
;
background-position
:
12px
center
;
background-size
:
20px
;
background-repeat
:
no-repeat
;
padding-left
:
30px
;
padding-right
:
12px
;
border
:
4px
solid
#007ACC
;
border-radius
:
4px
;
padding
:
8px
12px
8px
38px
;
margin-left
:
auto
;
transition
:
width
200ms
ease-out
;
}
.monaco-shell
.feedback-form
.form-buttons
.send.in-progress
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录