Skip to content

Commit

Permalink
Merge patch branch changes to main.
Browse files Browse the repository at this point in the history
  • Loading branch information
necouchman committed Aug 25, 2024
2 parents 30716c6 + e11c761 commit ad3a007
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ angular.module('clipboard').directive('guacClipboard', ['$injector',
const ClipboardData = $injector.get('ClipboardData');

// Required services
const $window = $injector.get('$window');
const clipboardService = $injector.get('clipboardService');

/**
Expand All @@ -53,24 +54,28 @@ angular.module('clipboard').directive('guacClipboard', ['$injector',
* editor via this DOM element rather than updating a model so that we
* are prepared for future support of rich text contents.
*
* @type Element
* @type {!Element}
*/
var element = $element[0].querySelectorAll('.clipboard.active')[0];
var element = $element[0].querySelectorAll('.clipboard')[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.
* Whether clipboard contents should be displayed in the clipboard
* editor. If false, clipboard contents will not be displayed until
* the user manually reveals them.
*
* @type Boolean
* @type {!boolean}
*/
$scope.isActive = false;
$scope.contentsShown = false;

/**
* Updates clipboard editor to be active.
* Reveals the contents of the clipboard editor, automatically
* assigning input focus to the editor if possible.
*/
$scope.setActive = function setActive() {
$scope.isActive = true;
$scope.showContents = function showContents() {
$scope.contentsShown = true;
$window.setTimeout(function setFocus() {
element.focus();
}, 0);
};

/**
Expand Down
43 changes: 40 additions & 3 deletions guacamole/src/main/frontend/src/app/clipboard/styles/clipboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,50 @@
overflow: hidden;
}

#clipboard-settings .clipboard.active {
.clipboard-editor {
position: relative;
}

.clipboard-editor .clipboard {
overflow: auto;
font-size: 1em;
}

#clipboard-settings .clipboard.inactive {
.clipboard-editor .clipboard.clipboard-contents-hidden {
color: transparent;
overflow: hidden;
}

.clipboard-editor .clipboard-contents-hidden-hint {

position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;

cursor: pointer;

display: flex;
align-items: center;

}

.clipboard-editor .clipboard-contents-hidden-hint .clipboard-contents-hidden-hint-text {

flex: 1;

background: rgba(0, 0, 0, 0.125);
color: #888;

padding: 0.5em;
overflow: hidden;
font-size: 0.9em;
opacity: 0.5;
text-align: center;
font-style: italic;

}

.clipboard-editor .clipboard-contents-hidden-hint:hover .clipboard-contents-hidden-hint-text {
text-decoration: underline;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<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 class="clipboard-editor">
<textarea class="clipboard"
ng-class="{
'clipboard-contents-hidden' : !contentsShown
}"
ng-disabled="!contentsShown"></textarea>
<div class="clipboard-contents-hidden-hint"
ng-click="showContents()"
ng-show="!contentsShown">
<p class="clipboard-contents-hidden-hint-text">{{ 'CLIENT.ACTION_SHOW_CLIPBOARD' | translate }}</p>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ angular.module('home').controller('homeController', ['$scope', '$injector',
];

/**
* Returns true if recent connections should be displayed on the Guacamole
* home page, otherwise false.
* Returns whether the "Recent Connections" section should be displayed on
* the home screen.
*
* @returns {!boolean}
* true if recent connections should be displayed on the home screen,
* false otherwise.
*/
$scope.willShowRecentConnections = function willShowRecentConnections() {
$scope.isRecentConnectionsVisible = function isRecentConnectionsVisible() {
return preferenceService.preferences.showRecentConnections;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,6 @@ angular.module('home').directive('guacRecentConnections', [function guacRecentCo
&& guacHistory.removeEntry(recentConnection.entry.id));
};

/**
* Returns whether or not recent connections should be displayed.
*
* @returns {!boolean}
* true if recent connections should be displayed, otherwise false.
*/
$scope.willShowRecentConnections = function willShowRecentConnections() {
return preferenceService.preferences.showRecentConnections;
};

/**
* Returns whether recent connections are available for display.
*
Expand Down
12 changes: 7 additions & 5 deletions guacamole/src/main/frontend/src/app/home/styles/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ a.home-connection, .empty.balancer a.home-connection-group {
display: none;
}

.header-app-name {
font-size: 0.85em;
box-shadow: none;
.recent-connections .connection .remove-recent {
visibility: hidden;
}

.recent-connections .connection:hover .remove-recent {
visibility: visible;
}

.recent-connections .connection .remove-recent::after {
Expand All @@ -90,11 +93,10 @@ a.home-connection, .empty.balancer a.home-connection-group {
background-repeat: no-repeat;
background-size: contain;
background-position: center center;
background-image: url('images/x.svg');
background-image: url('images/x-black.svg');
}

.recent-connections .connection .remove-recent {
background-color: red;
height: 1em;
width: 1em;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="recent-connections" ng-show="willShowRecentConnections()">
<div class="recent-connections">

<!-- Text displayed if no recent connections exist -->
<p class="placeholder" ng-hide="hasRecentConnections()">{{'HOME.INFO_NO_RECENT_CONNECTIONS' | translate}}</p>
Expand Down
13 changes: 6 additions & 7 deletions guacamole/src/main/frontend/src/app/home/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

<div class="connection-list-ui">

<div class="header header-app-name">
<h2 id="section-header-app-name">{{'APP.NAME' | translate}}</h2>
<guac-user-menu></guac-user-menu>
</div>

<!-- The recent connections for this user -->
<div class="header" ng-show="willShowRecentConnections()">
<div class="header" ng-show="isRecentConnectionsVisible()">
<h2 id="section-header-recent-connections">{{'HOME.SECTION_HEADER_RECENT_CONNECTIONS' | translate}}</h2>
<guac-user-menu></guac-user-menu>
</div>
<guac-recent-connections root-groups="rootConnectionGroups" ng-show="willShowRecentConnections()"></guac-recent-connections>
<guac-recent-connections
root-groups="rootConnectionGroups"
ng-show="isRecentConnectionsVisible()"></guac-recent-connections>

<!-- All connections for this user -->
<div class="header">
Expand All @@ -21,6 +19,7 @@ <h2 id="section-header-all-connections">{{'HOME.SECTION_HEADER_ALL_CONNECTIONS'
placeholder="'HOME.FIELD_PLACEHOLDER_FILTER' | translate"
connection-properties="filteredConnectionProperties"
connection-group-properties="filteredConnectionGroupProperties"></guac-group-list-filter>
<guac-user-menu></guac-user-menu>
</div>
<div class="all-connections">
<guac-group-list
Expand Down
9 changes: 6 additions & 3 deletions guacamole/src/main/frontend/src/app/index/styles/headers.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ h2 {
margin-bottom: 0;
}

.header ~ * .header,
.header ~ .header {
margin-top: 0;
.header:not(.ng-hide) ~ * .header,
.header:not(.ng-hide) ~ .header {
border-top: 1px solid rgba(0, 0, 0, 0.125);
}

Expand All @@ -106,3 +105,7 @@ h2 {
border-left: 1px solid rgba(0, 0, 0, 0.125);
background-color: transparent;
}

.header:not(.ng-hide) ~ .header .user-menu {
display: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,25 @@
<p>{{'SETTINGS_PREFERENCES.HELP_LOCALE' | translate}}</p>
<guac-form content="localeFields" model="preferences" namespace="'SETTINGS_PREFERENCES'"></guac-form>
</div>


<!-- Appearance -->
<h2 class="header">{{'SETTINGS_PREFERENCES.SECTION_HEADER_APPEARANCE' | translate}}</h2>
<div class="settings section appearance">
<p>{{'SETTINGS_PREFERENCES.HELP_APPEARANCE' | translate}}</p>
<div class='form'>
<table class='fields'>
<tr>
<th>{{'SETTINGS_PREFERENCES.FIELD_HEADER_SHOW_RECENT_CONNECTIONS' | translate}}</th>
<td><input ng-model="preferences.showRecentConnections" type="checkbox"/></td>
</tr>
<tr>
<th>{{'SETTINGS_PREFERENCES.FIELD_HEADER_NUMBER_RECENT_CONNECTIONS' | translate}}</th>
<td><input ng-model="preferences.numberOfRecentConnections" type="number" min="1" max="20"/></td>
</tr>
</table>
</div>
</div>

<!-- Password update -->
<h2 class="header" ng-show="canUpdateSelf">{{'SETTINGS_PREFERENCES.SECTION_HEADER_UPDATE_PASSWORD' | translate}}</h2>
<div class="settings section update-password" ng-show="canUpdateSelf">
Expand Down Expand Up @@ -89,24 +107,6 @@ <h2 class="header">{{'SETTINGS_PREFERENCES.SECTION_HEADER_DEFAULT_MOUSE_MODE' |
</div>
</div>

<!-- Recent connections -->
<h2 class="header">{{'SETTINGS_PREFERENCES.SECTION_HEADER_RECENT_CONNECTIONS' | translate}}</h2>
<div class="settings section recent">
<p>{{'SETTINGS_PREFERENCES.HELP_RECENT_CONNECTIONS' | translate}}</p>
<div class='form'>
<table class='fields'>
<tr>
<th>{{'SETTINGS_PREFERENCES.FIELD_HEADER_SHOW_RECENT_CONNECTIONS' | translate}}</th>
<td><input ng-model="preferences.showRecentConnections" type="checkbox"/></td>
</tr>
<tr>
<th>{{'SETTINGS_PREFERENCES.FIELD_HEADER_NUMBER_RECENT_CONNECTIONS' | translate}}</th>
<td><input ng-model="preferences.numberOfRecentConnections" type="number" min="1" max="20"/></td>
</tr>
</table>
</div>
</div>

<!-- User attributes section -->
<div class="attributes" ng-show="canUpdateSelf && attributes.length">
<guac-form namespace="'USER_ATTRIBUTES'" content="attributes"
Expand Down
1 change: 1 addition & 0 deletions guacamole/src/main/frontend/src/images/x-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion guacamole/src/main/frontend/src/translations/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

"ACTION_DISCONNECT" : "Desconnecta",
"ACTION_RECONNECT" : "Torneu a connectar",
"ACTION_SHOW_CLIPBOARD" : "Feu clic per veure les dades del porta-retalls.",
"ACTION_UPLOAD_FILES" : "Carregueu fitxers",

"DIALOG_HEADER_CONNECTING" : "Connectant",
Expand Down Expand Up @@ -143,7 +144,6 @@
"TEXT_CLIENT_STATUS_DISCONNECTED" : "Heu estat desconnectats.",
"TEXT_CLIENT_STATUS_UNSTABLE" : "La connexió de xarxa al servidor Guacamole sembla inestable.",
"TEXT_CLIENT_STATUS_WAITING" : "Connectat a Guacamole. Esperant resposta ...",
"TEXT_CLIPBOARD_AWAITING_FOCUS" : "Feu clic per veure les dades del porta-retalls...",
"TEXT_FILE_TRANSFER_PROGRESS" : "{PROGRESS} {UNIT, select, b{B} kb{KB} mb{MB} gb{GB} other{}}",
"TEXT_RECONNECT_COUNTDOWN" : "Re-conectant en {REMAINING} {REMAINING, plural, one{segon} other{segons}}...",
"TEXT_USER_JOINED" : "{USERNAME} s'ha afegit a la connexió.",
Expand Down
2 changes: 1 addition & 1 deletion guacamole/src/main/frontend/src/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"ACTION_RECONNECT" : "Znovu připojit",
"ACTION_SAVE_FILE" : "@:APP.ACTION_SAVE",
"ACTION_SHARE" : "@:APP.ACTION_SHARE",
"ACTION_SHOW_CLIPBOARD" : "Kliknutím zobrazíte obsah schránky.",
"ACTION_UPLOAD_FILES" : "Nahrát soubory",

"DIALOG_HEADER_CONNECTING" : "Připojování",
Expand Down Expand Up @@ -163,7 +164,6 @@
"TEXT_USER_LEFT" : "{USERNAME} opustil spojení.",
"TEXT_RECONNECT_COUNTDOWN" : "Znovu připojuji {REMAINING} {REMAINING, plural, one{sekundu} other{sekund}}...",
"TEXT_FILE_TRANSFER_PROGRESS" : "{PROGRESS} {UNIT, select, b{B} kb{KB} mb{MB} gb{GB} other{}}",
"TEXT_CLIPBOARD_AWAITING_FOCUS" : "Kliknutím zobrazíte obsah schránky...",

"URL_OSK_LAYOUT" : "layouts/en-us-qwerty.json"

Expand Down
2 changes: 1 addition & 1 deletion guacamole/src/main/frontend/src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"ACTION_RECONNECT" : "Neu verbinden",
"ACTION_SAVE_FILE" : "@:APP.ACTION_SAVE",
"ACTION_SHARE" : "@:APP.ACTION_SHARE",
"ACTION_SHOW_CLIPBOARD" : "Klicken um Zwischenablage anzuzeigen.",
"ACTION_UPLOAD_FILES" : "Dateien hochladen",

"DIALOG_HEADER_CONNECTING" : "Verbinden",
Expand Down Expand Up @@ -163,7 +164,6 @@
"TEXT_USER_LEFT" : "{USERNAME} hat die Verbindung verlassen.",
"TEXT_RECONNECT_COUNTDOWN" : "Neuverbindung in {REMAINING} {REMAINING, plural, one{Sekunde} other{Sekunden}}...",
"TEXT_FILE_TRANSFER_PROGRESS" : "{PROGRESS} {UNIT, select, b{B} kb{KB} mb{MB} gb{GB} other{}}",
"TEXT_CLIPBOARD_AWAITING_FOCUS" : "Klicken um Zwischenablage anzuzeigen...",

"URL_OSK_LAYOUT" : "layouts/de-de-qwertz.json"

Expand Down
6 changes: 3 additions & 3 deletions guacamole/src/main/frontend/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"ACTION_RECONNECT" : "Reconnect",
"ACTION_SAVE_FILE" : "@:APP.ACTION_SAVE",
"ACTION_SHARE" : "@:APP.ACTION_SHARE",
"ACTION_SHOW_CLIPBOARD" : "Click to view clipboard contents.",
"ACTION_UPLOAD_FILES" : "Upload Files",

"DIALOG_HEADER_CONNECTING" : "Connecting",
Expand Down Expand Up @@ -168,7 +169,6 @@
"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"

Expand Down Expand Up @@ -1075,6 +1075,7 @@
"FIELD_HEADER_TIMEZONE" : "Timezone:",
"FIELD_HEADER_USERNAME" : "Username:",

"HELP_APPEARANCE" : "Here you can enable or disable whether the \"Recent Connections\" section is shown on the home screen, and adjust the number of recent connections included.",
"HELP_DEFAULT_INPUT_METHOD" : "The default input method determines how keyboard events are received by Guacamole. Changing this setting may be necessary when using a mobile device, or when typing through an IME. This setting can be overridden on a per-connection basis within the Guacamole menu.",
"HELP_DEFAULT_MOUSE_MODE" : "The default mouse emulation mode determines how the remote mouse will behave in new connections with respect to touches. This setting can be overridden on a per-connection basis within the Guacamole menu.",
"HELP_INPUT_METHOD_NONE" : "@:CLIENT.HELP_INPUT_METHOD_NONE",
Expand All @@ -1083,7 +1084,6 @@
"HELP_LOCALE" : "Options below are related to the locale of the user and will impact how various parts of the interface are displayed.",
"HELP_MOUSE_MODE_ABSOLUTE" : "@:CLIENT.HELP_MOUSE_MODE_ABSOLUTE",
"HELP_MOUSE_MODE_RELATIVE" : "@:CLIENT.HELP_MOUSE_MODE_RELATIVE",
"HELP_RECENT_CONNECTIONS" : "Here you can enable or disable recent conections in the Guacamole Home Page, and adjust the number of recent connections that will be displayed.",
"HELP_UPDATE_PASSWORD" : "If you wish to change your password, enter your current password and the desired new password below, and click \"Update Password\". The change will take effect immediately.",

"INFO_PASSWORD_CHANGED" : "Password changed.",
Expand All @@ -1093,9 +1093,9 @@
"NAME_INPUT_METHOD_OSK" : "@:CLIENT.NAME_INPUT_METHOD_OSK",
"NAME_INPUT_METHOD_TEXT" : "@:CLIENT.NAME_INPUT_METHOD_TEXT",

"SECTION_HEADER_APPEARANCE" : "Appearance",
"SECTION_HEADER_DEFAULT_INPUT_METHOD" : "Default Input Method",
"SECTION_HEADER_DEFAULT_MOUSE_MODE" : "Default Mouse Emulation Mode",
"SECTION_HEADER_RECENT_CONNECTIONS" : "Recent Connections Preferences",
"SECTION_HEADER_UPDATE_PASSWORD" : "Change Password"

},
Expand Down
Loading

0 comments on commit ad3a007

Please sign in to comment.