From 2479f75d8a31f40b49d9271ec922efdd68794f90 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 13 Feb 2020 02:48:52 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E6=83=85=E5=A0=B1=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A8?= =?UTF-8?q?Misskey=E6=83=85=E5=A0=B1=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92?= =?UTF-8?q?=E5=88=86=E9=9B=A2=E3=81=99=E3=82=8B=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 1 + src/client/app.vue | 9 ++- src/client/config.ts | 4 +- src/client/init.ts | 2 +- src/client/pages/about-misskey.vue | 89 +++++++++++++++++++++++++ src/client/pages/about.vue | 55 --------------- src/client/pages/index.welcome.vue | 4 +- src/client/router.ts | 1 + src/client/scripts/get-instance-name.ts | 8 --- 9 files changed, 103 insertions(+), 70 deletions(-) create mode 100644 src/client/pages/about-misskey.vue delete mode 100644 src/client/scripts/get-instance-name.ts diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 8f4c937016..71cbd5663b 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -387,6 +387,7 @@ tapSecurityKey: "セキュリティーキーにタッチ" or: "もしくは" uiLanguage: "UIの表示言語" groupInvited: "グループに招待されました" +aboutX: "{x}について" _ago: unknown: "謎" diff --git a/src/client/app.vue b/src/client/app.vue index 46b616519d..c2e60c9bbe 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -157,7 +157,7 @@ import { faBell, faEnvelope, faLaugh, faComments } from '@fortawesome/free-regul import { ResizeObserver } from '@juggle/resize-observer'; import { v4 as uuid } from 'uuid'; import i18n from './i18n'; -import { host } from './config'; +import { host, instanceName } from './config'; import { search } from './scripts/search'; import contains from './scripts/contains'; import MkToast from './components/toast.vue'; @@ -481,9 +481,14 @@ export default Vue.extend({ icon: faQuestionCircle, }, { type: 'link', - text: this.$t('about'), + text: this.$t('aboutX', { x: instanceName || host }), to: '/about', icon: faInfoCircle, + }, { + type: 'link', + text: this.$t('aboutMisskey'), + to: '/about-misskey', + icon: faInfoCircle, }], align: 'left', fixed: true, diff --git a/src/client/config.ts b/src/client/config.ts index 175a3f0b29..0d4a96964e 100644 --- a/src/client/config.ts +++ b/src/client/config.ts @@ -3,7 +3,7 @@ declare const _VERSION_: string; declare const _ENV_: string; const address = new URL(location.href); -const siteName = document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement; +const siteName = (document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement)?.content; export const host = address.host; export const hostname = address.hostname; @@ -15,4 +15,4 @@ export const langs = _LANGS_; export const locale = JSON.parse(localStorage.getItem('locale')); export const version = _VERSION_; export const env = _ENV_; -export const instanceName = siteName && siteName.content ? siteName.content : 'Misskey'; +export const instanceName = siteName === 'Misskey' ? null : siteName; diff --git a/src/client/init.ts b/src/client/init.ts index a3953dcd0f..b013637f7f 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -149,7 +149,7 @@ os.init(async () => { store: os.store, metaInfo: { title: null, - titleTemplate: title => title ? `${title} | ${instanceName}` : instanceName + titleTemplate: title => title ? `${title} | ${(instanceName || 'Misskey')}` : (instanceName || 'Misskey') }, data() { return { diff --git a/src/client/pages/about-misskey.vue b/src/client/pages/about-misskey.vue new file mode 100644 index 0000000000..8eadd1abc7 --- /dev/null +++ b/src/client/pages/about-misskey.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/src/client/pages/about.vue b/src/client/pages/about.vue index 45314a53fb..e39600b487 100644 --- a/src/client/pages/about.vue +++ b/src/client/pages/about.vue @@ -20,51 +20,6 @@
Misskeyv{{ version }}
- -
-
{{ $t('aboutMisskey') }}
-
-
{{ $t('aboutMisskeyText') }}
-
{{ $t('misskeyMembers') }}
- - @syuilo - @AyaMorisawa - @mei23 - @acid-chicken - @tamaina - @rinsuki - -
{{ $t('misskeySource') }}
- -
{{ $t('misskeyTranslation') }}
- -
{{ $t('misskeyDonate') }}
- -
-
- {{ $t('patrons') }} -
    -
  • Gargron
  • -
  • Satsuki Yanagi
  • -
  • noellabo
  • -
  • naga_rus
  • -
  • Melilot
  • -
  • AureoleArk
  • -
  • Peter G.
  • -
  • motcha
  • -
  • Atsuko Tominaga
  • -
  • dansup
  • -
  • Nokotaro Takeda
  • -
  • YUKIMOCHI
  • -
  • nanami kan
  • -
  • Hekovic
  • -
  • wara
  • -
  • Takashi Shibuya
  • -
  • Noizeman
  • -
- {{ $t('morePatrons') }} -
-
@@ -119,15 +74,5 @@ export default Vue.extend({ } } } - - > .aboutMisskey { - > ._content { - > .members { - > a { - margin-right: 0.5em; - } - } - } - } } diff --git a/src/client/pages/index.welcome.vue b/src/client/pages/index.welcome.vue index 21fc0c3aba..fb4aba6588 100644 --- a/src/client/pages/index.welcome.vue +++ b/src/client/pages/index.welcome.vue @@ -10,7 +10,7 @@ import Vue from 'vue'; import XSetup from './index.welcome.setup.vue'; import XEntrance from './index.welcome.entrance.vue'; -import { getInstanceName } from '../scripts/get-instance-name'; +import { instanceName } from '../config'; export default Vue.extend({ components: { @@ -20,7 +20,7 @@ export default Vue.extend({ data() { return { - instanceName: getInstanceName(), + instanceName: instanceName || 'Misskey', } }, diff --git a/src/client/router.ts b/src/client/router.ts index a8b74b2eaf..a226cc9734 100644 --- a/src/client/router.ts +++ b/src/client/router.ts @@ -20,6 +20,7 @@ export const router = new VueRouter({ { path: '/@:user/pages/:pageName/view-source', component: page('page-editor/page-editor'), props: route => ({ initUser: route.params.user, initPageName: route.params.pageName }) }, { path: '/announcements', component: page('announcements') }, { path: '/about', component: page('about') }, + { path: '/about-misskey', component: page('about-misskey') }, { path: '/featured', component: page('featured') }, { path: '/docs', component: page('docs') }, { path: '/docs/:doc', component: page('doc'), props: true }, diff --git a/src/client/scripts/get-instance-name.ts b/src/client/scripts/get-instance-name.ts deleted file mode 100644 index b12a3a4c67..0000000000 --- a/src/client/scripts/get-instance-name.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function getInstanceName() { - const siteName = document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement; - if (siteName && siteName.content) { - return siteName.content; - } - - return 'Misskey'; -}