aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/comment
diff options
context:
space:
mode:
authorLesterpig <git@lesterpig.com>2019-10-02 21:17:10 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-12-17 09:45:02 +0100
commitd68ebf0b4a40f88e53a78de6b3109a41466fa7c6 (patch)
treebbe02b16b88351b354c99f959c888d36444e719c /client/src/app/videos/+video-watch/comment
parenta0dedc02ca870a31298eb35d5105a1ebc34dbb4a (diff)
downloadPeerTube-d68ebf0b4a40f88e53a78de6b3109a41466fa7c6.tar.gz
PeerTube-d68ebf0b4a40f88e53a78de6b3109a41466fa7c6.tar.zst
PeerTube-d68ebf0b4a40f88e53a78de6b3109a41466fa7c6.zip
Add hyperlink video timestamps in description
Fix #1312 (duplicates: #1728 and #2007) The modification is also applied to comments and video editing.
Diffstat (limited to 'client/src/app/videos/+video-watch/comment')
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.component.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
index 23ff20aad..d5e3ecc17 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
@@ -4,7 +4,7 @@ import { VideoCommentThreadTree } from '../../../../../../shared/models/videos/v
4import { AuthService } from '../../../core/auth' 4import { AuthService } from '../../../core/auth'
5import { Video } from '../../../shared/video/video.model' 5import { Video } from '../../../shared/video/video.model'
6import { VideoComment } from './video-comment.model' 6import { VideoComment } from './video-comment.model'
7import { MarkdownService } from '@app/shared/renderer' 7import { HtmlRendererService, MarkdownService } from '@app/shared/renderer'
8 8
9@Component({ 9@Component({
10 selector: 'my-video-comment', 10 selector: 'my-video-comment',
@@ -28,6 +28,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
28 newParentComments: VideoComment[] = [] 28 newParentComments: VideoComment[] = []
29 29
30 constructor ( 30 constructor (
31 private htmlRenderer: HtmlRendererService,
31 private markdownService: MarkdownService, 32 private markdownService: MarkdownService,
32 private authService: AuthService 33 private authService: AuthService
33 ) {} 34 ) {}
@@ -78,7 +79,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
78 } 79 }
79 80
80 isRemovableByUser () { 81 isRemovableByUser () {
81 return this.comment.account && this.isUserLoggedIn() && 82 return this.isUserLoggedIn() &&
82 ( 83 (
83 this.user.account.id === this.comment.account.id || 84 this.user.account.id === this.comment.account.id ||
84 this.user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT) 85 this.user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT)
@@ -86,8 +87,8 @@ export class VideoCommentComponent implements OnInit, OnChanges {
86 } 87 }
87 88
88 private async init () { 89 private async init () {
89 this.sanitizedCommentHTML = await this.markdownService.textMarkdownToHTML(this.comment.text, true) 90 const safeHTML = await this.htmlRenderer.toSafeHtml(this.comment.text)
90 91 this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(safeHTML)
91 this.newParentComments = this.parentComments.concat([ this.comment ]) 92 this.newParentComments = this.parentComments.concat([ this.comment ])
92 } 93 }
93} 94}