From 69a8e4f4b20a12321eac94d5f8db119ca268cb3c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 19 Feb 2018 23:37:09 +0900 Subject: [PATCH] wip --- src/web/app/common/-tags/authorized-apps.tag | 1 - .../app/common/views/components/messaging.vue | 2 +- .../app/desktop/-tags/widgets/activity.tag | 246 ------------------ .../views/components/activity.calendar.vue | 66 +++++ .../views/components/activity.chart.vue | 101 +++++++ .../app/desktop/views/components/activity.vue | 116 +++++++++ .../app/desktop/views/components/calendar.vue | 4 +- .../views/components/followers-window.vue | 4 +- .../views/components/following-window.vue | 4 +- .../views/components/friends-maker.vue | 2 +- src/web/app/desktop/views/components/index.ts | 2 + .../desktop/views/components/mute-setting.vue | 2 +- .../desktop/views/components/post-detail.vue | 2 +- .../app/desktop/views/components/timeline.vue | 2 +- .../desktop/views/components/users-list.vue | 2 +- .../views/components/widgets/broadcast.vue | 2 +- .../views/components/widgets/photo-stream.vue | 2 +- .../views/components/widgets/slideshow.vue | 2 +- .../desktop/views/pages/messaging-room.vue | 2 +- src/web/app/desktop/views/pages/post.vue | 2 +- src/web/app/desktop/views/pages/search.vue | 2 +- .../pages/user/user-followers-you-know.vue | 2 +- .../desktop/views/pages/user/user-friends.vue | 22 +- .../desktop/views/pages/user/user-home.vue | 17 +- .../desktop/views/pages/user/user-photos.vue | 5 +- .../desktop/views/pages/user/user-profile.vue | 16 +- .../user}/user-timeline.vue | 2 +- src/web/app/desktop/views/pages/user/user.vue | 2 +- src/web/app/mobile/views/components/drive.vue | 3 +- .../mobile/views/components/friends-maker.vue | 2 +- .../app/mobile/views/components/timeline.vue | 2 +- .../mobile/views/components/user-timeline.vue | 2 +- .../mobile/views/components/users-list.vue | 2 +- src/web/app/mobile/views/pages/followers.vue | 2 +- src/web/app/mobile/views/pages/following.vue | 2 +- src/web/app/mobile/views/pages/post.vue | 2 +- src/web/app/mobile/views/pages/user.vue | 2 +- .../mobile/views/pages/user/home-friends.vue | 2 +- .../mobile/views/pages/user/home-photos.vue | 2 +- .../mobile/views/pages/user/home-posts.vue | 2 +- 40 files changed, 356 insertions(+), 303 deletions(-) delete mode 100644 src/web/app/desktop/-tags/widgets/activity.tag create mode 100644 src/web/app/desktop/views/components/activity.calendar.vue create mode 100644 src/web/app/desktop/views/components/activity.chart.vue create mode 100644 src/web/app/desktop/views/components/activity.vue rename src/web/app/desktop/views/{components => pages/user}/user-timeline.vue (100%) diff --git a/src/web/app/common/-tags/authorized-apps.tag b/src/web/app/common/-tags/authorized-apps.tag index 288c2fcc2d..ed1570650a 100644 --- a/src/web/app/common/-tags/authorized-apps.tag +++ b/src/web/app/common/-tags/authorized-apps.tag @@ -28,7 +28,6 @@ this.$root.$data.os.api('i/authorized_apps').then(apps => { this.apps = apps; this.fetching = false; - this.update(); }); }); diff --git a/src/web/app/common/views/components/messaging.vue b/src/web/app/common/views/components/messaging.vue index c0b3a1924b..c1d5418944 100644 --- a/src/web/app/common/views/components/messaging.vue +++ b/src/web/app/common/views/components/messaging.vue @@ -78,8 +78,8 @@ export default Vue.extend({ this.connection.on('read', this.onRead); (this as any).api('messaging/history').then(messages => { - this.fetching = false; this.messages = messages; + this.fetching = false; }); }, beforeDestroy() { diff --git a/src/web/app/desktop/-tags/widgets/activity.tag b/src/web/app/desktop/-tags/widgets/activity.tag deleted file mode 100644 index 1f9bee5ed5..0000000000 --- a/src/web/app/desktop/-tags/widgets/activity.tag +++ /dev/null @@ -1,246 +0,0 @@ - - -

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

- - - - -
- - - - - { date.year }/{ date.month }/{ date.day }
Post: { posts }, Reply: { replies }, Repost: { reposts }
-
- - -
- - -
- - - - Black ... Total
Blue ... Posts
Red ... Replies
Green ... Reposts
- - - - -
- - -
- diff --git a/src/web/app/desktop/views/components/activity.calendar.vue b/src/web/app/desktop/views/components/activity.calendar.vue new file mode 100644 index 0000000000..d9b8523152 --- /dev/null +++ b/src/web/app/desktop/views/components/activity.calendar.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/web/app/desktop/views/components/activity.chart.vue b/src/web/app/desktop/views/components/activity.chart.vue new file mode 100644 index 0000000000..e64b181ba1 --- /dev/null +++ b/src/web/app/desktop/views/components/activity.chart.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/web/app/desktop/views/components/activity.vue b/src/web/app/desktop/views/components/activity.vue new file mode 100644 index 0000000000..d1c44f0f5d --- /dev/null +++ b/src/web/app/desktop/views/components/activity.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/src/web/app/desktop/views/components/calendar.vue b/src/web/app/desktop/views/components/calendar.vue index e548a82c57..a21d3e6148 100644 --- a/src/web/app/desktop/views/components/calendar.vue +++ b/src/web/app/desktop/views/components/calendar.vue @@ -47,7 +47,7 @@ export default Vue.extend({ default: 0 }, start: { - type: Object, + type: Date, required: false } }, @@ -94,7 +94,7 @@ export default Vue.extend({ isOutOfRange(day) { const test = (new Date(this.year, this.month - 1, day)).getTime(); return test > this.today.getTime() || - (this.start ? test < this.start.getTime() : false); + (this.start ? test < (this.start as any).getTime() : false); }, isDonichi(day) { diff --git a/src/web/app/desktop/views/components/followers-window.vue b/src/web/app/desktop/views/components/followers-window.vue index e56545cccb..ed439114c3 100644 --- a/src/web/app/desktop/views/components/followers-window.vue +++ b/src/web/app/desktop/views/components/followers-window.vue @@ -1,9 +1,9 @@ diff --git a/src/web/app/desktop/views/components/following-window.vue b/src/web/app/desktop/views/components/following-window.vue index fa2edfa473..4e1fb0306f 100644 --- a/src/web/app/desktop/views/components/following-window.vue +++ b/src/web/app/desktop/views/components/following-window.vue @@ -1,9 +1,9 @@ diff --git a/src/web/app/desktop/views/components/friends-maker.vue b/src/web/app/desktop/views/components/friends-maker.vue index b23373421d..61015b979f 100644 --- a/src/web/app/desktop/views/components/friends-maker.vue +++ b/src/web/app/desktop/views/components/friends-maker.vue @@ -43,8 +43,8 @@ export default Vue.extend({ limit: this.limit, offset: this.limit * this.page }).then(users => { - this.fetching = false; this.users = users; + this.fetching = false; }); }, refresh() { diff --git a/src/web/app/desktop/views/components/index.ts b/src/web/app/desktop/views/components/index.ts index 9a27369547..8e48d67b98 100644 --- a/src/web/app/desktop/views/components/index.ts +++ b/src/web/app/desktop/views/components/index.ts @@ -34,6 +34,7 @@ import driveNavFolder from './drive-nav-folder.vue'; import postDetail from './post-detail.vue'; import settings from './settings.vue'; import calendar from './calendar.vue'; +import activity from './activity.vue'; import wNav from './widgets/nav.vue'; import wCalendar from './widgets/calendar.vue'; import wPhotoStream from './widgets/photo-stream.vue'; @@ -78,6 +79,7 @@ Vue.component('mk-drive-nav-folder', driveNavFolder); Vue.component('mk-post-detail', postDetail); Vue.component('mk-settings', settings); Vue.component('mk-calendar', calendar); +Vue.component('mk-activity', activity); Vue.component('mkw-nav', wNav); Vue.component('mkw-calendar', wCalendar); Vue.component('mkw-photo-stream', wPhotoStream); diff --git a/src/web/app/desktop/views/components/mute-setting.vue b/src/web/app/desktop/views/components/mute-setting.vue index 3fcc34c9e6..fe78401af9 100644 --- a/src/web/app/desktop/views/components/mute-setting.vue +++ b/src/web/app/desktop/views/components/mute-setting.vue @@ -23,8 +23,8 @@ export default Vue.extend({ }, mounted() { (this as any).api('mute/list').then(x => { - this.fetching = false; this.users = x.users; + this.fetching = false; }); } }); diff --git a/src/web/app/desktop/views/components/post-detail.vue b/src/web/app/desktop/views/components/post-detail.vue index c2c2559f63..429b3549b9 100644 --- a/src/web/app/desktop/views/components/post-detail.vue +++ b/src/web/app/desktop/views/components/post-detail.vue @@ -4,7 +4,7 @@ class="read-more" v-if="p.reply && p.reply.reply_id && context == null" title="会話をもっと読み込む" - @click="loadContext" + @click="fetchContext" :disabled="contextFetching" > diff --git a/src/web/app/desktop/views/components/timeline.vue b/src/web/app/desktop/views/components/timeline.vue index c638013380..3e06774753 100644 --- a/src/web/app/desktop/views/components/timeline.vue +++ b/src/web/app/desktop/views/components/timeline.vue @@ -57,8 +57,8 @@ export default Vue.extend({ (this as any).api('posts/timeline', { until_date: this.date ? this.date.getTime() : undefined }).then(posts => { - this.fetching = false; this.posts = posts; + this.fetching = false; if (cb) cb(); }); }, diff --git a/src/web/app/desktop/views/components/users-list.vue b/src/web/app/desktop/views/components/users-list.vue index 12abb372e7..b93a81630c 100644 --- a/src/web/app/desktop/views/components/users-list.vue +++ b/src/web/app/desktop/views/components/users-list.vue @@ -45,9 +45,9 @@ export default Vue.extend({ _fetch(cb) { this.fetching = true; this.fetch(this.mode == 'iknow', this.limit, null, obj => { - this.fetching = false; this.users = obj.users; this.next = obj.next; + this.fetching = false; if (cb) cb(); }); }, diff --git a/src/web/app/desktop/views/components/widgets/broadcast.vue b/src/web/app/desktop/views/components/widgets/broadcast.vue index cdc65a2a7b..1a0fd9280c 100644 --- a/src/web/app/desktop/views/components/widgets/broadcast.vue +++ b/src/web/app/desktop/views/components/widgets/broadcast.vue @@ -46,8 +46,8 @@ export default define({ } }); } - this.fetching = false; this.broadcasts = broadcasts; + this.fetching = false; }); }, methods: { diff --git a/src/web/app/desktop/views/components/widgets/photo-stream.vue b/src/web/app/desktop/views/components/widgets/photo-stream.vue index a3f37e8c7e..6ad7d2f064 100644 --- a/src/web/app/desktop/views/components/widgets/photo-stream.vue +++ b/src/web/app/desktop/views/components/widgets/photo-stream.vue @@ -35,8 +35,8 @@ export default define({ type: 'image/*', limit: 9 }).then(images => { - this.fetching = false; this.images = images; + this.fetching = false; }); }, beforeDestroy() { diff --git a/src/web/app/desktop/views/components/widgets/slideshow.vue b/src/web/app/desktop/views/components/widgets/slideshow.vue index beda350666..3c2ef6da4f 100644 --- a/src/web/app/desktop/views/components/widgets/slideshow.vue +++ b/src/web/app/desktop/views/components/widgets/slideshow.vue @@ -93,8 +93,8 @@ export default define({ type: 'image/*', limit: 100 }).then(images => { - this.fetching = false; this.images = images; + this.fetching = false; (this.$refs.slideA as any).style.backgroundImage = ''; (this.$refs.slideB as any).style.backgroundImage = ''; this.change(); diff --git a/src/web/app/desktop/views/pages/messaging-room.vue b/src/web/app/desktop/views/pages/messaging-room.vue index 3e4fb256ac..ace9e1607b 100644 --- a/src/web/app/desktop/views/pages/messaging-room.vue +++ b/src/web/app/desktop/views/pages/messaging-room.vue @@ -24,8 +24,8 @@ export default Vue.extend({ (this as any).api('users/show', { username: this.username }).then(user => { - this.fetching = false; this.user = user; + this.fetching = false; document.title = 'メッセージ: ' + this.user.name; diff --git a/src/web/app/desktop/views/pages/post.vue b/src/web/app/desktop/views/pages/post.vue index 186ee332f6..8b9f30f108 100644 --- a/src/web/app/desktop/views/pages/post.vue +++ b/src/web/app/desktop/views/pages/post.vue @@ -26,8 +26,8 @@ export default Vue.extend({ (this as any).api('posts/show', { post_id: this.postId }).then(post => { - this.fetching = false; this.post = post; + this.fetching = false; Progress.done(); }); diff --git a/src/web/app/desktop/views/pages/search.vue b/src/web/app/desktop/views/pages/search.vue index 828aac8fe1..b8e8db2e79 100644 --- a/src/web/app/desktop/views/pages/search.vue +++ b/src/web/app/desktop/views/pages/search.vue @@ -45,8 +45,8 @@ export default Vue.extend({ window.addEventListener('scroll', this.onScroll); (this as any).api('posts/search', parse(this.query)).then(posts => { - this.fetching = false; this.posts = posts; + this.fetching = false; }); }, beforeDestroy() { diff --git a/src/web/app/desktop/views/pages/user/user-followers-you-know.vue b/src/web/app/desktop/views/pages/user/user-followers-you-know.vue index 246ff865d1..c58eb75bcf 100644 --- a/src/web/app/desktop/views/pages/user/user-followers-you-know.vue +++ b/src/web/app/desktop/views/pages/user/user-followers-you-know.vue @@ -27,8 +27,8 @@ export default Vue.extend({ iknow: true, limit: 16 }).then(x => { - this.fetching = false; this.users = x.users; + this.fetching = false; }); } }); diff --git a/src/web/app/desktop/views/pages/user/user-friends.vue b/src/web/app/desktop/views/pages/user/user-friends.vue index 9f324cfc08..a144ca2ad1 100644 --- a/src/web/app/desktop/views/pages/user/user-friends.vue +++ b/src/web/app/desktop/views/pages/user/user-friends.vue @@ -2,16 +2,18 @@

%fa:users%%i18n:desktop.tags.mk-user.frequently-replied-users.title%

%fa:spinner .pulse .fw%%i18n:desktop.tags.mk-user.frequently-replied-users.loading%

-
- - - -
- { _user.name } -

@{ _user.username }

+

%i18n:desktop.tags.mk-user.frequently-replied-users.no-users%

@@ -31,8 +33,8 @@ export default Vue.extend({ user_id: this.user.id, limit: 4 }).then(docs => { - this.fetching = false; this.users = docs.map(doc => doc.user); + this.fetching = false; }); } }); diff --git a/src/web/app/desktop/views/pages/user/user-home.vue b/src/web/app/desktop/views/pages/user/user-home.vue index ca2c68840c..5ed901579e 100644 --- a/src/web/app/desktop/views/pages/user/user-home.vue +++ b/src/web/app/desktop/views/pages/user/user-home.vue @@ -14,8 +14,8 @@
- - + +
@@ -25,7 +25,20 @@