From cf33e483f7e6f40e8cbbbc0118a7df70bdaf651f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 29 Mar 2018 20:32:18 +0900 Subject: 整理した MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/common/scripts/compose-notification.ts | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/client/app/common/scripts/compose-notification.ts (limited to 'src/client/app/common/scripts/compose-notification.ts') diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts new file mode 100644 index 0000000000..273579cbc6 --- /dev/null +++ b/src/client/app/common/scripts/compose-notification.ts @@ -0,0 +1,67 @@ +import getPostSummary from '../../../../common/get-post-summary'; +import getReactionEmoji from '../../../../common/get-reaction-emoji'; + +type Notification = { + title: string; + body: string; + icon: string; + onclick?: any; +}; + +// TODO: i18n + +export default function(type, data): Notification { + switch (type) { + case 'drive_file_created': + return { + title: 'ファイルがアップロードされました', + body: data.name, + icon: data.url + '?thumbnail&size=64' + }; + + case 'mention': + return { + title: `${data.user.name}さんから:`, + body: getPostSummary(data), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'reply': + return { + title: `${data.user.name}さんから返信:`, + body: getPostSummary(data), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'quote': + return { + title: `${data.user.name}さんが引用:`, + body: getPostSummary(data), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'reaction': + return { + title: `${data.user.name}: ${getReactionEmoji(data.reaction)}:`, + body: getPostSummary(data.post), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'unread_messaging_message': + return { + title: `${data.user.name}さんからメッセージ:`, + body: data.text, // TODO: getMessagingMessageSummary(data), + icon: data.user.avatarUrl + '?thumbnail&size=64' + }; + + case 'othello_invited': + return { + title: '対局への招待があります', + body: `${data.parent.name}さんから`, + icon: data.parent.avatarUrl + '?thumbnail&size=64' + }; + + default: + return null; + } +} -- cgit v1.2.3-freya From cd2542e0fd8578f6e41114ffebbda1f16f7d04ce Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 2 Apr 2018 04:15:27 +0900 Subject: Refactor --- src/client/app/ch/tags/channel.tag | 2 +- .../app/common/scripts/compose-notification.ts | 4 +- .../app/common/views/components/autocomplete.vue | 2 +- .../views/components/messaging-room.message.vue | 2 +- .../app/common/views/components/messaging.vue | 2 +- .../app/common/views/components/othello.game.vue | 2 +- .../app/common/views/components/othello.room.vue | 2 +- .../app/common/views/components/post-html.ts | 2 +- .../common/views/components/welcome-timeline.vue | 2 +- .../app/desktop/views/components/friends-maker.vue | 2 +- .../views/components/messaging-room-window.vue | 2 +- .../app/desktop/views/components/notifications.vue | 4 +- .../desktop/views/components/post-detail.sub.vue | 2 +- .../app/desktop/views/components/post-detail.vue | 2 +- .../app/desktop/views/components/post-preview.vue | 2 +- .../desktop/views/components/posts.post.sub.vue | 2 +- .../app/desktop/views/components/posts.post.vue | 2 +- .../app/desktop/views/components/settings.mute.vue | 2 +- .../app/desktop/views/components/user-preview.vue | 4 +- .../desktop/views/components/users-list.item.vue | 2 +- src/client/app/desktop/views/pages/home.vue | 2 +- .../app/desktop/views/pages/messaging-room.vue | 2 +- .../views/pages/user/user.followers-you-know.vue | 2 +- .../app/desktop/views/pages/user/user.friends.vue | 2 +- .../app/desktop/views/pages/user/user.header.vue | 2 +- src/client/app/desktop/views/pages/user/user.vue | 2 +- src/client/app/desktop/views/pages/welcome.vue | 2 +- .../desktop/views/widgets/channel.channel.post.vue | 2 +- src/client/app/desktop/views/widgets/polls.vue | 2 +- src/client/app/desktop/views/widgets/trends.vue | 2 +- src/client/app/desktop/views/widgets/users.vue | 2 +- src/client/app/mobile/api/post.ts | 2 +- .../views/components/notification-preview.vue | 2 +- .../app/mobile/views/components/notification.vue | 4 +- .../app/mobile/views/components/post-card.vue | 4 +- .../mobile/views/components/post-detail.sub.vue | 2 +- .../app/mobile/views/components/post-detail.vue | 2 +- .../app/mobile/views/components/post-preview.vue | 2 +- .../app/mobile/views/components/post.sub.vue | 2 +- src/client/app/mobile/views/components/post.vue | 2 +- .../app/mobile/views/components/user-card.vue | 2 +- .../app/mobile/views/components/user-preview.vue | 2 +- src/client/app/mobile/views/pages/followers.vue | 2 +- src/client/app/mobile/views/pages/following.vue | 2 +- src/client/app/mobile/views/pages/home.vue | 2 +- .../app/mobile/views/pages/messaging-room.vue | 2 +- src/client/app/mobile/views/pages/messaging.vue | 2 +- src/client/app/mobile/views/pages/user.vue | 4 +- .../views/pages/user/home.followers-you-know.vue | 2 +- .../app/mobile/views/pages/user/home.photos.vue | 2 +- src/common/drive/add-file.ts | 2 +- src/common/drive/upload-from-url.ts | 46 ++ src/common/drive/upload_from_url.ts | 46 -- src/common/get-notification-summary.ts | 27 - src/common/get-post-summary.ts | 45 - src/common/get-reaction-emoji.ts | 14 - src/common/othello/ai/back.ts | 376 --------- src/common/othello/ai/front.ts | 233 ------ src/common/othello/ai/index.ts | 1 - src/common/othello/core.ts | 340 -------- src/common/othello/maps.ts | 911 --------------------- src/common/remote/activitypub/act/create.ts | 9 - src/common/remote/activitypub/act/index.ts | 22 - src/common/remote/activitypub/create.ts | 87 -- src/common/remote/activitypub/renderer/context.ts | 5 - src/common/remote/activitypub/renderer/document.ts | 7 - src/common/remote/activitypub/renderer/follow.ts | 8 - src/common/remote/activitypub/renderer/hashtag.ts | 7 - src/common/remote/activitypub/renderer/image.ts | 6 - src/common/remote/activitypub/renderer/key.ts | 10 - src/common/remote/activitypub/renderer/note.ts | 44 - .../activitypub/renderer/ordered-collection.ts | 6 - src/common/remote/activitypub/renderer/person.ts | 20 - src/common/remote/activitypub/resolve-person.ts | 109 --- src/common/remote/activitypub/resolver.ts | 97 --- src/common/remote/activitypub/type.ts | 3 - src/common/remote/resolve-user.ts | 26 - src/common/remote/webfinger.ts | 25 - src/common/text/parse/elements/mention.ts | 2 +- src/common/user/get-acct.ts | 3 - src/common/user/get-summary.ts | 18 - src/common/user/parse-acct.ts | 4 - src/misc/get-notification-summary.ts | 27 + src/misc/get-post-summary.ts | 45 + src/misc/get-reaction-emoji.ts | 14 + src/misc/othello/ai/back.ts | 376 +++++++++ src/misc/othello/ai/front.ts | 233 ++++++ src/misc/othello/ai/index.ts | 1 + src/misc/othello/core.ts | 340 ++++++++ src/misc/othello/maps.ts | 911 +++++++++++++++++++++ src/misc/user/get-acct.ts | 3 + src/misc/user/get-summary.ts | 18 + src/misc/user/parse-acct.ts | 4 + src/processor/http/follow.ts | 4 +- src/processor/http/perform-activitypub.ts | 2 +- src/remote/activitypub/act/create.ts | 9 + src/remote/activitypub/act/index.ts | 22 + src/remote/activitypub/create.ts | 87 ++ src/remote/activitypub/renderer/context.ts | 5 + src/remote/activitypub/renderer/document.ts | 7 + src/remote/activitypub/renderer/follow.ts | 8 + src/remote/activitypub/renderer/hashtag.ts | 7 + src/remote/activitypub/renderer/image.ts | 6 + src/remote/activitypub/renderer/key.ts | 10 + src/remote/activitypub/renderer/note.ts | 44 + .../activitypub/renderer/ordered-collection.ts | 6 + src/remote/activitypub/renderer/person.ts | 20 + src/remote/activitypub/resolve-person.ts | 109 +++ src/remote/activitypub/resolver.ts | 97 +++ src/remote/activitypub/type.ts | 3 + src/remote/resolve-user.ts | 26 + src/remote/webfinger.ts | 25 + src/server/activitypub/inbox.ts | 2 +- src/server/activitypub/outbox.ts | 6 +- src/server/activitypub/post.ts | 6 +- src/server/activitypub/publickey.ts | 4 +- src/server/activitypub/user.ts | 4 +- src/server/activitypub/with-user.ts | 2 +- src/server/api/bot/core.ts | 8 +- src/server/api/bot/interfaces/line.ts | 6 +- .../api/endpoints/drive/files/upload_from_url.ts | 2 +- src/server/api/endpoints/othello/games/show.ts | 2 +- src/server/api/endpoints/othello/match.ts | 2 +- src/server/api/endpoints/posts/create.ts | 4 +- src/server/api/endpoints/users/show.ts | 2 +- src/server/api/limitter.ts | 2 +- src/server/api/stream/othello-game.ts | 4 +- src/server/webfinger.ts | 2 +- 128 files changed, 2599 insertions(+), 2599 deletions(-) create mode 100644 src/common/drive/upload-from-url.ts delete mode 100644 src/common/drive/upload_from_url.ts delete mode 100644 src/common/get-notification-summary.ts delete mode 100644 src/common/get-post-summary.ts delete mode 100644 src/common/get-reaction-emoji.ts delete mode 100644 src/common/othello/ai/back.ts delete mode 100644 src/common/othello/ai/front.ts delete mode 100644 src/common/othello/ai/index.ts delete mode 100644 src/common/othello/core.ts delete mode 100644 src/common/othello/maps.ts delete mode 100644 src/common/remote/activitypub/act/create.ts delete mode 100644 src/common/remote/activitypub/act/index.ts delete mode 100644 src/common/remote/activitypub/create.ts delete mode 100644 src/common/remote/activitypub/renderer/context.ts delete mode 100644 src/common/remote/activitypub/renderer/document.ts delete mode 100644 src/common/remote/activitypub/renderer/follow.ts delete mode 100644 src/common/remote/activitypub/renderer/hashtag.ts delete mode 100644 src/common/remote/activitypub/renderer/image.ts delete mode 100644 src/common/remote/activitypub/renderer/key.ts delete mode 100644 src/common/remote/activitypub/renderer/note.ts delete mode 100644 src/common/remote/activitypub/renderer/ordered-collection.ts delete mode 100644 src/common/remote/activitypub/renderer/person.ts delete mode 100644 src/common/remote/activitypub/resolve-person.ts delete mode 100644 src/common/remote/activitypub/resolver.ts delete mode 100644 src/common/remote/activitypub/type.ts delete mode 100644 src/common/remote/resolve-user.ts delete mode 100644 src/common/remote/webfinger.ts delete mode 100644 src/common/user/get-acct.ts delete mode 100644 src/common/user/get-summary.ts delete mode 100644 src/common/user/parse-acct.ts create mode 100644 src/misc/get-notification-summary.ts create mode 100644 src/misc/get-post-summary.ts create mode 100644 src/misc/get-reaction-emoji.ts create mode 100644 src/misc/othello/ai/back.ts create mode 100644 src/misc/othello/ai/front.ts create mode 100644 src/misc/othello/ai/index.ts create mode 100644 src/misc/othello/core.ts create mode 100644 src/misc/othello/maps.ts create mode 100644 src/misc/user/get-acct.ts create mode 100644 src/misc/user/get-summary.ts create mode 100644 src/misc/user/parse-acct.ts create mode 100644 src/remote/activitypub/act/create.ts create mode 100644 src/remote/activitypub/act/index.ts create mode 100644 src/remote/activitypub/create.ts create mode 100644 src/remote/activitypub/renderer/context.ts create mode 100644 src/remote/activitypub/renderer/document.ts create mode 100644 src/remote/activitypub/renderer/follow.ts create mode 100644 src/remote/activitypub/renderer/hashtag.ts create mode 100644 src/remote/activitypub/renderer/image.ts create mode 100644 src/remote/activitypub/renderer/key.ts create mode 100644 src/remote/activitypub/renderer/note.ts create mode 100644 src/remote/activitypub/renderer/ordered-collection.ts create mode 100644 src/remote/activitypub/renderer/person.ts create mode 100644 src/remote/activitypub/resolve-person.ts create mode 100644 src/remote/activitypub/resolver.ts create mode 100644 src/remote/activitypub/type.ts create mode 100644 src/remote/resolve-user.ts create mode 100644 src/remote/webfinger.ts (limited to 'src/client/app/common/scripts/compose-notification.ts') diff --git a/src/client/app/ch/tags/channel.tag b/src/client/app/ch/tags/channel.tag index 2abfb106a5..70e494aedd 100644 --- a/src/client/app/ch/tags/channel.tag +++ b/src/client/app/ch/tags/channel.tag @@ -229,7 +229,7 @@ diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts index ebc15952f6..e99d502960 100644 --- a/src/client/app/common/scripts/compose-notification.ts +++ b/src/client/app/common/scripts/compose-notification.ts @@ -1,5 +1,6 @@ import getPostSummary from '../../../../renderers/get-post-summary'; import getReactionEmoji from '../../../../renderers/get-reaction-emoji'; +import getUserName from '../../../../renderers/get-user-name'; type Notification = { title: string; @@ -21,35 +22,35 @@ export default function(type, data): Notification { case 'mention': return { - title: `${data.user.name}さんから:`, + title: `${getUserName(data.user)}さんから:`, body: getPostSummary(data), icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'reply': return { - title: `${data.user.name}さんから返信:`, + title: `${getUserName(data.user)}さんから返信:`, body: getPostSummary(data), icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'quote': return { - title: `${data.user.name}さんが引用:`, + title: `${getUserName(data.user)}さんが引用:`, body: getPostSummary(data), icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'reaction': return { - title: `${data.user.name}: ${getReactionEmoji(data.reaction)}:`, + title: `${getUserName(data.user)}: ${getReactionEmoji(data.reaction)}:`, body: getPostSummary(data.post), icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'unread_messaging_message': return { - title: `${data.user.name}さんからメッセージ:`, + title: `${getUserName(data.user)}さんからメッセージ:`, body: data.text, // TODO: getMessagingMessageSummary(data), icon: data.user.avatarUrl + '?thumbnail&size=64' }; @@ -57,7 +58,7 @@ export default function(type, data): Notification { case 'othello_invited': return { title: '対局への招待があります', - body: `${data.parent.name}さんから`, + body: `${getUserName(data.parent)}さんから`, icon: data.parent.avatarUrl + '?thumbnail&size=64' }; diff --git a/src/client/app/common/views/components/autocomplete.vue b/src/client/app/common/views/components/autocomplete.vue index 38eaf86508..8837fde6be 100644 --- a/src/client/app/common/views/components/autocomplete.vue +++ b/src/client/app/common/views/components/autocomplete.vue @@ -3,7 +3,7 @@
  1. - {{ user.name }} + {{ getUserName(user) }} @{{ getAcct(user) }}
