Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/share/js/kvm/atx.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function Atx(__recorder) {
$("atx-power-led").title = "Power Led";
$("atx-hdd-led").title = "Disk Activity Led";

tools.storage.bindSimpleSwitch($("atx-ask-switch"), "atx.ask", true);
tools.storage.bindSimpleSwitch($("atx-ask-switch"), "atx.ask", tools.config.getBool("kvm--atx-ask", true));

tools.el.setOnClick($("atx-power-button"), () => __clickAtx("power"));
tools.el.setOnClick($("atx-power-button-long"), () => __clickAtx("power_long"));
Expand Down
2 changes: 1 addition & 1 deletion web/share/js/kvm/hid.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function Hid(__getGeometry, __recorder) {
});
}

tools.storage.bindSimpleSwitch($("hid-sysrq-ask-switch"), "hid.sysrq.ask", true);
tools.storage.bindSimpleSwitch($("hid-sysrq-ask-switch"), "hid.sysrq.ask", tools.config.getBool("kvm--hid-sysrq-ask", true));

tools.el.setOnClick($("hid-jiggler-switch"), __clickJigglerSwitch);
};
Expand Down
4 changes: 2 additions & 2 deletions web/share/js/kvm/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export function Keyboard(__recordWsEvent) {
window.addEventListener("focusin", __updateOnlineLeds);
window.addEventListener("focusout", __updateOnlineLeds);

tools.storage.bindSimpleSwitch($("hid-keyboard-bad-link-switch"), "hid.keyboard.bad_link", false);
tools.storage.bindSimpleSwitch($("hid-keyboard-swap-cc-switch"), "hid.keyboard.swap_cc", false);
tools.storage.bindSimpleSwitch($("hid-keyboard-bad-link-switch"), "hid.keyboard.bad_link", tools.config.getBool("kvm--hid-keyboard-bad-link", false));
tools.storage.bindSimpleSwitch($("hid-keyboard-swap-cc-switch"), "hid.keyboard.swap_cc", tools.config.getBool("kvm--hid-keyboard-swap-cc", false));

__el_magic = $("hid-keyboard-magic-selector");
let alt = (tools.browser.is_apple ? "Option" : "Alt");
Expand Down
2 changes: 1 addition & 1 deletion web/share/js/kvm/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function main() {
}
}, false);

