From bc3006f3c41297536788ec20ea012ba0a4d0ee24 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Mar 2017 01:16:32 +0900 Subject: #277 --- src/web/app/common/scripts/text-compiler.js | 4 +++- src/web/app/desktop/tags/post-detail.tag | 14 ++++++++++++-- src/web/app/desktop/tags/timeline-post.tag | 14 ++++++++++++-- src/web/app/mobile/tags/post-detail.tag | 14 ++++++++++++-- src/web/app/mobile/tags/timeline-post.tag | 14 ++++++++++++-- 5 files changed, 51 insertions(+), 9 deletions(-) (limited to 'src/web') diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js index 2edffbb766..d4570ca923 100644 --- a/src/web/app/common/scripts/text-compiler.js +++ b/src/web/app/common/scripts/text-compiler.js @@ -21,8 +21,10 @@ module.exports = (tokens, shouldBreak) => { .replace(/(\r\n|\n|\r)/g, shouldBreak ? '
' : ' '); case 'bold': return '' + escape(token.bold) + ''; - case 'link': + case 'url': return ''; + case 'link': + return '' + escape(token.title) + ''; case 'mention': return '' + token.content + ''; case 'hashtag': // TODO diff --git a/src/web/app/desktop/tags/post-detail.tag b/src/web/app/desktop/tags/post-detail.tag index 69379317fc..ca2d59f2e2 100644 --- a/src/web/app/desktop/tags/post-detail.tag +++ b/src/web/app/desktop/tags/post-detail.tag @@ -233,6 +233,16 @@ font-size 1.5em color #717171 + .link + &:after + content "\f14c" + display inline-block + padding-left 2px + font-family FontAwesome + font-size .9em + font-weight 400 + font-style normal + > mk-url-preview margin-top 8px @@ -367,10 +377,10 @@ // URLをプレビュー tokens - .filter(t => t.type == 'link') + .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.content + url: t.url }); }); } diff --git a/src/web/app/desktop/tags/timeline-post.tag b/src/web/app/desktop/tags/timeline-post.tag index 9a1dede2da..8929a8dd5a 100644 --- a/src/web/app/desktop/tags/timeline-post.tag +++ b/src/web/app/desktop/tags/timeline-post.tag @@ -229,6 +229,16 @@ mk-url-preview margin-top 8px + .link + &:after + content "\f14c" + display inline-block + padding-left 2px + font-family FontAwesome + font-size .9em + font-weight 400 + font-style normal + > .reply margin-right 8px color #717171 @@ -344,10 +354,10 @@ // URLをプレビュー tokens - .filter(t => t.type == 'link') + .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.content + url: t.url }); }); } diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag index b32fe6173d..f6f6bb62db 100644 --- a/src/web/app/mobile/tags/post-detail.tag +++ b/src/web/app/mobile/tags/post-detail.tag @@ -230,6 +230,16 @@ @media (min-width 500px) font-size 24px + .link + &:after + content "\f14c" + display inline-block + padding-left 2px + font-family FontAwesome + font-size .9em + font-weight 400 + font-style normal + > mk-url-preview margin-top 8px @@ -368,10 +378,10 @@ // URLをプレビュー tokens - .filter(t => t.type == 'link') + .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.content + url: t.url }); }); } diff --git a/src/web/app/mobile/tags/timeline-post.tag b/src/web/app/mobile/tags/timeline-post.tag index 9da25b7b2f..f706dc7de6 100644 --- a/src/web/app/mobile/tags/timeline-post.tag +++ b/src/web/app/mobile/tags/timeline-post.tag @@ -209,6 +209,16 @@ > .dummy display none + .link + &:after + content "\f14c" + display inline-block + padding-left 2px + font-family FontAwesome + font-size .9em + font-weight 400 + font-style normal + mk-url-preview margin-top 8px @@ -318,10 +328,10 @@ // URLをプレビュー tokens - .filter(t => t.type == 'link') + .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.content + url: t.url }); }); } -- cgit v1.2.3-freya