@@ -22,6 +22,7 @@ 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'; @@ -107,6 +108,7 @@ 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 4ab3e46e89..9b1449daa5 100644 --- a/src/client/app/common/views/components/messaging.vue +++ b/src/client/app/common/views/components/messaging.vue @@ -14,7 +14,7 @@ tabindex="-1" > - {{ user.name }} + {{ getUserName(user) }} @{{ getAcct(user) }} @@ -33,7 +33,7 @@
- {{ isMe(message) ? message.recipient.name : message.user.name }} + {{ getUserName(isMe(message) ? message.recipient : message.user) }} @{{ getAcct(isMe(message) ? message.recipient : message.user) }}
@@ -52,6 +52,7 @@ diff --git a/src/client/app/desktop/views/components/following-window.vue b/src/client/app/desktop/views/components/following-window.vue index 612847b386..cbd8ec5f94 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 @@ @@ -36,7 +36,7 @@ export default define({ post() { this.posting = true; - (this as any).api('posts/create', { + (this as any).api('notes/create', { text: this.text }).then(data => { this.clear(); diff --git a/src/client/app/desktop/views/widgets/trends.vue b/src/client/app/desktop/views/widgets/trends.vue index 27c1860b32..c2c7636bb3 100644 --- a/src/client/app/desktop/views/widgets/trends.vue +++ b/src/client/app/desktop/views/widgets/trends.vue @@ -5,8 +5,8 @@

%fa:spinner .pulse .fw%%i18n:common.loading%

-
-

{{ post.text }}

+
+

{{ note.text }}

@{{ acct }}

%i18n:desktop.tags.mk-trends-home-widget.nothing%

@@ -25,12 +25,12 @@ export default define({ }).extend({ computed: { acct() { - return getAcct(this.post.user); + return getAcct(this.note.user); }, }, data() { return { - post: null, + note: null, fetching: true, offset: 0 }; @@ -44,23 +44,23 @@ export default define({ }, fetch() { this.fetching = true; - this.post = null; + this.note = null; - (this as any).api('posts/trend', { + (this as any).api('notes/trend', { limit: 1, offset: this.offset, - repost: false, + renote: false, reply: false, media: false, poll: false - }).then(posts => { - const post = posts ? posts[0] : null; - if (post == null) { + }).then(notes => { + const note = notes ? notes[0] : null; + if (note == null) { this.offset = 0; } else { this.offset++; } - this.post = post; + this.note = note; this.fetching = false; }); } @@ -103,7 +103,7 @@ export default define({ &:active color #999 - > .post + > .note padding 16px font-size 12px font-style oblique diff --git a/src/client/app/dev/views/new-app.vue b/src/client/app/dev/views/new-app.vue index e407ca00d7..c9d5971395 100644 --- a/src/client/app/dev/views/new-app.vue +++ b/src/client/app/dev/views/new-app.vue @@ -27,7 +27,7 @@ アカウントの情報を見る。 アカウントの情報を操作する。 - 投稿する。 + 投稿する。 リアクションしたりリアクションをキャンセルする。 フォローしたりフォロー解除する。 ドライブを見る。 diff --git a/src/client/app/mobile/api/post.ts b/src/client/app/mobile/api/post.ts index 98309ba8de..72919c6505 100644 --- a/src/client/app/mobile/api/post.ts +++ b/src/client/app/mobile/api/post.ts @@ -1,24 +1,24 @@ import PostForm from '../views/components/post-form.vue'; -//import RepostForm from '../views/components/repost-form.vue'; -import getPostSummary from '../../../../renderers/get-post-summary'; +//import RenoteForm from '../views/components/renote-form.vue'; +import getNoteSummary from '../../../../renderers/get-note-summary'; export default (os) => (opts) => { const o = opts || {}; - if (o.repost) { - /*const vm = new RepostForm({ + if (o.renote) { + /*const vm = new RenoteForm({ propsData: { - repost: o.repost + renote: o.renote } }).$mount(); vm.$once('cancel', recover); - vm.$once('post', recover); + vm.$once('note', recover); document.body.appendChild(vm.$el);*/ - const text = window.prompt(`「${getPostSummary(o.repost)}」をRepost`); + const text = window.prompt(`「${getNoteSummary(o.renote)}」をRenote`); if (text == null) return; - os.api('posts/create', { - repostId: o.repost.id, + os.api('notes/create', { + renoteId: o.renote.id, text: text == '' ? undefined : text }); } else { @@ -36,7 +36,7 @@ export default (os) => (opts) => { } }).$mount(); vm.$once('cancel', recover); - vm.$once('post', recover); + vm.$once('note', recover); document.body.appendChild(vm.$el); (vm as any).focus(); } diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts index 4776fccddb..6265d0d45f 100644 --- a/src/client/app/mobile/script.ts +++ b/src/client/app/mobile/script.ts @@ -25,7 +25,7 @@ import MkDrive from './views/pages/drive.vue'; import MkNotifications from './views/pages/notifications.vue'; import MkMessaging from './views/pages/messaging.vue'; import MkMessagingRoom from './views/pages/messaging-room.vue'; -import MkPost from './views/pages/post.vue'; +import MkNote from './views/pages/note.vue'; import MkSearch from './views/pages/search.vue'; import MkFollowers from './views/pages/followers.vue'; import MkFollowing from './views/pages/following.vue'; @@ -68,7 +68,7 @@ init((launch) => { { path: '/@:user', component: MkUser }, { path: '/@:user/followers', component: MkFollowers }, { path: '/@:user/following', component: MkFollowing }, - { path: '/@:user/:post', component: MkPost } + { path: '/@:user/:note', component: MkNote } ] }); diff --git a/src/client/app/mobile/views/components/activity.vue b/src/client/app/mobile/views/components/activity.vue index 2e44017e77..dcd319cb69 100644 --- a/src/client/app/mobile/views/components/activity.vue +++ b/src/client/app/mobile/views/components/activity.vue @@ -2,14 +2,14 @@
- - @@ -32,12 +32,12 @@ export default Vue.extend({ userId: this.user.id, limit: 30 }).then(data => { - data.forEach(d => d.total = d.posts + d.replies + d.reposts); + data.forEach(d => d.total = d.notes + d.replies + d.renotes); this.peak = Math.max.apply(null, data.map(d => d.total)); data.forEach(d => { - d.postsH = d.posts / this.peak; + d.notesH = d.notes / this.peak; d.repliesH = d.replies / this.peak; - d.repostsH = d.reposts / this.peak; + d.renotesH = d.renotes / this.peak; }); data.reverse(); this.data = data; diff --git a/src/client/app/mobile/views/components/index.ts b/src/client/app/mobile/views/components/index.ts index fb8f65f47d..9346700304 100644 --- a/src/client/app/mobile/views/components/index.ts +++ b/src/client/app/mobile/views/components/index.ts @@ -2,16 +2,16 @@ import Vue from 'vue'; import ui from './ui.vue'; import timeline from './timeline.vue'; -import post from './post.vue'; -import posts from './posts.vue'; +import note from './note.vue'; +import notes from './notes.vue'; import mediaImage from './media-image.vue'; import mediaVideo from './media-video.vue'; import drive from './drive.vue'; -import postPreview from './post-preview.vue'; -import subPostContent from './sub-post-content.vue'; -import postCard from './post-card.vue'; +import notePreview from './note-preview.vue'; +import subNoteContent from './sub-note-content.vue'; +import noteCard from './note-card.vue'; import userCard from './user-card.vue'; -import postDetail from './post-detail.vue'; +import noteDetail from './note-detail.vue'; import followButton from './follow-button.vue'; import friendsMaker from './friends-maker.vue'; import notification from './notification.vue'; @@ -25,16 +25,16 @@ import widgetContainer from './widget-container.vue'; Vue.component('mk-ui', ui); Vue.component('mk-timeline', timeline); -Vue.component('mk-post', post); -Vue.component('mk-posts', posts); +Vue.component('mk-note', note); +Vue.component('mk-notes', notes); Vue.component('mk-media-image', mediaImage); Vue.component('mk-media-video', mediaVideo); Vue.component('mk-drive', drive); -Vue.component('mk-post-preview', postPreview); -Vue.component('mk-sub-post-content', subPostContent); -Vue.component('mk-post-card', postCard); +Vue.component('mk-note-preview', notePreview); +Vue.component('mk-sub-note-content', subNoteContent); +Vue.component('mk-note-card', noteCard); Vue.component('mk-user-card', userCard); -Vue.component('mk-post-detail', postDetail); +Vue.component('mk-note-detail', noteDetail); Vue.component('mk-follow-button', followButton); Vue.component('mk-friends-maker', friendsMaker); Vue.component('mk-notification', notification); diff --git a/src/client/app/mobile/views/components/note-card.vue b/src/client/app/mobile/views/components/note-card.vue new file mode 100644 index 0000000000..9ad0d3e294 --- /dev/null +++ b/src/client/app/mobile/views/components/note-card.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/client/app/mobile/views/components/note-detail.sub.vue b/src/client/app/mobile/views/components/note-detail.sub.vue new file mode 100644 index 0000000000..38aea4ba20 --- /dev/null +++ b/src/client/app/mobile/views/components/note-detail.sub.vue @@ -0,0 +1,113 @@ + + + + + + diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue new file mode 100644 index 0000000000..e1682e58ed --- /dev/null +++ b/src/client/app/mobile/views/components/note-detail.vue @@ -0,0 +1,462 @@ + + + + + + + diff --git a/src/client/app/mobile/views/components/note-preview.vue b/src/client/app/mobile/views/components/note-preview.vue new file mode 100644 index 0000000000..8c8d8645bb --- /dev/null +++ b/src/client/app/mobile/views/components/note-preview.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/client/app/mobile/views/components/note.sub.vue b/src/client/app/mobile/views/components/note.sub.vue new file mode 100644 index 0000000000..a37d0dea08 --- /dev/null +++ b/src/client/app/mobile/views/components/note.sub.vue @@ -0,0 +1,119 @@ + + + + + + diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue new file mode 100644 index 0000000000..4b33c6f071 --- /dev/null +++ b/src/client/app/mobile/views/components/note.vue @@ -0,0 +1,540 @@ + + + + + + + diff --git a/src/client/app/mobile/views/components/notes.vue b/src/client/app/mobile/views/components/notes.vue new file mode 100644 index 0000000000..573026d53e --- /dev/null +++ b/src/client/app/mobile/views/components/notes.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/client/app/mobile/views/components/notification-preview.vue b/src/client/app/mobile/views/components/notification-preview.vue index 0492c5d86c..79ca3321e4 100644 --- a/src/client/app/mobile/views/components/notification-preview.vue +++ b/src/client/app/mobile/views/components/notification-preview.vue @@ -4,23 +4,23 @@ avatar

{{ name }}

-

%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%

+

%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%

- @@ -51,7 +51,7 @@ avatar

%fa:chart-pie%{{ name }}

-

%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%

+

%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%

@@ -59,7 +59,7 @@ - - diff --git a/src/client/app/mobile/views/components/post-detail.sub.vue b/src/client/app/mobile/views/components/post-detail.sub.vue deleted file mode 100644 index 98d6a14cac..0000000000 --- a/src/client/app/mobile/views/components/post-detail.sub.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - diff --git a/src/client/app/mobile/views/components/post-detail.vue b/src/client/app/mobile/views/components/post-detail.vue index 0226ce081a..e1682e58ed 100644 --- a/src/client/app/mobile/views/components/post-detail.vue +++ b/src/client/app/mobile/views/components/post-detail.vue @@ -1,5 +1,5 @@
- +
- +
-
+

- avatar + avatar %fa:retweet% {{ name }} - がRepost + がRenote

@@ -38,33 +38,33 @@
- +
{{ tag }}
- + %fa:map-marker-alt% 位置情報
-
- +
+
- - - -
- +
@@ -84,9 +84,9 @@ import getAcct from '../../../../../acct/render'; import getUserName from '../../../../../renderers/get-user-name'; import parse from '../../../../../text/parse'; -import MkPostMenu from '../../../common/views/components/post-menu.vue'; +import MkNoteMenu from '../../../common/views/components/note-menu.vue'; import MkReactionPicker from '../../../common/views/components/reaction-picker.vue'; -import XSub from './post-detail.sub.vue'; +import XSub from './note-detail.sub.vue'; export default Vue.extend({ components: { @@ -94,7 +94,7 @@ export default Vue.extend({ }, props: { - post: { + note: { type: Object, required: true }, @@ -113,10 +113,10 @@ export default Vue.extend({ computed: { acct(): string { - return getAcct(this.post.user); + return getAcct(this.note.user); }, name(): string { - return getUserName(this.post.user); + return getUserName(this.note.user); }, pAcct(): string { return getAcct(this.p.user); @@ -124,14 +124,14 @@ export default Vue.extend({ pName(): string { return getUserName(this.p.user); }, - isRepost(): boolean { - return (this.post.repost && - this.post.text == null && - this.post.mediaIds == null && - this.post.poll == null); + isRenote(): boolean { + return (this.note.renote && + this.note.text == null && + this.note.mediaIds == null && + this.note.poll == null); }, p(): any { - return this.isRepost ? this.post.repost : this.post; + return this.isRenote ? this.note.renote : this.note; }, reactionsCount(): number { return this.p.reactionCounts @@ -155,8 +155,8 @@ export default Vue.extend({ mounted() { // Get replies if (!this.compact) { - (this as any).api('posts/replies', { - postId: this.p.id, + (this as any).api('notes/replies', { + noteId: this.p.id, limit: 8 }).then(replies => { this.replies = replies; @@ -187,8 +187,8 @@ export default Vue.extend({ this.contextFetching = true; // Fetch context - (this as any).api('posts/context', { - postId: this.p.replyId + (this as any).api('notes/context', { + noteId: this.p.replyId }).then(context => { this.contextFetching = false; this.context = context.reverse(); @@ -199,22 +199,22 @@ export default Vue.extend({ reply: this.p }); }, - repost() { + renote() { (this as any).apis.post({ - repost: this.p + renote: this.p }); }, react() { (this as any).os.new(MkReactionPicker, { source: this.$refs.reactButton, - post: this.p, + note: this.p, compact: true }); }, menu() { - (this as any).os.new(MkPostMenu, { + (this as any).os.new(MkNoteMenu, { source: this.$refs.menuButton, - post: this.p, + note: this.p, compact: true }); } @@ -225,7 +225,7 @@ export default Vue.extend({ diff --git a/src/client/app/mobile/views/components/post.sub.vue b/src/client/app/mobile/views/components/post.sub.vue deleted file mode 100644 index 909d5cb597..0000000000 --- a/src/client/app/mobile/views/components/post.sub.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - diff --git a/src/client/app/mobile/views/components/post.vue b/src/client/app/mobile/views/components/post.vue index eee1e80fd3..4b33c6f071 100644 --- a/src/client/app/mobile/views/components/post.vue +++ b/src/client/app/mobile/views/components/post.vue @@ -1,19 +1,19 @@ @@ -25,7 +25,7 @@ export default Vue.extend({ return { fetching: true, existMore: false, - posts: [], + notes: [], offset: 0 }; }, @@ -48,30 +48,30 @@ export default Vue.extend({ this.fetching = true; Progress.start(); - (this as any).api('posts/search', Object.assign({ + (this as any).api('notes/search', Object.assign({ limit: limit + 1 - }, parse(this.q))).then(posts => { - if (posts.length == limit + 1) { - posts.pop(); + }, parse(this.q))).then(notes => { + if (notes.length == limit + 1) { + notes.pop(); this.existMore = true; } - this.posts = posts; + this.notes = notes; this.fetching = false; Progress.done(); }); }, more() { this.offset += limit; - (this as any).api('posts/search', Object.assign({ + (this as any).api('notes/search', Object.assign({ limit: limit + 1, offset: this.offset - }, parse(this.q))).then(posts => { - if (posts.length == limit + 1) { - posts.pop(); + }, parse(this.q))).then(notes => { + if (notes.length == limit + 1) { + notes.pop(); } else { this.existMore = false; } - this.posts = this.posts.concat(posts); + this.notes = this.notes.concat(notes); }); } } @@ -79,7 +79,7 @@ export default Vue.extend({ diff --git a/src/client/app/mobile/views/pages/user/home.photos.vue b/src/client/app/mobile/views/pages/user/home.photos.vue index ecf5082072..1c59260812 100644 --- a/src/client/app/mobile/views/pages/user/home.photos.vue +++ b/src/client/app/mobile/views/pages/user/home.photos.vue @@ -5,7 +5,7 @@

%i18n:mobile.tags.mk-user-overview-photos.no-photos%

@@ -28,15 +28,15 @@ export default Vue.extend({ getAcct }, mounted() { - (this as any).api('users/posts', { + (this as any).api('users/notes', { userId: this.user.id, withMedia: true, limit: 6 - }).then(posts => { - posts.forEach(post => { - post.media.forEach(media => { + }).then(notes => { + notes.forEach(note => { + note.media.forEach(media => { if (this.images.length < 9) this.images.push({ - post, + note, media }); }); diff --git a/src/client/app/mobile/views/pages/user/home.posts.vue b/src/client/app/mobile/views/pages/user/home.posts.vue deleted file mode 100644 index 654f7f63e0..0000000000 --- a/src/client/app/mobile/views/pages/user/home.posts.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/client/app/mobile/views/pages/user/home.vue b/src/client/app/mobile/views/pages/user/home.vue index 1afcd1f5ba..2554084969 100644 --- a/src/client/app/mobile/views/pages/user/home.vue +++ b/src/client/app/mobile/views/pages/user/home.vue @@ -1,10 +1,10 @@