From c7e1e432b0e5d321ff2331cf3ddff56c43500788 Mon Sep 17 00:00:00 2001 From: Julien Lemaire Date: Mon, 11 Dec 2017 11:59:39 -0500 Subject: [PATCH] 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. --- client/package.json | 1 + client/src/app/app.component.scss | 5 +++++ .../+video-watch/video-share.component.html | 18 ++++++++++++++++-- .../+video-watch/video-share.component.scss | 3 +++ .../+video-watch/video-share.component.ts | 12 ++++++++++-- .../videos/+video-watch/video-watch.module.ts | 4 +++- client/yarn.lock | 10 ++++++++++ 7 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 client/src/app/videos/+video-watch/video-share.component.scss diff --git a/client/package.json b/client/package.json index 45f555f29..7441d15ec 100644 --- a/client/package.json +++ b/client/package.json @@ -71,6 +71,7 @@ "ngc-webpack": "3.2.2", "ngx-bootstrap": "2.0.0-beta.9", "ngx-chips": "1.5.3", + "ngx-clipboard": "^9.0.0", "ngx-infinite-scroll": "^0.7.0", "ngx-pipes": "^2.0.5", "node-sass": "^4.1.1", diff --git a/client/src/app/app.component.scss b/client/src/app/app.component.scss index 008c6d1f0..c0ec2025d 100644 --- a/client/src/app/app.component.scss +++ b/client/src/app/app.component.scss @@ -86,3 +86,8 @@ footer { margin-top: $footer-margin; height: $footer-height; } + +simple-notifications { + position: relative; + z-index: 1500; +} diff --git a/client/src/app/videos/+video-watch/video-share.component.html b/client/src/app/videos/+video-watch/video-share.component.html index 36ec38d88..52ee36a2e 100644 --- a/client/src/app/videos/+video-watch/video-share.component.html +++ b/client/src/app/videos/+video-watch/video-share.component.html @@ -12,12 +12,26 @@