tools.storage.bindSimpleSwitch($("page-close-ask-switch"), "page.close.ask", true, function(value) {
tools.storage.bindSimpleSwitch($("page-close-ask-switch"), "page.close.ask", tools.config.getBool("kvm--page-close-ask", true), function(value) {
if (value) {
window.onbeforeunload = function(ev) {
let text = "Are you sure you want to close PiKVM session?";
Expand Down
10 changes: 5 additions & 5 deletions web/share/js/kvm/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export function Mouse(__getGeometry, __recordWsEvent) {
$("stream-box").addEventListener("touchmove", __streamTouchMoveHandler);
$("stream-box").addEventListener("touchend", __streamTouchEndHandler);

tools.storage.bindSimpleSwitch($("hid-mouse-squash-switch"), "hid.mouse.squash", true);
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-y-switch"), "hid.mouse.reverse_scrolling", false);
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-x-switch"), "hid.mouse.reverse_panning", false);
tools.storage.bindSimpleSwitch($("hid-mouse-squash-switch"), "hid.mouse.squash", tools.config.getBool("kvm--hid-mouse-squash", true));
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-y-switch"), "hid.mouse.reverse_scrolling", tools.config.getBool("kvm--hid-mouse-reverse-scrolling", false));
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-x-switch"), "hid.mouse.reverse_panning", tools.config.getBool("kvm--hid-mouse-reverse-panning", false));
let cumulative_scrolling = !(tools.browser.is_firefox && !tools.browser.is_mac);
tools.storage.bindSimpleSwitch($("hid-mouse-cumulative-scrolling-switch"), "hid.mouse.cumulative_scrolling", cumulative_scrolling);
tools.storage.bindSimpleSwitch($("hid-mouse-dot-switch"), "hid.mouse.dot", true, __updateOnlineLeds);
tools.storage.bindSimpleSwitch($("hid-mouse-cumulative-scrolling-switch"), "hid.mouse.cumulative_scrolling", tools.config.getBool("kvm--hid-mouse-cumulative-scrolling", cumulative_scrolling));
tools.storage.bindSimpleSwitch($("hid-mouse-dot-switch"), "hid.mouse.dot", tools.config.getBool("kvm--hid-mouse-dot", true), __updateOnlineLeds);

__updateOnlineLeds();
};
Expand Down
4 changes: 2 additions & 2 deletions web/share/js/kvm/paste.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export function Paste(__recorder) {
}
});

tools.storage.bindSimpleSwitch($("hid-pak-ask-switch"), "hid.pak.ask", true);
tools.storage.bindSimpleSwitch($("hid-pak-ask-switch"), "hid.pak.ask", tools.config.getBool("kvm--hid-pak-ask", true));

tools.storage.bindSimpleSwitch($("hid-pak-secure-switch"), "hid.pak.secure", false, function(value) {
tools.storage.bindSimpleSwitch($("hid-pak-secure-switch"), "hid.pak.secure", tools.config.getBool("kvm--hid-pak-secure", false), function(value) {
$("hid-pak-text").style.setProperty("-webkit-text-security", (value ? "disc" : "none"));
});

Expand Down
10 changes: 5 additions & 5 deletions web/share/js/kvm/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function Streamer() {

// Not getInt() because of radio is a string container.
// Also don't reset Streamer at class init.
tools.radio.clickValue("stream-orient-radio", tools.storage.get("stream.orient", 0));
tools.radio.clickValue("stream-orient-radio", tools.storage.get("stream.orient", tools.config.get("kvm--stream-orient", 0)));
tools.radio.setOnClick("stream-orient-radio", function() {
if (["janus", "media"].includes(__streamer.getMode())) {
let orient = parseInt(tools.radio.getValue("stream-orient-radio"));
Expand All @@ -98,15 +98,15 @@ export function Streamer() {
tools.el.setEnabled($("stream-cam-switch"), !!value);
});

tools.storage.bindSimpleSwitch($("stream-mic-switch"), "stream.mic", false, function(allow_mic) {
tools.storage.bindSimpleSwitch($("stream-mic-switch"), "stream.mic", tools.config.getBool("kvm--stream-mic", false), function(allow_mic) {
if (__streamer.getMode() === "janus") {
if (__streamer.isMicAllowed() !== allow_mic) {
__resetStream();
}
}
});

tools.storage.bindSimpleSwitch($("stream-cam-switch"), "stream.cam", false, function(allow_cam) {
tools.storage.bindSimpleSwitch($("stream-cam-switch"), "stream.cam", tools.config.getBool("kvm--stream-cam", false), function(allow_cam) {
if (__streamer.getMode() === "janus") {
if (__streamer.isCamAllowed() !== allow_cam) {
__resetStream();
Expand All @@ -117,7 +117,7 @@ export function Streamer() {
tools.el.setOnClick($("stream-screenshot-button"), __clickScreenshotButton);
tools.el.setOnClick($("stream-reset-button"), __clickResetButton);

tools.storage.bindSimpleSwitch($("stream-suspend-switch"), "stream.suspend", false, __visibilityHook);
tools.storage.bindSimpleSwitch($("stream-suspend-switch"), "stream.suspend", tools.config.getBool("kvm--stream-suspend", false), __visibilityHook);

$("stream-window").show_hook = __visibilityHook;
$("stream-window").close_hook = __visibilityHook;
Expand Down Expand Up @@ -253,7 +253,7 @@ export function Streamer() {
tools.feature.setEnabled($("stream-cam"), false);
}

let mode = tools.storage.get("stream.mode", "janus");
let mode = tools.storage.get("stream.mode", tools.config.get("kvm--stream-mode", "janus"));
if (mode === "janus" && !has_janus) {
mode = "media";
}
Expand Down
4 changes: 2 additions & 2 deletions web/share/js/kvm/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export function Switch() {
tools.el.setOnClick($("switch-edid-remove-button"), __clickRemoveEdidButton);
tools.el.setOnClick($("switch-edid-copy-data-button"), __clickCopyEdidDataButton);

tools.storage.bindSimpleSwitch($("switch-atx-ask-switch"), "switch.atx.ask", true);
tools.storage.bindSimpleSwitch($("switch-msd-ask-switch"), "switch.msd.ask", true);
tools.storage.bindSimpleSwitch($("switch-atx-ask-switch"), "switch.atx.ask", tools.config.getBool("kvm--switch-atx-ask", true));
tools.storage.bindSimpleSwitch($("switch-msd-ask-switch"), "switch.msd.ask", tools.config.getBool("kvm--switch-msd-ask", true));

for (let role of ["inactive", "active", "flashing", "beacon", "bootloader"]) {
let el_brightness = $(`switch-color-${role}-brightness-slider`);
Expand Down