Skip to content

Commit

Permalink
フォローユーザーのTLへ飛ぶメニュー
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jan 8, 2020
1 parent 59d6341 commit fa3d63a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 3 additions & 2 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,9 @@ common/views/components/nav.vue:
common/views/components/note-menu.vue:
mention: "Mention"
detail: "Details"
go-timeline: "Go timeline"
up-timeline: "Go timeline (reversed)"
go-timeline: "Go local TL"
up-timeline: "Go local TL (reversed)"
go-follow-tl: "Go follow TL"
copy-content: "Copy the contents"
copy-link: "Copy link"
favorite: "Favorite this note"
Expand Down
5 changes: 3 additions & 2 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,9 @@ common/views/components/nav.vue:
common/views/components/note-menu.vue:
mention: "メンション"
detail: "詳細"
go-timeline: "タイムラインへ"
up-timeline: "タイムラインへ (逆順)"
go-timeline: "ローカルTLへ"
up-timeline: "ローカルTLへ (逆順)"
go-follow-tl: "フォローのTLへ"
copy-content: "内容をコピー"
copy-link: "リンクをコピー"
favorite: "お気に入り"
Expand Down
14 changes: 13 additions & 1 deletion src/client/app/common/views/components/note-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import i18n from '../../../i18n';
import { url } from '../../../config';
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
import { faCopy, faEye, faEyeSlash, } from '@fortawesome/free-regular-svg-icons';
import { faPlaneArrival, faPlaneDeparture } from '@fortawesome/free-solid-svg-icons';
import { faPlaneArrival, faPlaneDeparture, faUserFriends } from '@fortawesome/free-solid-svg-icons';
export default Vue.extend({
i18n: i18n('common/views/components/note-menu.vue'),
Expand Down Expand Up @@ -39,6 +39,10 @@ export default Vue.extend({
icon: faPlaneDeparture,
text: this.$t('up-timeline'),
action: this.upTimeline
}, {
icon: faUserFriends,
text: this.$t('go-follow-tl'),
action: this.goFollowTL
}, {
icon: faCopy,
text: this.$t('copy-content'),
Expand Down Expand Up @@ -250,6 +254,14 @@ export default Vue.extend({
this.$router.push(`/search?q=${encodeURIComponent(q)}`);
},
goFollowTL() {
const date = new Date(new Date(this.note.createdAt).getTime() + 5000).toISOString();
const user = this.note.user.host ? `@${this.note.user.username}@${this.note.user.host}` : `@${this.note.user.username}`;
const q = `follow:${user} until:${date}`;
this.$router.push(`/search?q=${encodeURIComponent(q)}`);
},
closed() {
this.$emit('closed');
this.$nextTick(() => {
Expand Down

0 comments on commit fa3d63a

Please sign in to comment.