From 711816bd2665b450a63d90744740bb4cc0df4efe Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sun, 7 Feb 2021 23:26:50 +0300 Subject: [PATCH] refactoring --- web/share/js/kvm/atx.js | 4 ++-- web/share/js/kvm/hid.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/web/share/js/kvm/atx.js b/web/share/js/kvm/atx.js index 234c86c2..3ec04351 100644 --- a/web/share/js/kvm/atx.js +++ b/web/share/js/kvm/atx.js @@ -40,11 +40,11 @@ export function Atx() { ["atx-power-button", "power", "Are you sure you want to press the power button?"], ["atx-power-button-long", "power_long", ` Are you sure you want to long press the power button?
- (Warning! This could cause data loss on the server.) + Warning! This could cause data loss on the server. `], ["atx-reset-button", "reset", ` Are you sure you want to press the reset button?
- (Warning! This could case data loss on the server.) + Warning! This could case data loss on the server. `], ]) { tools.setOnClick($(args[0]), () => __clickButton(args[1], args[2])); diff --git a/web/share/js/kvm/hid.js b/web/share/js/kvm/hid.js index efbb46c0..bcd1e479 100644 --- a/web/share/js/kvm/hid.js +++ b/web/share/js/kvm/hid.js @@ -196,9 +196,7 @@ export function Hid() { var __clickPasteAsKeysButton = function() { let text = $("hid-pak-text").value.replace(/[^\x00-\x7F]/g, ""); // eslint-disable-line no-control-regex if (text) { - let confirm_msg = text.length !== 1 ? - `You're going to paste ${text.length} characters.
` : - `You're going to paste ${text.length} character.
`; + let confirm_msg = `You're going to paste ${text.length} character${text.length ? "s" : ""}.
`; confirm_msg += "Are you sure you want to continue?"; wm.confirm(confirm_msg).then(function(ok) {