Prettified all files.
This commit is contained in:
Vendored
+42
-27
@@ -1,13 +1,13 @@
|
||||
|
||||
class Bootstrap extends Object {
|
||||
|
||||
static get isSafari() {
|
||||
return /Safari/.test(navigator.userAgent) && /Apple Computer, Inc/.test(navigator.vendor)
|
||||
return (
|
||||
/Safari/.test(navigator.userAgent) &&
|
||||
/Apple Computer, Inc/.test(navigator.vendor)
|
||||
)
|
||||
}
|
||||
|
||||
static get isModernSafari() {
|
||||
if (!this.isSafari)
|
||||
return false
|
||||
if (!this.isSafari) return false
|
||||
let agent = navigator.appVersion
|
||||
let offset = agent.indexOf('Version')
|
||||
if (offset != -1) {
|
||||
@@ -27,7 +27,13 @@ class Bootstrap extends Object {
|
||||
|
||||
if (isIOSChrome) {
|
||||
return true
|
||||
} else if (isChromium !== null && isChromium !== undefined && vendorName === 'Google Inc.' && isOpera == false && isIEedge == false) {
|
||||
} else if (
|
||||
isChromium !== null &&
|
||||
isChromium !== undefined &&
|
||||
vendorName === 'Google Inc.' &&
|
||||
isOpera == false &&
|
||||
isIEedge == false
|
||||
) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
@@ -45,7 +51,6 @@ class Bootstrap extends Object {
|
||||
}
|
||||
|
||||
static get isFirefox() {
|
||||
|
||||
if (window.navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
|
||||
return true
|
||||
}
|
||||
@@ -54,7 +59,6 @@ class Bootstrap extends Object {
|
||||
}
|
||||
|
||||
static get isModernFirefox() {
|
||||
|
||||
if (!this.isFirefox) {
|
||||
return false
|
||||
}
|
||||
@@ -67,26 +71,35 @@ class Bootstrap extends Object {
|
||||
|
||||
static import(src, callback = null) {
|
||||
if (src.endsWith('babel.js')) {
|
||||
this.load(this.baseUrl + '/3rdparty/polyfills/babel-polyfill.js',
|
||||
this.load(
|
||||
this.baseUrl + '/3rdparty/polyfills/babel-polyfill.js',
|
||||
() => {
|
||||
this.load(src, callback, null)
|
||||
},
|
||||
null)
|
||||
}
|
||||
else if (this.isModernSafari || this.isModernChrome || this.isModernFirefox) {
|
||||
null
|
||||
)
|
||||
} else if (
|
||||
this.isModernSafari ||
|
||||
this.isModernChrome ||
|
||||
this.isModernFirefox
|
||||
) {
|
||||
this.load(src, callback)
|
||||
} else {
|
||||
this.load(this.baseUrl + '/3rdparty/systemjs/system.js', () => {
|
||||
SystemJS.config(this.systemjsConfig)
|
||||
let promise = SystemJS.import(src)
|
||||
if (promise) {
|
||||
promise.then(() => {
|
||||
if (callback) {
|
||||
callback.call(this)
|
||||
}
|
||||
})
|
||||
}
|
||||
}, 'script')
|
||||
this.load(
|
||||
this.baseUrl + '/3rdparty/systemjs/system.js',
|
||||
() => {
|
||||
SystemJS.config(this.systemjsConfig)
|
||||
let promise = SystemJS.import(src)
|
||||
if (promise) {
|
||||
promise.then(() => {
|
||||
if (callback) {
|
||||
callback.call(this)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
'script'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,14 +123,14 @@ class Bootstrap extends Object {
|
||||
}
|
||||
|
||||
static get systemjsConfig() {
|
||||
|
||||
const baseUrl = this.baseUrl
|
||||
|
||||
return {
|
||||
baseURL: baseUrl,
|
||||
map: {
|
||||
'plugin-babel': baseUrl + '/3rdparty/systemjs/plugin-babel.js',
|
||||
'systemjs-babel-build': baseUrl + '/3rdparty/systemjs/systemjs-babel-browser.js'
|
||||
'systemjs-babel-build':
|
||||
baseUrl + '/3rdparty/systemjs/systemjs-babel-browser.js'
|
||||
},
|
||||
transpiler: 'plugin-babel',
|
||||
meta: {
|
||||
@@ -132,7 +145,6 @@ class Bootstrap extends Object {
|
||||
}
|
||||
|
||||
static get baseUrl() {
|
||||
|
||||
let baseUrl = './'
|
||||
let scripts = document.getElementsByTagName('script')
|
||||
|
||||
@@ -154,7 +166,10 @@ class Bootstrap extends Object {
|
||||
let p = document.createElement('p')
|
||||
p.innerHTML = '.'
|
||||
document.body.appendChild(p)
|
||||
p.setAttribute('style', `font-family: '${font}'; font-weight: ${weight}; font-style: '${style}'; position: absolute; top: -10000px;`)
|
||||
p.setAttribute(
|
||||
'style',
|
||||
`font-family: '${font}'; font-weight: ${weight}; font-style: '${style}'; position: absolute; top: -10000px;`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user