From fd611ceba7ff6f02b5c8089bbeaf571308ef3a59 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 2 Oct 2018 16:10:45 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=83=BC=E3=83=9E=E3=81=AB=E9=96=A2?= =?UTF-8?q?=E3=81=97=E3=81=A6=E5=BC=B7=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 2 ++ .../app/common/views/components/theme.vue | 31 +++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 08d3c5173..1453f1b0b 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -309,6 +309,8 @@ common/views/components/theme.vue: select-theme: "テーマを選択してください" uninstall: "アンインストール" uninstalled: "「{}」をアンインストールしました" + author: "作者" + desc: "説明" common/views/components/cw-button.vue: hide: "隠す" diff --git a/src/client/app/common/views/components/theme.vue b/src/client/app/common/views/components/theme.vue index 293238e54..7cec1529b 100644 --- a/src/client/app/common/views/components/theme.vue +++ b/src/client/app/common/views/components/theme.vue @@ -52,13 +52,21 @@
%i18n:@installed-themes% - + - - %i18n:@theme-code% - - %i18n:@uninstall% +
@@ -93,7 +101,7 @@ export default Vue.extend({ data() { return { installThemeCode: null, - selectedInstalledTheme: null, + selectedInstalledThemeId: null, myThemeBase: 'light', myThemeName: '', myThemePrimary: lightTheme.vars.primary, @@ -121,15 +129,20 @@ export default Vue.extend({ set(value) { this.$store.commit('device/set', { key: 'darkTheme', value }); } }, + selectedInstalledTheme() { + if (this.selectedInstalledThemeId == null) return null; + return this.installedThemes.find(x => x.id == this.selectedInstalledThemeId); + }, + selectedInstalledThemeCode() { if (this.selectedInstalledTheme == null) return null; - return JSON5.stringify(this.installedThemes.find(x => x.id == this.selectedInstalledTheme), null, '\t'); + return JSON5.stringify(this.selectedInstalledTheme, null, '\t'); }, myTheme(): any { return { name: this.myThemeName, - author: this.$store.state.i.name, + author: this.$store.state.i.username, base: this.myThemeBase, vars: { primary: tinycolor(typeof this.myThemePrimary == 'string' ? this.myThemePrimary : this.myThemePrimary.rgba).toRgbString(), @@ -198,7 +211,7 @@ export default Vue.extend({ }, uninstall() { - const theme = this.installedThemes.find(x => x.id == this.selectedInstalledTheme); + const theme = this.selectedInstalledTheme; const themes = this.$store.state.device.themes.filter(t => t.id != theme.id); this.$store.commit('device/set', { key: 'themes', value: themes