This commit is contained in:
syuilo 2018-05-20 09:04:48 +09:00
parent 3a97f0467a
commit 186810cefe
6 changed files with 207 additions and 72 deletions

View file

@ -807,18 +807,13 @@ mobile/views/pages/notifications.vue:
read-all: "すべての通知を既読にしますか?" read-all: "すべての通知を既読にしますか?"
mobile/views/pages/settings/settings.profile.vue: mobile/views/pages/settings/settings.profile.vue:
title: "プロフィール設定" title: "プロフィール"
will-be-published: "これらのプロフィールは公開されます。" will-be-published: "これらのプロフィールは公開されます。"
name: "名前" name: "名前"
location: "場所" location: "場所"
description: "自己紹介" description: "自己紹介"
birthday: "誕生日" birthday: "誕生日"
avatar: "アイコン" is-bot: "このアカウントはBotです"
banner: "バナー"
avatar-saved: "アイコンを保存しました"
banner-saved: "バナーを保存しました"
set-avatar: "アイコンを選択する"
set-banner: "バナーを選択する"
save: "保存" save: "保存"
saved: "プロフィールを保存しました" saved: "プロフィールを保存しました"
@ -831,9 +826,34 @@ mobile/views/pages/selectdrive.vue:
mobile/views/pages/settings.vue: mobile/views/pages/settings.vue:
signed-in-as: "{}としてサインイン中" signed-in-as: "{}としてサインイン中"
profile: "プロフィール" lang: "言語"
lang-tip: "変更はページの再読み込み後に反映されます。"
recommended: "推奨"
auto: "自動"
specify-language: "言語を指定"
design: "デザインと表示"
dark-mode: "ダークモード"
circle-icons: "円形のアイコンを使用"
timeline: "タイムライン"
show-reply-target: "リプライ先を表示する"
show-my-renotes: "自分の行ったRenoteを表示する"
show-renoted-my-notes: "Renoteされた自分の投稿を表示する"
behavior: "動作"
fetch-on-scroll: "スクロールで自動読み込み"
disable-via-mobile: "「モバイルからの投稿」フラグを付けない"
twitter: "Twitter連携" twitter: "Twitter連携"
signin-history: "サインイン履歴" twitter-connect: "Twitterアカウントに接続する"
twitter-reconnect: "再接続する"
twitter-disconnect: "切断する"
update: "Misskey Update"
version: "バージョン:"
latest-version: "最新のバージョン:"
update-checking: "アップデートを確認中"
check-for-updates: "アップデートを確認"
no-updates: "利用可能な更新はありません"
no-updates-desc: "お使いのMisskeyは最新です。"
update-available: "新しいバージョンが利用可能です"
update-available-desc: "ページを再度読み込みすると更新が適用されます。"
settings: "設定" settings: "設定"
signout: "サインアウト" signout: "サインアウト"

View file

@ -7,6 +7,11 @@ html
cursor progress !important cursor progress !important
body body
// for md
font-size 16px !important
line-height initial !important
letter-spacing initial !important
overflow-wrap break-word overflow-wrap break-word
#error #error

View file

