mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-25 22:55:52 -05:00
Desktop keyboard shortcut re-order support.
This commit is contained in:
parent
b10096a451
commit
46097aba9f
BIN
public/images/c3.png
Normal file
BIN
public/images/c3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 B |
@ -7492,13 +7492,29 @@
|
|||||||
function deskUpdateShortcutList() {
|
function deskUpdateShortcutList() {
|
||||||
var x = '';
|
var x = '';
|
||||||
for (var i in deskKeyboardShortcuts) {
|
for (var i in deskKeyboardShortcuts) {
|
||||||
var kt = keyShortcutTotext(deskKeyboardShortcuts[i]);
|
var kt = keyShortcutTotext(deskKeyboardShortcuts[i]), orderButtons = '';
|
||||||
x += '<div style="width:100%;background-color:#AAA;border-radius:4px;margin-bottom:4px;padding:4px;text-align:left;box-sizing:border-box" value=' + deskKeyboardShortcuts[i] + '>' + kt + '<img width=10 height=10 style=float:right;cursor:pointer;padding:2px src="images/trash.png" onclick=removeDeskCustomizeKey(' + deskKeyboardShortcuts[i] + ')></div>';
|
if (i != (deskKeyboardShortcuts.length - 1)) { orderButtons += '<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c2.png" onclick=deskCustomizeKeyDown(' + deskKeyboardShortcuts[i] + ')>'; }
|
||||||
|
if (i != 0) { orderButtons += '<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c3.png" onclick=deskCustomizeKeyUp(' + deskKeyboardShortcuts[i] + ')>'; }
|
||||||
|
x += '<div style="width:100%;background-color:#AAA;border-radius:4px;margin-bottom:4px;padding:4px;text-align:left;box-sizing:border-box" value=' + deskKeyboardShortcuts[i] + '>' + kt + '<img width=10 height=10 style=float:right;cursor:pointer;padding:2px;margin-left:8px src="images/trash.png" onclick=removeDeskCustomizeKey(' + deskKeyboardShortcuts[i] + ')>' + orderButtons + '</div>';
|
||||||
}
|
}
|
||||||
if (x == '') { x = '<i>' + "No keyboard shortcuts defined" + '</i>'; }
|
if (x == '') { x = '<i>' + "No keyboard shortcuts defined" + '</i>'; }
|
||||||
QH('d2shortcuts', x);
|
QH('d2shortcuts', x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deskCustomizeKeyDown(k) {
|
||||||
|
var i = deskKeyboardShortcuts.indexOf(k), x = deskKeyboardShortcuts[i + 1];
|
||||||
|
deskKeyboardShortcuts[i + 1] = deskKeyboardShortcuts[i];
|
||||||
|
deskKeyboardShortcuts[i] = x;
|
||||||
|
deskUpdateShortcutList();
|
||||||
|
}
|
||||||
|
|
||||||
|
function deskCustomizeKeyUp(k) {
|
||||||
|
var i = deskKeyboardShortcuts.indexOf(k), x = deskKeyboardShortcuts[i];
|
||||||
|
deskKeyboardShortcuts[i] = deskKeyboardShortcuts[i - 1];
|
||||||
|
deskKeyboardShortcuts[i - 1] = x;
|
||||||
|
deskUpdateShortcutList();
|
||||||
|
}
|
||||||
|
|
||||||
function removeDeskCustomizeKey(k) {
|
function removeDeskCustomizeKey(k) {
|
||||||
var na = [];
|
var na = [];
|
||||||
for (var i in deskKeyboardShortcuts) { if (deskKeyboardShortcuts[i] != k) { na.push(deskKeyboardShortcuts[i]); } }
|
for (var i in deskKeyboardShortcuts) { if (deskKeyboardShortcuts[i] != k) { na.push(deskKeyboardShortcuts[i]); } }
|
||||||
|
Loading…
Reference in New Issue
Block a user