From 98fe9c39ebd23bc6359960cf56e51604050f5b6c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 9 Apr 2018 18:52:29 +0900 Subject: [PATCH] Refactor --- .../common/views/components/autocomplete.vue | 11 +- .../app/common/views/components/messaging.vue | 12 +- .../views/components/welcome-timeline.vue | 10 +- src/client/app/common/views/filters/index.ts | 2 + src/client/app/common/views/filters/note.ts | 5 + src/client/app/common/views/filters/user.ts | 15 + .../views/components/followers-window.vue | 10 +- .../views/components/following-window.vue | 10 +- .../views/components/friends-maker.vue | 10 +- .../components/messaging-room-window.vue | 6 +- .../views/components/note-detail.sub.vue | 16 +- .../desktop/views/components/note-detail.vue | 26 +- .../desktop/views/components/note-preview.vue | 16 +- .../views/components/notes.note.sub.vue | 16 +- .../desktop/views/components/notes.note.vue | 21 +- .../views/components/notifications.vue | 32 +- .../views/components/post-detail.sub.vue | 122 ++++ .../desktop/views/components/post-detail.vue | 434 +++++++++++++ .../desktop/views/components/post-preview.vue | 99 +++ .../views/components/posts.post.sub.vue | 108 ++++ .../desktop/views/components/posts.post.vue | 585 ++++++++++++++++++ .../views/components/settings.mute.vue | 8 +- .../desktop/views/components/ui.header.vue | 9 +- .../desktop/views/components/user-preview.vue | 6 +- .../views/components/users-list.item.vue | 18 +- .../pages/user/user.followers-you-know.vue | 10 +- .../desktop/views/pages/user/user.friends.vue | 6 +- .../desktop/views/pages/user/user.header.vue | 14 +- .../app/desktop/views/pages/user/user.vue | 2 +- .../app/desktop/views/pages/welcome.vue | 2 +- .../views/widgets/channel.channel.note.vue | 14 +- .../views/widgets/channel.channel.post.vue | 65 ++ .../app/desktop/views/widgets/profile.vue | 10 +- .../app/desktop/views/widgets/users.vue | 10 +- .../app/mobile/views/components/note-card.vue | 12 +- .../views/components/note-detail.sub.vue | 20 +- .../mobile/views/components/note-detail.vue | 28 +- .../mobile/views/components/note-preview.vue | 20 +- .../app/mobile/views/components/note.sub.vue | 18 +- .../app/mobile/views/components/note.vue | 21 +- .../views/components/notification-preview.vue | 18 +- .../mobile/views/components/notification.vue | 22 +- .../app/mobile/views/components/post-card.vue | 85 +++ .../views/components/post-detail.sub.vue | 103 +++ .../mobile/views/components/post-detail.vue | 444 +++++++++++++ .../mobile/views/components/post-preview.vue | 100 +++ .../app/mobile/views/components/post.vue | 523 ++++++++++++++++ .../app/mobile/views/components/ui.header.vue | 8 +- .../app/mobile/views/components/ui.nav.vue | 13 +- .../app/mobile/views/components/user-card.vue | 18 +- .../mobile/views/components/user-preview.vue | 18 +- .../app/mobile/views/pages/following.vue | 5 +- .../app/mobile/views/pages/messaging-room.vue | 10 +- .../app/mobile/views/pages/settings.vue | 5 +- src/client/app/mobile/views/pages/user.vue | 14 +- .../pages/user/home.followers-you-know.vue | 14 +- .../app/mobile/views/widgets/profile.vue | 9 +- 57 files changed, 2846 insertions(+), 422 deletions(-) create mode 100644 src/client/app/common/views/filters/note.ts create mode 100644 src/client/app/common/views/filters/user.ts create mode 100644 src/client/app/desktop/views/components/post-detail.sub.vue create mode 100644 src/client/app/desktop/views/components/post-detail.vue create mode 100644 src/client/app/desktop/views/components/post-preview.vue create mode 100644 src/client/app/desktop/views/components/posts.post.sub.vue create mode 100644 src/client/app/desktop/views/components/posts.post.vue create mode 100644 src/client/app/desktop/views/widgets/channel.channel.post.vue create mode 100644 src/client/app/mobile/views/components/post-card.vue create mode 100644 src/client/app/mobile/views/components/post-detail.sub.vue create mode 100644 src/client/app/mobile/views/components/post-detail.vue create mode 100644 src/client/app/mobile/views/components/post-preview.vue create mode 100644 src/client/app/mobile/views/components/post.vue diff --git a/src/client/app/common/views/components/autocomplete.vue b/src/client/app/common/views/components/autocomplete.vue index 8837fde6be..5c8f61a2a2 100644 --- a/src/client/app/common/views/components/autocomplete.vue +++ b/src/client/app/common/views/components/autocomplete.vue @@ -3,8 +3,8 @@
  1. - {{ getUserName(user) }} - @{{ getAcct(user) }} + {{ user | userName }} + @{{ user | acct }}
    @@ -21,17 +21,17 @@ import Vue from 'vue'; import * as emojilib from 'emojilib'; import contains from '../../../common/scripts/contains'; -import getAcct from '../../../../../acct/render'; -import getUserName from '../../../../../renderers/get-user-name'; const lib = Object.entries(emojilib.lib).filter((x: any) => { return x[1].category != 'flags'; }); + const emjdb = lib.map((x: any) => ({ emoji: x[1].char, name: x[0], alias: null })); + lib.forEach((x: any) => { if (x[1].keywords) { x[1].keywords.forEach(k => { @@ -43,6 +43,7 @@ lib.forEach((x: any) => { }); } }); + emjdb.sort((a, b) => a.name.length - b.name.length); export default Vue.extend({ @@ -107,8 +108,6 @@ export default Vue.extend({ }); }, methods: { - getAcct, - getUserName, exec() { this.select = -1; if (this.$refs.suggests) { diff --git a/src/client/app/common/views/components/messaging.vue b/src/client/app/common/views/components/messaging.vue index 9b1449daa5..751e4de50d 100644 --- a/src/client/app/common/views/components/messaging.vue +++ b/src/client/app/common/views/components/messaging.vue @@ -14,8 +14,8 @@ tabindex="-1" > - {{ getUserName(user) }} - @{{ getAcct(user) }} + {{ user | userName }} + @{{ user | acct }}
@@ -33,8 +33,8 @@
- {{ getUserName(isMe(message) ? message.recipient : message.user) }} - @{{ getAcct(isMe(message) ? message.recipient : message.user) }} + {{ isMe(message) ? message.recipient : message.use | userName }} + @{{ isMe(message) ? message.recipient : message.user | acct }}
@@ -51,8 +51,6 @@ diff --git a/src/client/app/desktop/views/components/following-window.vue b/src/client/app/desktop/views/components/following-window.vue index cbd8ec5f94..cc3d77198e 100644 --- a/src/client/app/desktop/views/components/following-window.vue +++ b/src/client/app/desktop/views/components/following-window.vue @@ -1,7 +1,7 @@ diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue index 483f5aaf3b..de32f0a748 100644 --- a/src/client/app/mobile/views/components/note-detail.vue +++ b/src/client/app/mobile/views/components/note-detail.vue @@ -17,24 +17,20 @@

- + avatar - %fa:retweet% - - {{ name }} - - がRenote + %fa:retweet%{{ note.user | userName }}がRenote

- + avatar
- {{ pName }} - @{{ pAcct }} + {{ p.user | userName }} + @{{ p.user | acct }}
@@ -80,8 +76,6 @@ diff --git a/src/client/app/mobile/views/components/note.sub.vue b/src/client/app/mobile/views/components/note.sub.vue index 96f8265cc2..d489f3a053 100644 --- a/src/client/app/mobile/views/components/note.sub.vue +++ b/src/client/app/mobile/views/components/note.sub.vue @@ -1,13 +1,13 @@