diff options
Diffstat (limited to 'src/client/app/common')
29 files changed, 141 insertions, 176 deletions
diff --git a/src/client/app/common/define-widget.ts b/src/client/app/common/define-widget.ts index 1efdbb1880..632ddf2ed6 100644 --- a/src/client/app/common/define-widget.ts +++ b/src/client/app/common/define-widget.ts @@ -45,15 +45,9 @@ export default function <T extends object>(data: { this.$watch('props', () => { this.mergeProps(); }); - - this.bakeProps(); }, methods: { - bakeProps() { - this.bakedOldProps = JSON.stringify(this.props); - }, - mergeProps() { if (data.props) { const defaultProps = data.props(); @@ -65,17 +59,10 @@ export default function <T extends object>(data: { }, save() { - if (this.bakedOldProps == JSON.stringify(this.props)) return; - - this.bakeProps(); - if (this.platform == 'deck') { this.$store.commit('device/updateDeckColumn', this.column); } else { - this.$root.api('i/update_widget', { - id: this.id, - data: this.props - }); + this.$store.commit('device/updateWidget', this.widget); } } } diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts index 5707d1bb41..67bbe8c0ae 100644 --- a/src/client/app/common/scripts/note-mixin.ts +++ b/src/client/app/common/scripts/note-mixin.ts @@ -70,8 +70,8 @@ export default (opts: Opts = {}) => ({ }, reactionsCount(): number { - return this.appearNote.reactionCounts - ? sum(Object.values(this.appearNote.reactionCounts)) + return this.appearNote.reactions + ? sum(Object.values(this.appearNote.reactions)) : 0; }, diff --git a/src/client/app/common/scripts/note-subscriber.ts b/src/client/app/common/scripts/note-subscriber.ts index c2b4dd6df9..02d810ded9 100644 --- a/src/client/app/common/scripts/note-subscriber.ts +++ b/src/client/app/common/scripts/note-subscriber.ts @@ -87,16 +87,16 @@ export default prop => ({ case 'reacted': { const reaction = body.reaction; - if (this.$_ns_target.reactionCounts == null) { - Vue.set(this.$_ns_target, 'reactionCounts', {}); + if (this.$_ns_target.reactions == null) { + Vue.set(this.$_ns_target, 'reactions', {}); } - if (this.$_ns_target.reactionCounts[reaction] == null) { - Vue.set(this.$_ns_target.reactionCounts, reaction, 0); + if (this.$_ns_target.reactions[reaction] == null) { + Vue.set(this.$_ns_target.reactions, reaction, 0); } // Increment the count - this.$_ns_target.reactionCounts[reaction]++; + this.$_ns_target.reactions[reaction]++; if (body.userId == this.$store.state.i.id) { Vue.set(this.$_ns_target, 'myReaction', reaction); @@ -107,16 +107,16 @@ export default prop => ({ case 'unreacted': { const reaction = body.reaction; - if (this.$_ns_target.reactionCounts == null) { + if (this.$_ns_target.reactions == null) { return; } - if (this.$_ns_target.reactionCounts[reaction] == null) { + if (this.$_ns_target.reactions[reaction] == null) { return; } // Decrement the count - if (this.$_ns_target.reactionCounts[reaction] > 0) this.$_ns_target.reactionCounts[reaction]--; + if (this.$_ns_target.reactions[reaction] > 0) this.$_ns_target.reactions[reaction]--; if (body.userId == this.$store.state.i.id) { Vue.set(this.$_ns_target, 'myReaction', null); @@ -125,9 +125,11 @@ export default prop => ({ } case 'pollVoted': { - if (body.userId == this.$store.state.i.id) return; const choice = body.choice; - this.$_ns_target.poll.choices.find(c => c.id === choice).votes++; + this.$_ns_target.poll.choices[choice].votes++; + if (body.userId == this.$store.state.i.id) { + Vue.set(this.$_ns_target.poll.choices[choice], 'isVoted', true); + } break; } diff --git a/src/client/app/common/views/components/avatar.vue b/src/client/app/common/views/components/avatar.vue index dce594e702..c074fb600f 100644 --- a/src/client/app/common/views/components/avatar.vue +++ b/src/client/app/common/views/components/avatar.vue @@ -55,11 +55,12 @@ export default Vue.extend({ }, icon(): any { return { - backgroundColor: this.lightmode - ? `rgb(${this.user.avatarColor.slice(0, 3).join(',')})` - : this.user.avatarColor && this.user.avatarColor.length == 3 - ? `rgb(${this.user.avatarColor.join(',')})` - : null, + backgroundColor: this.user.avatarColor ? this.lightmode + ? this.user.avatarColor + : this.user.avatarColor.startsWith('rgb(') + ? this.user.avatarColor + : null + : null, backgroundImage: this.lightmode ? null : `url(${this.url})`, borderRadius: this.$store.state.settings.circleIcons ? '100%' : null }; @@ -67,7 +68,7 @@ export default Vue.extend({ }, mounted() { if (this.user.avatarColor) { - this.$el.style.color = `rgb(${this.user.avatarColor.slice(0, 3).join(',')})`; + this.$el.style.color = this.user.avatarColor; } }, methods: { diff --git a/src/client/app/common/views/components/games/reversi/reversi.game.vue b/src/client/app/common/views/components/games/reversi/reversi.game.vue index c6fc36db33..bd0401f785 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.game.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.game.vue @@ -24,11 +24,11 @@ <div class="board"> <div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels"> - <span v-for="i in game.settings.map[0].length">{{ String.fromCharCode(64 + i) }}</span> + <span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span> </div> <div class="flex"> <div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels"> - <div v-for="i in game.settings.map.length">{{ i }}</div> + <div v-for="i in game.map.length">{{ i }}</div> </div> <div class="cells" :style="cellsStyle"> <div v-for="(stone, i) in o.board" @@ -46,11 +46,11 @@ </div> </div> <div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels"> - <div v-for="i in game.settings.map.length">{{ i }}</div> + <div v-for="i in game.map.length">{{ i }}</div> </div> </div> <div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels"> - <span v-for="i in game.settings.map[0].length">{{ String.fromCharCode(64 + i) }}</span> + <span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span> </div> </div> @@ -71,9 +71,9 @@ </div> <div class="info"> - <p v-if="game.settings.isLlotheo">{{ $t('is-llotheo') }}</p> - <p v-if="game.settings.loopedBoard">{{ $t('looped-map') }}</p> - <p v-if="game.settings.canPutEverywhere">{{ $t('can-put-everywhere') }}</p> + <p v-if="game.isLlotheo">{{ $t('is-llotheo') }}</p> + <p v-if="game.loopedBoard">{{ $t('looped-map') }}</p> + <p v-if="game.canPutEverywhere">{{ $t('can-put-everywhere') }}</p> </div> </div> </template> @@ -160,8 +160,8 @@ export default Vue.extend({ cellsStyle(): any { return { - 'grid-template-rows': `repeat(${this.game.settings.map.length}, 1fr)`, - 'grid-template-columns': `repeat(${this.game.settings.map[0].length}, 1fr)` + 'grid-template-rows': `repeat(${this.game.map.length}, 1fr)`, + 'grid-template-columns': `repeat(${this.game.map[0].length}, 1fr)` }; } }, @@ -169,10 +169,10 @@ export default Vue.extend({ watch: { logPos(v) { if (!this.game.isEnded) return; - this.o = new Reversi(this.game.settings.map, { - isLlotheo: this.game.settings.isLlotheo, - canPutEverywhere: this.game.settings.canPutEverywhere, - loopedBoard: this.game.settings.loopedBoard + this.o = new Reversi(this.game.map, { + isLlotheo: this.game.isLlotheo, + canPutEverywhere: this.game.canPutEverywhere, + loopedBoard: this.game.loopedBoard }); for (const log of this.logs.slice(0, v)) { this.o.put(log.color, log.pos); @@ -184,10 +184,10 @@ export default Vue.extend({ created() { this.game = this.initGame; - this.o = new Reversi(this.game.settings.map, { - isLlotheo: this.game.settings.isLlotheo, - canPutEverywhere: this.game.settings.canPutEverywhere, - loopedBoard: this.game.settings.loopedBoard + this.o = new Reversi(this.game.map, { + isLlotheo: this.game.isLlotheo, + canPutEverywhere: this.game.canPutEverywhere, + loopedBoard: this.game.loopedBoard }); for (const log of this.game.logs) { @@ -286,10 +286,10 @@ export default Vue.extend({ onRescue(game) { this.game = game; - this.o = new Reversi(this.game.settings.map, { - isLlotheo: this.game.settings.isLlotheo, - canPutEverywhere: this.game.settings.canPutEverywhere, - loopedBoard: this.game.settings.loopedBoard + this.o = new Reversi(this.game.map, { + isLlotheo: this.game.isLlotheo, + canPutEverywhere: this.game.canPutEverywhere, + loopedBoard: this.game.loopedBoard }); for (const log of this.game.logs) { diff --git a/src/client/app/common/views/components/games/reversi/reversi.room.vue b/src/client/app/common/views/components/games/reversi/reversi.room.vue index d5d148790c..9ee1a78b86 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.room.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.room.vue @@ -17,9 +17,9 @@ </header> <div> - <div class="random" v-if="game.settings.map == null"><fa icon="dice"/></div> - <div class="board" v-else :style="{ 'grid-template-rows': `repeat(${ game.settings.map.length }, 1fr)`, 'grid-template-columns': `repeat(${ game.settings.map[0].length }, 1fr)` }"> - <div v-for="(x, i) in game.settings.map.join('')" + <div class="random" v-if="game.map == null"><fa icon="dice"/></div> + <div class="board" v-else :style="{ 'grid-template-rows': `repeat(${ game.map.length }, 1fr)`, 'grid-template-columns': `repeat(${ game.map[0].length }, 1fr)` }"> + <div v-for="(x, i) in game.map.join('')" :data-none="x == ' '" @click="onPixelClick(i, x)"> <fa v-if="x == 'b'" :icon="fasCircle"/> @@ -35,9 +35,9 @@ </header> <div> - <form-radio v-model="game.settings.bw" value="random" @change="updateSettings">{{ $t('random') }}</form-radio> - <form-radio v-model="game.settings.bw" :value="1" @change="updateSettings">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user1"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio> - <form-radio v-model="game.settings.bw" :value="2" @change="updateSettings">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user2"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio> + <form-radio v-model="game.bw" value="random" @change="updateSettings('bw')">{{ $t('random') }}</form-radio> + <form-radio v-model="game.bw" :value="1" @change="updateSettings('bw')">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user1"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio> + <form-radio v-model="game.bw" :value="2" @change="updateSettings('bw')">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user2"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio> </div> </div> @@ -47,9 +47,9 @@ </header> <div> - <ui-switch v-model="game.settings.isLlotheo" @change="updateSettings">{{ $t('is-llotheo') }}</ui-switch> - <ui-switch v-model="game.settings.loopedBoard" @change="updateSettings">{{ $t('looped-map') }}</ui-switch> - <ui-switch v-model="game.settings.canPutEverywhere" @change="updateSettings">{{ $t('can-put-everywhere') }}</ui-switch> + <ui-switch v-model="game.isLlotheo" @change="updateSettings('isLlotheo')">{{ $t('is-llotheo') }}</ui-switch> + <ui-switch v-model="game.loopedBoard" @change="updateSettings('loopedBoard')">{{ $t('looped-map') }}</ui-switch> + <ui-switch v-model="game.canPutEverywhere" @change="updateSettings('canPutEverywhere')">{{ $t('can-put-everywhere') }}</ui-switch> </div> </div> @@ -159,8 +159,8 @@ export default Vue.extend({ this.connection.on('initForm', this.onInitForm); this.connection.on('message', this.onMessage); - if (this.game.user1Id != this.$store.state.i.id && this.game.settings.form1) this.form = this.game.settings.form1; - if (this.game.user2Id != this.$store.state.i.id && this.game.settings.form2) this.form = this.game.settings.form2; + if (this.game.user1Id != this.$store.state.i.id && this.game.form1) this.form = this.game.form1; + if (this.game.user2Id != this.$store.state.i.id && this.game.form2) this.form = this.game.form2; }, beforeDestroy() { @@ -189,18 +189,19 @@ export default Vue.extend({ this.$forceUpdate(); }, - updateSettings() { + updateSettings(key: string) { this.connection.send('updateSettings', { - settings: this.game.settings + key: key, + value: this.game[key] }); }, - onUpdateSettings(settings) { - this.game.settings = settings; - if (this.game.settings.map == null) { + onUpdateSettings({ key, value }) { + this.game[key] = value; + if (this.game.map == null) { this.mapName = null; } else { - const found = Object.values(maps).find(x => x.data.join('') == this.game.settings.map.join('')); + const found = Object.values(maps).find(x => x.data.join('') == this.game.map.join('')); this.mapName = found ? found.name : '-Custom-'; } }, @@ -224,27 +225,27 @@ export default Vue.extend({ onMapChange() { if (this.mapName == null) { - this.game.settings.map = null; + this.game.map = null; } else { - this.game.settings.map = Object.values(maps).find(x => x.name == this.mapName).data; + this.game.map = Object.values(maps).find(x => x.name == this.mapName).data; } this.$forceUpdate(); this.updateSettings(); }, onPixelClick(pos, pixel) { - const x = pos % this.game.settings.map[0].length; - const y = Math.floor(pos / this.game.settings.map[0].length); + const x = pos % this.game.map[0].length; + const y = Math.floor(pos / this.game.map[0].length); const newPixel = pixel == ' ' ? '-' : pixel == '-' ? 'b' : pixel == 'b' ? 'w' : ' '; - const line = this.game.settings.map[y].split(''); + const line = this.game.map[y].split(''); line[x] = newPixel; - this.$set(this.game.settings.map, y, line.join('')); + this.$set(this.game.map, y, line.join('')); this.$forceUpdate(); - this.updateSettings(); + this.updateSettings('map'); } } }); diff --git a/src/client/app/common/views/components/games/reversi/reversi.vue b/src/client/app/common/views/components/games/reversi/reversi.vue index b6803cd7f7..d33471a049 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.vue @@ -106,7 +106,7 @@ export default Vue.extend({ async nav(game, actualNav = true) { if (this.selfNav) { // 受け取ったゲーム情報が省略されたものなら完全な情報を取得する - if (game != null && (game.settings == null || game.settings.map == null)) { + if (game != null && game.map == null) { game = await this.$root.api('games/reversi/games/show', { gameId: game.id }); diff --git a/src/client/app/common/views/components/instance.vue b/src/client/app/common/views/components/instance.vue index 7b8d4f8e0b..497e4976f5 100644 --- a/src/client/app/common/views/components/instance.vue +++ b/src/client/app/common/views/components/instance.vue @@ -2,7 +2,7 @@ <div class="nhasjydimbopojusarffqjyktglcuxjy" v-if="meta"> <div class="banner" :style="{ backgroundImage: meta.bannerUrl ? `url(${meta.bannerUrl})` : null }"></div> - <h1>{{ meta.name }}</h1> + <h1>{{ meta.name || 'Misskey' }}</h1> <p v-html="meta.description || this.$t('@.about')"></p> <router-link to="/">{{ $t('start') }}</router-link> </div> diff --git a/src/client/app/common/views/components/mention.vue b/src/client/app/common/views/components/mention.vue index 11dddbd52a..e1f67282b6 100644 --- a/src/client/app/common/views/components/mention.vue +++ b/src/client/app/common/views/components/mention.vue @@ -33,7 +33,7 @@ export default Vue.extend({ }, computed: { canonical(): string { - return `@${this.username}@${toUnicode(this.host)}`; + return this.host === localHost ? `@${this.username}` : `@${this.username}@${toUnicode(this.host)}`; }, isMe(): boolean { return this.$store.getters.isSignedIn && this.canonical.toLowerCase() === `@${this.$store.state.i.username}@${toUnicode(localHost)}`.toLowerCase(); diff --git a/src/client/app/common/views/components/poll.vue b/src/client/app/common/views/components/poll.vue index ba14ba3a44..dc3aaa34f3 100644 --- a/src/client/app/common/views/components/poll.vue +++ b/src/client/app/common/views/components/poll.vue @@ -1,7 +1,7 @@ <template> <div class="mk-poll" :data-done="closed || isVoted"> <ul> - <li v-for="choice in poll.choices" :key="choice.id" @click="vote(choice.id)" :class="{ voted: choice.voted }" :title="!closed && !isVoted ? $t('vote-to').replace('{}', choice.text) : ''"> + <li v-for="(choice, i) in poll.choices" :key="i" @click="vote(i)" :class="{ voted: choice.voted }" :title="!closed && !isVoted ? $t('vote-to').replace('{}', choice.text) : ''"> <div class="backdrop" :style="{ 'width': `${showResult ? (choice.votes / total * 100) : 0}%` }"></div> <span> <template v-if="choice.isVoted"><fa icon="check"/></template> @@ -82,12 +82,6 @@ export default Vue.extend({ noteId: this.note.id, choice: id }).then(() => { - for (const c of this.poll.choices) { - if (c.id == id) { - c.votes++; - Vue.set(c, 'isVoted', true); - } - } if (!this.showResult) this.showResult = !this.poll.multiple; }); } diff --git a/src/client/app/common/views/components/reactions-viewer.vue b/src/client/app/common/views/components/reactions-viewer.vue index cf7f88b2f5..46668054b8 100644 --- a/src/client/app/common/views/components/reactions-viewer.vue +++ b/src/client/app/common/views/components/reactions-viewer.vue @@ -20,7 +20,7 @@ export default Vue.extend({ }, computed: { reactions(): any { - return this.note.reactionCounts; + return this.note.reactions; }, isMe(): boolean { return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId; diff --git a/src/client/app/common/views/components/settings/notification.vue b/src/client/app/common/views/components/settings/notification.vue index b689544d69..2554fe6331 100644 --- a/src/client/app/common/views/components/settings/notification.vue +++ b/src/client/app/common/views/components/settings/notification.vue @@ -2,7 +2,7 @@ <ui-card> <template #title><fa :icon="['far', 'bell']"/> {{ $t('title') }}</template> <section> - <ui-switch v-model="$store.state.i.settings.autoWatch" @change="onChangeAutoWatch"> + <ui-switch v-model="$store.state.i.autoWatch" @change="onChangeAutoWatch"> {{ $t('auto-watch') }}<template #desc>{{ $t('auto-watch-desc') }}</template> </ui-switch> <section> diff --git a/src/client/app/common/views/components/settings/profile.vue b/src/client/app/common/views/components/settings/profile.vue index b9837a6966..acfc1875a6 100644 --- a/src/client/app/common/views/components/settings/profile.vue +++ b/src/client/app/common/views/components/settings/profile.vue @@ -158,14 +158,14 @@ export default Vue.extend({ computed: { alwaysMarkNsfw: { - get() { return this.$store.state.i.settings.alwaysMarkNsfw; }, + get() { return this.$store.state.i.alwaysMarkNsfw; }, set(value) { this.$root.api('i/update', { alwaysMarkNsfw: value }); } }, bannerStyle(): any { if (this.$store.state.i.bannerUrl == null) return {}; return { - backgroundColor: this.$store.state.i.bannerColor && this.$store.state.i.bannerColor.length == 3 ? `rgb(${ this.$store.state.i.bannerColor.join(',') })` : null, + backgroundColor: this.$store.state.i.bannerColor ? this.$store.state.i.bannerColor : null, backgroundImage: `url(${ this.$store.state.i.bannerUrl })` }; }, @@ -178,10 +178,10 @@ export default Vue.extend({ this.email = this.$store.state.i.email; this.name = this.$store.state.i.name; this.username = this.$store.state.i.username; - this.location = this.$store.state.i.profile.location; + this.location = this.$store.state.i.location; this.description = this.$store.state.i.description; this.lang = this.$store.state.i.lang; - this.birthday = this.$store.state.i.profile.birthday; + this.birthday = this.$store.state.i.birthday; this.avatarId = this.$store.state.i.avatarId; this.bannerId = this.$store.state.i.bannerId; this.isCat = this.$store.state.i.isCat; diff --git a/src/client/app/common/views/components/settings/theme.vue b/src/client/app/common/views/components/settings/theme.vue index 1dff61e459..3440aacb28 100644 --- a/src/client/app/common/views/components/settings/theme.vue +++ b/src/client/app/common/views/components/settings/theme.vue @@ -130,20 +130,6 @@ import * as tinycolor from 'tinycolor2'; import * as JSON5 from 'json5'; import { faMoon, faSun } from '@fortawesome/free-regular-svg-icons'; -// 後方互換性のため -function convertOldThemedefinition(t) { - const t2 = { - id: t.meta.id, - name: t.meta.name, - author: t.meta.author, - base: t.meta.base, - vars: t.meta.vars, - props: t - }; - delete t2.props.meta; - return t2; -} - export default Vue.extend({ i18n: i18n('common/views/components/theme.vue'), components: { @@ -231,20 +217,6 @@ export default Vue.extend({ } }, - beforeCreate() { - // migrate old theme definitions - // 後方互換性のため - this.$store.commit('device/set', { - key: 'themes', value: this.$store.state.device.themes.map(t => { - if (t.id == null) { - return convertOldThemedefinition(t); - } else { - return t; - } - }) - }); - }, - methods: { install(code) { let theme; @@ -259,11 +231,6 @@ export default Vue.extend({ return; } - // 後方互換性のため - if (theme.id == null && theme.meta != null) { - theme = convertOldThemedefinition(theme); - } - if (theme.id == null) { this.$root.dialog({ type: 'error', diff --git a/src/client/app/common/views/components/signup.vue b/src/client/app/common/views/components/signup.vue index 16e1afaa94..45c2eabd45 100644 --- a/src/client/app/common/views/components/signup.vue +++ b/src/client/app/common/views/components/signup.vue @@ -4,7 +4,7 @@ <ui-input v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required styl="fill"> <span>{{ $t('invitation-code') }}</span> <template #prefix><fa icon="id-card-alt"/></template> - <template #desc v-html="this.$t('invitation-info').replace('{}', 'mailto:' + meta.maintainer.email)"></template> + <template #desc v-html="this.$t('invitation-info').replace('{}', 'mailto:' + meta.maintainerEmail)"></template> </ui-input> <ui-input v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @input="onChangeUsername" styl="fill"> <span>{{ $t('username') }}</span> diff --git a/src/client/app/common/views/components/trends.vue b/src/client/app/common/views/components/trends.vue index 536d55247c..cd67cc0092 100644 --- a/src/client/app/common/views/components/trends.vue +++ b/src/client/app/common/views/components/trends.vue @@ -4,9 +4,9 @@ <p class="empty" v-else-if="stats.length == 0"><fa icon="exclamation-circle"/>{{ $t('empty') }}</p> <!-- トランジションを有効にするとなぜかメモリリークする --> <transition-group v-else tag="div" name="chart"> - <div v-for="stat in stats" :key="stat.tag"> + <div v-for="stat in stats" :key="stat.name"> <div class="tag"> - <router-link :to="`/tags/${ encodeURIComponent(stat.tag) }`" :title="stat.tag">#{{ stat.tag }}</router-link> + <router-link :to="`/tags/${ encodeURIComponent(stat.name) }`" :title="stat.name">#{{ stat.name }}</router-link> <p>{{ $t('count').replace('{}', stat.usersCount) }}</p> </div> <x-chart class="chart" :src="stat.chart"/> diff --git a/src/client/app/common/views/components/user-list-editor.vue b/src/client/app/common/views/components/user-list-editor.vue index 53c945ca0a..8d2e04d045 100644 --- a/src/client/app/common/views/components/user-list-editor.vue +++ b/src/client/app/common/views/components/user-list-editor.vue @@ -1,7 +1,7 @@ <template> <div class="cudqjmnl"> <ui-card> - <template #title><fa :icon="faList"/> {{ list.title }}</template> + <template #title><fa :icon="faList"/> {{ list.name }}</template> <section> <ui-button @click="rename"><fa :icon="faICursor"/> {{ $t('rename') }}</ui-button> @@ -75,7 +75,7 @@ export default Vue.extend({ this.$root.dialog({ title: this.$t('rename'), input: { - default: this.list.title + default: this.list.name } }).then(({ canceled, result: title }) => { if (canceled) return; @@ -89,7 +89,7 @@ export default Vue.extend({ del() { this.$root.dialog({ type: 'warning', - text: this.$t('delete-are-you-sure').replace('$1', this.list.title), + text: this.$t('delete-are-you-sure').replace('$1', this.list.name), showCancelButton: true }).then(({ canceled }) => { if (canceled) return; diff --git a/src/client/app/common/views/components/user-menu.vue b/src/client/app/common/views/components/user-menu.vue index 93fd759fd9..a95f7a9225 100644 --- a/src/client/app/common/views/components/user-menu.vue +++ b/src/client/app/common/views/components/user-menu.vue @@ -73,7 +73,7 @@ export default Vue.extend({ title: t, select: { items: lists.map(list => ({ - value: list.id, text: list.title + value: list.id, text: list.name })) }, showCancelButton: true diff --git a/src/client/app/common/views/deck/deck.column-core.vue b/src/client/app/common/views/deck/deck.column-core.vue index 974c58235d..e3f92dea16 100644 --- a/src/client/app/common/views/deck/deck.column-core.vue +++ b/src/client/app/common/views/deck/deck.column-core.vue @@ -3,7 +3,7 @@ <x-notifications-column v-else-if="column.type == 'notifications'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> <x-tl-column v-else-if="column.type == 'home'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> <x-tl-column v-else-if="column.type == 'local'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> -<x-tl-column v-else-if="column.type == 'hybrid'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> +<x-tl-column v-else-if="column.type == 'social'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> <x-tl-column v-else-if="column.type == 'global'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> <x-tl-column v-else-if="column.type == 'list'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> <x-tl-column v-else-if="column.type == 'hashtag'" :column="column" :is-stacked="isStacked" v-on="$listeners"/> diff --git a/src/client/app/common/views/deck/deck.hashtag-tl.vue b/src/client/app/common/views/deck/deck.hashtag-tl.vue index 07d96f82c4..b94267b74b 100644 --- a/src/client/app/common/views/deck/deck.hashtag-tl.vue +++ b/src/client/app/common/views/deck/deck.hashtag-tl.vue @@ -28,7 +28,7 @@ export default Vue.extend({ data() { return { connection: null, - makePromise: cursor => this.$root.api('notes/search_by_tag', { + makePromise: cursor => this.$root.api('notes/search-by-tag', { limit: fetchLimit + 1, untilId: cursor ? cursor : undefined, withFiles: this.mediaOnly, diff --git a/src/client/app/common/views/deck/deck.notification.vue b/src/client/app/common/views/deck/deck.notification.vue index 6a116260e5..3ced7b7e23 100644 --- a/src/client/app/common/views/deck/deck.notification.vue +++ b/src/client/app/common/views/deck/deck.notification.vue @@ -62,7 +62,7 @@ </div> </div> - <div class="notification poll_vote" v-if="notification.type == 'poll_vote'"> + <div class="notification pollVote" v-if="notification.type == 'pollVote'"> <mk-avatar class="avatar" :user="notification.user"/> <div> <header> diff --git a/src/client/app/common/views/deck/deck.tl-column.vue b/src/client/app/common/views/deck/deck.tl-column.vue index d53aabaea5..f6a9ee5286 100644 --- a/src/client/app/common/views/deck/deck.tl-column.vue +++ b/src/client/app/common/views/deck/deck.tl-column.vue @@ -3,7 +3,7 @@ <template #header> <fa v-if="column.type == 'home'" icon="home"/> <fa v-if="column.type == 'local'" :icon="['far', 'comments']"/> - <fa v-if="column.type == 'hybrid'" icon="share-alt"/> + <fa v-if="column.type == 'social'" icon="share-alt"/> <fa v-if="column.type == 'global'" icon="globe"/> <fa v-if="column.type == 'list'" icon="list"/> <fa v-if="column.type == 'hashtag'" icon="hashtag"/> @@ -80,9 +80,9 @@ export default Vue.extend({ switch (this.column.type) { case 'home': return this.$t('@deck.home'); case 'local': return this.$t('@deck.local'); - case 'hybrid': return this.$t('@deck.hybrid'); + case 'social': return this.$t('@deck.social'); case 'global': return this.$t('@deck.global'); - case 'list': return this.column.list.title; + case 'list': return this.column.list.name; case 'hashtag': return this.$store.state.settings.tagTimelines.find(x => x.id == this.column.tagTlId).title; } } diff --git a/src/client/app/common/views/deck/deck.tl.vue b/src/client/app/common/views/deck/deck.tl.vue index 35cdfa704f..5381cfbd5e 100644 --- a/src/client/app/common/views/deck/deck.tl.vue +++ b/src/client/app/common/views/deck/deck.tl.vue @@ -51,7 +51,7 @@ export default Vue.extend({ switch (this.src) { case 'home': return this.$root.stream.useSharedConnection('homeTimeline'); case 'local': return this.$root.stream.useSharedConnection('localTimeline'); - case 'hybrid': return this.$root.stream.useSharedConnection('hybridTimeline'); + case 'social': return this.$root.stream.useSharedConnection('socialTimeline'); case 'global': return this.$root.stream.useSharedConnection('globalTimeline'); } }, @@ -60,7 +60,7 @@ export default Vue.extend({ switch (this.src) { case 'home': return 'notes/timeline'; case 'local': return 'notes/local-timeline'; - case 'hybrid': return 'notes/hybrid-timeline'; + case 'social': return 'notes/social-timeline'; case 'global': return 'notes/global-timeline'; } }, @@ -107,7 +107,7 @@ export default Vue.extend({ this.$root.getMeta().then(meta => { this.disabled = !this.$store.state.i.isModerator && !this.$store.state.i.isAdmin && ( - meta.disableLocalTimeline && ['local', 'hybrid'].includes(this.src) || + meta.disableLocalTimeline && ['local', 'social'].includes(this.src) || meta.disableGlobalTimeline && ['global'].includes(this.src)); }); }, diff --git a/src/client/app/common/views/deck/deck.vue b/src/client/app/common/views/deck/deck.vue index 8ffb3223f9..a1bef84008 100644 --- a/src/client/app/common/views/deck/deck.vue +++ b/src/client/app/common/views/deck/deck.vue @@ -106,16 +106,6 @@ export default Vue.extend({ value: deck }); } - - // 互換性のため - if (this.$store.state.device.deck != null && this.$store.state.device.deck.layout == null) { - this.$store.commit('device/set', { - key: 'deck', - value: Object.assign({}, this.$store.state.device.deck, { - layout: this.$store.state.device.deck.columns.map(c => [c.id]) - }) - }); - } }, mounted() { @@ -155,11 +145,11 @@ export default Vue.extend({ } }, { icon: 'share-alt', - text: this.$t('@deck.hybrid'), + text: this.$t('@deck.social'), action: () => { this.$store.commit('device/addDeckColumn', { id: uuid(), - type: 'hybrid' + type: 'social' }); } }, { @@ -199,7 +189,7 @@ export default Vue.extend({ title: this.$t('@deck.select-list'), select: { items: lists.map(list => ({ - value: list.id, text: list.title + value: list.id, text: list.name })) }, showCancelButton: true @@ -312,7 +302,7 @@ export default Vue.extend({ isTlColumn(id) { const column = this.columns.find(c => c.id === id); - return ['home', 'local', 'hybrid', 'global', 'list', 'hashtag', 'mentions', 'direct'].includes(column.type); + return ['home', 'local', 'social', 'global', 'list', 'hashtag', 'mentions', 'direct'].includes(column.type); } } }); diff --git a/src/client/app/common/views/pages/explore.vue b/src/client/app/common/views/pages/explore.vue index 098bf1f4c4..67e92af445 100644 --- a/src/client/app/common/views/pages/explore.vue +++ b/src/client/app/common/views/pages/explore.vue @@ -3,7 +3,7 @@ <ui-container :show-header="false" v-if="meta && stats"> <div class="kpdsmpnk" :style="{ backgroundImage: meta.bannerUrl ? `url(${meta.bannerUrl})` : null }"> <div> - <router-link to="/explore" class="title">{{ $t('explore', { host: meta.name }) }}</router-link> + <router-link to="/explore" class="title">{{ $t('explore', { host: meta.name || 'Misskey' }) }}</router-link> <span>{{ $t('users-info', { users: num(stats.originalUsersCount) }) }}</span> </div> </div> @@ -13,8 +13,8 @@ <template #header><fa :icon="faHashtag" fixed-width/>{{ $t('popular-tags') }}</template> <div class="vxjfqztj"> - <router-link v-for="tag in tagsLocal" :to="`/explore/tags/${tag.tag}`" :key="'local:' + tag.tag" class="local">{{ tag.tag }}</router-link> - <router-link v-for="tag in tagsRemote" :to="`/explore/tags/${tag.tag}`" :key="'remote:' + tag.tag">{{ tag.tag }}</router-link> + <router-link v-for="tag in tagsLocal" :to="`/explore/tags/${tag.name}`" :key="'local:' + tag.name" class="local">{{ tag.name }}</router-link> + <router-link v-for="tag in tagsRemote" :to="`/explore/tags/${tag.name}`" :key="'remote:' + tag.name">{{ tag.name }}</router-link> </div> </ui-container> diff --git a/src/client/app/common/views/pages/followers.vue b/src/client/app/common/views/pages/followers.vue index 94d9c9b13c..67cfb8512f 100644 --- a/src/client/app/common/views/pages/followers.vue +++ b/src/client/app/common/views/pages/followers.vue @@ -9,20 +9,30 @@ import Vue from 'vue'; import parseAcct from '../../../../../misc/acct/parse'; import i18n from '../../../i18n'; +const fetchLimit = 30; + export default Vue.extend({ - i18n: i18n(''), + i18n: i18n(), data() { return { makePromise: cursor => this.$root.api('users/followers', { ...parseAcct(this.$route.params.user), - limit: 30, - cursor: cursor ? cursor : undefined - }).then(x => { - return { - users: x.users, - cursor: x.next - }; + limit: fetchLimit + 1, + untilId: cursor ? cursor : undefined, + }).then(followings => { + if (followings.length == fetchLimit + 1) { + followings.pop(); + return { + users: followings.map(following => following.follower), + cursor: followings[followings.length - 1].id + }; + } else { + return { + users: followings.map(following => following.follower), + cursor: null + }; + } }), }; }, diff --git a/src/client/app/common/views/pages/following.vue b/src/client/app/common/views/pages/following.vue index 39739fa3da..518a63ac1b 100644 --- a/src/client/app/common/views/pages/following.vue +++ b/src/client/app/common/views/pages/following.vue @@ -7,19 +7,32 @@ <script lang="ts"> import Vue from 'vue'; import parseAcct from '../../../../../misc/acct/parse'; +import i18n from '../../../i18n'; + +const fetchLimit = 30; export default Vue.extend({ + i18n: i18n(), + data() { return { makePromise: cursor => this.$root.api('users/following', { ...parseAcct(this.$route.params.user), - limit: 30, - cursor: cursor ? cursor : undefined - }).then(x => { - return { - users: x.users, - cursor: x.next - }; + limit: fetchLimit + 1, + untilId: cursor ? cursor : undefined, + }).then(followings => { + if (followings.length == fetchLimit + 1) { + followings.pop(); + return { + users: followings.map(following => following.followee), + cursor: followings[followings.length - 1].id + }; + } else { + return { + users: followings.map(following => following.followee), + cursor: null + }; + } }), }; }, diff --git a/src/client/app/common/views/pages/share.vue b/src/client/app/common/views/pages/share.vue index 760350b921..0452b25dfc 100644 --- a/src/client/app/common/views/pages/share.vue +++ b/src/client/app/common/views/pages/share.vue @@ -42,7 +42,7 @@ export default Vue.extend({ }, mounted() { this.$root.getMeta().then(meta => { - this.name = meta.name; + this.name = meta.name || 'Misskey'; }); } }); diff --git a/src/client/app/common/views/widgets/server.info.vue b/src/client/app/common/views/widgets/server.info.vue index f7efb6fa2a..a97b4ec496 100644 --- a/src/client/app/common/views/widgets/server.info.vue +++ b/src/client/app/common/views/widgets/server.info.vue @@ -1,6 +1,6 @@ <template> <div class="info"> - <p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p> + <p>Maintainer: <b><a :href="'mailto:' + meta.maintainerEmail" target="_blank">{{ meta.maintainerName }}</a></b></p> <p>Machine: {{ meta.machine }}</p> <p>Node: {{ meta.node }}</p> <p>Version: {{ meta.version }} </p> |