summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-18 01:16:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-18 01:16:32 +0900
commitbc3006f3c41297536788ec20ea012ba0a4d0ee24 (patch)
tree66878ca481de7e0005bfd6bb91c7d027d018511d /src/web
parentnanka iroiro (diff)
downloadsharkey-bc3006f3c41297536788ec20ea012ba0a4d0ee24.tar.gz
sharkey-bc3006f3c41297536788ec20ea012ba0a4d0ee24.tar.bz2
sharkey-bc3006f3c41297536788ec20ea012ba0a4d0ee24.zip
#277
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/scripts/text-compiler.js4
-rw-r--r--src/web/app/desktop/tags/post-detail.tag14
-rw-r--r--src/web/app/desktop/tags/timeline-post.tag14
-rw-r--r--src/web/app/mobile/tags/post-detail.tag14
-rw-r--r--src/web/app/mobile/tags/timeline-post.tag14
5 files changed, 51 insertions, 9 deletions
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 ? '<br>' : ' ');
case 'bold':
return '<strong>' + escape(token.bold) + '</strong>';
- case 'link':
+ case 'url':
return '<mk-url href="' + escape(token.content) + '" target="_blank"></mk-url>';
+ case 'link':
+ return '<a class="link" href="' + escape(token.url) + '" target="_blank">' + escape(token.title) + '</a>';
case 'mention':
return '<a href="' + CONFIG.url + '/' + escape(token.username) + '" target="_blank" data-user-preview="' + token.content + '" ' + (me && me.username == token.username ? 'data-is-me' : '') + '>' + token.content + '</a>';
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
});
});
}