diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/modal')
3 files changed, 61 insertions, 0 deletions
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.html b/client/src/app/videos/+video-watch/modal/video-support.component.html new file mode 100644 index 000000000..16ad9502a --- /dev/null +++ b/client/src/app/videos/+video-watch/modal/video-support.component.html | |||
@@ -0,0 +1,22 @@ | |||
1 | <div bsModal #modal="bs-modal" class="modal" tabindex="-1"> | ||
2 | <div class="modal-dialog"> | ||
3 | <div class="modal-content"> | ||
4 | |||
5 | <div class="modal-header"> | ||
6 | <span class="close" aria-hidden="true" (click)="hide()"></span> | ||
7 | <h4 class="modal-title">Support</h4> | ||
8 | </div> | ||
9 | |||
10 | <div class="modal-body"> | ||
11 | |||
12 | <div [innerHTML]="videoHTMLSupport"></div> | ||
13 | |||
14 | <div class="form-group inputs"> | ||
15 | <span class="action-button action-button-cancel" (click)="hide()"> | ||
16 | Cancel | ||
17 | </span> | ||
18 | </div> | ||
19 | </div> | ||
20 | </div> | ||
21 | </div> | ||
22 | </div> | ||
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.scss b/client/src/app/videos/+video-watch/modal/video-support.component.scss new file mode 100644 index 000000000..184e09027 --- /dev/null +++ b/client/src/app/videos/+video-watch/modal/video-support.component.scss | |||
@@ -0,0 +1,3 @@ | |||
1 | .action-button-cancel { | ||
2 | margin-right: 0 !important; | ||
3 | } | ||
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.ts b/client/src/app/videos/+video-watch/modal/video-support.component.ts new file mode 100644 index 000000000..f805215b9 --- /dev/null +++ b/client/src/app/videos/+video-watch/modal/video-support.component.ts | |||
@@ -0,0 +1,36 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | ||
2 | import { MarkdownService } from '@app/videos/shared' | ||
3 | |||
4 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
5 | import { VideoDetails } from '../../../shared/video/video-details.model' | ||
6 | |||
7 | @Component({ | ||
8 | selector: 'my-video-support', | ||
9 | templateUrl: './video-support.component.html', | ||
10 | styleUrls: [ './video-support.component.scss' ] | ||
11 | }) | ||
12 | export class VideoSupportComponent { | ||
13 | @Input() video: VideoDetails = null | ||
14 | |||
15 | @ViewChild('modal') modal: ModalDirective | ||
16 | |||
17 | videoHTMLSupport = '' | ||
18 | |||
19 | constructor (private markdownService: MarkdownService) { | ||
20 | // empty | ||
21 | } | ||
22 | |||
23 | show () { | ||
24 | this.modal.show() | ||
25 | |||
26 | if (this.video.support) { | ||
27 | this.videoHTMLSupport = this.markdownService.enhancedMarkdownToHTML(this.video.support) | ||
28 | } else { | ||
29 | this.videoHTMLSupport = '' | ||
30 | } | ||
31 | } | ||
32 | |||
33 | hide () { | ||
34 | this.modal.hide() | ||
35 | } | ||
36 | } | ||