@@ -12,32 +12,32 @@ interface ISafeWindow {
1212}
1313
1414interface ISafeDocument {
15- URL :string ;
16- createElement ( tagName :'div' ) :HTMLDivElement ;
17- createElement ( tagName :string ) :HTMLElement ;
15+ URL : string ;
16+ createElement ( tagName : 'div' ) : HTMLDivElement ;
17+ createElement ( tagName : string ) : HTMLElement ;
1818}
1919
2020interface INavigator {
21- userAgent :string ;
21+ userAgent : string ;
2222}
2323
2424interface ILocation {
2525 search : string ;
2626}
2727
2828interface IGlobalScope {
29- window :ISafeWindow ;
30- navigator :INavigator ;
31- parent :IGlobalScope ;
32- document :ISafeDocument ;
29+ window : ISafeWindow ;
30+ navigator : INavigator ;
31+ parent : IGlobalScope ;
32+ document : ISafeDocument ;
3333 history : {
34- pushState :any
34+ pushState : any
3535 } ;
36- isTest :boolean ;
36+ isTest : boolean ;
3737 location : ILocation ;
3838}
3939
40- var globals = < IGlobalScope > < any > ( typeof self === 'object' ? self : global ) ;
40+ const globals = < IGlobalScope > < any > ( typeof self === 'object' ? self : global ) ;
4141
4242// MAC:
4343// chrome: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.100 Safari/535.2"
@@ -53,8 +53,8 @@ var globals = <IGlobalScope><any> (typeof self === 'object' ? self : global);
5353// chrome: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36"
5454// firefox: "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"
5555
56- var userAgent = globals . navigator ? globals . navigator . userAgent : '' ;
57- var isTest = ! ! globals . isTest ;
56+ const userAgent = globals . navigator ? globals . navigator . userAgent : '' ;
57+ const isTest = ! ! globals . isTest ;
5858
5959// DOCUMENTED FOR FUTURE REFERENCE:
6060// When running IE11 in IE10 document mode, the code below will identify the browser as being IE10,
@@ -77,14 +77,15 @@ export const canUseTranslate3d = !isIE9 && !isFirefox;
7777
7878export const enableEmptySelectionClipboard = isWebKit ;
7979
80+ let _disablePushState = false ;
81+
8082/**
8183 * Returns if the browser supports the history.pushState function or not.
8284 */
8385export function canPushState ( ) {
8486 return ( ! _disablePushState && globals . history && globals . history . pushState ) ;
8587} ;
8688
87- var _disablePushState = false ;
8889/**
8990 * Helpful when we detect that pushing state does not work for some reason (e.g. FF prevents pushState for security reasons in some cases)
9091 */
@@ -104,11 +105,11 @@ export function hasCSSAnimationSupport() {
104105 return false ;
105106 }
106107
107- var supported = false ;
108- var element = globals . document . createElement ( 'div' ) ;
109- var properties = [ 'animationName' , 'webkitAnimationName' , 'msAnimationName' , 'MozAnimationName' , 'OAnimationName' ] ;
110- for ( var i = 0 ; i < properties . length ; i ++ ) {
111- var property = properties [ i ] ;
108+ let supported = false ;
109+ let element = globals . document . createElement ( 'div' ) ;
110+ let properties = [ 'animationName' , 'webkitAnimationName' , 'msAnimationName' , 'MozAnimationName' , 'OAnimationName' ] ;
111+ for ( let i = 0 ; i < properties . length ; i ++ ) {
112+ let property = properties [ i ] ;
112113 if ( ! types . isUndefinedOrNull ( element . style [ property ] ) || element . style . hasOwnProperty ( property ) ) {
113114 supported = true ;
114115 break ;
@@ -127,14 +128,14 @@ export function hasCSSAnimationSupport() {
127128/**
128129 * Returns if the browser supports the provided video mime type or not.
129130 */
130- export function canPlayVideo ( type :string ) {
131+ export function canPlayVideo ( type : string ) {
131132 if ( ! globals . document ) {
132133 return false ;
133134 }
134135
135- var video :HTMLVideoElement = < HTMLVideoElement > globals . document . createElement ( 'video' ) ;
136+ let video : HTMLVideoElement = < HTMLVideoElement > globals . document . createElement ( 'video' ) ;
136137 if ( video . canPlayType ) {
137- var canPlay = video . canPlayType ( type ) ;
138+ let canPlay = video . canPlayType ( type ) ;
138139
139140 return canPlay === 'maybe' || canPlay === 'probably' ;
140141 }
@@ -145,26 +146,26 @@ export function canPlayVideo(type:string) {
145146/**
146147 * Returns if the browser supports the provided audio mime type or not.
147148 */
148- export function canPlayAudio ( type :string ) {
149+ export function canPlayAudio ( type : string ) {
149150 if ( ! globals . document ) {
150151 return false ;
151152 }
152153
153- var audio :HTMLAudioElement = < HTMLAudioElement > globals . document . createElement ( 'audio' ) ;
154+ let audio : HTMLAudioElement = < HTMLAudioElement > globals . document . createElement ( 'audio' ) ;
154155 if ( audio . canPlayType ) {
155- var canPlay = audio . canPlayType ( type ) ;
156+ let canPlay = audio . canPlayType ( type ) ;
156157
157158 return canPlay === 'maybe' || canPlay === 'probably' ;
158159 }
159160
160161 return false ;
161162}
162163
163- export function isInWebWorker ( ) :boolean {
164- return ! globals . document && typeof ( ( < any > globals ) . importScripts ) !== 'undefined' ;
164+ export function isInWebWorker ( ) : boolean {
165+ return ! globals . document && typeof ( ( < any > globals ) . importScripts ) !== 'undefined' ;
165166}
166167
167- export function supportsExecCommand ( command :string ) : boolean {
168+ export function supportsExecCommand ( command : string ) : boolean {
168169 return (
169170 ( isIE11orEarlier || Platform . isNative )
170171 && document . queryCommandSupported ( command )
0 commit comments