Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
07b83624
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,体验更适合开发者的 AI 搜索 >>
提交
07b83624
编写于
1月 13, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove support for IE9 and IE10
上级
aefac3b8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
1 addition
and
113 deletion
+1
-113
src/vs/base/browser/browser.ts
src/vs/base/browser/browser.ts
+1
-30
src/vs/base/browser/ui/progressbar/progressbar.ts
src/vs/base/browser/ui/progressbar/progressbar.ts
+0
-49
src/vs/base/test/browser/browser.test.ts
src/vs/base/test/browser/browser.test.ts
+0
-34
未找到文件。
src/vs/base/browser/browser.ts
浏览文件 @
07b83624
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
types
=
require
(
'
vs/base/common/types
'
);
import
*
as
Platform
from
'
vs/base/common/platform
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -129,37 +128,9 @@ export const canUseTranslate3d = !isFirefox;
export
const
enableEmptySelectionClipboard
=
isWebKit
;
/**
* Returns if the browser supports CSS 3 animations.
*/
export
function
hasCSSAnimationSupport
()
{
if
(
this
.
_hasCSSAnimationSupport
===
true
||
this
.
_hasCSSAnimationSupport
===
false
)
{
return
this
.
_hasCSSAnimationSupport
;
}
let
supported
=
false
;
let
element
=
document
.
createElement
(
'
div
'
);
let
properties
=
[
'
animationName
'
,
'
webkitAnimationName
'
,
'
msAnimationName
'
,
'
MozAnimationName
'
,
'
OAnimationName
'
];
for
(
let
i
=
0
;
i
<
properties
.
length
;
i
++
)
{
let
property
=
properties
[
i
];
if
(
!
types
.
isUndefinedOrNull
(
element
.
style
[
property
])
||
element
.
style
.
hasOwnProperty
(
property
))
{
supported
=
true
;
break
;
}
}
if
(
supported
)
{
this
.
_hasCSSAnimationSupport
=
true
;
}
else
{
this
.
_hasCSSAnimationSupport
=
false
;
}
return
this
.
_hasCSSAnimationSupport
;
}
export
function
supportsExecCommand
(
command
:
string
):
boolean
{
return
(
(
isIE
||
Platform
.
isNative
)
&&
document
.
queryCommandSupported
(
command
)
);
}
\ No newline at end of file
}
src/vs/base/browser/ui/progressbar/progressbar.ts
浏览文件 @
07b83624
...
...
@@ -8,10 +8,8 @@
import
'
vs/css!./progressbar
'
;
import
{
TPromise
,
ValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
assert
=
require
(
'
vs/base/common/assert
'
);
import
browser
=
require
(
'
vs/base/browser/browser
'
);
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
const
css_done
=
'
done
'
;
...
...
@@ -33,7 +31,6 @@ export class ProgressBar {
private
bit
:
HTMLElement
;
private
totalWork
:
number
;
private
animationStopToken
:
ValueCallback
;
private
currentProgressToken
:
string
;
constructor
(
builder
:
Builder
)
{
this
.
toUnbind
=
[];
...
...
@@ -130,55 +127,9 @@ export class ProgressBar {
this
.
element
.
addClass
(
css_active
);
this
.
element
.
addClass
(
css_infinite
);
if
(
!
browser
.
hasCSSAnimationSupport
())
{
// Use a generated token to avoid race conditions from reentrant calls to this function
let
currentProgressToken
=
uuid
.
v4
().
asHex
();
this
.
currentProgressToken
=
currentProgressToken
;
this
.
manualInfinite
(
currentProgressToken
);
}
return
this
;
}
private
manualInfinite
(
currentProgressToken
:
string
):
void
{
this
.
bit
.
style
.
width
=
'
5%
'
;
this
.
bit
.
style
.
display
=
'
inherit
'
;
let
counter
=
0
;
let
animationFn
:
()
=>
void
=
()
=>
{
TPromise
.
timeout
(
50
).
then
(()
=>
{
// Return if another manualInfinite() call was made
if
(
currentProgressToken
!==
this
.
currentProgressToken
)
{
return
;
}
// Animation done
else
if
(
this
.
element
.
hasClass
(
css_done
))
{
this
.
bit
.
style
.
display
=
'
none
'
;
this
.
bit
.
style
.
left
=
'
0
'
;
}
// Wait until progress bar becomes visible
else
if
(
this
.
element
.
isHidden
())
{
animationFn
();
}
// Continue Animation until done
else
{
counter
=
(
counter
+
1
)
%
95
;
this
.
bit
.
style
.
left
=
counter
+
'
%
'
;
animationFn
();
}
});
};
// Start Animation
animationFn
();
}
/**
* Tells the progress bar the total number of work. Use in combination with workedVal() to let
* the progress bar show the actual progress based on the work that is done.
...
...
src/vs/base/test/browser/browser.test.ts
浏览文件 @
07b83624
...
...
@@ -6,43 +6,9 @@
import
*
as
assert
from
'
assert
'
;
import
{
isWindows
,
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
suite
(
'
Browsers
'
,
()
=>
{
test
(
'
all
'
,
function
()
{
assert
(
!
(
isWindows
&&
isMacintosh
));
let
isOpera
=
browser
.
isOpera
||
navigator
.
userAgent
.
indexOf
(
'
OPR
'
)
>=
0
;
let
isIE
=
browser
.
isIE
;
let
isFirefox
=
browser
.
isFirefox
;
let
isWebKit
=
browser
.
isWebKit
;
let
isChrome
=
browser
.
isChrome
;
let
isSafari
=
browser
.
isSafari
;
let
hasCSSAnimations
=
browser
.
hasCSSAnimationSupport
();
let
browserCount
=
0
;
if
(
isOpera
)
{
browserCount
++
;
}
if
(
isIE
)
{
browserCount
++
;
}
if
(
isFirefox
)
{
browserCount
++
;
assert
(
hasCSSAnimations
);
}
if
(
isWebKit
)
{
browserCount
++
;
assert
(
hasCSSAnimations
);
}
if
(
isChrome
)
{
browserCount
++
;
assert
(
hasCSSAnimations
);
}
if
(
isSafari
)
{
browserCount
++
;
assert
(
hasCSSAnimations
);
}
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录