aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/modal/video-support.component.ts
blob: bd5290a721666ce36275ab26f1df3eec23661c34 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
                                                           

                                                      
                                                     








                                                 
                                                       


                       


                                             
       

           
                                                                           


                                                                   

                   

   
import { Component, Input, ViewChild } from '@angular/core'
import { MarkdownService } from '@app/core'
import { VideoDetails } from '@app/shared/shared-main'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'

@Component({
  selector: 'my-video-support',
  templateUrl: './video-support.component.html',
  styleUrls: [ './video-support.component.scss' ]
})
export class VideoSupportComponent {
  @Input() video: VideoDetails = null

  @ViewChild('modal', { static: true }) modal: NgbModal

  videoHTMLSupport = ''

  constructor (
    private markdownService: MarkdownService,
    private modalService: NgbModal
  ) { }

  show () {
    const modalRef = this.modalService.open(this.modal, { centered: true })

    this.markdownService.enhancedMarkdownToHTML(this.video.support)
      .then(r => this.videoHTMLSupport = r)

    return modalRef
  }
}