Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c1b1d60b
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,发现更多精彩内容 >>
提交
c1b1d60b
编写于
11月 22, 2015
作者:
K
kheiakiyama
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unnecessary files
上级
bff376d1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
403 deletion
+0
-403
src/vs/base/browser/ui/inputbox2/inputBox2.css
src/vs/base/browser/ui/inputbox2/inputBox2.css
+0
-194
src/vs/base/browser/ui/inputbox2/inputBox2.ts
src/vs/base/browser/ui/inputbox2/inputBox2.ts
+0
-209
未找到文件。
src/vs/base/browser/ui/inputbox2/inputBox2.css
已删除
100644 → 0
浏览文件 @
bff376d1
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-inputbox2
{
position
:
relative
;
display
:
inline-block
;
padding
:
0
;
-webkit-box-sizing
:
border-box
;
-o-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-ms-box-sizing
:
border-box
;
box-sizing
:
border-box
;
font-family
:
"Segoe UI"
,
"SFUIText-Light"
,
"HelveticaNeue-Light"
,
sans-serif
,
"Droid Sans Fallback"
;
line-height
:
auto
!important
;
/* Customizable */
font-size
:
inherit
;
}
.monaco-inputbox2
>
.wrapper
>
.placeholder-shim
,
.monaco-inputbox2
>
.wrapper
>
.input
{
/* Customizable */
padding
:
4px
;
}
.monaco-inputbox2
>
.wrapper
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
}
.monaco-inputbox2
>
.wrapper
>
.input
{
display
:
inline-block
;
-webkit-box-sizing
:
border-box
;
-o-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-ms-box-sizing
:
border-box
;
box-sizing
:
border-box
;
width
:
100%
;
height
:
100%
;
line-height
:
inherit
;
border
:
none
;
font-family
:
inherit
;
font-size
:
inherit
;
}
.monaco-inputbox2
>
.wrapper
>
.input
:focus
{
outline
:
none
;
}
.monaco-inputbox2
>
.wrapper
>
.message
{
position
:
absolute
;
border
:
1px
solid
red
;
background
:
white
;
z-index
:
1000
;
}
.monaco-inputbox2
>
.wrapper
>
.placeholder-shim
{
position
:
absolute
;
display
:
inline-block
;
-webkit-box-sizing
:
border-box
;
-o-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-ms-box-sizing
:
border-box
;
box-sizing
:
border-box
;
z-index
:
1
;
margin-left
:
0
;
margin-top
:
0
;
width
:
100%
;
height
:
100%
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
opacity
:
0.5
;
cursor
:
text
;
}
/* Context view */
.monaco-inputbox-container2
{
position
:
absolute
;
text-align
:
right
;
z-index
:
1000
;
}
.monaco-inputbox-container2
.monaco-inputbox-message
{
display
:
inline-block
;
overflow
:
hidden
;
text-align
:
left
;
width
:
100%
;
-webkit-box-sizing
:
border-box
;
-o-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-ms-box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
0.4em
;
font-size
:
12px
;
line-height
:
17px
;
min-height
:
34px
;
margin-top
:
-1px
;
}
/* Theming */
.monaco-inputbox2.idle
{
border
:
1px
solid
transparent
;
}
.monaco-inputbox2.info
{
border
:
1px
solid
#009CCC
;
}
.monaco-inputbox-container2
.monaco-inputbox-message.info
{
background
:
#D6ECF2
;
border
:
1px
solid
#009CCC
;
}
.monaco-inputbox2.warning
{
border
:
1px
solid
#F2CB1D
;
}
.monaco-inputbox-container2
.monaco-inputbox-message.warning
{
background
:
#F6F5D2
;
border
:
1px
solid
#F2CB1D
;
}
.monaco-inputbox2.error
{
border
:
1px
solid
#E51400
;
}
.monaco-inputbox-container2
.monaco-inputbox-message.error
{
background
:
#f2dede
;
border
:
1px
solid
#E51400
;
}
/* VS Dark */
.vs-dark
.monaco-inputbox2.info
{
border-color
:
#55AAFF
;
}
.vs-dark
.monaco-inputbox-container2
.monaco-inputbox-message.info
{
background-color
:
#063B49
;
border-color
:
#55AAFF
;
}
.vs-dark
.monaco-inputbox2.warning
{
border-color
:
#B89500
;
}
.vs-dark
.monaco-inputbox-container2
.monaco-inputbox-message.warning
{
background-color
:
#352A05
;
border-color
:
#B89500
;
}
.vs-dark
.monaco-inputbox2.error
{
border-color
:
#BE1100
;
}
.vs-dark
.monaco-inputbox-container2
.monaco-inputbox-message.error
{
background-color
:
#5A1D1D
;
border-color
:
#BE1100
;
}
/* High Contrast Theming */
.hc-black
.monaco-inputbox2.idle
{
border
:
1px
solid
#6FC3DF
;
}
.hc-black
.monaco-inputbox-container2
.monaco-inputbox-message.info
{
background-color
:
#000
;
border-color
:
#6FC3DF
;
}
.hc-black
.monaco-inputbox2.warning
{
border-color
:
#B89500
;
}
.hc-black
.monaco-inputbox-container2
.monaco-inputbox-message.warning
{
background-color
:
#000
;
border-color
:
#B89500
;
}
.hc-black
.monaco-inputbox2.error
{
border-color
:
#BE1100
;
}
.hc-black
.monaco-inputbox-container2
.monaco-inputbox-message.error
{
background-color
:
#000
;
border-color
:
#BE1100
;
}
\ No newline at end of file
src/vs/base/browser/ui/inputbox2/inputBox2.ts
已删除
100644 → 0
浏览文件 @
bff376d1
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
'
vs/css!./inputBox2
'
;
import
Browser
=
require
(
'
vs/base/browser/browser
'
);
import
React
=
require
(
'
lib/react
'
);
var
DOM
=
React
.
DOM
,
div
=
DOM
.
div
,
input
=
DOM
.
input
,
label
=
DOM
.
label
,
span
=
DOM
.
span
;
export
interface
InputBoxProps
{
type
?:
string
;
placeholder
?:
string
;
ariaLabel
?:
string
;
disabled
?:
boolean
;
message
?:
IMessage
;
value
:
string
;
onChange
?:
(
newValue
:
string
)
=>
void
;
onKeyDown
:
(
e
:
React
.
KeyboardEvent
)
=>
void
;
}
export
interface
IMessage
{
content
?:
string
;
type
?:
MessageType
;
}
export
function
messageEquals
(
a
:
IMessage
,
b
:
IMessage
):
boolean
{
if
(
!
a
||
!
b
)
{
return
!
a
&&
!
b
;
}
return
(
a
.
content
===
b
.
content
&&
a
.
type
===
b
.
type
);
}
export
enum
MessageType
{
INFO
=
1
,
WARNING
=
2
,
ERROR
=
3
}
export
interface
IRange
{
start
:
number
;
end
:
number
;
}
export
interface
InputBoxState
{}
export
class
InputBoxSpec
extends
React
.
BaseComponent
<
InputBoxProps
,
InputBoxState
>
{
private
refs
:
{
input
:
React
.
DomReferencer2
<
HTMLInputElement
>
;
};
public
getInitialState
():
InputBoxState
{
return
{};
}
public
shouldComponentUpdate
(
nextProps
:
InputBoxProps
,
nextState
:
InputBoxState
):
boolean
{
return
(
this
.
props
.
type
!==
nextProps
.
type
||
this
.
props
.
placeholder
!==
nextProps
.
placeholder
||
this
.
props
.
ariaLabel
!==
nextProps
.
ariaLabel
||
this
.
props
.
disabled
!==
nextProps
.
disabled
||
!
messageEquals
(
this
.
props
.
message
,
nextProps
.
message
)
||
this
.
props
.
value
!==
nextProps
.
value
);
}
public
render
():
React
.
ReactElement
<
any
,
any
>
{
var
inputAttr
=
<
React
.
DomAttributes
>
{
ref
:
'
input
'
,
className
:
'
input
'
,
type
:
(
this
.
props
.
type
||
'
text
'
),
wrap
:
'
off
'
,
autoCorrect
:
'
off
'
,
autoCapitalize
:
'
off
'
,
spellCheck
:
'
false
'
,
value
:
this
.
props
.
value
,
onKeyDown
:
this
.
_onKeyDown
};
if
(
this
.
props
.
ariaLabel
)
{
inputAttr
[
'
aria-label
'
]
=
this
.
props
.
ariaLabel
;
}
if
(
this
.
props
.
disabled
)
{
inputAttr
.
disabled
=
this
.
props
.
disabled
;
}
if
(
this
.
props
.
onChange
)
{
inputAttr
.
onChange
=
this
.
_onValueChange
;
}
if
(
Browser
.
isIE9
)
{
inputAttr
.
onKeyUp
=
this
.
_onValueChange
;
}
var
extraWrapperChild
:
React
.
ReactDOMElement
<
React
.
DomAttributes
>
=
null
;
if
(
this
.
props
.
placeholder
)
{
if
(
!
supportsInputPlaceholder
())
{
extraWrapperChild
=
label
(
<
React
.
DomAttributes
>
{
className
:
'
placeholder-shim
'
+
(
this
.
props
.
value
?
'
hidden
'
:
''
),
for
:
'
input
'
,
onClick
:
this
.
_onPlaceholderShimClick
,
'
aria-hidden
'
:
(
this
.
props
.
value
?
'
true
'
:
'
false
'
)
},
this
.
props
.
placeholder
);
}
else
{
inputAttr
[
'
placeholder
'
]
=
this
.
props
.
placeholder
;
}
}
var
wrapperChildren
:
React
.
ReactElement
<
any
,
any
>
[]
=
[];
if
(
extraWrapperChild
)
{
wrapperChildren
.
push
(
extraWrapperChild
);
}
wrapperChildren
.
push
(
input
(
inputAttr
));
if
(
this
.
props
.
message
)
{
var
messageChildren
:
React
.
ReactElement
<
any
,
any
>
[]
=
[];
if
(
this
.
props
.
message
.
content
)
{
messageChildren
.
push
(
span
({
className
:
'
monaco-inputbox-message
'
+
this
.
_classForType
(
this
.
props
.
message
.
type
)
},
this
.
props
.
message
.
content
));
}
wrapperChildren
.
push
(
div
({
className
:
'
monaco-inputbox-container2
'
,
children
:
messageChildren
})
);
}
var
topLevelClassName
=
'
monaco-inputbox2
'
;
if
(
this
.
props
.
message
)
{
topLevelClassName
+=
'
'
+
this
.
_classForType
(
this
.
props
.
message
.
type
);
}
return
(
div
({
className
:
topLevelClassName
},
div
({
className
:
'
wrapper
'
,
children
:
wrapperChildren
})
)
);
}
private
_getInputElement
():
HTMLInputElement
{
return
this
.
refs
.
input
.
getDOMNode
();
}
public
focus
():
void
{
this
.
_getInputElement
().
focus
();
}
public
select
(
range
:
IRange
=
null
):
void
{
var
inputElement
=
this
.
_getInputElement
();
inputElement
.
select
();
if
(
range
)
{
inputElement
.
setSelectionRange
(
range
.
start
,
range
.
end
);
}
}
private
_onKeyDown
(
e
:
React
.
KeyboardEvent
):
void
{
this
.
props
.
onKeyDown
(
e
);
}
private
_classForType
(
type
:
MessageType
):
string
{
switch
(
type
)
{
case
MessageType
.
INFO
:
return
'
info
'
;
case
MessageType
.
WARNING
:
return
'
warning
'
;
default
:
return
'
error
'
;
}
}
private
_onValueChange
():
void
{
this
.
props
.
onChange
(
this
.
_getInputElement
().
value
);
}
private
_onPlaceholderShimClick
(
e
:
React
.
MouseEvent
):
void
{
e
.
preventDefault
();
e
.
stopPropagation
();
this
.
_getInputElement
().
focus
();
}
}
export
var
InputBox
=
React
.
createFactoryForTS
<
InputBoxProps
>
(
InputBoxSpec
.
prototype
);
var
supportsInputPlaceholder
=
(
function
()
{
var
result
:
boolean
;
return
function
supportsInputPlaceholder
()
{
if
(
typeof
result
===
'
undefined
'
)
{
// http://stackoverflow.com/questions/8245093/html5-placeholder-feature-detection-woes
var
input
=
document
.
createElement
(
'
input
'
);
result
=
(
typeof
input
.
placeholder
!==
'
undefined
'
);
}
return
result
;
};
})();
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录