Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f1dcaaea
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,发现更多精彩内容 >>
提交
f1dcaaea
编写于
5月 21, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some styling tweaks, fix status calculation
上级
f86589cd
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
52 addition
and
34 deletion
+52
-34
extensions/git-extended/media/index.css
extensions/git-extended/media/index.css
+2
-0
extensions/git-extended/media/index.js
extensions/git-extended/media/index.js
+23
-14
extensions/git-extended/preview-src/index.ts
extensions/git-extended/preview-src/index.ts
+1
-1
extensions/git-extended/preview-src/pullRequestOverviewRenderer.ts
...s/git-extended/preview-src/pullRequestOverviewRenderer.ts
+18
-12
extensions/git-extended/resources/icons/dark/book.svg
extensions/git-extended/resources/icons/dark/book.svg
+1
-1
extensions/git-extended/src/common/pullRequestOverview.ts
extensions/git-extended/src/common/pullRequestOverview.ts
+5
-3
src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts
...s/comments/electron-browser/commentsEditorContribution.ts
+1
-1
src/vs/workbench/parts/comments/electron-browser/media/review.css
...orkbench/parts/comments/electron-browser/media/review.css
+1
-2
未找到文件。
extensions/git-extended/media/index.css
浏览文件 @
f1dcaaea
...
...
@@ -135,6 +135,8 @@ body .comment-form {
body
.comment-form
textarea
{
display
:
block
;
box-sizing
:
border-box
;
padding
:
10px
;
width
:
100%
;
min-height
:
100px
;
max-height
:
500px
;
...
...
extensions/git-extended/media/index.js
浏览文件 @
f1dcaaea
此差异已折叠。
点击以展开。
extensions/git-extended/preview-src/index.ts
浏览文件 @
f1dcaaea
...
...
@@ -52,7 +52,7 @@ function setTitleHTML(pr: any) {
<h2>
${
pr
.
title
}
(<a href=
${
pr
.
url
}
>#
${
pr
.
number
}
</a>) </h2> <button id="checkout" aria-live="polite"><svg class="octicon octicon-desktop-download" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 6h3V0h2v6h3l-4 4-4-4zm11-4h-4v1h4v8H1V3h4V2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1z"></path></svg>Checkout Pull Request</button>
</div>
<div>
<div class="status">
${
getStatus
(
pr
)}
</div>
<div class="status">
${
getStatus
(
pr
.
state
)}
</div>
<img class="avatar" src="
${
pr
.
author
.
avatarUrl
}
" alt="">
<strong class="author"><a href="
${
pr
.
author
.
html_url
}
">
${
pr
.
author
.
login
}
</a></strong>
</div>
...
...
extensions/git-extended/preview-src/pullRequestOverviewRenderer.ts
浏览文件 @
f1dcaaea
...
...
@@ -138,6 +138,12 @@ export interface CommitEvent {
event
:
EventType
;
}
export
enum
PullRequestStateEnum
{
Open
,
Merged
,
Closed
,
}
export
type
TimelineEvent
=
CommitEvent
|
ReviewEvent
|
SubscribeEvent
|
CommentEvent
|
MentionEvent
;
export
function
renderComment
(
comment
:
CommentEvent
):
string
{
...
...
@@ -199,20 +205,20 @@ export function renderTimelineEvent(timelineEvent: TimelineEvent): string {
return
''
;
}
// export function getStatusBGCoor(pr: any
) {
// if (pr.is
Merged) {
//
return '#6f42c1';
// } else if (pr.is
Open) {
//
return '#2cbe4e';
//
} else {
//
return '#cb2431';
//
}
//
}
export
function
getStatusBGCoor
(
state
:
PullRequestStateEnum
)
{
if
(
state
===
PullRequestStateEnum
.
Merged
)
{
return
'
#6f42c1
'
;
}
else
if
(
state
===
PullRequestStateEnum
.
Open
)
{
return
'
#2cbe4e
'
;
}
else
{
return
'
#cb2431
'
;
}
}
export
function
getStatus
(
pr
:
any
)
{
if
(
pr
.
is
Merged
)
{
export
function
getStatus
(
state
:
PullRequestStateEnum
)
{
if
(
state
===
PullRequestStateEnum
.
Merged
)
{
return
'
Merged
'
;
}
else
if
(
pr
.
is
Open
)
{
}
else
if
(
state
===
PullRequestStateEnum
.
Open
)
{
return
'
Open
'
;
}
else
{
return
'
Closed
'
;
...
...
extensions/git-extended/resources/icons/dark/book.svg
浏览文件 @
f1dcaaea
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
><path
style=
"fill:#FFFFFF;"
fill-rule=
"evenodd"
d=
"M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"
></path></svg>
\ No newline at end of file
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
viewBox=
"0 0 16 16"
><path
style=
"fill:#FFFFFF;"
fill-rule=
"evenodd"
d=
"M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"
></path></svg>
\ No newline at end of file
extensions/git-extended/src/common/pullRequestOverview.ts
浏览文件 @
f1dcaaea
...
...
@@ -24,13 +24,15 @@ export class PullRequestOverviewPanel {
public
static
createOrShow
(
extensionPath
:
string
,
pullRequestModel
:
PullRequestModel
)
{
const
column
=
vscode
.
window
.
activeTextEditor
?
vscode
.
window
.
activeTextEditor
.
viewColumn
:
undefined
;
const
title
=
`Pull Request #
${
pullRequestModel
.
prNumber
.
toString
()}
`
;
// If we already have a panel, show it.
// Otherwise, create a new panel.
if
(
PullRequestOverviewPanel
.
currentPanel
)
{
PullRequestOverviewPanel
.
currentPanel
.
_panel
.
reveal
(
column
);
PullRequestOverviewPanel
.
currentPanel
.
_panel
.
title
=
title
;
}
else
{
PullRequestOverviewPanel
.
currentPanel
=
new
PullRequestOverviewPanel
(
extensionPath
,
column
||
vscode
.
ViewColumn
.
One
);
PullRequestOverviewPanel
.
currentPanel
=
new
PullRequestOverviewPanel
(
extensionPath
,
column
||
vscode
.
ViewColumn
.
One
,
title
);
}
PullRequestOverviewPanel
.
currentPanel
.
update
(
pullRequestModel
);
...
...
@@ -39,11 +41,11 @@ export class PullRequestOverviewPanel {
});
}
private
constructor
(
extensionPath
:
string
,
column
:
vscode
.
ViewColumn
)
{
private
constructor
(
extensionPath
:
string
,
column
:
vscode
.
ViewColumn
,
title
:
string
)
{
this
.
_extensionPath
=
extensionPath
;
// Create and show a new webview panel
this
.
_panel
=
vscode
.
window
.
createWebviewPanel
(
PullRequestOverviewPanel
.
viewType
,
'
Pull Request
'
,
column
,
{
this
.
_panel
=
vscode
.
window
.
createWebviewPanel
(
PullRequestOverviewPanel
.
viewType
,
title
,
column
,
{
// Enable javascript in the webview
enableScripts
:
true
,
...
...
src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts
浏览文件 @
f1dcaaea
...
...
@@ -277,7 +277,7 @@ export class ReviewController implements IEditorContribution {
this
.
addComment
(
lineNumber
);
})
:
this
.
_newCommentGlyph
=
new
CommentGlyphWidget
(
'
comment-hint
'
,
this
.
editor
,
lineNumber
,
true
,
()
=>
{
this
.
notificationService
.
warn
(
'
Commenting is not supported outside of diff
c
hunk areas.
'
);
this
.
notificationService
.
warn
(
'
Commenting is not supported outside of diff hunk areas.
'
);
});
this
.
editor
.
layoutContentWidget
(
this
.
_newCommentGlyph
);
...
...
src/vs/workbench/parts/comments/electron-browser/media/review.css
浏览文件 @
f1dcaaea
...
...
@@ -34,8 +34,7 @@
}
.monaco-editor
.review-widget
.body
.review-comment
{
margin-left
:
20px
;
padding
:
8px
16px
8px
0px
;
padding
:
8px
16px
8px
20px
;
display
:
flex
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录