Simplify modifier button display

This commit is contained in:
Pierre Ossman 2016-08-25 17:32:57 +02:00
parent 999f1d45db
commit 6cba147d4e
3 changed files with 21 additions and 20 deletions

View File

@ -2,6 +2,7 @@
* noVNC base CSS * noVNC base CSS
* Copyright (C) 2012 Joel Martin * Copyright (C) 2012 Joel Martin
* Copyright (C) 2016 Samuel Mannehed for Cendio AB * Copyright (C) 2016 Samuel Mannehed for Cendio AB
* Copyright (C) 2016 Pierre Ossman for Cendio AB
* noVNC is licensed under the MPL 2.0 (see LICENSE.txt) * noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
* This file is licensed under the 2-Clause BSD license (see LICENSE.txt). * This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
*/ */
@ -151,6 +152,9 @@ html {
#noVNC_sendEsc_button { #noVNC_sendEsc_button {
display: inline; display: inline;
} }
#noVNC_modifiers {
display: inline;
}
/* Left side buttons */ /* Left side buttons */
.noVNC_buttons_left { .noVNC_buttons_left {
@ -430,26 +434,25 @@ html {
#noVNC_toggleExtraKeys_button { #noVNC_toggleExtraKeys_button {
display: inline; display: inline;
} }
#noVNC_toggleCtrl_button { #noVNC_modifiers {
display: none; display: none;
}
#noVNC_toggleCtrl_button {
position: absolute; position: absolute;
top: 30px; top: 30px;
left: 0px; left: 0px;
} }
#noVNC_toggleAlt_button { #noVNC_toggleAlt_button {
display: none;
position: absolute; position: absolute;
top: 65px; top: 65px;
left: 0px; left: 0px;
} }
#noVNC_sendTab_button { #noVNC_sendTab_button {
display: none;
position: absolute; position: absolute;
top: 100px; top: 100px;
left: 0px; left: 0px;
} }
#noVNC_sendEsc_button { #noVNC_sendEsc_button {
display: none;
position: absolute; position: absolute;
top: 135px; top: 135px;
left: 0px; left: 0px;

View File

@ -2,6 +2,7 @@
* noVNC: HTML5 VNC client * noVNC: HTML5 VNC client
* Copyright (C) 2012 Joel Martin * Copyright (C) 2012 Joel Martin
* Copyright (C) 2016 Samuel Mannehed for Cendio AB * Copyright (C) 2016 Samuel Mannehed for Cendio AB
* Copyright (C) 2016 Pierre Ossman for Cendio AB
* Licensed under MPL 2.0 (see LICENSE.txt) * Licensed under MPL 2.0 (see LICENSE.txt)
* *
* See README.md for usage and integration instructions. * See README.md for usage and integration instructions.
@ -1216,17 +1217,11 @@ var UI;
toggleExtraKeys: function() { toggleExtraKeys: function() {
UI.keepKeyboard(); UI.keepKeyboard();
if(UI.extraKeysVisible === false) { if(UI.extraKeysVisible === false) {
document.getElementById('noVNC_toggleCtrl_button').style.display = "inline"; document.getElementById('noVNC_modifiers').style.display = "inline";
document.getElementById('noVNC_toggleAlt_button').style.display = "inline";
document.getElementById('noVNC_sendTab_button').style.display = "inline";
document.getElementById('noVNC_sendEsc_button').style.display = "inline";
document.getElementById('noVNC_toggleExtraKeys_button').className = "noVNC_status_button_selected"; document.getElementById('noVNC_toggleExtraKeys_button').className = "noVNC_status_button_selected";
UI.extraKeysVisible = true; UI.extraKeysVisible = true;
} else if(UI.extraKeysVisible === true) { } else if(UI.extraKeysVisible === true) {
document.getElementById('noVNC_toggleCtrl_button').style.display = ""; document.getElementById('noVNC_modifiers').style.display = "";
document.getElementById('noVNC_toggleAlt_button').style.display = "";
document.getElementById('noVNC_sendTab_button').style.display = "";
document.getElementById('noVNC_sendEsc_button').style.display = "";
document.getElementById('noVNC_toggleExtraKeys_button').className = "noVNC_status_button"; document.getElementById('noVNC_toggleExtraKeys_button').className = "noVNC_status_button";
UI.extraKeysVisible = false; UI.extraKeysVisible = false;
} }

View File

@ -6,6 +6,7 @@
noVNC example: simple example using default UI noVNC example: simple example using default UI
Copyright (C) 2012 Joel Martin Copyright (C) 2012 Joel Martin
Copyright (C) 2016 Samuel Mannehed for Cendio AB Copyright (C) 2016 Samuel Mannehed for Cendio AB
Copyright (C) 2016 Pierre Ossman for Cendio AB
noVNC is licensed under the MPL 2.0 (see LICENSE.txt) noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
This file is licensed under the 2-Clause BSD license (see LICENSE.txt). This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
@ -81,14 +82,16 @@
<div id="noVNC_extra_keys"> <div id="noVNC_extra_keys">
<input type="image" alt="Extra keys" src="app/images/toggleextrakeys.png" <input type="image" alt="Extra keys" src="app/images/toggleextrakeys.png"
id="noVNC_toggleExtraKeys_button" class="noVNC_status_button" /> id="noVNC_toggleExtraKeys_button" class="noVNC_status_button" />
<input type="image" alt="Ctrl" src="app/images/ctrl.png" <div id="noVNC_modifiers">
id="noVNC_toggleCtrl_button" class="noVNC_status_button" /> <input type="image" alt="Ctrl" src="app/images/ctrl.png"
<input type="image" alt="Alt" src="app/images/alt.png" id="noVNC_toggleCtrl_button" class="noVNC_status_button" />
id="noVNC_toggleAlt_button" class="noVNC_status_button" /> <input type="image" alt="Alt" src="app/images/alt.png"
<input type="image" alt="Tab" src="app/images/tab.png" id="noVNC_toggleAlt_button" class="noVNC_status_button" />
id="noVNC_sendTab_button" class="noVNC_status_button" /> <input type="image" alt="Tab" src="app/images/tab.png"
<input type="image" alt="Esc" src="app/images/esc.png" id="noVNC_sendTab_button" class="noVNC_status_button" />
id="noVNC_sendEsc_button" class="noVNC_status_button" /> <input type="image" alt="Esc" src="app/images/esc.png"
id="noVNC_sendEsc_button" class="noVNC_status_button" />
</div>
</div> </div>
</div> </div>
</div> </div>