From 390574cd7a14ca8e0109175747018e34a23ab28b Mon Sep 17 00:00:00 2001 From: AhyoungRyu Date: Tue, 13 Dec 2016 14:26:18 +0900 Subject: [PATCH 1/6] Add 'copy to clipboard' next to the paragraph id --- zeppelin-web/bower.json | 3 +- zeppelin-web/src/app/app.js | 9 +++-- .../notebook/paragraph/paragraph-control.html | 17 +++++++-- .../src/app/notebook/paragraph/paragraph.css | 9 ++++- zeppelin-web/src/assets/images/clippy.svg | 3 ++ .../clipboard/clipboard.controller.js | 36 +++++++++++++++++++ zeppelin-web/src/index.html | 2 ++ zeppelin-web/test/karma.conf.js | 1 + 8 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 zeppelin-web/src/assets/images/clippy.svg create mode 100644 zeppelin-web/src/components/clipboard/clipboard.controller.js diff --git a/zeppelin-web/bower.json b/zeppelin-web/bower.json index 06d01451b8f..bc59d691bde 100644 --- a/zeppelin-web/bower.json +++ b/zeppelin-web/bower.json @@ -34,7 +34,8 @@ "moment-duration-format": "^1.3.0", "select2": "^4.0.3", "github-markdown-css": "^2.4.0", - "MathJax": "2.7.0" + "MathJax": "2.7.0", + "angular-zeroclipboard": "^0.8.0" }, "devDependencies": { "angular-mocks": "1.5.0" diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js index c1a73c746dc..70dab597fcd 100644 --- a/zeppelin-web/src/app/app.js +++ b/zeppelin-web/src/app/app.js @@ -33,7 +33,8 @@ 'xeditable', 'ngToast', 'focus-if', - 'ngResource' + 'ngResource', + 'zeroclipboard' ]) .filter('breakFilter', function() { return function(text) { @@ -42,7 +43,7 @@ } }; }) - .config(function($httpProvider, $routeProvider, ngToastProvider) { + .config(function($httpProvider, $routeProvider, ngToastProvider, uiZeroclipConfigProvider) { // withCredentials when running locally via grunt $httpProvider.defaults.withCredentials = true; @@ -101,6 +102,10 @@ combineDuplications: true, timeout: 6000 }); + + uiZeroclipConfigProvider.setZcConf({ + swfPath: '../bower_components/zeroclipboard/dist/ZeroClipboard.swf' + }); }); function auth() { diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html b/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html index 699ef4ceca3..92279d2dd88 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html @@ -38,9 +38,20 @@ data-toggle="dropdown" type="button"> -