completeVideoDescription: string
shortVideoDescription: string
videoHTMLDescription = ''
+ likesBarTooltipText = ''
private paramsSub: Subscription
removeVideo (event: Event) {
event.preventDefault()
- this.confirmService.confirm('Do you really want to delete this video?', 'Delete').subscribe(
- res => {
- if (res === false) return
+ this.confirmService.confirm('Do you really want to delete this video?', 'Delete')
+ .subscribe(
+ res => {
+ if (res === false) return
- this.videoService.removeVideo(this.video.id)
- .subscribe(
- status => {
- this.notificationsService.success('Success', `Video ${this.video.name} deleted.`)
+ this.videoService.removeVideo(this.video.id)
+ .subscribe(
+ status => {
+ this.notificationsService.success('Success', `Video ${this.video.name} deleted.`)
- // Go back to the video-list.
- this.router.navigate([ '/videos/list' ])
- },
+ // Go back to the video-list.
+ this.router.navigate([ '/videos/list' ])
+ },
- error => this.notificationsService.error('Error', error.text)
- )
- }
- )
+ error => this.notificationsService.error('Error', error.text)
+ )
+ }
+ )
}
private updateVideoDescription (description: string) {
this.videoHTMLDescription = this.markdownService.markdownToHTML(this.video.description)
}
+ private setVideoLikesBarTooltipText () {
+ this.likesBarTooltipText = `${this.video.likes} likes / ${this.video.dislikes} dislikes`
+ }
+
private handleError (err: any) {
const errorMessage: string = typeof err === 'string' ? err : err.message
let message = ''
}
this.setVideoDescriptionHTML()
+ this.setVideoLikesBarTooltipText()
this.setOpenGraphTags()
this.checkUserRating()
import { MarkdownService } from '../shared'
import { SharedModule } from '../../shared'
import { ClipboardModule } from 'ngx-clipboard'
+import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { VideoWatchComponent } from './video-watch.component'
import { VideoReportComponent } from './video-report.component'
imports: [
VideoWatchRoutingModule,
SharedModule,
- ClipboardModule
+ ClipboardModule,
+ TooltipModule.forRoot()
],
declarations: [
// Components w/ JavaScript
@import "~bootstrap-sass/assets/stylesheets/bootstrap/modals";
-//@import "~bootstrap-sass/assets/stylesheets/bootstrap/tooltip";
+@import "~bootstrap-sass/assets/stylesheets/bootstrap/tooltip";
//@import "~bootstrap-sass/assets/stylesheets/bootstrap/popovers";
//@import "~bootstrap-sass/assets/stylesheets/bootstrap/carousel";