From cc909352b4844784198e85744b7a1786bca52ba2 Mon Sep 17 00:00:00 2001 From: Owen D'Aprile Date: Sun, 7 Feb 2021 14:18:52 -0500 Subject: Web interface spelling fixes and improvements Also make the popup message for pasting characters change plurality depending on the amount of characters. --- web/share/js/kvm/atx.js | 12 +++++++++--- web/share/js/kvm/gpio.js | 2 +- web/share/js/kvm/hid.js | 8 ++++---- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'web/share') diff --git a/web/share/js/kvm/atx.js b/web/share/js/kvm/atx.js index ec870506..234c86c2 100644 --- a/web/share/js/kvm/atx.js +++ b/web/share/js/kvm/atx.js @@ -37,9 +37,15 @@ export function Atx() { $("atx-hdd-led").title = "Disk Activity Led"; for (let args of [ - ["atx-power-button", "power", "Are you sure to click the power button?"], - ["atx-power-button-long", "power_long", "Are you sure to perform the long press of the power button?"], - ["atx-reset-button", "reset", "Are you sure to reboot the server?"], + ["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.) + `], + ["atx-reset-button", "reset", ` + Are you sure you want to press the reset button?
+ (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/gpio.js b/web/share/js/kvm/gpio.js index 9a339da6..f31dbf05 100644 --- a/web/share/js/kvm/gpio.js +++ b/web/share/js/kvm/gpio.js @@ -123,7 +123,7 @@ export function Gpio() { `; } else if (item.type === "output") { let controls = []; - let confirm = (item.confirm ? "Are you sure to act this control?" : ""); + let confirm = (item.confirm ? "Are you sure you want to perform this action?" : ""); if (item.scheme["switch"]) { controls.push(`
diff --git a/web/share/js/kvm/hid.js b/web/share/js/kvm/hid.js index 4b4324bc..efbb46c0 100644 --- a/web/share/js/kvm/hid.js +++ b/web/share/js/kvm/hid.js @@ -196,10 +196,10 @@ 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 = ` - You're going to paste ${text.length} characters.
- Are you sure you want to continue? - `; + let confirm_msg = text.length !== 1 ? + `You're going to paste ${text.length} characters.
` : + `You're going to paste ${text.length} character.
`; + confirm_msg += "Are you sure you want to continue?"; wm.confirm(confirm_msg).then(function(ok) { if (ok) { -- cgit v1.2.3