From 2afcdda0587b8f63b5bfd8c28348ede41b5f12ee Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 19 Apr 2019 11:07:54 +0900 Subject: wip --- src/client/app/boot.js | 16 ++++----- .../common/views/components/settings/app-type.vue | 40 ++++++++++++++++++++++ .../common/views/components/settings/settings.vue | 3 ++ src/client/app/store.ts | 1 + 4 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 src/client/app/common/views/components/settings/app-type.vue (limited to 'src') diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 01104bf715..56eb59e21e 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -35,12 +35,12 @@ const url = new URL(location.href); //#region Detect app name - let app = null; + var appType = null; - if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs'; - if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev'; - if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth'; - if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin'; + if (`${url.pathname}/`.startsWith('/docs/')) appType = 'docs'; + if (`${url.pathname}/`.startsWith('/dev/')) appType = 'dev'; + if (`${url.pathname}/`.startsWith('/auth/')) appType = 'auth'; + if (`${url.pathname}/`.startsWith('/admin/')) appType = 'admin'; //#endregion // Script version @@ -103,15 +103,15 @@ } // Switch desktop or mobile version - if (app == null) { - app = isMobile ? 'mobile' : 'desktop'; + if (appType == null) { + appType = isMobile ? 'mobile' : 'desktop'; } // Load an app script // Note: 'async' make it possible to load the script asyncly. // 'defer' make it possible to run the script when the dom loaded. const script = document.createElement('script'); - script.setAttribute('src', `/assets/${app}.${ver}.js`); + script.setAttribute('src', `/assets/${appType}.${ver}.js`); script.setAttribute('async', 'true'); script.setAttribute('defer', 'true'); head.appendChild(script); diff --git a/src/client/app/common/views/components/settings/app-type.vue b/src/client/app/common/views/components/settings/app-type.vue new file mode 100644 index 0000000000..533fd51517 --- /dev/null +++ b/src/client/app/common/views/components/settings/app-type.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/client/app/common/views/components/settings/settings.vue b/src/client/app/common/views/components/settings/settings.vue index 1254eb5e5e..5f370c8be7 100644 --- a/src/client/app/common/views/components/settings/settings.vue +++ b/src/client/app/common/views/components/settings/settings.vue @@ -163,6 +163,7 @@ +