From be9f836b21c3d7dc1b315fa305caf17f04c139c4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 7 Jun 2018 06:13:57 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=84=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja.yml | 1 + .../desktop/views/pages/deck/deck.column.vue | 17 ++++++- .../desktop/views/pages/deck/deck.list-tl.vue | 15 ++++++ .../pages/deck/deck.notifications-column.vue | 17 +++++-- .../views/pages/deck/deck.tl-column.vue | 50 ++++++++++++++++--- .../app/desktop/views/pages/deck/deck.tl.vue | 15 ++++++ .../app/desktop/views/pages/deck/deck.vue | 2 +- .../views/pages/deck/deck.widgets-column.vue | 11 +++- src/client/app/store.ts | 11 ++++ .../api/endpoints/notes/global-timeline.ts | 8 +++ .../api/endpoints/notes/local-timeline.ts | 8 +++ src/server/api/endpoints/notes/timeline.ts | 10 ++++ .../api/endpoints/notes/user-list-timeline.ts | 10 ++++ 13 files changed, 159 insertions(+), 16 deletions(-) diff --git a/locales/ja.yml b/locales/ja.yml index 8e04d0988..320da8e77 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -87,6 +87,7 @@ common: swap-right: "右に移動" remove: "カラムを削除" add-column: "カラムを追加" + rename: "名前を変更" common/views/components/connect-failed.vue: title: "サーバーに接続できません" diff --git a/src/client/app/desktop/views/pages/deck/deck.column.vue b/src/client/app/desktop/views/pages/deck/deck.column.vue index f71503d5c..10005fa9b 100644 --- a/src/client/app/desktop/views/pages/deck/deck.column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.column.vue @@ -20,6 +20,10 @@ export default Vue.extend({ type: String, required: false }, + name: { + type: String, + required: false + }, menu: { type: Array, required: false @@ -75,6 +79,17 @@ export default Vue.extend({ showMenu() { const items = [{ + content: '%fa:pencil-alt% %i18n:common.deck.rename%', + onClick: () => { + (this as any).apis.input({ + title: '%i18n:common.deck.rename%', + default: this.name, + allowEmpty: false + }).then(name => { + this.$store.dispatch('settings/renameDeckColumn', { id: this.id, name }); + }); + } + }, null, { content: '%fa:arrow-left% %i18n:common.deck.swap-left%', onClick: () => { this.$store.dispatch('settings/swapLeftDeckColumn', this.id); @@ -84,7 +99,7 @@ export default Vue.extend({ onClick: () => { this.$store.dispatch('settings/swapRightDeckColumn', this.id); } - }, { + }, null, { content: '%fa:trash-alt R% %i18n:common.deck.remove%', onClick: () => { this.$store.dispatch('settings/removeDeckColumn', this.id); diff --git a/src/client/app/desktop/views/pages/deck/deck.list-tl.vue b/src/client/app/desktop/views/pages/deck/deck.list-tl.vue index 7b5e76ffe..ee4e89747 100644 --- a/src/client/app/desktop/views/pages/deck/deck.list-tl.vue +++ b/src/client/app/desktop/views/pages/deck/deck.list-tl.vue @@ -18,6 +18,11 @@ export default Vue.extend({ list: { type: Object, required: true + }, + mediaOnly: { + type: Boolean, + required: false, + default: false } }, @@ -30,6 +35,12 @@ export default Vue.extend({ }; }, + watch: { + mediaOnly() { + this.fetch(); + } + }, + mounted() { if (this.connection) this.connection.close(); this.connection = new UserListStream((this as any).os, this.$store.state.i, this.list.id); @@ -52,6 +63,7 @@ export default Vue.extend({ (this as any).api('notes/user-list-timeline', { listId: this.list.id, limit: fetchLimit + 1, + mediaOnly: this.mediaOnly, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes }).then(notes => { @@ -72,6 +84,7 @@ export default Vue.extend({ listId: this.list.id, limit: fetchLimit + 1, untilId: (this.$refs.timeline as any).tail().id, + mediaOnly: this.mediaOnly, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes }); @@ -89,6 +102,8 @@ export default Vue.extend({ return promise; }, onNote(note) { + if (this.mediaOnly && note.media.length == 0) return; + // Prepend a note (this.$refs.timeline as any).prepend(note); }, diff --git a/src/client/app/desktop/views/pages/deck/deck.notifications-column.vue b/src/client/app/desktop/views/pages/deck/deck.notifications-column.vue index f57c52d2e..e01f91c24 100644 --- a/src/client/app/desktop/views/pages/deck/deck.notifications-column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.notifications-column.vue @@ -1,7 +1,7 @@