fix bug in script

This commit is contained in:
Alexander Popov 2021-11-18 01:13:18 +03:00
parent 8f95ae6d29
commit ac3787e10a
Signed by: iiiypuk
GPG Key ID: 398FC73478D97286
2 changed files with 2 additions and 5 deletions

View File

@ -14,7 +14,7 @@
<div class="content">
<div class="wrap">
<textarea id="one" rows="3" placeholder="Paste fail layout text" onchange="layoutReplace()"></textarea>
<button>q > й</button>
<button onclick="layoutReplace()">q > й</button>
<textarea id="two" rows="3" disabled="disabled"></textarea>
</div>
</div>

View File

@ -2,7 +2,7 @@ function layoutReplace()
{
'use strict';
keys = {
let keys = {
"q":"й", "w":"ц", "e":"у", "r":"к", "t":"е", "y":"н", "u":"г",
"i":"ш", "o":"щ", "p":"з", "[":"х", "]":"ъ", "a":"ф", "s":"ы",
"d":"в", "f":"а", "g":"п", "h":"р", "j":"о", "k":"л", "l":"д",
@ -14,9 +14,6 @@ function layoutReplace()
let outputText = document.getElementById("two");
let text = null;
console.log(inputText);
text = inputText.replace(/[A-z/,.;\'\]\[]/g, function(x) {
return x == x.toLowerCase() ? keys[ x ] : keys[ x.toLowerCase() ].toUpperCase();
});