aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/modal/video-share.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-27 16:11:53 +0100
committerChocobozzz <me@florianbigard.com>2017-12-27 16:11:53 +0100
commit4635f59d7c3fea4b97029f10886c62fdf38b2084 (patch)
treed97357a00042bbfb33c4177ee24c01171d28dfce /client/src/app/videos/+video-watch/modal/video-share.component.ts
parentea44f375f5d3da06ca0aebfe871b9f924a26ec29 (diff)
downloadPeerTube-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.ts48
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 @@
1import { Component, Input, ViewChild } from '@angular/core'
2
3import { NotificationsService } from 'angular2-notifications'
4
5import { ModalDirective } from 'ngx-bootstrap/modal'
6import { 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})
13export 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}