diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-06-07 06:13:57 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-06-07 06:13:57 +0900 |
| commit | be9f836b21c3d7dc1b315fa305caf17f04c139c4 (patch) | |
| tree | 0cbf5b065ac2c0b756d8bdd0e616834e9ea451e1 /src/client/app/desktop/views/pages | |
| parent | 2.28.0 (diff) | |
| download | misskey-be9f836b21c3d7dc1b315fa305caf17f04c139c4.tar.gz misskey-be9f836b21c3d7dc1b315fa305caf17f04c139c4.tar.bz2 misskey-be9f836b21c3d7dc1b315fa305caf17f04c139c4.zip | |
やった
Diffstat (limited to 'src/client/app/desktop/views/pages')
7 files changed, 111 insertions, 16 deletions
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 f71503d5c1..10005fa9b0 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 7b5e76ffec..ee4e89747b 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 f57c52d2e1..e01f91c24d 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 @@ <template> <div> - <x-column :id="id"> - <span slot="header">%fa:bell R%%i18n:common.deck.notifications%</span> + <x-column :id="column.id" :name="name"> + <span slot="header">%fa:bell R%{{ name }}</span> <x-notifications/> </x-column> @@ -20,10 +20,17 @@ export default Vue.extend({ }, props: { - id: { - type: String, + column: { + type: Object, required: true } - } + }, + + computed: { + name(): string { + if (this.column.name) return this.column.name; + return '%i18n:common.deck.notifications%'; + } + }, }); </script> diff --git a/src/client/app/desktop/views/pages/deck/deck.tl-column.vue b/src/client/app/desktop/views/pages/deck/deck.tl-column.vue index 54bc6bfc22..1a5075396b 100644 --- a/src/client/app/desktop/views/pages/deck/deck.tl-column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.tl-column.vue @@ -1,15 +1,20 @@ <template> <div> - <x-column :id="column.id"> + <x-column :id="column.id" :menu="menu" :name="name"> <span slot="header"> - <template v-if="column.type == 'home'">%fa:home%%i18n:common.deck.home%</template> - <template v-if="column.type == 'local'">%fa:R comments%%i18n:common.deck.local%</template> - <template v-if="column.type == 'global'">%fa:globe%%i18n:common.deck.global%</template> - <template v-if="column.type == 'list'">%fa:list%{{ column.list.title }}</template> + <template v-if="column.type == 'home'">%fa:home%</template> + <template v-if="column.type == 'local'">%fa:R comments%</template> + <template v-if="column.type == 'global'">%fa:globe%</template> + <template v-if="column.type == 'list'">%fa:list%</template> + <span>{{ name }}</span> </span> - <x-list-tl v-if="column.type == 'list'" :list="column.list"/> - <x-tl v-else :src="column.type"/> + <div class="editor" v-if="edit"> + <mk-switch v-model="column.isMediaOnly" @change="onChangeSettings" text="%i18n:@is-media-only%"/> + <mk-switch v-model="column.isMediaView" @change="onChangeSettings" text="%i18n:@is-media-view%"/> + </div> + <x-list-tl v-if="column.type == 'list'" :list="column.list" :media-only="column.isMediaOnly"/> + <x-tl v-else :src="column.type" :media-only="column.isMediaOnly"/> </x-column> </div> </template> @@ -32,6 +37,37 @@ export default Vue.extend({ type: Object, required: true } + }, + + data() { + return { + edit: false, + menu: [{ + content: '%fa:cog% %i18n:@edit%', + onClick: () => { + this.edit = !this.edit; + } + }] + } + }, + + computed: { + name(): string { + if (this.column.name) return this.column.name; + + switch (this.column.type) { + case 'home': return '%i18n:common.deck.home%'; + case 'local': return '%i18n:common.deck.local%'; + case 'global': return '%i18n:common.deck.global%'; + case 'list': return this.column.list.title; + } + } + }, + + methods: { + onChangeSettings(v) { + this.$store.dispatch('settings/saveDeck'); + } } }); </script> diff --git a/src/client/app/desktop/views/pages/deck/deck.tl.vue b/src/client/app/desktop/views/pages/deck/deck.tl.vue index 8e9d783875..47aa8c6413 100644 --- a/src/client/app/desktop/views/pages/deck/deck.tl.vue +++ b/src/client/app/desktop/views/pages/deck/deck.tl.vue @@ -18,6 +18,11 @@ export default Vue.extend({ type: String, required: false, default: 'home' + }, + mediaOnly: { + type: Boolean, + required: false, + default: false } }, @@ -31,6 +36,12 @@ export default Vue.extend({ }; }, + watch: { + mediaOnly() { + this.fetch(); + } + }, + computed: { stream(): any { return this.src == 'home' @@ -78,6 +89,7 @@ export default Vue.extend({ (this.$refs.timeline as any).init(() => new Promise((res, rej) => { (this as any).api(this.endpoint, { limit: fetchLimit + 1, + mediaOnly: this.mediaOnly, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes }).then(notes => { @@ -97,6 +109,7 @@ export default Vue.extend({ const promise = (this as any).api(this.endpoint, { limit: fetchLimit + 1, + mediaOnly: this.mediaOnly, untilId: (this.$refs.timeline as any).tail().id, includeMyRenotes: this.$store.state.settings.showMyRenotes, includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes @@ -116,6 +129,8 @@ export default Vue.extend({ }, 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.vue b/src/client/app/desktop/views/pages/deck/deck.vue index 369874ec67..57ec214c3a 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -3,7 +3,7 @@ <div class="qlvquzbjribqcaozciifydkngcwtyzje" :data-darkmode="$store.state.device.darkmode"> <template v-for="column in columns"> <x-widgets-column v-if="column.type == 'widgets'" :key="column.id" :column="column"/> - <x-notifications-column v-if="column.type == 'notifications'" :key="column.id" :id="column.id"/> + <x-notifications-column v-if="column.type == 'notifications'" :key="column.id" :column="column"/> <x-tl-column v-if="column.type == 'home'" :key="column.id" :column="column"/> <x-tl-column v-if="column.type == 'local'" :key="column.id" :column="column"/> <x-tl-column v-if="column.type == 'global'" :key="column.id" :column="column"/> diff --git a/src/client/app/desktop/views/pages/deck/deck.widgets-column.vue b/src/client/app/desktop/views/pages/deck/deck.widgets-column.vue index 34073160c1..6bcebd07cc 100644 --- a/src/client/app/desktop/views/pages/deck/deck.widgets-column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.widgets-column.vue @@ -1,7 +1,7 @@ <template> <div class="wtdtxvecapixsepjtcupubtsmometobz"> - <x-column :id="column.id" :menu="menu" :naked="true" :narrow="true"> - <span slot="header">%fa:calculator%%i18n:common.deck.widgets%</span> + <x-column :id="column.id" :menu="menu" :naked="true" :narrow="true" :name="name"> + <span slot="header">%fa:calculator%{{ name }}</span> <div class="gqpwvtwtprsbmnssnbicggtwqhmylhnq"> <template v-if="edit"> @@ -81,6 +81,13 @@ export default Vue.extend({ } }, + computed: { + name(): string { + if (this.column.name) return this.column.name; + return '%i18n:common.deck.widgets%'; + } + }, + created() { this.menu = [{ content: '%fa:cog% %i18n:@edit%', |