From 3d2083d1661f2242e85782fc5f43ded794154fc4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jun 2018 21:36:21 +0900 Subject: [PATCH 1/4] wip --- locales/ja.yml | 1 + src/client/app/desktop/script.ts | 2 + .../views/components/ui.header.nav.vue | 6 + .../app/desktop/views/components/ui.vue | 9 + .../desktop/views/pages/deck/deck.column.vue | 59 ++ .../views/pages/deck/deck.note.sub.vue | 153 +++++ .../desktop/views/pages/deck/deck.note.vue | 539 ++++++++++++++++++ .../desktop/views/pages/deck/deck.notes.vue | 248 ++++++++ .../app/desktop/views/pages/deck/deck.tl.vue | 143 +++++ .../app/desktop/views/pages/deck/deck.vue | 42 ++ 10 files changed, 1202 insertions(+) create mode 100644 src/client/app/desktop/views/pages/deck/deck.column.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.note.sub.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.note.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.notes.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.tl.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.vue diff --git a/locales/ja.yml b/locales/ja.yml index a62b341f6..026c2308c 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -606,6 +606,7 @@ desktop/views/components/ui.header.account.vue: desktop/views/components/ui.header.nav.vue: home: "ホーム" + deck: "デッキ" messaging: "メッセージ" game: "ゲーム" diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index 8fb6096af..61f1f5b87 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -23,6 +23,7 @@ import updateAvatar from './api/update-avatar'; import updateBanner from './api/update-banner'; import MkIndex from './views/pages/index.vue'; +import MkDeck from './views/pages/deck/deck.vue'; import MkUser from './views/pages/user/user.vue'; import MkFavorites from './views/pages/favorites.vue'; import MkSelectDrive from './views/pages/selectdrive.vue'; @@ -50,6 +51,7 @@ init(async (launch) => { mode: 'history', routes: [ { path: '/', name: 'index', component: MkIndex }, + { path: '/deck', name: 'deck', component: MkDeck }, { path: '/i/customize-home', component: MkHomeCustomize }, { path: '/i/favorites', component: MkFavorites }, { path: '/i/messaging/:user', component: MkMessagingRoom }, diff --git a/src/client/app/desktop/views/components/ui.header.nav.vue b/src/client/app/desktop/views/components/ui.header.nav.vue index 4780c57cb..8e792b3df 100644 --- a/src/client/app/desktop/views/components/ui.header.nav.vue +++ b/src/client/app/desktop/views/components/ui.header.nav.vue @@ -8,6 +8,12 @@

%i18n:@home%

+
  • + + %fa:columns% +

    %i18n:@deck%

    +
    +
  • %fa:comments% diff --git a/src/client/app/desktop/views/components/ui.vue b/src/client/app/desktop/views/components/ui.vue index 32cc71e4b..ad6fc69df 100644 --- a/src/client/app/desktop/views/components/ui.vue +++ b/src/client/app/desktop/views/components/ui.vue @@ -37,7 +37,16 @@ export default Vue.extend({ diff --git a/src/client/app/desktop/views/pages/deck/deck.column.vue b/src/client/app/desktop/views/pages/deck/deck.column.vue new file mode 100644 index 000000000..4e0679829 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.column.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.note.sub.vue b/src/client/app/desktop/views/pages/deck/deck.note.sub.vue new file mode 100644 index 000000000..b458b7418 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.note.sub.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.note.vue b/src/client/app/desktop/views/pages/deck/deck.note.vue new file mode 100644 index 000000000..8582a37b9 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.note.vue @@ -0,0 +1,539 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.notes.vue b/src/client/app/desktop/views/pages/deck/deck.notes.vue new file mode 100644 index 000000000..ff871b049 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.notes.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.tl.vue b/src/client/app/desktop/views/pages/deck/deck.tl.vue new file mode 100644 index 000000000..ce9a77703 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.tl.vue @@ -0,0 +1,143 @@ + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue new file mode 100644 index 000000000..afb65d233 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -0,0 +1,42 @@ + + + + + + + From a0c7817130654868d4ec9e513af269ce06197316 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jun 2018 21:44:02 +0900 Subject: [PATCH 2/4] wip --- src/client/app/desktop/views/pages/deck/deck.column.vue | 3 ++- src/client/app/desktop/views/pages/deck/deck.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/app/desktop/views/pages/deck/deck.column.vue b/src/client/app/desktop/views/pages/deck/deck.column.vue index 4e0679829..e0fc394f3 100644 --- a/src/client/app/desktop/views/pages/deck/deck.column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.column.vue @@ -30,7 +30,7 @@ export default Vue.extend({ root(isDark) flex 1 - max-width 330px + min-width 330px height 100% margin-right 16px background isDark ? #282C37 : #fff @@ -49,6 +49,7 @@ root(isDark) > div height calc(100% - 48px) overflow auto + overflow-x hidden .dnpfarvgbnfmyzbdquhhzyxcmstpdqzs[data-darkmode] root(true) diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue index afb65d233..0c32b7d66 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -31,7 +31,8 @@ export default Vue.extend({ root(isDark) display flex flex 1 - padding 16px + padding 16px 0 16px 16px + overflow auto .qlvquzbjribqcaozciifydkngcwtyzje[data-darkmode] root(true) From 132dfff31b9c490279c3db1e95c67c6e9272dfa7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jun 2018 22:54:03 +0900 Subject: [PATCH 3/4] wip --- .../views/components/ui.header.nav.vue | 2 +- .../desktop/views/pages/deck/deck.column.vue | 25 +++++++++++--- .../desktop/views/pages/deck/deck.notes.vue | 16 +++++---- .../views/pages/deck/deck.tl-column.vue | 33 +++++++++++++++++++ .../app/desktop/views/pages/deck/deck.tl.vue | 4 --- .../app/desktop/views/pages/deck/deck.vue | 11 +++---- src/services/note/create.ts | 4 ++- 7 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 src/client/app/desktop/views/pages/deck/deck.tl-column.vue diff --git a/src/client/app/desktop/views/components/ui.header.nav.vue b/src/client/app/desktop/views/components/ui.header.nav.vue index 8e792b3df..fe2637cec 100644 --- a/src/client/app/desktop/views/components/ui.header.nav.vue +++ b/src/client/app/desktop/views/components/ui.header.nav.vue @@ -11,7 +11,7 @@
  • %fa:columns% -

    %i18n:@deck%

    +

    %i18n:@deck% (beta)

  • diff --git a/src/client/app/desktop/views/pages/deck/deck.column.vue b/src/client/app/desktop/views/pages/deck/deck.column.vue index e0fc394f3..8d0b3c0fd 100644 --- a/src/client/app/desktop/views/pages/deck/deck.column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.column.vue @@ -1,10 +1,10 @@ @@ -17,9 +17,23 @@ export default Vue.extend({ components: { XTl }, + provide() { + return { + getColumn() { + return this; + }, + getScrollContainer() { + return this.$refs.body; + } + }; + }, mounted() { this.$nextTick(() => { - this.$refs.tl.mount(this.$refs.body); + this.$emit('mounted'); + + setInterval(() => { + this.$emit('mounted'); + }, 100); }); } }); @@ -31,6 +45,7 @@ export default Vue.extend({ root(isDark) flex 1 min-width 330px + max-width 330px height 100% margin-right 16px background isDark ? #282C37 : #fff @@ -40,14 +55,14 @@ root(isDark) > header z-index 1 - line-height 48px + line-height 42px padding 0 16px color isDark ? #e3e5e8 : #888 background isDark ? #313543 : #fff box-shadow 0 1px rgba(#000, 0.15) > div - height calc(100% - 48px) + height calc(100% - 42px) overflow auto overflow-x hidden diff --git a/src/client/app/desktop/views/pages/deck/deck.notes.vue b/src/client/app/desktop/views/pages/deck/deck.notes.vue index ff871b049..48be4e585 100644 --- a/src/client/app/desktop/views/pages/deck/deck.notes.vue +++ b/src/client/app/desktop/views/pages/deck/deck.notes.vue @@ -73,16 +73,20 @@ export default Vue.extend({ } }, + inject: ['getColumn', 'getScrollContainer'], + + created() { + this.getColumn().$once('mounted', () => { + this.rootEl = this.getScrollContainer(); + this.rootEl.addEventListener('scroll', this.onScroll); + }) + }, + beforeDestroy() { - this.root.removeEventListener('scroll', this.onScroll); + this.rootEl.removeEventListener('scroll', this.onScroll); }, methods: { - mount(root) { - this.rootEl = root; - this.rootEl.addEventListener('scroll', this.onScroll); - }, - isScrollTop() { if (this.rootEl == null) return true; return this.rootEl.scrollTop <= 8; 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 new file mode 100644 index 000000000..674f04077 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.tl-column.vue @@ -0,0 +1,33 @@ + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.tl.vue b/src/client/app/desktop/views/pages/deck/deck.tl.vue index ce9a77703..0a788b32e 100644 --- a/src/client/app/desktop/views/pages/deck/deck.tl.vue +++ b/src/client/app/desktop/views/pages/deck/deck.tl.vue @@ -14,10 +14,6 @@ export default Vue.extend({ }, props: { - root: { - type: Object, - required: false - }, src: { type: String, required: false, diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue index 0c32b7d66..dfd480029 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -1,21 +1,20 @@ diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 37d21feca..f820182a4 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -221,7 +221,9 @@ export default async (user: IUser, data: { } // Publish note to global timeline stream - publishGlobalTimelineStream(noteObj); + if (note.visibility == 'public' && note.replyId == null) { + publishGlobalTimelineStream(noteObj); + } if (note.visibility == 'specified') { data.visibleUsers.forEach(async u => { From 6334ae3a5f3abc0e7a348f0c590239114841469e Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 5 Jun 2018 23:19:04 +0900 Subject: [PATCH 4/4] wip --- .../pages/deck/deck.notifications-column.vue | 22 ++ .../views/pages/deck/deck.notifications.vue | 335 ++++++++++++++++++ .../app/desktop/views/pages/deck/deck.vue | 5 +- 3 files changed, 361 insertions(+), 1 deletion(-) create mode 100644 src/client/app/desktop/views/pages/deck/deck.notifications-column.vue create mode 100644 src/client/app/desktop/views/pages/deck/deck.notifications.vue diff --git a/src/client/app/desktop/views/pages/deck/deck.notifications-column.vue b/src/client/app/desktop/views/pages/deck/deck.notifications-column.vue new file mode 100644 index 000000000..056698964 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.notifications-column.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.notifications.vue b/src/client/app/desktop/views/pages/deck/deck.notifications.vue new file mode 100644 index 000000000..7a9646b58 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.notifications.vue @@ -0,0 +1,335 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue index dfd480029..fb5e55086 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -2,6 +2,7 @@
    +
    @@ -11,10 +12,12 @@