refactoring

This commit is contained in:
Devaev Maxim 2021-02-07 23:26:50 +03:00
parent 365d8e9fef
commit 711816bd26
2 changed files with 3 additions and 5 deletions

View File

@ -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?<br>
(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?<br>
(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]));

View File

@ -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.<br>` :
`You're going to paste ${text.length} character.<br>`;
let confirm_msg = `You're going to paste ${text.length} character${text.length ? "s" : ""}.<br>`;
confirm_msg += "Are you sure you want to continue?";
wm.confirm(confirm_msg).then(function(ok) {