From 912ad5d84925ac8e6f54403ea5047de548bddaba Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 17 Sep 2018 09:00:20 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8F=E3=83=83=E3=82=B7=E3=83=A5=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 5 + .../app/common/scripts/streaming/hashtag.ts | 13 ++ .../views/components/settings-window.vue | 8 +- .../views/components/settings.tags.vue | 65 ++++++++++ .../app/desktop/views/components/settings.vue | 18 ++- .../views/components/timeline.core.vue | 76 ++++++++--- .../app/desktop/views/components/timeline.vue | 119 +++++++++++++++--- .../views/pages/deck/deck.column-core.vue | 1 + .../views/pages/deck/deck.hashtag-tl.vue | 117 +++++++++++++++++ .../views/pages/deck/deck.tl-column.vue | 7 +- .../app/desktop/views/pages/deck/deck.vue | 14 +++ .../app/mobile/views/pages/home.timeline.vue | 76 ++++++++--- src/client/app/mobile/views/pages/home.vue | 17 ++- src/client/app/store.ts | 1 + .../api/endpoints/notes/search_by_tag.ts | 45 +++---- src/server/api/stream/hashtag.ts | 48 +++++++ src/server/api/streaming.ts | 6 + src/services/note/create.ts | 6 +- src/stream.ts | 5 + 19 files changed, 555 insertions(+), 92 deletions(-) create mode 100644 src/client/app/common/scripts/streaming/hashtag.ts create mode 100644 src/client/app/desktop/views/components/settings.tags.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.hashtag-tl.vue create mode 100644 src/server/api/stream/hashtag.ts diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 2a8cfebb5..a3b2bd88e 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -166,6 +166,7 @@ common: home: "ホーム" local: "ローカル" hybrid: "ソーシャル" + hashtag: "ハッシュタグ" global: "グローバル" mentions: "あなた宛て" notifications: "通知" @@ -916,6 +917,10 @@ desktop/views/components/timeline.vue: global: "グローバル" mentions: "あなた宛て" list: "リスト" + hashtag: "ハッシュタグ" + add-tag-timeline: "ハッシュタグを追加" + add-list: "リストを追加" + list-name: "リスト名" desktop/views/components/ui.header.vue: welcome-back: "おかえりなさい、" diff --git a/src/client/app/common/scripts/streaming/hashtag.ts b/src/client/app/common/scripts/streaming/hashtag.ts new file mode 100644 index 000000000..276b8f8d3 --- /dev/null +++ b/src/client/app/common/scripts/streaming/hashtag.ts @@ -0,0 +1,13 @@ +import Stream from './stream'; +import MiOS from '../../../mios'; + +export class HashtagStream extends Stream { + constructor(os: MiOS, me, q) { + super(os, 'hashtag', me ? { + i: me.token, + q: JSON.stringify(q) + } : { + q: JSON.stringify(q) + }); + } +} diff --git a/src/client/app/desktop/views/components/settings-window.vue b/src/client/app/desktop/views/components/settings-window.vue index deb865b10..b4cc57028 100644 --- a/src/client/app/desktop/views/components/settings-window.vue +++ b/src/client/app/desktop/views/components/settings-window.vue @@ -1,13 +1,19 @@ + + diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue index 3911ec593..312a7ed56 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -5,6 +5,7 @@

%fa:desktop .fw%Web

%fa:R bell .fw%%i18n:@notification%

%fa:cloud .fw%%i18n:@drive%

+

%fa:hashtag .fw%%i18n:@tags%

%fa:ban .fw%%i18n:@mute%

%fa:puzzle-piece .fw%%i18n:@apps%

%fa:B twitter .fw%Twitter

@@ -138,6 +139,11 @@ +
+

%i18n:@tags%

+ +
+

%i18n:@mute%

@@ -222,6 +228,7 @@ import XApi from './settings.api.vue'; import XApps from './settings.apps.vue'; import XSignins from './settings.signins.vue'; import XDrive from './settings.drive.vue'; +import XTags from './settings.tags.vue'; import { url, langs, version } from '../../../config'; import checkForUpdate from '../../../common/scripts/check-for-update'; @@ -234,11 +241,18 @@ export default Vue.extend({ XApi, XApps, XSignins, - XDrive + XDrive, + XTags + }, + props: { + initialPage: { + type: String, + required: false + } }, data() { return { - page: 'profile', + page: this.initialPage || 'profile', meta: null, version, langs, diff --git a/src/client/app/desktop/views/components/timeline.core.vue b/src/client/app/desktop/views/components/timeline.core.vue index b6b5cca81..d2176dee8 100644 --- a/src/client/app/desktop/views/components/timeline.core.vue +++ b/src/client/app/desktop/views/components/timeline.core.vue @@ -15,6 +15,7 @@ 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 231b505f5..550b1be62 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 @@ -6,6 +6,7 @@ + {{ name }} @@ -14,6 +15,7 @@ + @@ -23,12 +25,14 @@ import Vue from 'vue'; import XColumn from './deck.column.vue'; import XTl from './deck.tl.vue'; import XListTl from './deck.list-tl.vue'; +import XHashtagTl from './deck.hashtag-tl.vue'; export default Vue.extend({ components: { XColumn, XTl, - XListTl + XListTl, + XHashtagTl }, props: { @@ -65,6 +69,7 @@ export default Vue.extend({ case 'hybrid': return '%i18n:common.deck.hybrid%'; case 'global': return '%i18n:common.deck.global%'; case 'list': return this.column.list.title; + case 'hashtag': return this.$store.state.settings.tagTimelines.find(x => x.id == this.column.tagTlId).title; } } }, diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue index 4a4535959..aafe9a45d 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -161,6 +161,20 @@ export default Vue.extend({ w.close(); }); } + }, { + icon: '%fa:hashtag%', + text: '%i18n:common.deck.hashtag%', + action: () => { + (this as any).apis.input({ + title: '%i18n:@enter-hashtag-tl-title%' + }).then(title => { + this.$store.dispatch('settings/addDeckColumn', { + id: uuid(), + type: 'hashtag', + tagTlId: this.$store.state.settings.tagTimelines.find(x => x.title == title).id + }); + }); + } }, { icon: '%fa:bell R%', text: '%i18n:common.deck.notifications%', diff --git a/src/client/app/mobile/views/pages/home.timeline.vue b/src/client/app/mobile/views/pages/home.timeline.vue index d4fcea1f9..fecb2384b 100644 --- a/src/client/app/mobile/views/pages/home.timeline.vue +++ b/src/client/app/mobile/views/pages/home.timeline.vue @@ -13,6 +13,7 @@