diff --git a/static/check-serials.html b/static/check-serials.html index decf344..8a34660 100644 --- a/static/check-serials.html +++ b/static/check-serials.html @@ -90,7 +90,7 @@ diff --git a/static/css/login-style.css b/static/css/login-style.css index f015d71..5755eb5 100644 --- a/static/css/login-style.css +++ b/static/css/login-style.css @@ -123,7 +123,7 @@ body { .login__submit { background: #fff; font-size: 14px; - margin-top: 30px; + margin-top: 20px; padding: 16px 20px; border-radius: 26px; border: 1px solid #D4D3E8; @@ -204,4 +204,35 @@ body { color: #000; font-size: 12px; font-family: serif; +} + + +.sign-up-btn { + justify-content: center; + background: #fff; + font-size: 14px; + margin-top: 10px; + padding: 16px 20px; + border-radius: 26px; + border: 1px solid #D4D3E8; + text-transform: uppercase; + font-weight: 700; + display: flex; + align-items: center; + width: 100%; + color: #4C489D; + box-shadow: 0px 2px 2px #5C5696; + cursor: pointer; + transition: .2s; +} + +.sign-up-btn:hover { + + background: #f19999; +} +.disabled-btn{ + color: #b7b5b5; + cursor: no-drop ; + box-shadow: 0px 2px 2px #575662; + font-weight: 100; } \ No newline at end of file diff --git a/static/css/login.css b/static/css/login.css deleted file mode 100644 index 4db51a6..0000000 --- a/static/css/login.css +++ /dev/null @@ -1,71 +0,0 @@ -body { - font-family: Arial, sans-serif; -} -nav ul { - list-style-type: none; - padding: 0; -} -nav ul li { - display: inline; - margin-right: 10px; -} - - -* { - box-sizing: border-box; - font-family: -apple-system, BlinkMacSystemFont, "segoe ui", roboto, oxygen, ubuntu, cantarell, "fira sans", "droid sans", "helvetica neue", Arial, sans-serif; - font-size: 16px; -} -body { - background-color: #435165; -} -.login { - width: 400px; - background-color: #ffffff; - box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.3); - margin: 100px auto; -} -.login h1 { - text-align: center; - color: #5b6574; - font-size: 24px; - padding: 20px 0 20px 0; - border-bottom: 1px solid #dee0e4; -} -.login form { - display: flex; - flex-wrap: wrap; - justify-content: center; - padding-top: 20px; -} -.login form label { - display: flex; - justify-content: center; - align-items: center; - width: 50px; - height: 50px; - background-color: #3274d6; - color: #ffffff; -} -.login form input[type="password"], .login form input[type="text"] { - width: 310px; - height: 50px; - border: 1px solid #dee0e4; - margin-bottom: 20px; - padding: 0 15px; -} -.login form input[type="submit"] { - width: 100%; - padding: 15px; - margin-top: 20px; - background-color: #3274d6; - border: 0; - cursor: pointer; - font-weight: bold; - color: #ffffff; - transition: background-color 0.2s; -} -.login form input[type="submit"]:hover { - background-color: #2868c7; - transition: background-color 0.2s; -} \ No newline at end of file diff --git a/static/css/navbar.css b/static/css/navbar.css index cd34098..d8f988a 100644 --- a/static/css/navbar.css +++ b/static/css/navbar.css @@ -84,6 +84,7 @@ img.user-photo:hover { select#banksList { border-top-left-radius: 10px; border-bottom-left-radius: 10px; + width: 105px; } input#datepicker { @@ -100,6 +101,7 @@ input#datepicker { width: 300px; display: flex; height: 24px; + padding-right: 110px; } @@ -107,7 +109,7 @@ input#datepicker { #cityInput { border: 2px solid #ccc; /* Default border */ - padding: 10px; + padding: 5px; width: 200px; box-sizing: border-box; height: -webkit-fill-available; @@ -124,6 +126,7 @@ input#datepicker { } #cityList { + width: max-content; color: black; font-size: smaller; border: 1px solid #ccc; @@ -144,13 +147,15 @@ input#datepicker { background-color: #f0f0f0; } + .auto-complete-text { position: absolute; - /* float: right; */ + float: right; /* padding-left: 55%; */ - - right: 19px; - top: 3px; + right: 115px; + top: 4px; color: green; margin-bottom: 4px; + font-size: 13px; + font-family: sans-serif; } \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index 57d9bac..bb9ab76 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -14,7 +14,8 @@ body { /* background-color: rgb(71, 71, 71); */ /* background: linear-gradient(135deg, #7d7e7d 0%, #0e0e0e 100%); background: linear-gradient(135deg, #7d7e7d 0%, #0e0e0e 100%); */ - background: linear-gradient(0deg, #7d7e7d 0%, #0e0e0e 100%); + /* background: linear-gradient(0deg, #7d7e7d 0%, #0e0e0e 100%); */ + background: linear-gradient(0deg, #207895 0%, #03284d 100%); background-repeat: no-repeat; background-attachment: fixed; margin: auto; @@ -150,11 +151,13 @@ body { } .clean { - background-color: coral; + color: rgb(90, 32, 11); + /* background-color: coral; */ } .copying { - background-color: lightgreen; + color: rgb(8, 31, 8); + /* background-color: lightgreen; */ } .device { @@ -397,7 +400,18 @@ footer { display: block; } - - +.pax{ + /* background-color: rgb(50, 92, 230); */ + /* color: rgb(0, 0, 0); */ +} + +.verifone{ + /* background-color: rgb(0, 0, 0); */ + /* color: rgb(255, 255, 255); */ +} + +.ui-datepicker{ + z-index: 200 !important; +} diff --git a/static/images/d230.png b/static/images/d230.png new file mode 100644 index 0000000..8a40b49 Binary files /dev/null and b/static/images/d230.png differ diff --git a/static/images/favicon/site.webmanifest b/static/images/favicon/site.webmanifest index cc9ab84..f8a29bc 100644 --- a/static/images/favicon/site.webmanifest +++ b/static/images/favicon/site.webmanifest @@ -1,6 +1,6 @@ { - "name": "Pax S90", - "short_name": "Pax S90", + "name": "POS Diagnostic Assist", + "short_name": "POS Diagnostic Assist", "icons": [ { "src": "/images/favicon/android-chrome-36x36.png", diff --git a/static/images/scan-pos.png b/static/images/scan-pos.png new file mode 100644 index 0000000..2c21e40 Binary files /dev/null and b/static/images/scan-pos.png differ diff --git a/static/js/citydetails.js b/static/js/citydetails.js index 9243754..dba2ec8 100644 --- a/static/js/citydetails.js +++ b/static/js/citydetails.js @@ -47,7 +47,11 @@ function filterCities() { return; } - const filteredCities = cities.filter(city => city.toLowerCase().startsWith(input.value.toLowerCase())); + // Convert the input value using keyboardLayoutSwitch + const convertedInputValue = keyboardLayoutSwitch(input.value, 'en-ru'); + + + const filteredCities = cities.filter(city => city.toLowerCase().startsWith(convertedInputValue.toLowerCase())); if (filteredCities.length > 0) { // Remove the first letter from the matching city and set it as autocomplete text @@ -56,11 +60,6 @@ function filterCities() { // autocompleteText.innerText = matchCity.slice(1); // remove the first letter currentSelection = matchCity; // Update current selection - // Move the cursor to the second position (after the first letter) - // setTimeout(() => { - // input.setSelectionRange(1, 1); // Move cursor to the second position - // }, 0); - filteredCities.forEach(city => { const div = document.createElement("div"); div.textContent = city; @@ -77,8 +76,6 @@ function filterCities() { autocompleteText.innerText = ''; // Clear autocomplete text if no matches } - - } function selectCity(city) { @@ -145,7 +142,7 @@ function loadCityDetails() { } if (citydetails.datepickerInput) { - console.log(citydetails.datepickerInput); + // console.log(citydetails.datepickerInput); $(function () { $('#datepicker').datepicker({ diff --git a/static/js/diag.js b/static/js/diag.js index e89713f..3c4ee52 100644 --- a/static/js/diag.js +++ b/static/js/diag.js @@ -20,23 +20,28 @@ let details = { dcjack: ["Перепайка разъема зарядки", "Не заряжается"], batteries: ["Замена батарейки CR2032", "TAMPER"], batteries2: ["Замена Батарейки CR2450", "TAMPER"], + batteries1630: ["Замена Батарейки CR1630", "TAMPER"], buzzer: ["Замена пищалка", "пищалка"], conactlessboard: ["Замена платы ктлц", "Залипает клавиатура"], key: ["Очистка клавиатуры", "Залипает клавиатура"], keyC: ["Очистка платы ктлц", "Залипает клавиатура"], boardio: ["Замена нижней платы", "Не печатает"], ctls: ["Замена платы ктлц", "Залипает CTLS"], - mag_clean: ["Очистка магнитный ридер", "Залит"], - frontcase_change: ["Замена переднего корпуса", "Корпус МЕХ"], + frontcasechange: ["Замена переднего корпуса", "Корпус МЕХ"], frontcase_clean: ["Очистка корпуса", "Залит"], bunker: ["Замена бункер", "Кнопки"], charging: ["Восстановление АКБ", "АКБ"], - battery_new: ["Замена АКБ", "АКБ"], + accumnew: ["Замена АКБ", "АКБ"], gprs: ["Замена модуль связи", "Связь"], lens: ["Замена линза", "Линза"], chip: ["обшая работа", "Не прошивается"], off: ["", "Не вкл"], + powersupply: ["TAMPER", "Восстановление ципи питания"], + miscroSD: ["miscroSD", "Перепайка miscroSD"], + sim: ["сим", "Замена сим лоток"], + touch: ["touch", "Замена touch"], + speaker: ["динамика", "Замена динамика"] } const models = { @@ -69,12 +74,11 @@ let copiedTitle = ''; let polite = true; let enableBlinking = true; +let modelFound = false; + $(function () { $('.maparea').maphilight({ - // "strokeColor":"0000ff", - // "strokeWidth":3, - // "fillColor":"ff0000", - // "fillOpacity":0.6 + }); }); @@ -217,7 +221,7 @@ checkDetails = () => { tempSerial = $("#serial").val(); } - checkModel(); + // checkModel(); let serial = document.getElementById("serial"); tempSerial = keyboardLayoutSwitch(serial.value) @@ -455,7 +459,12 @@ $('#reset').on('click', () => { const cleanAll = () => { + modelFound = false manualSelectModel = false; + $("#selectmodel").removeClass("blinking"); + + cleanCoords(); // clean coords and shapes in area tag + document.getElementById("serial").focus(); for (let id in intervalIds) { @@ -510,6 +519,72 @@ $('#showStorage').on('click', () => { }); +const modelImages = { + 'S90': './images/PAX-S90-v0.7.png', + 'D230': './images/d230.png' + // Add more models as needed +}; + +function cleanCoords() { + + const newCoords = "0,0,0,0,0,0,0,0"; // Example polygon coordinates + const newShape = "poly"; // Example shape type + + // Get all area elements within the map + const areas = document.querySelectorAll('map area'); + + // Update each area element + areas.forEach(area => { + area.setAttribute('coords', newCoords); + area.setAttribute('shape', newShape); + }); +} + + +function updateCoords(model) { + // Check if coordinates are available for the model + if (modelCoords[model]) { + modelCoords[model].forEach(area => { + const areaElement = document.querySelector(`#map area[id=${area.id}]`); + if (areaElement) { + areaElement.setAttribute('coords', area.coords.join(',')); + areaElement.setAttribute('shape', area.shape); + } else { + console.log(`No area found with id: ${area.id}`); + } + }); + } else { + console.log('No coordinates available for this model'); + } +} + +function imageFromModel(model) { + // console.log('func imageFromModel', model); + + if (modelImages[model]) { + // Update the image source + let imagePath = modelImages[model]; + if (imagePath) { + let timestamp = new Date().getTime(); + $('.maparea img').attr('src', `${imagePath}?${timestamp}`); + + // Update the coordinates + updateCoords(model); + + // Reinitialize maphilight if needed + $('.maparea').maphilight({ + // Add your maphilight options here if needed + }); + + console.log('imagePath', imagePath); + } + } else { + console.log('Model not found for the serial number'); + imageFromModel('S90') + } +} + + let SerialNumber = document.getElementById("SerialNumber"); SerialNumber.addEventListener("submit", (e) => { @@ -529,6 +604,9 @@ SerialNumber.addEventListener("submit", (e) => { tempSerial = keyboardLayoutSwitch(serial.value) $("#serial").val(tempSerial); checkModel(tempSerial, models) + + imageFromModel(checkModel(tempSerial, models)) + console.log('tempSerial, models', tempSerial, models); @@ -562,10 +640,6 @@ SerialNumber.addEventListener("submit", (e) => { $('.form-btn').css('background-color', 'orangered') }); - - - - } }); @@ -640,18 +714,21 @@ $("#selectmodel").change(function () { $("#selectmodel").removeClass("blinking"); tempModel = document.getElementById("selectmodel").value; // checkModel(tempSerial, tempModel); + cleanCoords(); + imageFromModel(tempModel) checkDetails() // console.log(tempSerial, tempModel); }); const checkModel = (serial, models) => { - // serial.includes("3K"); // true console.log('func checkModel'); - if (manualSelectModel) { tempModel = document.getElementById("selectmodel").value; + // updateCoords(tempModel); + + return; } @@ -666,17 +743,19 @@ const checkModel = (serial, models) => { if (serial.startsWith(element[length])) { console.log('found serial match: ' + key); $("#selectmodel").val(key); + // tempModel = key // console.log('list length is ', listSerialLength); // console.log('Serial length is ', serial.length); if (listSerialLength == serial.length) { tempModel = key $("#selectmodel").removeClass("blinking"); - return; + modelFound = true; + return key ; }else if (listSerialLength == '0'){ tempModel = key $("#selectmodel").removeClass("blinking"); - return; + return key; } else { $("#selectmodel").addClass("blinking"); tempModel = 'ERROR' diff --git a/static/js/id-coords.js b/static/js/id-coords.js new file mode 100644 index 0000000..1f7bdec --- /dev/null +++ b/static/js/id-coords.js @@ -0,0 +1,113 @@ +const modelCoords = { + "S90": [ + {"id":"usb","shape":"poly","coords":[30,406,31,430,33,431,32,463,27,465,25,466,24,470,24,477,23,489,24,502,26,503,38,504,38,511,15,511,14,499,15,495,14,482,13,482,12,467,8,464,5,463,4,461,4,430,7,429,7,406]} + ,{"id":"backcase","shape":"poly","coords":[489,506,491,507,498,508,500,510,501,515,502,517,503,521,504,529,503,600,501,603,500,608,494,611,482,612,459,611,456,607,455,599,454,569,455,524,456,522,456,519,458,517,459,511,465,508,471,507,470,506,472,505]} + ,{"id":"keyboard","shape":"rect","coords":[358,436,416,487]} + ,{"id":"printerroller","shape":"poly","coords":[59,76,64,82,74,81,78,80,213,81,215,82,221,83,229,84,227,91,208,92,73,92,72,89,61,90,56,95,54,94,53,90,53,75]} + ,{"id":"printerchange","shape":"poly","coords":[230,52,231,58,232,60,233,68,232,82,231,84,231,95,231,104,224,104,223,94,223,91,229,90,229,83,227,82,221,83,216,82,214,81,196,80,143,80,144,52]} + ,{"id":"printerclean","shape":"poly","coords":[129,25,136,33,129,37,127,36,125,37,101,38,103,39,138,39,139,52,142,52,142,79,72,80,67,82,62,81,60,76,59,74,57,75,52,75,53,97,59,96,60,92,62,91,63,93,62,113,43,112,42,110,43,92,42,88,43,50,47,49,49,48,92,47,94,44,95,39,93,34,92,29,91,28,89,29,88,26,108,25,122,24]} + ,{"id":"printercoverused","shape":"poly","coords":[217,121,228,127,234,137,247,193,245,208,143,206,145,117,212,120]} + ,{"id":"printercovernew","shape":"poly","coords":[142,117,142,208,34,207,35,194,36,192,37,186,38,172,39,168,42,149,43,147,48,133,58,122,64,121,68,120,90,117]} + ,{"id":"Clear","shape":"poly","coords":[157,596,160,598,161,602,160,608,155,612,145,615,135,614,133,613,127,610,123,603,126,597,128,596,142,595]} + ,{"id":"Cancle","shape":"poly","coords":[105,571,107,574,108,578,108,585,106,586,104,590,103,592,97,597,84,596,77,588,76,586,75,582,76,575,80,571,103,571]} + ,{"id":"n0","shape":"poly","coords":[161,568,163,573,162,579,155,585,144,587,133,586,125,581,123,574,124,569,129,567]} + ,{"id":"Enter","shape":"poly","coords":[199,570,207,571,210,575,209,586,206,592,204,593,204,594,203,593,200,596,197,596,189,595,187,594,182,590,178,581,177,577,178,573,182,570]} + ,{"id":"n9","shape":"poly","coords":[208,539,214,543,215,547,214,553,209,557,200,559,188,558,186,557,180,554,177,548,178,540,182,539,196,538]} + ,{"id":"n8","shape":"poly","coords":[160,539,163,543,162,550,156,556,143,558,133,557,131,556,124,551,123,545,124,541,127,539,131,538]} + ,{"id":"n7","shape":"poly","coords":[107,540,108,543,109,543,108,551,102,557,92,560,78,559,72,554,71,552,72,542,78,539]} + ,{"id":"n4","shape":"poly","coords":[108,512,109,516,108,522,102,528,92,531,79,530,77,529,72,525,71,521,72,514,74,512,76,511]} + ,{"id":"n5","shape":"poly","coords":[160,510,163,516,162,522,158,526,150,529,146,530,134,529,132,528,125,524,123,517,124,512,128,509]} + ,{"id":"n6","shape":"poly","coords":[210,510,211,512,214,513,215,519,214,524,210,528,197,530,188,529,186,528,181,525,177,520,178,512,183,510]} + ,{"id":"n3","shape":"poly","coords":[211,482,214,486,215,492,208,499,200,500,188,499,181,494,178,490,179,483,181,482,189,481]} + ,{"id":"n2","shape":"poly","coords":[157,481,160,481,161,483,163,484,162,493,156,498,149,500,145,501,134,500,132,499,127,496,123,491,124,483,127,481]} + ,{"id":"n1","shape":"poly","coords":[107,482,106,483,108,485,109,487,108,492,101,499,92,501,86,502,84,501,77,500,71,495,72,484,75,482,79,481]} + ,{"id":"alpha","shape":"poly","coords":[104,447,108,450,108,455,105,460,101,463,91,466,79,465,72,460,71,454,73,449,78,447,86,446]} + ,{"id":"down","shape":"poly","coords":[159,447,161,450,163,451,162,458,157,463,147,466,134,465,132,464,125,459,123,454,124,449,126,447,128,446]} + ,{"id":"menu","shape":"poly","coords":[207,446,209,447,214,451,215,455,214,460,210,464,197,466,184,463,177,455,178,449,184,446,200,445]} + ,{"id":"func","shape":"poly","coords":[210,417,214,421,215,425,214,430,210,434,201,436,189,435,187,434,182,431,178,426,178,420,179,419,178,418,179,417,180,418,182,417,188,416]} + ,{"id":"up","shape":"poly","coords":[153,418,161,425,162,428,163,430,162,433,158,436,151,437,149,436,147,437,131,436,125,435,123,428,128,421,134,418,138,417]} + ,{"id":"power","shape":"poly","coords":[106,417,108,420,107,429,103,432,97,435,89,436,75,433,72,429,71,425,72,421,75,417,87,416]} + ,{"id":"f4","shape":"rect","coords":[219,364,239,378]} + ,{"id":"f3","shape":"rect","coords":[220,339,239,354]} + ,{"id":"f2","shape":"rect","coords":[220,315,239,331]} + ,{"id":"f1","shape":"rect","coords":[220,293,239,307]} + ,{"id":"plonka","shape":"rect","coords":[68,283,138,376]} + ,{"id":"screen","shape":"rect","coords":[206,283,140,378]} + ,{"id":"newdc","shape":"poly","coords":[420,364,416,391,410,397,413,400,400,409,360,399,360,374,372,361,372,359,378,358,386,354,419,362]} + ,{"id":"Tarakan","shape":"poly","coords":[303,521,305,518,305,529,312,530,313,528,315,526,320,519,314,536,316,543,317,543,322,545,324,546,335,551,341,552,325,554,324,559,326,563,330,591,334,602,337,609,335,609,329,596,326,593,323,595,324,605,319,608,309,611,297,605,292,605,291,601,287,617,287,603,283,590,282,573,282,571,289,569,285,559,281,561,279,564,276,565,276,567,274,567,270,566,273,564,273,563,278,560,278,558,280,558,280,557,287,551,287,542,284,530,283,526,288,527,291,527,281,515,273,506,295,524,299,521,307,499,301,523,303,523]} + ,{"id":"water","shape":"circle","coords":[395,563,43]} + ,{"id":"changesimreader","shape":"poly","coords":[480,315,449,235,378,235,381,306]} + ,{"id":"cleansimreader","shape":"poly","coords":[307,231,286,307,377,305,377,232]} + ,{"id":"cpu","shape":"poly","coords":[404,189,423,189,424,193,425,197,426,201,427,205,430,215,431,222,401,221,357,220,329,219,322,219,323,208,324,206,329,188]} + ,{"id":"protection","shape":"poly","coords":[307,222,319,225,317,232,304,234,286,292,282,324,278,323,273,314,272,300,285,251,297,220]} + ,{"id":"protection","shape":"poly","coords":[460,228,469,251,489,312,479,325,478,302,457,250,448,236,438,230,444,225]} + ,{"id":"dcjack","shape":"poly","coords":[478,118,483,128,482,139,481,141,480,142,476,143,474,144,469,143,467,142,464,141,463,143,463,144,462,139,457,140,457,141,456,138,454,135,453,129,454,117]} + ,{"id":"batteries","shape":"poly","coords":[352,91,354,92,360,95,362,98,361,110,349,117,335,118,320,117,314,112,312,107,311,104,310,103,320,94,326,91,334,90]} + ,{"id":"batteries2","shape":"poly","coords":[400,119,402,120,407,121,413,124,416,125,426,134,428,139,429,143,428,155,426,158,425,163,420,170,412,175,400,178,388,179,384,178,374,177,368,174,359,169,355,165,352,161,351,157,350,140,349,138,349,131,353,130,367,121,371,120,380,118]} + ,{"id":"buzzer","shape":"poly","coords":[323,148,324,150,325,150,327,153,328,153,330,160,329,171,321,179,322,180,320,182,303,181,301,168,302,165,300,163,299,160,306,152,311,150,315,149,317,148]} + ,{"id":"ctls","shape":"rect","coords":[49,249,242,470]} + ,{"id":"boardio","shape":"poly","coords":[430,45,453,83,463,85,464,94,456,98,458,100,462,102,464,104,475,106,476,114,386,117,363,117,362,109,361,96,352,91,330,90,314,98,311,101,309,108,303,107,292,107,298,95,304,89,308,80,316,77,317,65,313,62,321,40,426,41]} + ,{"id":"lens","shape":"poly","coords":[675,42,680,66,683,67,679,91,682,101,681,109,682,117,683,128,683,143,685,165,601,168,553,165,556,86,556,49,561,47,563,40]} + ,{"id":"accumnew","shape":"poly","coords":[596,293,652,294,690,299,689,336,562,335,558,302,546,322,545,328,536,332,533,335,521,323,528,314,531,310,538,310,556,298,567,293,594,293]} + ,{"id":"gprs","shape":"poly","coords":[696,186,696,262,587,261,546,255,549,235,542,232,556,195]} + ,{"id":"chip","shape":"poly","coords":[659,544,667,559,671,548,712,554,708,593,665,587,664,584,639,597,636,594,620,562,657,542]} + ,{"id":"off","shape":"rect","coords":[547,533,606,612]} + ,{"id":"charging","shape":"poly","coords":[653,362,654,364,655,372,659,373,661,380,675,381,674,382,659,383,658,388,654,389,653,399,584,398,583,396,582,381,567,381,568,379,583,378,584,362,586,361]} + ,{"id":"bunker","shape":"poly","coords":[678,433,690,513,550,511,564,430,664,428]} + ,{"id":"mag_change","shape":"poly","coords":[314,424,310,449,308,450,305,470,302,490,298,493,285,489,283,450,277,447,277,422]} + ,{"id":"mag_clean","shape":"poly","coords":[304,350,306,359,307,389,308,389,309,391,311,392,312,398,313,406,314,408,314,421,276,420,277,393,280,392,282,391,285,388,286,385,285,383,286,381,287,351,288,352,293,350]} + ,{"id":"frontcase_clean","shape":"rect","coords":[452,355,477,470]} + ,{"id":"frontcasechange","shape":"rect","coords":[478,355,504,470]} +], + 'D230': [ + {"id":"printerclean","shape":"poly","coords":[82,33,84,42,85,49,116,49,176,50,191,50,196,50,195,98,81,97,73,78,74,59,75,57,76,32]} + ,{"id":"cleansimreader","shape":"poly","coords":[609,374,584,286,491,286,491,380,605,380]} + ,{"id":"buzzer","shape":"poly","coords":[511,256,512,286,569,286,558,256]} + ,{"id":"connector","shape":"poly","coords":[492,263,507,263,508,280,507,286,492,286,491,272]} + ,{"id":"changesimreader","shape":"poly","coords":[396,286,396,291,390,291,366,375,373,380,491,380,491,380,491,286]} + ,{"id":"cpu","shape":"poly","coords":[433,237,486,237,488,276,426,276]} + ,{"id":"dcjack","shape":"poly","coords":[373,269,369,284,369,290,394,291,394,286,396,284,402,269]} + ,{"id":"powersupply","shape":"rect","coords":[464,104,569,133]} + ,{"id":"miscroSD","shape":"rect","coords":[523,65,577,89]} + ,{"id":"sim","shape":"rect","coords":[402,57,451,90]} + ,{"id":"speaker","shape":"circle","coords":[426,172,30]} + ,{"id":"batteries1630","shape":"circle","coords":[528,189,30]} + ,{"id":"n1","shape":"poly","coords":[102,458,103,458,104,458,105,458,106,458,107,458,108,458,109,458,110,458,111,458,112,458,113,458,114,458,115,458,116,458,117,458,118,458,119,458,120,458,121,458,122,458,123,458,124,458,125,458,126,458,127,458,128,458,129,458,130,458,131,458,132,458,133,458,134,458,135,459,136,459,137,460,138,461,138,462,139,463,139,464,139,465,139,466,139,467,139,468,139,469,139,470,139,471,139,472,139,473,138,474,138,475,137,476,136,477,135,477,134,478,133,478,132,478,131,478,130,478,129,478,128,478,127,478,126,478,125,478,124,478,123,478,122,478,121,478,120,478,119,478,118,478,117,478,116,478,115,478,114,478,113,478,112,478,111,478,110,478,109,478,108,478,107,478,106,478,105,478,104,478,103,478,102,478,101,477,100,477,99,476,98,475,98,474,97,473,97,472,97,471,97,470,97,469,97,468,97,467,97,466,97,465,97,464,97,463,98,462,98,461,99,460,100,459,101,459]} + ,{"id":"n2","shape":"poly","coords":[152,458,153,458,154,458,155,458,156,458,157,458,158,458,159,458,160,458,161,458,162,458,163,458,164,458,165,458,166,458,167,458,168,458,169,458,170,458,171,458,172,458,173,458,174,458,175,458,176,458,177,458,178,458,179,458,180,458,181,458,182,458,183,458,184,458,185,458,186,459,187,459,188,460,189,461,189,462,190,463,190,464,190,465,190,466,190,467,190,468,190,469,190,470,190,471,190,472,190,473,189,474,189,475,188,476,187,477,186,477,185,478,184,478,183,478,182,478,181,478,180,478,179,478,178,478,177,478,176,478,175,478,174,478,173,478,172,478,171,478,170,478,169,478,168,478,167,478,166,478,165,478,164,478,163,478,162,478,161,478,160,478,159,478,158,478,157,478,156,478,155,478,154,478,153,478,152,478,151,477,150,477,149,476,148,475,148,474,147,473,147,472,147,471,147,470,147,469,147,468,147,467,147,466,147,465,147,464,147,463,148,462,148,461,149,460,150,459,151,459]} + ,{"id":"n3","shape":"poly","coords":[203,458,204,458,205,458,206,458,207,458,208,458,209,458,210,458,211,458,212,458,213,458,214,458,215,458,216,458,217,458,218,458,219,458,220,458,221,458,222,458,223,458,224,458,225,458,226,458,227,458,228,458,229,458,230,458,231,458,232,458,233,458,234,458,235,458,236,458,237,459,238,459,239,460,240,461,240,462,241,463,241,464,241,465,241,466,241,467,241,468,241,469,241,470,241,471,241,472,241,473,240,474,240,475,239,476,238,477,237,477,236,478,235,478,234,478,233,478,232,478,231,478,230,478,229,478,228,478,227,478,226,478,225,478,224,478,223,478,222,478,221,478,220,478,219,478,218,478,217,478,216,478,215,478,214,478,213,478,212,478,211,478,210,478,209,478,208,478,207,478,206,478,205,478,204,478,203,478,202,477,201,477,200,476,199,475,199,474,198,473,198,472,198,471,198,470,198,469,198,468,198,467,198,466,198,465,198,464,198,463,199,462,199,461,200,460,201,459,202,459]} + ,{"id":"n4","shape":"poly","coords":[101,485,102,485,103,485,104,485,105,485,106,485,107,485,108,485,109,485,110,485,111,485,112,485,113,485,114,485,115,485,116,485,117,485,118,485,119,485,120,485,121,485,122,485,123,485,124,485,125,485,126,485,127,485,128,485,129,485,130,485,131,485,132,485,133,485,134,485,135,485,136,486,137,487,138,488,139,489,139,490,139,491,139,492,139,493,139,494,139,495,139,496,139,497,139,498,139,499,139,500,138,501,137,502,136,503,135,504,134,504,133,504,132,504,131,504,130,504,129,504,128,504,127,504,126,504,125,504,124,504,123,504,122,504,121,504,120,504,119,504,118,504,117,504,116,504,115,504,114,504,113,504,112,504,111,504,110,504,109,504,108,504,107,504,106,504,105,504,104,504,103,504,102,504,101,504,100,503,99,502,98,501,97,500,97,499,97,498,97,497,97,496,97,495,97,494,97,493,97,492,97,491,97,490,97,489,98,488,99,487,100,486]} + ,{"id":"n5","shape":"poly","coords":[152,485,153,485,154,485,155,485,156,485,157,485,158,485,159,485,160,485,161,485,162,485,163,485,164,485,165,485,166,485,167,485,168,485,169,485,170,485,171,485,172,485,173,485,174,485,175,485,176,485,177,485,178,485,179,485,180,485,181,485,182,485,183,485,184,485,185,485,186,486,187,486,188,487,189,488,189,489,190,490,190,491,190,492,190,493,190,494,190,495,190,496,190,497,190,498,190,499,190,500,189,501,189,502,188,503,187,504,186,504,185,505,184,505,183,505,182,505,181,505,180,505,179,505,178,505,177,505,176,505,175,505,174,505,173,505,172,505,171,505,170,505,169,505,168,505,167,505,166,505,165,505,164,505,163,505,162,505,161,505,160,505,159,505,158,505,157,505,156,505,155,505,154,505,153,505,152,505,151,504,150,504,149,503,148,502,148,501,147,500,147,499,147,498,147,497,147,496,147,495,147,494,147,493,147,492,147,491,147,490,148,489,148,488,149,487,150,486,151,486]} + ,{"id":"n6","shape":"poly","coords":[203,485,204,485,205,485,206,485,207,485,208,485,209,485,210,485,211,485,212,485,213,485,214,485,215,485,216,485,217,485,218,485,219,485,220,485,221,485,222,485,223,485,224,485,225,485,226,485,227,485,228,485,229,485,230,485,231,485,232,485,233,485,234,485,235,485,236,485,237,486,238,486,239,487,240,488,240,489,241,490,241,491,241,492,241,493,241,494,241,495,241,496,241,497,241,498,241,499,241,500,240,501,240,502,239,503,238,504,237,504,236,505,235,505,234,505,233,505,232,505,231,505,230,505,229,505,228,505,227,505,226,505,225,505,224,505,223,505,222,505,221,505,220,505,219,505,218,505,217,505,216,505,215,505,214,505,213,505,212,505,211,505,210,505,209,505,208,505,207,505,206,505,205,505,204,505,203,505,202,504,201,504,200,503,199,502,199,501,198,500,198,499,198,498,198,497,198,496,198,495,198,494,198,493,198,492,198,491,198,490,199,489,199,488,200,487,201,486,202,486]} + ,{"id":"n7","shape":"poly","coords":[101,513,102,513,103,513,104,513,105,513,106,513,107,513,108,513,109,513,110,513,111,513,112,513,113,513,114,513,115,513,116,513,117,513,118,513,119,513,120,513,121,513,122,513,123,513,124,513,125,513,126,513,127,513,128,513,129,513,130,513,131,513,132,513,133,513,134,513,135,513,136,514,137,515,138,516,139,517,139,518,139,519,139,520,139,521,139,522,139,523,139,524,139,525,139,526,139,527,139,528,138,529,137,530,136,531,135,532,134,532,133,532,132,532,131,532,130,532,129,532,128,532,127,532,126,532,125,532,124,532,123,532,122,532,121,532,120,532,119,532,118,532,117,532,116,532,115,532,114,532,113,532,112,532,111,532,110,532,109,532,108,532,107,532,106,532,105,532,104,532,103,532,102,532,101,532,100,531,99,530,98,529,97,528,97,527,97,526,97,525,97,524,97,523,97,522,97,521,97,520,97,519,97,518,97,517,98,516,99,515,100,514]} + ,{"id":"n8","shape":"poly","coords":[151,513,152,513,153,513,154,513,155,513,156,513,157,513,158,513,159,513,160,513,161,513,162,513,163,513,164,513,165,513,166,513,167,513,168,513,169,513,170,513,171,513,172,513,173,513,174,513,175,513,176,513,177,513,178,513,179,513,180,513,181,513,182,513,183,513,184,513,185,513,186,513,187,514,188,515,189,516,190,517,190,518,190,519,190,520,190,521,190,522,190,523,190,524,190,525,190,526,190,527,190,528,189,529,188,530,187,531,186,532,185,532,184,532,183,532,182,532,181,532,180,532,179,532,178,532,177,532,176,532,175,532,174,532,173,532,172,532,171,532,170,532,169,532,168,532,167,532,166,532,165,532,164,532,163,532,162,532,161,532,160,532,159,532,158,532,157,532,156,532,155,532,154,532,153,532,152,532,151,532,150,531,149,530,148,529,147,528,147,527,147,526,147,525,147,524,147,523,147,522,147,521,147,520,147,519,147,518,147,517,148,516,149,515,150,514]} + ,{"id":"n9","shape":"poly","coords":[202,513,203,513,204,513,205,513,206,513,207,513,208,513,209,513,210,513,211,513,212,513,213,513,214,513,215,513,216,513,217,513,218,513,219,513,220,513,221,513,222,513,223,513,224,513,225,513,226,513,227,513,228,513,229,513,230,513,231,513,232,513,233,513,234,513,235,513,236,513,237,513,238,514,239,515,240,516,241,517,241,518,241,519,241,520,241,521,241,522,241,523,241,524,241,525,241,526,241,527,241,528,240,529,239,530,238,531,237,532,236,532,235,532,234,532,233,532,232,532,231,532,230,532,229,532,228,532,227,532,226,532,225,532,224,532,223,532,222,532,221,532,220,532,219,532,218,532,217,532,216,532,215,532,214,532,213,532,212,532,211,532,210,532,209,532,208,532,207,532,206,532,205,532,204,532,203,532,202,532,201,531,200,530,199,529,198,528,198,527,198,526,198,525,198,524,198,523,198,522,198,521,198,520,198,519,198,518,198,517,199,516,200,515,201,514]} + ,{"id":"func","shape":"poly","coords":[102,539,103,539,104,539,105,539,106,539,107,539,108,539,109,539,110,539,111,539,112,539,113,539,114,539,115,539,116,539,117,539,118,539,119,539,120,539,121,539,122,539,123,539,124,539,125,539,126,539,127,539,128,539,129,539,130,539,131,539,132,539,133,539,134,539,135,540,136,540,137,541,138,542,138,543,139,544,139,545,139,546,139,547,139,548,139,549,139,550,139,551,139,552,139,553,139,554,139,555,138,556,138,557,137,558,136,559,135,559,134,560,133,560,132,560,131,560,130,560,129,560,128,560,127,560,126,560,125,560,124,560,123,560,122,560,121,560,120,560,119,560,118,560,117,560,116,560,115,560,114,560,113,560,112,560,111,560,110,560,109,560,108,560,107,560,106,560,105,560,104,560,103,560,102,560,101,559,100,559,99,558,98,557,98,556,97,555,97,554,97,553,97,552,97,551,97,550,97,549,97,548,97,547,97,546,97,545,97,544,98,543,98,542,99,541,100,540,101,540]} + ,{"id":"n0","shape":"poly","coords":[152,539,153,539,154,539,155,539,156,539,157,539,158,539,159,539,160,539,161,539,162,539,163,539,164,539,165,539,166,539,167,539,168,539,169,539,170,539,171,539,172,539,173,539,174,539,175,539,176,539,177,539,178,539,179,539,180,539,181,539,182,539,183,539,184,539,185,539,186,539,187,540,188,540,189,541,190,542,190,543,191,544,191,545,191,546,191,547,191,548,191,549,191,550,191,551,191,552,191,553,191,554,191,555,190,556,190,557,189,558,188,559,187,559,186,560,185,560,184,560,183,560,182,560,181,560,180,560,179,560,178,560,177,560,176,560,175,560,174,560,173,560,172,560,171,560,170,560,169,560,168,560,167,560,166,560,165,560,164,560,163,560,162,560,161,560,160,560,159,560,158,560,157,560,156,560,155,560,154,560,153,560,152,560,151,559,150,559,149,558,148,557,148,556,147,555,147,554,147,553,147,552,147,551,147,550,147,549,147,548,147,547,147,546,147,545,147,544,148,543,148,542,149,541,150,540,151,540]} + ,{"id":"alpha","shape":"poly","coords":[203,539,204,539,205,539,206,539,207,539,208,539,209,539,210,539,211,539,212,539,213,539,214,539,215,539,216,539,217,539,218,539,219,539,220,539,221,539,222,539,223,539,224,539,225,539,226,539,227,539,228,539,229,539,230,539,231,539,232,539,233,539,234,539,235,539,236,539,237,540,238,540,239,541,240,542,240,543,241,544,241,545,241,546,241,547,241,548,241,549,241,550,241,551,241,552,241,553,241,554,241,555,240,556,240,557,239,558,238,559,237,559,236,560,235,560,234,560,233,560,232,560,231,560,230,560,229,560,228,560,227,560,226,560,225,560,224,560,223,560,222,560,221,560,220,560,219,560,218,560,217,560,216,560,215,560,214,560,213,560,212,560,211,560,210,560,209,560,208,560,207,560,206,560,205,560,204,560,203,560,202,559,201,559,200,558,199,557,199,556,198,555,198,554,198,553,198,552,198,551,198,550,198,549,198,548,198,547,198,546,198,545,198,544,199,543,199,542,200,541,201,540,202,540]} + ,{"id":"Cancle","shape":"poly","coords":[256,458,257,458,258,458,259,458,260,458,261,458,262,458,263,458,264,458,265,458,266,458,267,458,268,458,269,458,270,458,271,458,272,458,273,458,274,458,275,458,276,458,277,458,278,458,279,458,280,458,281,458,282,458,283,458,284,458,285,458,286,458,287,459,288,459,289,460,290,461,290,462,291,463,291,464,291,465,291,466,291,467,291,468,291,469,291,470,291,471,291,472,291,473,290,474,290,475,289,476,288,477,287,477,286,478,285,478,284,478,283,478,282,478,281,478,280,478,279,478,278,478,277,478,276,478,275,478,274,478,273,478,272,478,271,478,270,478,269,478,268,478,267,478,266,478,265,478,264,478,263,478,262,478,261,478,260,478,259,478,258,478,257,478,256,478,255,477,254,477,253,476,252,475,252,474,251,473,251,472,251,471,251,470,251,469,251,468,251,467,251,466,251,465,251,464,251,463,252,462,252,461,253,460,254,459,255,459]} + ,{"id":"Clear","shape":"poly","coords":[256,485,257,485,258,485,259,485,260,485,261,485,262,485,263,485,264,485,265,485,266,485,267,485,268,485,269,485,270,485,271,485,272,485,273,485,274,485,275,485,276,485,277,485,278,485,279,485,280,485,281,485,282,485,283,485,284,485,285,485,286,485,287,486,288,486,289,487,290,488,290,489,291,490,291,491,291,492,291,493,291,494,291,495,291,496,291,497,291,498,291,499,291,500,290,501,290,502,289,503,288,504,287,504,286,505,285,505,284,505,283,505,282,505,281,505,280,505,279,505,278,505,277,505,276,505,275,505,274,505,273,505,272,505,271,505,270,505,269,505,268,505,267,505,266,505,265,505,264,505,263,505,262,505,261,505,260,505,259,505,258,505,257,505,256,505,255,504,254,504,253,503,252,502,252,501,251,500,251,499,251,498,251,497,251,496,251,495,251,494,251,493,251,492,251,491,251,490,252,489,252,488,253,487,254,486,255,486]} + ,{"id":"Enter","shape":"poly","coords":[256,513,257,513,258,513,259,513,260,513,261,513,262,513,263,513,264,513,265,513,266,513,267,513,268,513,269,513,270,513,271,513,272,513,273,513,274,513,275,513,276,513,277,513,278,513,279,513,280,513,281,513,282,513,283,513,284,513,285,513,286,513,287,514,288,514,289,515,290,516,290,517,291,518,291,519,291,520,291,521,291,522,291,523,291,524,291,525,291,526,291,527,291,528,291,529,291,530,291,531,291,532,291,533,291,534,291,535,291,536,291,537,291,538,291,539,291,540,291,541,291,542,291,543,291,544,291,545,291,546,291,547,291,548,291,549,291,550,291,551,291,552,291,553,291,554,291,555,290,556,290,557,289,558,288,559,287,559,286,560,285,560,284,560,283,560,282,560,281,560,280,560,279,560,278,560,277,560,276,560,275,560,274,560,273,560,272,560,271,560,270,560,269,560,268,560,267,560,266,560,265,560,264,560,263,560,262,560,261,560,260,560,259,560,258,560,257,560,256,560,255,559,254,559,253,558,252,557,252,556,251,555,251,554,251,553,251,552,251,551,251,550,251,549,251,548,251,547,251,546,251,545,251,544,251,543,251,542,251,541,251,540,251,539,251,538,251,537,251,536,251,535,251,534,251,533,251,532,251,531,251,530,251,529,251,528,251,527,251,526,251,525,251,524,251,523,251,522,251,521,251,520,251,519,251,518,252,517,252,516,253,515,254,514,255,514]} + ,{"id":"screen","shape":"rect","coords":[198,269,296,419]} + ,{"id":"touch","shape":"rect","coords":[97,269,197,419]} + ,{"id":"ctls","shape":"poly","coords":[82,269,82,435,84,439,88,442,91,443,297,443,302,442,307,437,308,433,308,246,307,240,303,237,297,237,91,237,87,240,84,244,82,252,82,269,297,269,297,419,97,419,97,269]} + ,{"id":"printercoverused","shape":"poly","coords":[275,111,307,114,310,119,317,155,321,206,319,212,281,215,198,213,200,111,256,109,257,107]} + ,{"id":"printercovernew","shape":"poly","coords":[133,108,134,111,197,111,196,215,88,214,86,213,70,212,68,210,69,179,70,177,79,116,82,112,86,111,112,110,113,107]} + ,{"id":"printerchange","shape":"poly","coords":[310,34,309,36,310,48,310,98,197,98,198,50,267,49,269,48,271,49,275,50,279,47,281,45,289,44,291,41,292,33]} + ,{"id":"printerroller","shape":"poly","coords":[289,19,292,25,292,36,291,44,289,46,278,45,277,46,275,39,268,38,266,37,257,37,255,42,152,42,93,41,90,37,82,36,84,26,88,25,93,24,93,21,135,22,255,23,256,25,258,28,267,27,268,25,270,26,278,25,279,20,284,18]} + ,{"id":"bunker","shape":"poly","coords":[512,543,515,546,519,548,517,600,512,602,514,606,518,610,515,614,415,612,412,607,413,605,416,602,414,598,410,596,414,545,432,543,434,543,436,539]} + ,{"id":"keyboard","shape":"poly","coords":[575,426,577,463,578,483,578,488,571,490,569,500,453,497,450,487,445,485,448,423]} + ,{"id":"accumnew","shape":"rect","coords":[635,332,697,388]} + ,{"id":"backcase","shape":"poly","coords":[692,186,694,212,691,226,691,294,670,298,639,296,633,265,638,184,655,182]} + ,{"id":"frontcasechange","shape":"poly","coords":[636,28,632,33,632,54,634,66,634,139,634,147,639,153,690,153,692,149,695,145,695,83,697,46,697,33,692,28,689,29,687,56,690,56,689,61,642,61,641,59,642,56,639,37,639,33,639,29,639,28,632,32]} + ,{"id":"mag_change","shape":"poly","coords":[394,420,392,592,390,591,388,519,386,518,356,514,361,511,361,504,364,502,358,499,355,494,352,478,358,458,364,456,361,453,361,444,390,442,392,419]} + ,{"id":"off","shape":"rect","coords":[548,544,598,610]} + ,{"id":"Tarakan","shape":"circle","coords":[667,571,44]} + ,{"id":"usb","shape":"poly","coords":[36,348,36,371,32,371,32,401,32,405,41,406,43,411,43,423,44,423,44,452,68,452,68,445,50,445,50,423,54,423,54,419,50,415,54,407,61,401,61,370,59,348]} + ,{"id":"water","shape":"circle","coords":[663,464,45]} + ], + 'D230xxx': [ + + ] + + +} //ends modelCoords \ No newline at end of file diff --git a/static/js/navbar.js b/static/js/navbar.js index 9b47879..68b1915 100644 --- a/static/js/navbar.js +++ b/static/js/navbar.js @@ -5,7 +5,7 @@ function toggleDropdown(event) { } // Close the dropdown if clicked outside -window.onclick = function(event) { +document.onclick = function(event) { if (!event.target.matches('.user-photo')) { const dropdowns = document.getElementsByClassName("dropdown-menu"); for (let i = 0; i < dropdowns.length; i++) { diff --git a/static/js/russiankeys.js b/static/js/russiankeys.js index e9df4c6..e8bd646 100644 --- a/static/js/russiankeys.js +++ b/static/js/russiankeys.js @@ -1,80 +1,108 @@ -function keyboardLayoutSwitch(stringToConvert) { - var sourceLayout = [ - 'й', - 'ц', - 'у', - 'к', - 'е', - 'н', - 'г', - 'ш', - 'щ', - 'з', - 'х', - 'ъ', - 'ф', - 'ы', - 'в', - 'а', - 'п', - 'р', - 'о', - 'л', - 'д', - 'ж', - 'э', - 'я', - 'ч', - 'с', - 'м', - 'и', - 'т', - 'ь', - 'б', - 'ю' +function keyboardLayoutSwitch(stringToConvert, direction = 'ru-en') { + const ruLayout = [ + 'й', 'ц', 'у', 'к', 'е', 'н', 'г', 'ш', 'щ', 'з', + 'х', 'ъ', 'ф', 'ы', 'в', 'а', 'п', 'р', 'о', 'л', + 'д', 'ж', 'э', 'я', 'ч', 'с', 'м', 'и', 'т', 'ь', + 'б', 'ю' ]; - var targetLayout = [ - 'q', - 'w', - 'e', - 'r', - 't', - 'y', - 'u', - 'i', - 'o', - 'p', - '[', - ']', - 'a', - 's', - 'd', - 'f', - 'g', - 'h', - 'j', - 'k', - 'l', - ';', - "'", - 'z', - 'x', - 'c', - 'v', - 'b', - 'n', - 'm', - ',', - '.' + const enLayout = [ + 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', + '[', ']', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', + 'l', ';', "'", 'z', 'x', 'c', 'v', 'b', 'n', 'm', + ',', '.' ]; - for (var index = 0; index < sourceLayout.length; index++) { - const reg = new RegExp(sourceLayout[index], 'mig'); - stringToConvert = stringToConvert.replace(reg, function(currentLetter) { - return currentLetter == currentLetter.toLowerCase() ? targetLayout[index] : targetLayout[index].toUpperCase(); - }); - } + let sourceLayout = direction === 'en-ru' ? enLayout : ruLayout; + let targetLayout = direction === 'en-ru' ? ruLayout : enLayout; - return stringToConvert; + return stringToConvert.split('').map(char => { + const index = sourceLayout.indexOf(char.toLowerCase()); + if (index !== -1) { + return char === char.toLowerCase() + ? targetLayout[index] + : targetLayout[index].toUpperCase(); + } + return char; + }).join(''); } +// function keyboardLayoutSwitch(stringToConvert) { +// var sourceLayout = [ +// 'й', +// 'ц', +// 'у', +// 'к', +// 'е', +// 'н', +// 'г', +// 'ш', +// 'щ', +// 'з', +// 'х', +// 'ъ', +// 'ф', +// 'ы', +// 'в', +// 'а', +// 'п', +// 'р', +// 'о', +// 'л', +// 'д', +// 'ж', +// 'э', +// 'я', +// 'ч', +// 'с', +// 'м', +// 'и', +// 'т', +// 'ь', +// 'б', +// 'ю' +// ]; + +// var targetLayout = [ +// 'q', +// 'w', +// 'e', +// 'r', +// 't', +// 'y', +// 'u', +// 'i', +// 'o', +// 'p', +// '[', +// ']', +// 'a', +// 's', +// 'd', +// 'f', +// 'g', +// 'h', +// 'j', +// 'k', +// 'l', +// ';', +// "'", +// 'z', +// 'x', +// 'c', +// 'v', +// 'b', +// 'n', +// 'm', +// ',', +// '.' +// ]; + +// for (var index = 0; index < sourceLayout.length; index++) { +// const reg = new RegExp(sourceLayout[index], 'mig'); +// stringToConvert = stringToConvert.replace(reg, function(currentLetter) { +// return currentLetter == currentLetter.toLowerCase() ? targetLayout[index] : targetLayout[index].toUpperCase(); +// }); +// } + +// return stringToConvert; +// }