summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-19 15:23:52 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-19 15:23:52 +0900
commitc072232e679029dbef8e5891d58d15ebf6426db0 (patch)
treed353561f71b25ea740b156483148121fe62c8131 /src
parent[API] Better public timeline api (BREAKING) (diff)
downloadsharkey-c072232e679029dbef8e5891d58d15ebf6426db0.tar.gz
sharkey-c072232e679029dbef8e5891d58d15ebf6426db0.tar.bz2
sharkey-c072232e679029dbef8e5891d58d15ebf6426db0.zip
[Client] Follow api changes and some improvements
Diffstat (limited to 'src')
-rw-r--r--src/web/app/common/tags/public-timeline.tag24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/web/app/common/tags/public-timeline.tag b/src/web/app/common/tags/public-timeline.tag
index c39a231813..98b1a12a7c 100644
--- a/src/web/app/common/tags/public-timeline.tag
+++ b/src/web/app/common/tags/public-timeline.tag
@@ -2,7 +2,6 @@
<inside-renderer each="{ posts }"></inside-renderer>
<style>
:scope
-
display block
</style>
<script>
@@ -14,8 +13,10 @@
this.on('mount', () => {
this.api('posts', {
limit: 5,
- include_reposts: false,
- include_replies: false
+ repost: false,
+ reply: false,
+ media: false,
+ poll: false
}).then(posts => {
this.update({
isFetching: false,
@@ -90,8 +91,21 @@
import compile from '../../common/scripts/text-compiler';
this.on('mount', () => {
- const text = compile(this.ast);
- this.refs.text.innerHTML = text;
+ const html = compile(this.ast);
+ this.refs.text.innerHTML = html;
+
+ this.refs.text.children.forEach(e => {
+ if (e.tagName == 'MK-URL') riot.mount(e);
+ });
+
+ // URLをプレビュー
+ this.ast
+ .filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
+ .map(t => {
+ riot.mount(this.refs.text.appendChild(document.createElement('mk-url-preview')), {
+ url: t.url
+ });
+ });
});
</script>
</inside-renderer>