diff options
author | Julien Lemaire <sticmac@outlook.fr> | 2017-12-11 11:59:39 -0500 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-11 17:59:39 +0100 |
commit | c7e1e432b0e5d321ff2331cf3ddff56c43500788 (patch) | |
tree | 753cdd499a0f04059869a96f41fb6a20d8eef258 /client/src/app/videos/+video-watch/video-share.component.ts | |
parent | ed9f9f5fb04437b8dcf164fd0ae9c29b90826096 (diff) | |
download | PeerTube-c7e1e432b0e5d321ff2331cf3ddff56c43500788.tar.gz PeerTube-c7e1e432b0e5d321ff2331cf3ddff56c43500788.tar.zst PeerTube-c7e1e432b0e5d321ff2331cf3ddff56c43500788.zip |
Copy to clipboard (#142)
* Copy buttons on share view
Ugly but working buttons to copy video url and video iframe code.
Add ngx-clipboard dependency to allow easy copy to clipboard directive.
* Designed copy buttons
Using some css (scss) rules to make buttons look better.
* First version on copy feedback
Little success alert message on copy.
Fix lint errors
Move dependencies to dev dependencies
* Update button design
* Use of notifications service
Provides feedback of copy action to the user through the
angular2-notifications module.
Diffstat (limited to 'client/src/app/videos/+video-watch/video-share.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/video-share.component.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/client/src/app/videos/+video-watch/video-share.component.ts b/client/src/app/videos/+video-watch/video-share.component.ts index 4df9adf29..0664c28be 100644 --- a/client/src/app/videos/+video-watch/video-share.component.ts +++ b/client/src/app/videos/+video-watch/video-share.component.ts | |||
@@ -1,17 +1,21 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | 1 | import { Component, Input, ViewChild } from '@angular/core' |
2 | |||
3 | import { NotificationsService } from 'angular2-notifications' | ||
4 | |||
2 | import { ModalDirective } from 'ngx-bootstrap/modal' | 5 | import { ModalDirective } from 'ngx-bootstrap/modal' |
3 | import { VideoDetails } from '../../shared/video/video-details.model' | 6 | import { VideoDetails } from '../../shared/video/video-details.model' |
4 | 7 | ||
5 | @Component({ | 8 | @Component({ |
6 | selector: 'my-video-share', | 9 | selector: 'my-video-share', |
7 | templateUrl: './video-share.component.html' | 10 | templateUrl: './video-share.component.html', |
11 | styleUrls: [ './video-share.component.scss' ] | ||
8 | }) | 12 | }) |
9 | export class VideoShareComponent { | 13 | export class VideoShareComponent { |
10 | @Input() video: VideoDetails = null | 14 | @Input() video: VideoDetails = null |
11 | 15 | ||
12 | @ViewChild('modal') modal: ModalDirective | 16 | @ViewChild('modal') modal: ModalDirective |
13 | 17 | ||
14 | constructor () { | 18 | constructor (private notificationsService: NotificationsService) { |
15 | // empty | 19 | // empty |
16 | } | 20 | } |
17 | 21 | ||
@@ -37,4 +41,8 @@ export class VideoShareComponent { | |||
37 | notSecure () { | 41 | notSecure () { |
38 | return window.location.protocol === 'http:' | 42 | return window.location.protocol === 'http:' |
39 | } | 43 | } |
44 | |||
45 | activateCopiedMessage () { | ||
46 | this.notificationsService.success('Success', 'Copied') | ||
47 | } | ||
40 | } | 48 | } |