diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-05-18 14:26:38 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-05-18 14:26:38 +0900 |
| commit | 2c3dbf8e64cf060a99dc37bd5b3120ff70e5ea99 (patch) | |
| tree | ad6fdcc6151f7e4055a29ba7960e16ab5431e90a /src/web | |
| parent | Refactorung (diff) | |
| download | misskey-2c3dbf8e64cf060a99dc37bd5b3120ff70e5ea99.tar.gz misskey-2c3dbf8e64cf060a99dc37bd5b3120ff70e5ea99.tar.bz2 misskey-2c3dbf8e64cf060a99dc37bd5b3120ff70e5ea99.zip | |
More readability
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/boot.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/web/app/boot.js b/src/web/app/boot.js index 95f5957d09..7431f817b4 100644 --- a/src/web/app/boot.js +++ b/src/web/app/boot.js @@ -13,10 +13,16 @@ // Get the current url information const Url = new URL(location.href); -// Extarct the (sub) domain part +// Extarct the (sub) domain part of the current url +// +// e.g. +// misskey.alice => misskey +// misskey.strawberry.pasta => misskey +// dev.misskey.alice.tachibana => dev let app = Url.host.split('.')[0]; // Detect user language +// Note: The default language is English let lang = navigator.language.split('-')[0]; if (!/^(en|ja)$/.test(lang)) lang = 'en'; @@ -41,6 +47,8 @@ if (app == 'misskey') { } // Load app script +// Note: 'async' makes can load the script async. +// 'defer' makes can run script when the dom loaded. const script = document.createElement('script'); script.setAttribute('src', `/assets/${app}.${VERSION}.${lang}.js`); script.setAttribute('async', 'true'); |