diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-27 16:11:53 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-27 16:11:53 +0100 |
commit | 4635f59d7c3fea4b97029f10886c62fdf38b2084 (patch) | |
tree | d97357a00042bbfb33c4177ee24c01171d28dfce /client/src/app/videos/+video-watch/modal/video-share.component.ts | |
parent | ea44f375f5d3da06ca0aebfe871b9f924a26ec29 (diff) | |
download | PeerTube-4635f59d7c3fea4b97029f10886c62fdf38b2084.tar.gz PeerTube-4635f59d7c3fea4b97029f10886c62fdf38b2084.tar.zst PeerTube-4635f59d7c3fea4b97029f10886c62fdf38b2084.zip |
Add video comment components
Diffstat (limited to 'client/src/app/videos/+video-watch/modal/video-share.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/modal/video-share.component.ts | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.ts b/client/src/app/videos/+video-watch/modal/video-share.component.ts new file mode 100644 index 000000000..678cccfb5 --- /dev/null +++ b/client/src/app/videos/+video-watch/modal/video-share.component.ts | |||
@@ -0,0 +1,48 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | ||
2 | |||
3 | import { NotificationsService } from 'angular2-notifications' | ||
4 | |||
5 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
6 | import { VideoDetails } from '../../../shared/video/video-details.model' | ||
7 | |||
8 | @Component({ | ||
9 | selector: 'my-video-share', | ||
10 | templateUrl: './video-share.component.html', | ||
11 | styleUrls: [ './video-share.component.scss' ] | ||
12 | }) | ||
13 | export class VideoShareComponent { | ||
14 | @Input() video: VideoDetails = null | ||
15 | |||
16 | @ViewChild('modal') modal: ModalDirective | ||
17 | |||
18 | constructor (private notificationsService: NotificationsService) { | ||
19 | // empty | ||
20 | } | ||
21 | |||
22 | show () { | ||
23 | this.modal.show() | ||
24 | } | ||
25 | |||
26 | hide () { | ||
27 | this.modal.hide() | ||
28 | } | ||
29 | |||
30 | getVideoIframeCode () { | ||
31 | return '<iframe width="560" height="315" ' + | ||
32 | 'src="' + this.video.embedUrl + '" ' + | ||
33 | 'frameborder="0" allowfullscreen>' + | ||
34 | '</iframe>' | ||
35 | } | ||
36 | |||
37 | getVideoUrl () { | ||
38 | return window.location.href | ||
39 | } | ||
40 | |||
41 | notSecure () { | ||
42 | return window.location.protocol === 'http:' | ||
43 | } | ||
44 | |||
45 | activateCopiedMessage () { | ||
46 | this.notificationsService.success('Success', 'Copied') | ||
47 | } | ||
48 | } | ||