From ef20849dea2a0a8fb41d33b4f9615ca69ef15bc9 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 23 Jan 2019 23:35:55 +0900 Subject: [PATCH 01/13] Change computed to originalMessage in toot --- src/renderer/components/molecules/Toot.vue | 154 ++++++++++----------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index 815151a8..66810839 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -9,52 +9,52 @@ role="article" aria-label="toot" > -
+
Filtered
-
+
-
- - {{ accountName(originalMessage(message).account) }} +
+ + {{ accountName(originalMessage.account) }}
-
-
- - +
+ + {{ $t('cards.toot.show_more') }} {{ $t('cards.toot.hide')}}
-
+
- + {{ $t('cards.toot.sensitive') }} -
- +
+ -
- +
+ GIF VIDEO
@@ -73,7 +73,7 @@
- + @@ -82,17 +82,17 @@ - + - {{ reblogsCount(message) }} + {{ reblogsCount() }} - + - {{ favouritesCount(message) }} + {{ favouritesCount() }} @@ -103,22 +103,22 @@
  • {{ $t('cards.toot.view_toot_detail') }}
  • -
  • +
  • {{ $t('cards.toot.open_in_browser') }}
  • -
  • +
  • {{ $t('cards.toot.copy_link_to_toot') }}
  • -
  • +
  • {{ $t('cards.toot.mute') }}
  • -
  • +
  • {{ $t('cards.toot.block') }}
  • -
  • +
  • {{ $t('cards.toot.report') }}
  • -
  • +
  • {{ $t('cards.toot.delete') }}
  • @@ -128,8 +128,8 @@
    -
    - {{ $t('cards.toot.via', { application: application(message) }) }} +
    + {{ $t('cards.toot.via', { application: application() }) }}
    @@ -193,11 +193,18 @@ export default { return this.focused && !this.overlaid }, timestamp: function () { - return this.parseDatetime(this.originalMessage(this.message).created_at, this.now) + return this.parseDatetime(this.originalMessage.created_at, this.now) }, readableTimestamp: function () { moment.locale(this.language) - return moment(this.originalMessage(this.message).created_at).format('LLLL') + return moment(this.originalMessage.created_at).format('LLLL') + }, + originalMessage: function () { + if (this.message.reblog !== null) { + return this.message.reblog + } else { + return this.message + } } }, mounted () { @@ -225,13 +232,6 @@ export default { } }, methods: { - originalMessage (message) { - if (message.reblog !== null) { - return message.reblog - } else { - return message - } - }, username (account) { switch (this.displayNameStyle) { case DisplayStyle.DisplayNameAndUsername.value: @@ -298,8 +298,8 @@ export default { return shell.openExternal(link) } }, - openReply (message) { - this.$store.dispatch('TimelineSpace/Modals/NewToot/openReply', this.originalMessage(message)) + openReply () { + this.$store.dispatch('TimelineSpace/Modals/NewToot/openReply', this.originalMessage) }, openDetail (message) { this.$store.dispatch('TimelineSpace/Contents/SideBar/openTootComponent') @@ -315,17 +315,17 @@ export default { clipboard.writeText(message.url, 'toot-link') this.$refs.popper.doClose() }, - reportUser (message) { - this.$store.dispatch('TimelineSpace/Modals/Report/openReport', this.originalMessage(message)) + reportUser () { + this.$store.dispatch('TimelineSpace/Modals/Report/openReport', this.originalMessage) this.$refs.popper.doClose() }, - confirmMute (message) { - this.$store.dispatch('TimelineSpace/Modals/MuteConfirm/changeAccount', this.originalMessage(message).account) + confirmMute () { + this.$store.dispatch('TimelineSpace/Modals/MuteConfirm/changeAccount', this.originalMessage.account) this.$store.dispatch('TimelineSpace/Modals/MuteConfirm/changeModal', true) this.$refs.popper.doClose() }, - block (message) { - this.$store.dispatch('molecules/Toot/block', this.originalMessage(message).account) + block () { + this.$store.dispatch('molecules/Toot/block', this.originalMessage.account) this.$refs.popper.doClose() }, changeReblog (message) { @@ -395,23 +395,23 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true) }, - mediaAttachments (message) { - return this.originalMessage(message).media_attachments + mediaAttachments () { + return this.originalMessage.media_attachments }, - reblogsCount (message) { - if (this.originalMessage(message).reblogs_count > 0) { - return this.originalMessage(message).reblogs_count + reblogsCount () { + if (this.originalMessage.reblogs_count > 0) { + return this.originalMessage.reblogs_count } return '' }, - favouritesCount (message) { - if (this.originalMessage(message).favourites_count > 0) { - return this.originalMessage(message).favourites_count + favouritesCount () { + if (this.originalMessage.favourites_count > 0) { + return this.originalMessage.favourites_count } return '' }, - isMyMessage (message) { - return this.$store.state.TimelineSpace.account.accountId === this.originalMessage(message).account.id + isMyMessage () { + return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id }, deleteToot (message) { this.$store.dispatch('molecules/Toot/deleteToot', message) @@ -425,28 +425,28 @@ export default { }) }) }, - application (message) { - let msg = this.originalMessage(message) + application () { + let msg = this.originalMessage if (msg.application !== undefined && msg.application !== null) { return msg.application.name } return null }, - spoilered (message) { - return this.originalMessage(message).spoiler_text.length > 0 + spoilered () { + return this.originalMessage.spoiler_text.length > 0 }, - isShowContent (message) { - return !this.spoilered(message) || this.showContent + isShowContent () { + return !this.spoilered() || this.showContent }, - sensitive (message) { - return this.originalMessage(message).sensitive && this.mediaAttachments(message).length > 0 + sensitive () { + return this.originalMessage.sensitive && this.mediaAttachments().length > 0 }, - isShowAttachments (message) { - return !this.sensitive(message) || this.showAttachments + isShowAttachments () { + return !this.sensitive() || this.showAttachments }, - filtered (message) { - return this.filter.length > 0 && this.originalMessage(message).content.search(this.filter) >= 0 + filtered () { + return this.filter.length > 0 && this.originalMessage.content.search(this.filter) >= 0 }, locked (message) { return message.visibility === 'private' @@ -454,12 +454,12 @@ export default { directed (message) { return message.visibility === 'direct' }, - status (message) { - const original = this.originalMessage(message) + status () { + const original = this.originalMessage return emojify(original.content, original.emojis) }, - spoilerText (message) { - const original = this.originalMessage(message) + spoilerText () { + const original = this.originalMessage return emojify(original.spoiler_text, original.emojis) }, handleTootControl (event) { @@ -477,7 +477,7 @@ export default { this.$emit('focusLeft') break case 'reply': - this.openReply(this.message) + this.openReply() break case 'boost': this.changeReblog(this.message) @@ -489,10 +489,10 @@ export default { this.openDetail(this.message) break case 'profile': - this.openUser(this.originalMessage(this.message).account) + this.openUser(this.originalMessage.account) break case 'image': - const images = this.mediaAttachments(this.message) + const images = this.mediaAttachments() if (images.length === 0) { return 0 } From 47d25b921c9f4aaeaa0b94c5ec5b80c0ceff651e Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 23 Jan 2019 23:38:07 +0900 Subject: [PATCH 02/13] Change computed to mediaAttachments in toot --- src/renderer/components/molecules/Toot.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index 66810839..0d8f59b3 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -53,8 +53,8 @@ -
    - +
    + GIF VIDEO
    @@ -205,6 +205,9 @@ export default { } else { return this.message } + }, + mediaAttachments: function () { + return this.originalMessage.media_attachments } }, mounted () { @@ -395,9 +398,6 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true) }, - mediaAttachments () { - return this.originalMessage.media_attachments - }, reblogsCount () { if (this.originalMessage.reblogs_count > 0) { return this.originalMessage.reblogs_count @@ -440,7 +440,7 @@ export default { return !this.spoilered() || this.showContent }, sensitive () { - return this.originalMessage.sensitive && this.mediaAttachments().length > 0 + return this.originalMessage.sensitive && this.mediaAttachments.length > 0 }, isShowAttachments () { return !this.sensitive() || this.showAttachments @@ -492,7 +492,7 @@ export default { this.openUser(this.originalMessage.account) break case 'image': - const images = this.mediaAttachments() + const images = this.mediaAttachments if (images.length === 0) { return 0 } From 6facd3ccfaf4e2c2dcc0c78af3e8c938a2a676c1 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 23 Jan 2019 23:39:51 +0900 Subject: [PATCH 03/13] Change computed to reblogsCount in toot --- src/renderer/components/molecules/Toot.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index 0d8f59b3..c33ca5e4 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -86,7 +86,7 @@ - {{ reblogsCount() }} + {{ reblogsCount }} @@ -208,6 +208,12 @@ export default { }, mediaAttachments: function () { return this.originalMessage.media_attachments + }, + reblogsCount: function () { + if (this.originalMessage.reblogs_count > 0) { + return this.originalMessage.reblogs_count + } + return '' } }, mounted () { @@ -398,12 +404,6 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true) }, - reblogsCount () { - if (this.originalMessage.reblogs_count > 0) { - return this.originalMessage.reblogs_count - } - return '' - }, favouritesCount () { if (this.originalMessage.favourites_count > 0) { return this.originalMessage.favourites_count From 58db5c1b2525f2547335f818728b090827d38c1f Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 23 Jan 2019 23:41:06 +0900 Subject: [PATCH 04/13] Change computed to favouritesCount in toot --- src/renderer/components/molecules/Toot.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index c33ca5e4..6070f5ce 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -92,7 +92,7 @@ - {{ favouritesCount() }} + {{ favouritesCount }} @@ -214,6 +214,12 @@ export default { return this.originalMessage.reblogs_count } return '' + }, + favouritesCount: function () { + if (this.originalMessage.favourites_count > 0) { + return this.originalMessage.favourites_count + } + return '' } }, mounted () { @@ -404,12 +410,6 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true) }, - favouritesCount () { - if (this.originalMessage.favourites_count > 0) { - return this.originalMessage.favourites_count - } - return '' - }, isMyMessage () { return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id }, From 1b2a3f725a1e23c23adae645b10deca052e9aa86 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 23 Jan 2019 23:43:10 +0900 Subject: [PATCH 05/13] Change computed to isMyMessage in toot --- src/renderer/components/molecules/Toot.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index 6070f5ce..257d7114 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -115,10 +115,10 @@
  • {{ $t('cards.toot.block') }}
  • -
  • +
  • {{ $t('cards.toot.report') }}
  • -
  • +
  • {{ $t('cards.toot.delete') }}
  • @@ -220,6 +220,9 @@ export default { return this.originalMessage.favourites_count } return '' + }, + isMyMessage: function () { + return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id } }, mounted () { @@ -410,9 +413,6 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true) }, - isMyMessage () { - return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id - }, deleteToot (message) { this.$store.dispatch('molecules/Toot/deleteToot', message) .then((message) => { From 5032c9c0f75bd852dfdd1e9cab0f99a9e3ff35bc Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 23 Jan 2019 23:44:41 +0900 Subject: [PATCH 06/13] Change computed to application in toot --- src/renderer/components/molecules/Toot.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index 257d7114..e5201ea7 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -128,8 +128,8 @@
    -
    - {{ $t('cards.toot.via', { application: application() }) }} +
    + {{ $t('cards.toot.via', { application: application }) }}
    @@ -223,6 +223,14 @@ export default { }, isMyMessage: function () { return this.$store.state.TimelineSpace.account.accountId === this.originalMessage.account.id + }, + application: function () { + let msg = this.originalMessage + if (msg.application !== undefined && + msg.application !== null) { + return msg.application.name + } + return null } }, mounted () { @@ -425,14 +433,6 @@ export default { }) }) }, - application () { - let msg = this.originalMessage - if (msg.application !== undefined && - msg.application !== null) { - return msg.application.name - } - return null - }, spoilered () { return this.originalMessage.spoiler_text.length > 0 }, From c76c6f0c498730e293c2f9e0c0207f5566640331 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 24 Jan 2019 00:01:25 +0900 Subject: [PATCH 07/13] Change computed to spoilered in toot --- src/renderer/components/molecules/Toot.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index e5201ea7..0520e0cc 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -34,7 +34,7 @@
    -
    +
    {{ $t('cards.toot.show_more') }} @@ -231,6 +231,9 @@ export default { return msg.application.name } return null + }, + spoilered: function () { + return this.originalMessage.spoiler_text.length > 0 } }, mounted () { @@ -433,11 +436,8 @@ export default { }) }) }, - spoilered () { - return this.originalMessage.spoiler_text.length > 0 - }, isShowContent () { - return !this.spoilered() || this.showContent + return !this.spoilered || this.showContent }, sensitive () { return this.originalMessage.sensitive && this.mediaAttachments.length > 0 From b953e45c8626c8eaabf08a045bd361ef1c505e63 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 24 Jan 2019 00:02:31 +0900 Subject: [PATCH 08/13] Change computed to isShowContent in toot --- src/renderer/components/molecules/Toot.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index 0520e0cc..a99217ac 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -36,14 +36,14 @@
    - + {{ $t('cards.toot.show_more') }} {{ $t('cards.toot.hide')}}
    -
    +
    @@ -234,6 +234,9 @@ export default { }, spoilered: function () { return this.originalMessage.spoiler_text.length > 0 + }, + isShowContent: function () { + return !this.spoilered || this.showContent } }, mounted () { @@ -436,9 +439,6 @@ export default { }) }) }, - isShowContent () { - return !this.spoilered || this.showContent - }, sensitive () { return this.originalMessage.sensitive && this.mediaAttachments.length > 0 }, From 80e9c7a92cdd277e741134c95931f4bb0a289f71 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 24 Jan 2019 00:03:54 +0900 Subject: [PATCH 09/13] Change computed to sensitive in toot --- src/renderer/components/molecules/Toot.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index a99217ac..efcf59c0 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -46,11 +46,11 @@
    - + {{ $t('cards.toot.sensitive') }}
    - +
    @@ -237,6 +237,9 @@ export default { }, isShowContent: function () { return !this.spoilered || this.showContent + }, + sensitive: function () { + return this.originalMessage.sensitive && this.mediaAttachments.length > 0 } }, mounted () { @@ -439,11 +442,8 @@ export default { }) }) }, - sensitive () { - return this.originalMessage.sensitive && this.mediaAttachments.length > 0 - }, isShowAttachments () { - return !this.sensitive() || this.showAttachments + return !this.sensitive || this.showAttachments }, filtered () { return this.filter.length > 0 && this.originalMessage.content.search(this.filter) >= 0 From c6dda41188633dffafe44a9e3dcdc674e66070bd Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 24 Jan 2019 00:05:09 +0900 Subject: [PATCH 10/13] Change computed to isShowAttachments in toot --- src/renderer/components/molecules/Toot.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index efcf59c0..5c7fe88b 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -46,11 +46,11 @@
    - + {{ $t('cards.toot.sensitive') }} -
    - +
    +
    @@ -240,6 +240,9 @@ export default { }, sensitive: function () { return this.originalMessage.sensitive && this.mediaAttachments.length > 0 + }, + isShowAttachments: function () { + return !this.sensitive || this.showAttachments } }, mounted () { @@ -442,9 +445,6 @@ export default { }) }) }, - isShowAttachments () { - return !this.sensitive || this.showAttachments - }, filtered () { return this.filter.length > 0 && this.originalMessage.content.search(this.filter) >= 0 }, From e57d01b17a213adbee2c228b7e0dbf0d572c7aca Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 24 Jan 2019 00:06:13 +0900 Subject: [PATCH 11/13] Change computed to filtered in toot --- src/renderer/components/molecules/Toot.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/molecules/Toot.vue b/src/renderer/components/molecules/Toot.vue index 5c7fe88b..911f5629 100644 --- a/src/renderer/components/molecules/Toot.vue +++ b/src/renderer/components/molecules/Toot.vue @@ -9,10 +9,10 @@ role="article" aria-label="toot" > -
    +
    Filtered
    -
    +