@ -5,7 +5,7 @@
import Vue from 'vue'; import Vue from 'vue';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import { MdCard, MdButton, MdField, MdMenu, MdList, MdSwitch } from 'vue-material/dist/components'; import { MdCard, MdButton, MdField, MdMenu, MdList, MdSwitch, MdSubheader } from 'vue-material/dist/components';
import 'vue-material/dist/vue-material.min.css'; import 'vue-material/dist/vue-material.min.css';
import 'vue-material/dist/theme/default.css'; import 'vue-material/dist/theme/default.css';
@ -46,6 +46,7 @@ Vue.use(MdField);
Vue.use(MdMenu); Vue.use(MdMenu);
Vue.use(MdList); Vue.use(MdList);
Vue.use(MdSwitch); Vue.use(MdSwitch);
Vue.use(MdSubheader);
/** /**
* init * init

View file

@ -6,9 +6,9 @@
<div> <div>
<x-profile/> <x-profile/>
<md-card class="md-layout-item md-size-50 md-small-size-100"> <md-card>
<md-card-header> <md-card-header>
<div class="md-title">%i18n:@design%</div> <div class="md-title">%fa:palette% %i18n:@design%</div>
</md-card-header> </md-card-header>
<md-card-content> <md-card-content>
@ -19,6 +19,95 @@
<div> <div>
<md-switch v-model="clientSettings.circleIcons" @change="onChangeCircleIcons">%i18n:@circle-icons%</md-switch> <md-switch v-model="clientSettings.circleIcons" @change="onChangeCircleIcons">%i18n:@circle-icons%</md-switch>
</div> </div>
<div>
<div class="md-body-2">%i18n:@timeline%</div>
<div>
<md-switch v-model="clientSettings.showReplyTarget" @change="onChangeShowReplyTarget">%i18n:@show-reply-target%</md-switch>
</div>
<div>
<md-switch v-model="clientSettings.showMyRenotes" @change="onChangeShowMyRenotes">%i18n:@show-my-renotes%</md-switch>
</div>
<div>
<md-switch v-model="clientSettings.showRenotedMyNotes" @change="onChangeShowRenotedMyNotes">%i18n:@show-renoted-my-notes%</md-switch>
</div>
</div>
</md-card-content>
</md-card>
<md-card>
<md-card-header>
<div class="md-title">%fa:cog% %i18n:@behavior%</div>
</md-card-header>
<md-card-content>
<div>
<md-switch v-model="clientSettings.fetchOnScroll" @change="onChangeFetchOnScroll">%i18n:@fetch-on-scroll%</md-switch>
</div>
<div>
<md-switch v-model="clientSettings.disableViaMobile" @change="onChangeDisableViaMobile">%i18n:@disable-via-mobile%</md-switch>
</div>
</md-card-content>
</md-card>
<md-card>
<md-card-header>
<div class="md-title">%fa:language% %i18n:@lang%</div>
</md-card-header>
<md-card-content>
<md-field>
<md-select v-model="lang" placeholder="%i18n:@auto%">
<md-optgroup label="%i18n:@recommended%">
<md-option value="">%i18n:@auto%</md-option>
</md-optgroup>
<md-optgroup label="%i18n:@specify-language%">
<md-option value="ja">日本語</md-option>
<md-option value="en">English</md-option>
<md-option value="fr">Français</md-option>
<md-option value="pl">Polski</md-option>
<md-option value="de">Deutsch</md-option>
</md-optgroup>
</md-select>
</md-field>
<span class="md-helper-text">%fa:info-circle% %i18n:@lang-tip%</span>
</md-card-content>
</md-card>
<md-card>
<md-card-header>
<div class="md-title">%fa:B twitter% %i18n:@twitter%</div>
</md-card-header>
<md-card-content>
<p class="account" v-if="os.i.twitter"><a :href="`https://twitter.com/${os.i.twitter.screenName}`" target="_blank">@{{ os.i.twitter.screenName }}</a></p>
<p>
<a :href="`${apiUrl}/connect/twitter`" target="_blank">{{ os.i.twitter ? '%i18n:!@twitter-reconnect%' : '%i18n:!@twitter-connect%' }}</a>
<span v-if="os.i.twitter"> or </span>
<a :href="`${apiUrl}/disconnect/twitter`" target="_blank" v-if="os.i.twitter">%i18n:@twitter-disconnect%</a>
</p>
</md-card-content>
</md-card>
<md-card>
<md-card-header>
<div class="md-title">%fa:sync-alt% %i18n:@update%</div>
</md-card-header>
<md-card-content>
<div>%i18n:@version% <i>{{ version }}</i></div>
<template v-if="latestVersion !== undefined">
<div>%i18n:@latest-version% <i>{{ latestVersion ? latestVersion : version }}</i></div>
</template>
<md-button class="md-raised md-primary" @click="checkForUpdate" :disabled="checkingForUpdate">
<template v-if="checkingForUpdate">%i18n:@update-checking%<mk-ellipsis/></template>
<template v-else>%i18n:@check-for-updates%</template>
</md-button>
</md-card-content> </md-card-content>
</md-card> </md-card>
</div> </div>
@ -29,7 +118,8 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { version, codename } from '../../../config'; import { apiUrl, version, codename } from '../../../config';
import checkForUpdate from '../../../common/scripts/check-for-update';
import XProfile from './settings/settings.profile.vue'; import XProfile from './settings/settings.profile.vue';
@ -40,9 +130,13 @@ export default Vue.extend({
data() { data() {
return { return {
apiUrl,
version, version,
codename, codename,
darkmode: localStorage.getItem('darkmode') == 'true' darkmode: localStorage.getItem('darkmode') == 'true',
lang: localStorage.getItem('lang') || '',
latestVersion: undefined,
checkingForUpdate: false
}; };
}, },
@ -55,6 +149,9 @@ export default Vue.extend({
watch: { watch: {
darkmode() { darkmode() {
(this as any)._updateDarkmode_(this.darkmode); (this as any)._updateDarkmode_(this.darkmode);
},
lang() {
localStorage.setItem('lang', this.lang);
} }
}, },
@ -67,11 +164,65 @@ export default Vue.extend({
(this as any).os.signout(); (this as any).os.signout();
}, },
onChangeFetchOnScroll(v) {
this.$store.dispatch('settings/set', {
key: 'fetchOnScroll',
value: v
});
},
onChangeDisableViaMobile(v) {
this.$store.dispatch('settings/set', {
key: 'disableViaMobile',
value: v
});
},
onChangeCircleIcons(v) { onChangeCircleIcons(v) {
this.$store.dispatch('settings/set', { this.$store.dispatch('settings/set', {
key: 'circleIcons', key: 'circleIcons',
value: v value: v
}); });
},
onChangeShowReplyTarget(v) {
this.$store.dispatch('settings/set', {
key: 'showReplyTarget',
value: v
});
},
onChangeShowMyRenotes(v) {
this.$store.dispatch('settings/set', {
key: 'showMyRenotes',
value: v
});
},
onChangeShowRenotedMyNotes(v) {
this.$store.dispatch('settings/set', {
key: 'showRenotedMyNotes',
value: v
});
},
checkForUpdate() {
this.checkingForUpdate = true;
checkForUpdate((this as any).os, true, true).then(newer => {
this.checkingForUpdate = false;
this.latestVersion = newer;
if (newer == null) {
(this as any).apis.dialog({
title: '%i18n:!@no-updates%',
text: '%i18n:!@no-updates-desc%'
});
} else {
(this as any).apis.dialog({
title: '%i18n:!@update-available%',
text: '%i18n:!@update-available-desc%'
});
}
});
} }
} }
}); });

View file

@ -1,7 +1,7 @@
<template> <template>
<md-card class="md-layout-item md-size-50 md-small-size-100"> <md-card>
<md-card-header> <md-card-header>
<div class="md-title">%i18n:@title%</div> <div class="md-title">%fa:pencil-alt% %i18n:@title%</div>
</md-card-header> </md-card-header>
<md-card-content> <md-card-content>
@ -10,41 +10,25 @@
<md-input v-model="name" :disabled="saving"/> <md-input v-model="name" :disabled="saving"/>
</md-field> </md-field>
<md-field>
<label>%i18n:@location%</label>
<md-input v-model="location" :disabled="saving"/>
</md-field>
<md-field> <md-field>
<label>%i18n:@description%</label> <label>%i18n:@description%</label>
<md-textarea v-model="description" :disabled="saving"/> <md-textarea v-model="description" :disabled="saving"/>
</md-field> </md-field>
<md-field> <md-field>
<md-icon>%fa:map-marker-alt%</md-icon>
<label>%i18n:@location%</label>
<md-input v-model="location" :disabled="saving"/>
</md-field>
<md-field>
<md-icon>%fa:birthday-cake%</md-icon>
<label>%i18n:@birthday%</label> <label>%i18n:@birthday%</label>
<md-input type="date" v-model="birthday" :disabled="saving"/> <md-input type="date" v-model="birthday" :disabled="saving"/>
</md-field> </md-field>
<div> <div>
<div class="md-body-2">%i18n:@avatar%</div> <md-switch v-model="os.i.isBot" @change="onChangeIsBot">%i18n:@is-bot%</md-switch>
<md-menu md-direction="bottom-end" :md-close-on-select="true">
<md-button md-menu-trigger>%i18n:@set-avatar%</md-button>
<md-menu-content>
<md-menu-item @click="uploadAvatar">%i18n:@upload-avatar%</md-menu-item>
<md-menu-item @click="chooseAvatar">%i18n:@choose-avatar%</md-menu-item>
</md-menu-content>
</md-menu>
</div>
<div>
<div class="md-body-2">%i18n:@banner%</div>
<md-menu md-direction="bottom-end" :md-close-on-select="true">
<md-button md-menu-trigger>%i18n:@set-banner%</md-button>
<md-menu-content>
<md-menu-item @click="uploadAvatar">%i18n:@upload-banner%</md-menu-item>
<md-menu-item @click="chooseAvatar">%i18n:@choose-banner%</md-menu-item>
</md-menu-content>
</md-menu>
</div> </div>
</md-card-content> </md-card-content>
@ -67,47 +51,21 @@ export default Vue.extend({
saving: false saving: false
}; };
}, },
created() { created() {
this.name = (this as any).os.i.name || ''; this.name = (this as any).os.i.name || '';
this.location = (this as any).os.i.profile.location; this.location = (this as any).os.i.profile.location;
this.description = (this as any).os.i.description; this.description = (this as any).os.i.description;
this.birthday = (this as any).os.i.profile.birthday; this.birthday = (this as any).os.i.profile.birthday;
}, },
methods: { methods: {
chooseAvatar() { onChangeIsBot() {
(this as any).apis.chooseDriveFile({ (this as any).api('i/update', {
multiple: false isBot: (this as any).os.i.isBot
}).then(file => {
this.avatarSaving = true;
(this as any).api('i/update', {
avatarId: file.id
}).then(() => {
this.avatarSaving = false;
alert('%i18n:!@avatar-saved%');
});
}); });
}, },
chooseBanner() {
(this as any).apis.chooseDriveFile({
multiple: false
}).then(file => {
this.bannerSaving = true;
(this as any).api('i/update', {
bannerId: file.id
}).then(() => {
this.bannerSaving = false;
alert('%i18n:!@banner-saved%');
});
});
},
uploadAvatar() {
// a
},
uploadBanner() {
// a
},
save() { save() {
this.saving = true; this.saving = true;

View file

@ -6,7 +6,7 @@
@include md-register-theme("default", ( @include md-register-theme("default", (
primary: $themeColor, primary: $themeColor,
accent: md-get-palette-color(red, A200) accent: $themeColor
)); ));
@import "~vue-material/dist/components/MdButton/theme"; @import "~vue-material/dist/components/MdButton/theme";