Skip to content

Commit

Permalink
GUACAMOLE-124: Add full-screen action
Browse files Browse the repository at this point in the history
  • Loading branch information
madmath03 committed Feb 5, 2020
1 parent b51d2a8 commit c21d120
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,48 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
return authenticationService.isAnonymous();
};

/**
* Requests fullscreen for the Guacamole page.
*/
$scope.fullscreen = function fullscreen() {
var elem = document.documentElement;
var fullscreenElem = !(!document.fullscreenElement &&
!document.msFullscreenElement &&
!document.mozFullScreenElement &&
!document.webkitFullscreenElement);

if (!fullscreenElem) {
if (!elem.requestFullscreen) {
elem.requestFullscreen = (elem.mozRequestFullScreen
|| elem.webkitRequestFullscreen
|| elem.msRequestFullscreen).bind(elem);
}

if (elem.requestFullscreen) {
elem.requestFullscreen();
}
} else {
if (!document.exitFullscreen) {
document.exitFullscreen = (document.mozCancelFullScreen
|| document.webkitExitFullscreen
|| document.msExitFullscreen).bind(document);
}

if (document.exitFullscreen) {
document.exitFullscreen();
}
}
};

/**
* Action which requests fullscreen for the Guacamole page.
*/
var FULLSCREEN_ACTION = {
name : 'USER_MENU.ACTION_FULLSCREEN',
className : 'fullscreen',
callback : $scope.fullscreen
};

