GUACAMOLE-1740: Don't display clipboard contents in the clipboard editor until it is focused on.

This commit is contained in:
Alex Leitner
2023-02-22 18:47:29 +00:00
parent 72b0634a5f
commit 2c15f3d21f
5 changed files with 38 additions and 6 deletions

View File

@@ -49,11 +49,29 @@ angular.module('clipboard').directive('guacClipboard', ['$injector',
/**
* The DOM element which will contain the clipboard contents within the
* user interface provided by this directive.
* user interface provided by this directive. We populate the clipboard
* editor via this DOM element rather than updating a model so that we
* are prepared for future support of rich text contents.
*
* @type Element
*/
var element = $element[0];
var element = $element[0].querySelectorAll('.clipboard.active')[0];
/**
* When isActive is set to true then the Clipboard data will be
* displayed in the Clipboard Editor. When false, the Clipboard Editor
* will not be displayed with Clipboard data.
*
* @type Boolean
*/
$scope.isActive = false;
/**
* Updates clipboard editor to be active.
*/
$scope.setActive = function setActive() {
$scope.isActive = true;
};
/**
* Rereads the contents of the clipboard field, updating the

View File

@@ -31,8 +31,6 @@
width: 100%;
height: 2in;
white-space: pre;
font-size: 1em;
overflow: auto;
padding: 0.25em;
}
@@ -59,3 +57,14 @@
white-space: pre;
overflow: hidden;
}
.active {
overflow: auto;
font-size: 1em;
}
.inactive {
overflow: hidden;
font-size: 0.9em;
opacity: 0.5;
}

View File

@@ -1 +1,4 @@
<textarea class="clipboard"></textarea>
<div>
<textarea ng-show="isActive" class="clipboard active"></textarea>
<textarea ng-show="!isActive" class="clipboard inactive" ng-focus="setActive()">{{'CLIENT.TEXT_CLIPBOARD_AWAITING_FOCUS' | translate}}</textarea>
</div>

View File

@@ -162,6 +162,7 @@
"TEXT_USER_LEFT" : "{USERNAME} has left the connection.",
"TEXT_RECONNECT_COUNTDOWN" : "Reconnecting in {REMAINING} {REMAINING, plural, one{second} other{seconds}}...",
"TEXT_FILE_TRANSFER_PROGRESS" : "{PROGRESS} {UNIT, select, b{B} kb{KB} mb{MB} gb{GB} other{}}",
"TEXT_CLIPBOARD_AWAITING_FOCUS" : "Click to view clipboard data...",
"URL_OSK_LAYOUT" : "layouts/en-us-qwerty.json"

View File

@@ -132,7 +132,8 @@
"TEXT_CLIENT_STATUS_DISCONNECTED" : "切断されました。",
"TEXT_CLIENT_STATUS_UNSTABLE" : "Guacamoleサーバへのネットワーク接続が不安定です。",
"TEXT_CLIENT_STATUS_WAITING" : "Guacamoleサーバに接続しました。応答を待っています",
"TEXT_RECONNECT_COUNTDOWN" : "再接続しています... {REMAINING} {REMAINING, plural, one{second} other{seconds}}..."
"TEXT_RECONNECT_COUNTDOWN" : "再接続しています... {REMAINING} {REMAINING, plural, one{second} other{seconds}}...",
"TEXT_CLIPBOARD_AWAITING_FOCUS" : "クリックをしてコピー/カットされたテキストが表示されます..."
},