summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-02-22 20:52:39 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-02-22 20:52:39 +0900
commit62d16db008df5847f9c77eabea8af4604ae573f0 (patch)
tree09f17b9d67dcd3f9a72edc4adbccc1568e9422f8 /src/web
parentwip (diff)
downloadsharkey-62d16db008df5847f9c77eabea8af4604ae573f0.tar.gz
sharkey-62d16db008df5847f9c77eabea8af4604ae573f0.tar.bz2
sharkey-62d16db008df5847f9c77eabea8af4604ae573f0.zip
wip
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/desktop/views/components/activity.calendar.vue2
-rw-r--r--src/web/app/desktop/views/components/activity.chart.vue10
-rw-r--r--src/web/app/desktop/views/components/friends-maker.vue10
-rw-r--r--src/web/app/desktop/views/components/timeline.vue15
-rw-r--r--src/web/app/desktop/views/components/widgets/users.vue4
5 files changed, 25 insertions, 16 deletions
diff --git a/src/web/app/desktop/views/components/activity.calendar.vue b/src/web/app/desktop/views/components/activity.calendar.vue
index d9b8523152..72233e9aca 100644
--- a/src/web/app/desktop/views/components/activity.calendar.vue
+++ b/src/web/app/desktop/views/components/activity.calendar.vue
@@ -37,7 +37,7 @@ export default Vue.extend({
d.x = x;
d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay();
- d.v = d.total / (peak / 2);
+ d.v = peak == 0 ? 0 : d.total / (peak / 2);
if (d.v > 1) d.v = 1;
const ch = d.date.weekday == 0 || d.date.weekday == 6 ? 275 : 170;
const cs = d.v * 100;
diff --git a/src/web/app/desktop/views/components/activity.chart.vue b/src/web/app/desktop/views/components/activity.chart.vue
index e64b181ba1..5057786ed4 100644
--- a/src/web/app/desktop/views/components/activity.chart.vue
+++ b/src/web/app/desktop/views/components/activity.chart.vue
@@ -62,10 +62,12 @@ export default Vue.extend({
methods: {
render() {
const peak = Math.max.apply(null, this.data.map(d => d.total));
- this.pointsPost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.posts / peak)) * this.viewBoxY}`).join(' ');
- this.pointsReply = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.replies / peak)) * this.viewBoxY}`).join(' ');
- this.pointsRepost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.reposts / peak)) * this.viewBoxY}`).join(' ');
- this.pointsTotal = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.total / peak)) * this.viewBoxY}`).join(' ');
+ if (peak != 0) {
+ this.pointsPost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.posts / peak)) * this.viewBoxY}`).join(' ');
+ this.pointsReply = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.replies / peak)) * this.viewBoxY}`).join(' ');
+ this.pointsRepost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.reposts / peak)) * this.viewBoxY}`).join(' ');
+ this.pointsTotal = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.total / peak)) * this.viewBoxY}`).join(' ');
+ }
},
onMousedown(e) {
const clickX = e.clientX;
diff --git a/src/web/app/desktop/views/components/friends-maker.vue b/src/web/app/desktop/views/components/friends-maker.vue
index 61015b979f..ab35efc75a 100644
--- a/src/web/app/desktop/views/components/friends-maker.vue
+++ b/src/web/app/desktop/views/components/friends-maker.vue
@@ -3,20 +3,20 @@
<p class="title">気になるユーザーをフォロー:</p>
<div class="users" v-if="!fetching && users.length > 0">
<div class="user" v-for="user in users" :key="user.id">
- <a class="avatar-anchor" :href="`/${user.username}`">
+ <router-link class="avatar-anchor" :to="`/${user.username}`">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="user.id"/>
- </a>
+ </router-link>
<div class="body">
- <a class="name" :href="`/${user.username}`" target="_blank" v-user-preview="user.id">{{ user.name }}</a>
+ <router-link class="name" :to="`/${user.username}`" v-user-preview="user.id">{{ user.name }}</router-link>
<p class="username">@{{ user.username }}</p>
</div>
- <mk-follow-button user="user"/>
+ <mk-follow-button :user="user"/>
</div>
</div>
<p class="empty" v-if="!fetching && users.length == 0">おすすめのユーザーは見つかりませんでした。</p>
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%読み込んでいます<mk-ellipsis/></p>
<a class="refresh" @click="refresh">もっと見る</a>
- <button class="close" @click="$destroy" title="閉じる">%fa:times%</button>
+ <button class="close" @click="$destroy()" title="閉じる">%fa:times%</button>
</div>
</template>
diff --git a/src/web/app/desktop/views/components/timeline.vue b/src/web/app/desktop/views/components/timeline.vue
index a3f27412d1..eef62104eb 100644
--- a/src/web/app/desktop/views/components/timeline.vue
+++ b/src/web/app/desktop/views/components/timeline.vue
@@ -4,8 +4,15 @@
<div class="fetching" v-if="fetching">
<mk-ellipsis-icon/>
</div>
- <p class="empty" v-if="posts.length == 0 && !fetching">%fa:R comments%自分の投稿や、自分がフォローしているユーザーの投稿が表示されます。</p>
- <mk-posts :posts="posts" ref="timeline"/>
+ <p class="empty" v-if="posts.length == 0 && !fetching">
+ %fa:R comments%自分の投稿や、自分がフォローしているユーザーの投稿が表示されます。
+ </p>
+ <mk-posts :posts="posts" ref="timeline">
+ <div slot="footer">
+ <template v-if="!moreFetching">%fa:comments%</template>
+ <template v-if="moreFetching">%fa:spinner .pulse .fw%</template>
+ </div>
+ </mk-posts>
</div>
</template>
@@ -69,8 +76,8 @@ export default Vue.extend({
(this as any).api('posts/timeline', {
until_id: this.posts[this.posts.length - 1].id
}).then(posts => {
+ this.posts = this.posts.concat(posts);
this.moreFetching = false;
- this.posts.unshift(posts);
});
},
onPost(post) {
@@ -104,7 +111,7 @@ export default Vue.extend({
border solid 1px rgba(0, 0, 0, 0.075)
border-radius 6px
- > .mk-following-setuper
+ > .mk-friends-maker
border-bottom solid 1px #eee
> .fetching
diff --git a/src/web/app/desktop/views/components/widgets/users.vue b/src/web/app/desktop/views/components/widgets/users.vue
index 4a9ab2aa33..f3a1509cfd 100644
--- a/src/web/app/desktop/views/components/widgets/users.vue
+++ b/src/web/app/desktop/views/components/widgets/users.vue
@@ -7,11 +7,11 @@
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
<template v-else-if="users.length != 0">
<div class="user" v-for="_user in users">
- <router-link class="avatar-anchor" :href="`/${_user.username}`">
+ <router-link class="avatar-anchor" :to="`/${_user.username}`">
<img class="avatar" :src="`${_user.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
</router-link>
<div class="body">
- <a class="name" :href="`/${_user.username}`" v-user-preview="_user.id">{{ _user.name }}</a>
+ <router-link class="name" :to="`/${_user.username}`" v-user-preview="_user.id">{{ _user.name }}</router-link>
<p class="username">@{{ _user.username }}</p>
</div>
<mk-follow-button :user="_user"/>