summaryrefslogtreecommitdiff
path: root/src/web/app/desktop/views/components
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-02-26 00:39:05 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-02-26 00:39:05 +0900
commit3ae824c3542b0e232b9847ae702956e631acb276 (patch)
treefe6183d41238471019539c4e4c14ccde995d8222 /src/web/app/desktop/views/components
parentv3886 (diff)
downloadmisskey-3ae824c3542b0e232b9847ae702956e631acb276.tar.gz
misskey-3ae824c3542b0e232b9847ae702956e631acb276.tar.bz2
misskey-3ae824c3542b0e232b9847ae702956e631acb276.zip
:v:
Diffstat (limited to 'src/web/app/desktop/views/components')
-rw-r--r--src/web/app/desktop/views/components/post-detail.vue29
-rw-r--r--src/web/app/desktop/views/components/posts.post.vue35
-rw-r--r--src/web/app/desktop/views/components/timeline.vue14
3 files changed, 74 insertions, 4 deletions
diff --git a/src/web/app/desktop/views/components/post-detail.vue b/src/web/app/desktop/views/components/post-detail.vue
index c453867dfb..1e31752fe7 100644
--- a/src/web/app/desktop/views/components/post-detail.vue
+++ b/src/web/app/desktop/views/components/post-detail.vue
@@ -44,6 +44,9 @@
<mk-images :images="p.media"/>
</div>
<mk-poll v-if="p.poll" :post="p"/>
+ <div class="tags" v-if="p.tags && p.tags.length > 0">
+ <router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=${tag}`">{{ tag }}</router-link>
+ </div>
</div>
<footer>
<mk-reactions-viewer :post="p"/>
@@ -306,6 +309,32 @@ export default Vue.extend({
> .mk-url-preview
margin-top 8px
+ > .tags
+ > *
+ margin 0 8px 0 0
+ padding 0 8px 0 16px
+ font-size 90%
+ color #8d969e
+ background #edf0f3
+ border-radius 4px
+
+ &:before
+ content ""
+ display block
+ position absolute
+ top 0
+ bottom 0
+ left 4px
+ width 8px
+ height 8px
+ margin auto 0
+ background #fff
+ border-radius 100%
+
+ &:hover
+ text-decoration none
+ background #e2e7ec
+
> footer
font-size 1.2em
diff --git a/src/web/app/desktop/views/components/posts.post.vue b/src/web/app/desktop/views/components/posts.post.vue
index 4898de0b6b..382a8de97d 100644
--- a/src/web/app/desktop/views/components/posts.post.vue
+++ b/src/web/app/desktop/views/components/posts.post.vue
@@ -38,6 +38,9 @@
</p>
<a class="reply" v-if="p.reply">%fa:reply%</a>
<mk-post-html v-if="p.ast" :ast="p.ast" :i="os.i" :class="$style.text"/>
+ <div class="tags" v-if="p.tags && p.tags.length > 0">
+ <router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=${tag}`">{{ tag }}</router-link>
+ </div>
<a class="quote" v-if="p.repost">RP:</a>
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
</div>
@@ -342,9 +345,9 @@ export default Vue.extend({
display block
float left
margin 0 16px 10px 0
- position -webkit-sticky
- position sticky
- top 74px
+ //position -webkit-sticky
+ //position sticky
+ //top 74px
> .avatar
display block
@@ -428,6 +431,32 @@ export default Vue.extend({
font-style oblique
color #a0bf46
+ > .tags
+ > *
+ margin 0 8px 0 0
+ padding 0 8px 0 16px
+ font-size 90%
+ color #8d969e
+ background #edf0f3
+ border-radius 4px
+
+ &:before
+ content ""
+ display block
+ position absolute
+ top 0
+ bottom 0
+ left 4px
+ width 8px
+ height 8px
+ margin auto 0
+ background #fff
+ border-radius 100%
+
+ &:hover
+ text-decoration none
+ background #e2e7ec
+
> .mk-poll
font-size 80%
diff --git a/src/web/app/desktop/views/components/timeline.vue b/src/web/app/desktop/views/components/timeline.vue
index eef62104eb..0d16d60df9 100644
--- a/src/web/app/desktop/views/components/timeline.vue
+++ b/src/web/app/desktop/views/components/timeline.vue
@@ -24,6 +24,7 @@ export default Vue.extend({
return {
fetching: true,
moreFetching: false,
+ existMore: false,
posts: [],
connection: null,
connectionId: null,
@@ -62,8 +63,13 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('posts/timeline', {
+ limit: 11,
until_date: this.date ? this.date.getTime() : undefined
}).then(posts => {
+ if (posts.length == 11) {
+ posts.pop();
+ this.existMore = true;
+ }
this.posts = posts;
this.fetching = false;
this.$emit('loaded');
@@ -71,11 +77,17 @@ export default Vue.extend({
});
},
more() {
- if (this.moreFetching || this.fetching || this.posts.length == 0) return;
+ if (this.moreFetching || this.fetching || this.posts.length == 0 || !this.existMore) return;
this.moreFetching = true;
(this as any).api('posts/timeline', {
+ limit: 11,
until_id: this.posts[this.posts.length - 1].id
}).then(posts => {
+ if (posts.length == 11) {
+ posts.pop();
+ } else {
+ this.existMore = false;
+ }
this.posts = this.posts.concat(posts);
this.moreFetching = false;
});