Added shift-click to open a new tab

This commit is contained in:
Ylian Saint-Hilaire 2019-09-25 15:41:37 -07:00
parent f4afd7a8ea
commit d9d31d4dc8
2 changed files with 40 additions and 29 deletions

File diff suppressed because one or more lines are too long

View File

@ -70,22 +70,22 @@
</div>
<div id="page_leftbar">
<div style="height:16px"></div>
<div id=LeftMenuMyDevices tabindex=0 class="lbbutton lbbuttonsel" title="My Devices" onclick=go(1) onkeypress="if (event.key=='Enter') { go(1); }">
<div id=LeftMenuMyDevices tabindex=0 class="lbbutton lbbuttonsel" title="My Devices" onclick=go(1,event) onkeypress="if (event.key=='Enter') { go(1); }">
<div class="lb2"></div>
</div>
<div id=LeftMenuMyAccount tabindex=0 class="lbbutton" title="My Account" onclick=go(2) onkeypress="if (event.key=='Enter') { go(2); }">
<div id=LeftMenuMyAccount tabindex=0 class="lbbutton" title="My Account" onclick=go(2,event) onkeypress="if (event.key=='Enter') { go(2); }">
<div class="lb1"></div>
</div>
<div id=LeftMenuMyEvents tabindex=0 class="lbbutton" title="My Events" onclick=go(3) onkeypress="if (event.key=='Enter') { go(3); }">
<div id=LeftMenuMyEvents tabindex=0 class="lbbutton" title="My Events" onclick=go(3,event) onkeypress="if (event.key=='Enter') { go(3); }">
<div class="lb3"></div>
</div>
<div id=LeftMenuMyFiles tabindex=0 class="lbbutton" style="display:none" title="My Files" onclick=go(5) onkeypress="if (event.key=='Enter') { go(5); }">
<div id=LeftMenuMyFiles tabindex=0 class="lbbutton" style="display:none" title="My Files" onclick=go(5,event) onkeypress="if (event.key=='Enter') { go(5); }">
<div class="lb4"></div>
</div>
<div id=LeftMenuMyUsers tabindex=0 class="lbbutton" style="display:none" title="My Users" onclick=go(4) onkeypress="if (event.key=='Enter') { go(4); }">
<div id=LeftMenuMyUsers tabindex=0 class="lbbutton" style="display:none" title="My Users" onclick=go(4,event) onkeypress="if (event.key=='Enter') { go(4); }">
<div class="lb5"></div>
</div>
<div id=LeftMenuMyServer tabindex=0 class="lbbutton" style="display:none" title="My Server" onclick=go(6) onkeypress="if (event.key=='Enter') { go(6); }">
<div id=LeftMenuMyServer tabindex=0 class="lbbutton" style="display:none" title="My Server" onclick=go(6,event) onkeypress="if (event.key=='Enter') { go(6); }">
<div class="lb6"></div>
</div>
</div>
@ -102,26 +102,26 @@
</div>
<table id=MainMenuSpan cellpadding=0 cellspacing=0 class=style1>
<tr>
<td tabindex=0 id=MainMenuMyDevices class="topbar_td style3x" onclick=go(1) onkeypress="if (event.key == 'Enter') go(1)">My Devices</td>
<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x" onclick=go(2) onkeypress="if (event.key == 'Enter') go(2)">My Account</td>
<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x" onclick=go(3) onkeypress="if (event.key == 'Enter') go(3)">My Events</td>
<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x" onclick=go(5) onkeypress="if (event.key == 'Enter') go(5)">My Files</td>
<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x" onclick=go(4) onkeypress="if (event.key == 'Enter') go(4)">My Users</td>
<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x" onclick=go(6) onkeypress="if (event.key == 'Enter') go(6)">My Server</td>
<td tabindex=0 id=MainMenuMyDevices class="topbar_td style3x" onclick=go(1,event) onkeypress="if (event.key == 'Enter') go(1)">My Devices</td>
<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x" onclick=go(2,event) onkeypress="if (event.key == 'Enter') go(2)">My Account</td>
<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x" onclick=go(3,event) onkeypress="if (event.key == 'Enter') go(3)">My Events</td>
<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x" onclick=go(5,event) onkeypress="if (event.key == 'Enter') go(5)">My Files</td>
<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x" onclick=go(4,event) onkeypress="if (event.key == 'Enter') go(4)">My Users</td>
<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x" onclick=go(6,event) onkeypress="if (event.key == 'Enter') go(6)">My Server</td>
<td class="topbar_td_end style3">&nbsp;</td>
</tr>
</table>
<div id=MainSubMenuSpan style="display:none">
<table id=MainSubMenu cellpadding=0 cellspacing=0 class=style1>
<tr>
<td tabindex=0 id=MainDev class="topbar_td style3x" onclick=go(10) onkeypress="if (event.key == 'Enter') go(10)">General</td>
<td tabindex=0 id=MainDevDesktop class="topbar_td style3x" onclick=go(11) onkeypress="if (event.key == 'Enter') go(11)">Desktop</td>
<td tabindex=0 id=MainDevTerminal class="topbar_td style3x" onclick=go(12) onkeypress="if (event.key == 'Enter') go(12)">Terminal</td>
<td tabindex=0 id=MainDevFiles class="topbar_td style3x" onclick=go(13) onkeypress="if (event.key == 'Enter') go(13)">Files</td>
<td tabindex=0 id=MainDevEvents class="topbar_td style3x" onclick=go(16) onkeypress="if (event.key == 'Enter') go(16)">Events</td>
<td tabindex=0 id=MainDevInfo class="topbar_td style3x" onclick=go(17) onkeypress="if (event.key == 'Enter') go(17)">Details</td>
<td tabindex=0 id=MainDevAmt class="topbar_td style3x" onclick=go(14) onkeypress="if (event.key == 'Enter') go(14)">Intel&reg; AMT</td>
<td tabindex=0 id=MainDevConsole class="topbar_td style3x" onclick=go(15) onkeypress="if (event.key == 'Enter') go(15)">Console</td>
<td tabindex=0 id=MainDev class="topbar_td style3x" onclick=go(10,event) onkeypress="if (event.key == 'Enter') go(10)">General</td>
<td tabindex=0 id=MainDevDesktop class="topbar_td style3x" onclick=go(11,event) onkeypress="if (event.key == 'Enter') go(11)">Desktop</td>
<td tabindex=0 id=MainDevTerminal class="topbar_td style3x" onclick=go(12,event) onkeypress="if (event.key == 'Enter') go(12)">Terminal</td>
<td tabindex=0 id=MainDevFiles class="topbar_td style3x" onclick=go(13,event) onkeypress="if (event.key == 'Enter') go(13)">Files</td>
<td tabindex=0 id=MainDevEvents class="topbar_td style3x" onclick=go(16,event) onkeypress="if (event.key == 'Enter') go(16)">Events</td>
<td tabindex=0 id=MainDevInfo class="topbar_td style3x" onclick=go(17,event) onkeypress="if (event.key == 'Enter') go(17)">Details</td>
<td tabindex=0 id=MainDevAmt class="topbar_td style3x" onclick=go(14,event) onkeypress="if (event.key == 'Enter') go(14)">Intel&reg; AMT</td>
<td tabindex=0 id=MainDevConsole class="topbar_td style3x" onclick=go(15,event) onkeypress="if (event.key == 'Enter') go(15)">Console</td>
<td class="topbar_td_end style3">&nbsp;</td>
</tr>
</table>
@ -129,7 +129,7 @@
<div id=MeshSubMenuSpan style="display:none">
<table id=MeshSubMenu cellpadding=0 cellspacing=0 class=style1>
<tr>
<td tabindex=0 id=MeshGeneral class="topbar_td style3x" onclick=go(20) onkeypress="if (event.key == 'Enter') go(20)">General</td>
<td tabindex=0 id=MeshGeneral class="topbar_td style3x" onclick=go(20,event) onkeypress="if (event.key == 'Enter') go(20)">General</td>
<td class="topbar_td_end style3">&nbsp;</td>
</tr>
</table>
@ -137,8 +137,8 @@
<div id=UserSubMenuSpan style="display:none">
<table id=UserSubMenu cellpadding=0 cellspacing=0 class=style1>
<tr>
<td tabindex=0 id=UserGeneral class="topbar_td style3x" onclick=go(30) onkeypress="if (event.key == 'Enter') go(30)">General</td>
<td tabindex=0 id=UserEvents class="topbar_td style3x" onclick=go(31) onkeypress="if (event.key == 'Enter') go(31)">Events</td>
<td tabindex=0 id=UserGeneral class="topbar_td style3x" onclick=go(30,event) onkeypress="if (event.key == 'Enter') go(30)">General</td>
<td tabindex=0 id=UserEvents class="topbar_td style3x" onclick=go(31,event) onkeypress="if (event.key == 'Enter') go(31)">Events</td>
<td class="topbar_td_end style3">&nbsp;</td>
</tr>
</table>
@ -146,10 +146,10 @@
<div id=ServerSubMenuSpan style="display:none">
<table id=ServerSubMenu cellpadding=0 cellspacing=0 class=style1>
<tr>
<td tabindex=0 id=ServerGeneral class="topbar_td style3x" onclick=go(6) onkeypress="if (event.key == 'Enter') go(6)">General</td>
<td tabindex=0 id=ServerStats class="topbar_td style3x" onclick=go(40) onkeypress="if (event.key == 'Enter') go(40)">Stats</td>
<td tabindex=0 id=ServerConsole class="topbar_td style3x" onclick=go(115) onkeypress="if (event.key == 'Enter') go(115)">Console</td>
<td tabindex=0 id=ServerTrace class="topbar_td style3x" onclick=go(41) onkeypress="if (event.key == 'Enter') go(41)">Trace</td>
<td tabindex=0 id=ServerGeneral class="topbar_td style3x" onclick=go(6,event) onkeypress="if (event.key == 'Enter') go(6)">General</td>
<td tabindex=0 id=ServerStats class="topbar_td style3x" onclick=go(40,event) onkeypress="if (event.key == 'Enter') go(40)">Stats</td>
<td tabindex=0 id=ServerConsole class="topbar_td style3x" onclick=go(115,event) onkeypress="if (event.key == 'Enter') go(115)">Console</td>
<td tabindex=0 id=ServerTrace class="topbar_td style3x" onclick=go(41,event) onkeypress="if (event.key == 'Enter') go(41)">Trace</td>
<td class="topbar_td_end style3">&nbsp;</td>
</tr>
</table>
@ -8852,11 +8852,22 @@
if ((xxcurrentView >= 30) && (xxcurrentView < 40)) { go(4); } // Return to My Users
}
function go(x) {
function go(x, event) {
setSessionActivity();
if (xxdialogMode || xxcurrentView == x) return;
QV('uiMenu', false);
// If "shift" is pressed, open a new tab.
if (event && (event.shiftKey == true) && (x != 15)) {
// Open the device in a different tab
if ((x >= 10) && (x <= 19)) {
if (currentNode) { window.open(window.location.origin + '?node=' + currentNode._id.split('/')[2] + '&viewmode=' + x + '&hide=16', 'meshcentral:' + currentNode._id); }
} else {
window.open(window.location.origin + '?viewmode=' + x + '&hide=0', 'meshcentral:' + x);
}
return;
}
// Edit this line when adding a new screen
for (var i = 0; i < 42; i++) { QV('p' + i, i == x); }
xxcurrentView = x;