forked from FoundKeyGang/FoundKey
fix
This commit is contained in:
parent
5afe96e15a
commit
788edd3622
3 changed files with 10 additions and 15 deletions
|
@ -637,15 +637,13 @@ common/views/components/emoji-picker.vue:
|
||||||
symbols: "記号"
|
symbols: "記号"
|
||||||
flags: "旗"
|
flags: "旗"
|
||||||
|
|
||||||
common/views/components/settings/client-mode.vue:
|
common/views/components/settings/app-type.vue:
|
||||||
title: "モード"
|
title: "モード"
|
||||||
intro: "デスクトップ版とモバイル版のどちらを使うかを指定できます。"
|
intro: "デスクトップ版とモバイル版のどちらを使うかを指定できます。"
|
||||||
choices:
|
choices:
|
||||||
auto: "自動で選択"
|
auto: "自動で選択"
|
||||||
desktop: "デスクトップ版に固定"
|
desktop: "デスクトップ版に固定"
|
||||||
mobile: "モバイル版に固定"
|
mobile: "モバイル版に固定"
|
||||||
desktop: "デスクトップ"
|
|
||||||
mobile: "モバイル"
|
|
||||||
info: "変更はページの再度読み込み後に反映されます。"
|
info: "変更はページの再度読み込み後に反映されます。"
|
||||||
|
|
||||||
common/views/components/signin.vue:
|
common/views/components/signin.vue:
|
||||||
|
|
|
@ -35,12 +35,12 @@
|
||||||
const url = new URL(location.href);
|
const url = new URL(location.href);
|
||||||
|
|
||||||
//#region Detect app name
|
//#region Detect app name
|
||||||
window.appType = null;
|
let app = null;
|
||||||
|
|
||||||
if (`${url.pathname}/`.startsWith('/docs/')) window.appType = 'docs';
|
if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs';
|
||||||
if (`${url.pathname}/`.startsWith('/dev/')) window.appType = 'dev';
|
if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev';
|
||||||
if (`${url.pathname}/`.startsWith('/auth/')) window.appType = 'auth';
|
if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth';
|
||||||
if (`${url.pathname}/`.startsWith('/admin/')) window.appType = 'admin';
|
if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin';
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
// Script version
|
// Script version
|
||||||
|
@ -105,15 +105,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch desktop or mobile version
|
// Switch desktop or mobile version
|
||||||
if (window.appType == null) {
|
if (app == null) {
|
||||||
window.appType = isMobile ? 'mobile' : 'desktop';
|
app = isMobile ? 'mobile' : 'desktop';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load an app script
|
// Load an app script
|
||||||
// Note: 'async' make it possible to load the script asyncly.
|
// Note: 'async' make it possible to load the script asyncly.
|
||||||
// 'defer' make it possible to run the script when the dom loaded.
|
// 'defer' make it possible to run the script when the dom loaded.
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.setAttribute('src', `/assets/${window.appType}.${ver}.js`);
|
script.setAttribute('src', `/assets/${app}.${ver}.js`);
|
||||||
script.setAttribute('async', 'true');
|
script.setAttribute('async', 'true');
|
||||||
script.setAttribute('defer', 'true');
|
script.setAttribute('defer', 'true');
|
||||||
head.appendChild(script);
|
head.appendChild(script);
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<ui-select v-model="appTypeForce" :placeholder="$t('intro')">
|
<ui-select v-model="appTypeForce" :placeholder="$t('intro')">
|
||||||
<option v-for="x in ['auto', 'desktop', 'mobile']" :value="x" :key="x">{{ $t(`choices.${x}`) }}</option>
|
<option v-for="x in ['auto', 'desktop', 'mobile']" :value="x" :key="x">{{ $t(`choices.${x}`) }}</option>
|
||||||
</ui-select>
|
</ui-select>
|
||||||
<ui-info>Current: <i>{{ $t(currentAppType) }}</i></ui-info>
|
|
||||||
<ui-info warn>{{ $t('info') }}</ui-info>
|
<ui-info warn>{{ $t('info') }}</ui-info>
|
||||||
</section>
|
</section>
|
||||||
</ui-card>
|
</ui-card>
|
||||||
|
@ -19,12 +18,10 @@ import i18n from '../../../../i18n';
|
||||||
import { faMobileAlt } from '@fortawesome/free-solid-svg-icons'
|
import { faMobileAlt } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
i18n: i18n('common/views/components/settings/client-mode.vue'),
|
i18n: i18n('common/views/components/settings/app-type.vue'),
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentAppType: (window as any).appType,
|
|
||||||
|
|
||||||
faMobileAlt
|
faMobileAlt
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue