mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 08:03:08 +02:00
Extract to safe.js
This commit is contained in:
parent
e82bdf1511
commit
f06adb5e53
4 changed files with 15 additions and 8 deletions
|
@ -120,7 +120,7 @@ gulp.task('webpack', done => {
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build:client:script', () =>
|
gulp.task('build:client:script', () =>
|
||||||
gulp.src('./src/web/app/boot.js')
|
gulp.src(['./src/web/app/boot.js', './src/web/app/safe.js'])
|
||||||
.pipe(replace('VERSION', JSON.stringify(version)))
|
.pipe(replace('VERSION', JSON.stringify(version)))
|
||||||
.pipe(isProduction ? uglify() : gutil.noop())
|
.pipe(isProduction ? uglify() : gutil.noop())
|
||||||
.pipe(gulp.dest('./built/web/assets/')) as any
|
.pipe(gulp.dest('./built/web/assets/')) as any
|
||||||
|
|
|
@ -17,6 +17,9 @@ html
|
||||||
script
|
script
|
||||||
include ./../../../built/web/assets/boot.js
|
include ./../../../built/web/assets/boot.js
|
||||||
|
|
||||||
|
script
|
||||||
|
include ./../../../built/web/assets/safe.js
|
||||||
|
|
||||||
script(src='https://use.fontawesome.com/22aba0df4f.js' async)
|
script(src='https://use.fontawesome.com/22aba0df4f.js' async)
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
|
@ -11,13 +11,6 @@
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Detect an old browser
|
|
||||||
if (window.fetch == undefined) {
|
|
||||||
alert(
|
|
||||||
'お使いのブラウザが古いためMisskeyを動作させることができません。' +
|
|
||||||
'バージョンを最新のものに更新するか、別のブラウザをお試しください。');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the current url information
|
// Get the current url information
|
||||||
const Url = new URL(location.href);
|
const Url = new URL(location.href);
|
||||||
|
|
||||||
|
|
11
src/web/app/safe.js
Normal file
11
src/web/app/safe.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
* 古いブラウザの検知を行う
|
||||||
|
* ブートローダーとは隔離されているため互いに影響を及ぼすことはない
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Detect an old browser
|
||||||
|
if (!'fetch' in window) {
|
||||||
|
alert(
|
||||||
|
'お使いのブラウザが古いためMisskeyを動作させることができません。' +
|
||||||
|
'バージョンを最新のものに更新するか、別のブラウザをお試しください。');
|
||||||
|
}
|
Loading…
Reference in a new issue