diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 00:02:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 00:02:53 +0900 |
| commit | 5ad77e8a3a7d3771559b02ea5c3e445ff2983533 (patch) | |
| tree | d6fbaa72a612baadee18e24c9ebc7e6a1fa3eb54 /src/web/app/client | |
| parent | 7.7.3 (diff) | |
| download | sharkey-5ad77e8a3a7d3771559b02ea5c3e445ff2983533.tar.gz sharkey-5ad77e8a3a7d3771559b02ea5c3e445ff2983533.tar.bz2 sharkey-5ad77e8a3a7d3771559b02ea5c3e445ff2983533.zip | |
nanka iroiro
Diffstat (limited to 'src/web/app/client')
| -rw-r--r-- | src/web/app/client/script.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/web/app/client/script.js b/src/web/app/client/script.js index dcd6bb16f2..ffc9c892cd 100644 --- a/src/web/app/client/script.js +++ b/src/web/app/client/script.js @@ -1,18 +1,29 @@ +/** + * MISSKEY ENTRY POINT + */ (() => { const head = document.getElementsByTagName('head')[0]; + + // Detect user agent const ua = navigator.userAgent.toLowerCase(); const isMobile = /mobile|iphone|ipad|android/.test(ua); isMobile ? mountMobile() : mountDesktop(); + /** + * Mount the desktop app + */ function mountDesktop() { const script = document.createElement('script'); - script.setAttribute('src', '/resources/desktop/script.js'); + script.setAttribute('src', `/resources/desktop/script.${VERSION}.js`); script.setAttribute('async', 'true'); script.setAttribute('defer', 'true'); head.appendChild(script); } + /** + * Mount the mobile app + */ function mountMobile() { const meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); @@ -20,7 +31,7 @@ head.appendChild(meta); const script = document.createElement('script'); - script.setAttribute('src', '/resources/mobile/script.js'); + script.setAttribute('src', `/resources/mobile/script.${VERSION}.js`); script.setAttribute('async', 'true'); script.setAttribute('defer', 'true'); head.appendChild(script); |