diff --git a/client/listeners/index.js b/client/listeners/index.js index 7011e78b..a155300a 100644 --- a/client/listeners/index.js +++ b/client/listeners/index.js @@ -9,6 +9,8 @@ const getRange = require('./get-range'); const getIndex = currify(require('./get-index')); +const {writeText} = require('@cloudcmd/clipboard'); + const uploadFiles = require('../dom/upload-files'); const { @@ -52,7 +54,6 @@ const execAll = currify((funcs, event) => { }); const Info = DOM.CurrentInfo; -const Storage = DOM.Storage; const Events = DOM.Events; const EventsFiles = { mousedown: exec.with(execIfNotUL, setCurrentFileByEvent), @@ -187,7 +188,6 @@ function decodePath(path){ .replace('%%', '%25%') .replace(NBSP_REG, SPACE) || '/'; } - function onPathElementClick(panel, event) { event.preventDefault(); @@ -196,8 +196,8 @@ function onPathElementClick(panel, event) { const attr = element.getAttribute('data-name'); const noCurrent = isNoCurrent(panel); - if (attr === 'js-clear-storage') - return Storage.clear(); + if (attr === 'js-copy-path') + return copyPath(element); if (attr === 'js-refresh') return CloudCmd.refresh({ @@ -218,6 +218,12 @@ function onPathElementClick(panel, event) { }); } +function copyPath(el) { + writeText(el.parentElement.title) + .then(CloudCmd.log) + .catch(CloudCmd.log); +} + function execIfNotUL(callback, event) { const {target} = event; const {tagName} = target; diff --git a/css/icons.css b/css/icons.css index aece5439..4f979db7 100644 --- a/css/icons.css +++ b/css/icons.css @@ -98,7 +98,7 @@ content : '\e814 '; } -.icon-clear::before { +.icon-copy-to-clipboard::before { font-family : 'Fontello'; content : '\e815 '; } diff --git a/font/fontello.eot b/font/fontello.eot index ae073b83..4d36373c 100644 Binary files a/font/fontello.eot and b/font/fontello.eot differ diff --git a/font/fontello.svg b/font/fontello.svg index d57b1f5d..3021d29a 100644 --- a/font/fontello.svg +++ b/font/fontello.svg @@ -1,7 +1,7 @@ -Copyright (C) 2017 by original authors @ fontello.com +Copyright (C) 2018 by original authors @ fontello.com @@ -48,7 +48,7 @@ - + @@ -59,8 +59,6 @@ - - \ No newline at end of file diff --git a/font/fontello.ttf b/font/fontello.ttf index e79f2905..5a240774 100644 Binary files a/font/fontello.ttf and b/font/fontello.ttf differ diff --git a/font/fontello.woff b/font/fontello.woff index 61c5a5f4..b2dbf703 100644 Binary files a/font/fontello.woff and b/font/fontello.woff differ diff --git a/font/fontello.woff2 b/font/fontello.woff2 index b4d6b0af..ea3eb4c9 100644 Binary files a/font/fontello.woff2 and b/font/fontello.woff2 differ diff --git a/test/common/cloudfunc.js b/test/common/cloudfunc.js index 958cfcc1..98625a0a 100644 --- a/test/common/cloudfunc.js +++ b/test/common/cloudfunc.js @@ -56,8 +56,8 @@ const JSON_FILES = { let Expect = '
' + - '' + + '' + '' + '' + diff --git a/tmpl/fs/path.hbs b/tmpl/fs/path.hbs index a985a7ef..b1a5e148 100644 --- a/tmpl/fs/path.hbs +++ b/tmpl/fs/path.hbs @@ -1 +1 @@ -
{{ path }}
\ No newline at end of file +
{{ path }}
\ No newline at end of file