From ee35c1d1515a6c2355d5594b542370e63a8d007e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Wed, 4 Dec 2019 12:46:56 +0000 Subject: [PATCH] display share link in textarea --- customize.dist/src/less2/include/alertify.less | 7 +++++++ www/common/common-interface.js | 12 ++++++++++++ www/common/common-ui-elements.js | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index 585627a28..354b29174 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -233,6 +233,13 @@ } } + textarea { + overflow: hidden; + &[readonly] { + resize: none; + } + } + span.cp-password-container { display: flex; align-items: center; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 8efc7397a..8dc14cc8c 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -127,6 +127,18 @@ define([ return input; }; + dialog.selectableArea = function (value, opt) { + var attrs = merge({ + readonly: 'readonly', + }, opt); + + var input = h('textarea', attrs); + $(input).val(value).click(function () { + input.select(); + }); + return input; + }; + dialog.okButton = function (content, classString) { var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.ok.primary'; return h(sel, { tabindex: '2', }, content || Messages.okButton); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 76d296606..fd64571ab 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1088,7 +1088,7 @@ define([ h('br'), ]; - linkContent.push(UI.dialog.selectable('', { id: 'cp-share-link-preview', tabindex: 1 })); + linkContent.push(UI.dialog.selectableArea('', { id: 'cp-share-link-preview', tabindex: 1, rows:3})); // Show alert if the pad is password protected if (hasPassword) {