/**
* Logs out the current user, redirecting them to back to the root
* after logout completes.
Expand Down Expand Up @@ -162,7 +204,7 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
/**
* All available actions for the current user.
*/
$scope.actions = [ LOGOUT_ACTION ];
$scope.actions = [ FULLSCREEN_ACTION, LOGOUT_ACTION ];

}] // end controller

Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ACTION_DOWNLOAD" : "Stáhnout",
"ACTION_LOGIN" : "Přihlásit",
"ACTION_LOGOUT" : "Odhlásit",
"ACTION_FULLSCREEN" : "Celá obrazovka",
"ACTION_MANAGE_CONNECTIONS" : "Připojení",
"ACTION_MANAGE_PREFERENCES" : "Vlastnosti",
"ACTION_MANAGE_SETTINGS" : "Nastavení",
Expand Down Expand Up @@ -869,6 +870,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ACTION_DOWNLOAD" : "Download",
"ACTION_LOGIN" : "Anmelden",
"ACTION_LOGOUT" : "Abmelden",
"ACTION_FULLSCREEN" : "Ganzer Bildschirm",
"ACTION_MANAGE_CONNECTIONS" : "Verbindungen",
"ACTION_MANAGE_PREFERENCES" : "Einstellungen",
"ACTION_MANAGE_SETTINGS" : "Einstellungen",
Expand Down Expand Up @@ -862,6 +863,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"ACTION_DOWNLOAD" : "Download",
"ACTION_LOGIN" : "Login",
"ACTION_LOGOUT" : "Logout",
"ACTION_FULLSCREEN" : "Fullscreen",
"ACTION_MANAGE_CONNECTIONS" : "Connections",
"ACTION_MANAGE_PREFERENCES" : "Preferences",
"ACTION_MANAGE_SETTINGS" : "Settings",
Expand Down Expand Up @@ -963,6 +964,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ACTION_DOWNLOAD" : "Descargar",
"ACTION_LOGIN" : "Iniciar Sesión",
"ACTION_LOGOUT" : "Cerrar Sesión",
"ACTION_FULLSCREEN" : "Pantalla completa",
"ACTION_MANAGE_CONNECTIONS" : "Conexiones",
"ACTION_MANAGE_PREFERENCES" : "Preferencias",
"ACTION_MANAGE_SETTINGS" : "Configuración",
Expand Down Expand Up @@ -729,6 +730,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ACTION_DELETE_SESSIONS" : "Fermer les Sessions",
"ACTION_LOGIN" : "Se connecter",
"ACTION_LOGOUT" : "Se déconnecter",
"ACTION_FULLSCREEN" : "Plein écran",
"ACTION_MANAGE_CONNECTIONS" : "Connexions",
"ACTION_MANAGE_PREFERENCES" : "Préférences",
"ACTION_MANAGE_SETTINGS" : "Paramètres",
Expand Down Expand Up @@ -648,6 +649,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ACTION_DELETE_SESSIONS" : "Termina Sessione",
"ACTION_LOGIN" : "Entra",
"ACTION_LOGOUT" : "Esci",
"ACTION_FULLSCREEN" : "A schermo intero",
"ACTION_MANAGE_CONNECTIONS" : "Connessioni",
"ACTION_MANAGE_PREFERENCES" : "Preferenze",
"ACTION_MANAGE_SETTINGS" : "Opzioni",
Expand Down Expand Up @@ -590,6 +591,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ACTION_DOWNLOAD" : "ダウンロード",
"ACTION_LOGIN" : "ログイン",
"ACTION_LOGOUT" : "ログアウト",
"ACTION_FULLSCREEN" : "全画面表示",
"ACTION_MANAGE_CONNECTIONS" : "接続",
"ACTION_MANAGE_PREFERENCES" : "ユーザ設定",
"ACTION_MANAGE_SETTINGS" : "設定",
Expand Down Expand Up @@ -733,6 +734,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ACTION_DELETE_SESSIONS" : "Verwijder Sessies",
"ACTION_LOGIN" : "Inloggen",
"ACTION_LOGOUT" : "Uitloggen",
"ACTION_FULLSCREEN" : "Volledig scherm",
"ACTION_MANAGE_CONNECTIONS" : "Verbindingen",
"ACTION_MANAGE_PREFERENCES" : "Voorkeuren",
"ACTION_MANAGE_SETTINGS" : "Instellingen",
Expand Down Expand Up @@ -678,6 +679,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ACTION_DELETE_SESSIONS" : "Avslutt Sesjoner",
"ACTION_LOGIN" : "Logg inn",
"ACTION_LOGOUT" : "Logg ut",
"ACTION_FULLSCREEN" : "Full skjerm",
"ACTION_MANAGE_CONNECTIONS" : "Forbindelser",
"ACTION_MANAGE_PREFERENCES" : "Mine valg",
"ACTION_MANAGE_SETTINGS" : "Innstillinger",
Expand Down Expand Up @@ -659,6 +660,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"ACTION_DELETE_SESSIONS" : "Завершить сессии",
"ACTION_LOGIN" : "Вход",
"ACTION_LOGOUT" : "Выход",
"ACTION_FULLSCREEN" : "Полноэкранный",
"ACTION_MANAGE_CONNECTIONS" : "Подключения",
"ACTION_MANAGE_PREFERENCES" : "Настройки",
"ACTION_MANAGE_SETTINGS" : "Опции",
Expand Down Expand Up @@ -574,6 +575,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/webapp/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ACTION_DOWNLOAD" : "下载",
"ACTION_LOGIN" : "登录",
"ACTION_LOGOUT" : "登出",
"ACTION_FULLSCREEN" : "全屏",
"ACTION_MANAGE_CONNECTIONS" : "连接",
"ACTION_MANAGE_PREFERENCES" : "偏好",
"ACTION_MANAGE_SETTINGS" : "设置",
Expand Down Expand Up @@ -764,6 +765,7 @@
"USER_MENU" : {

"ACTION_LOGOUT" : "@:APP.ACTION_LOGOUT",
"ACTION_FULLSCREEN" : "@:APP.ACTION_FULLSCREEN",
"ACTION_MANAGE_CONNECTIONS" : "@:APP.ACTION_MANAGE_CONNECTIONS",
"ACTION_MANAGE_PREFERENCES" : "@:APP.ACTION_MANAGE_PREFERENCES",
"ACTION_MANAGE_SESSIONS" : "@:APP.ACTION_MANAGE_SESSIONS",
Expand Down

0 comments on commit c21d120

Please sign in to comment.