From f3478dc24153ffbf3043efa29f465aaee3bb7ba8 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 6 Oct 2018 03:23:03 +0300 Subject: refactoring --- web/css/hid.css | 21 +++++++++++++++++++++ web/css/leds.css | 2 +- web/css/shortcuts.css | 21 --------------------- web/index.html | 8 ++++---- web/js/hid.js | 26 +++++++++++++------------- 5 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 web/css/hid.css delete mode 100644 web/css/shortcuts.css (limited to 'web') diff --git a/web/css/hid.css b/web/css/hid.css new file mode 100644 index 00000000..8c420fe9 --- /dev/null +++ b/web/css/hid.css @@ -0,0 +1,21 @@ +textarea#hid-pak-text { + display: block; + resize: none; + width: 100%; + height: 40px; + color: var(--fg-color-dark); + background-color: var(--bg-color-light); + border: none; + outline: 0 !important; + -webkit-appearance:none; +} + +textarea#hid-pak-text::-moz-placeholder { + line-height: 40px; + text-align: center; +} + +textarea#hid-pak-text::-webkit-input-placeholder { + line-height: 40px; + text-align: center; +} diff --git a/web/css/leds.css b/web/css/leds.css index c5c122e3..ba8559b3 100644 --- a/web/css/leds.css +++ b/web/css/leds.css @@ -37,7 +37,7 @@ img.led-hdd-busy { } img.led-msd-writing, -img.led-pak-typing { +img.led-hid-pak-typing { -webkit-filter: var(--led-filter-yellow); filter: var(--led-filter-yellow); -webkit-animation: var(--led-spin-fast); diff --git a/web/css/shortcuts.css b/web/css/shortcuts.css deleted file mode 100644 index a96716ab..00000000 --- a/web/css/shortcuts.css +++ /dev/null @@ -1,21 +0,0 @@ -textarea#pak-text { - display: block; - resize: none; - width: 100%; - height: 40px; - color: var(--fg-color-dark); - background-color: var(--bg-color-light); - border: none; - outline: 0 !important; - -webkit-appearance:none; -} - -textarea#pak-text::-moz-placeholder { - line-height: 40px; - text-align: center; -} - -textarea#pak-text::-webkit-input-placeholder { - line-height: 40px; - text-align: center; -} diff --git a/web/index.html b/web/index.html index 35fae241..71e068d1 100644 --- a/web/index.html +++ b/web/index.html @@ -15,7 +15,7 @@ - + @@ -218,14 +218,14 @@
  • - + Shortcuts ↴
    - +
    - +
    diff --git a/web/js/hid.js b/web/js/hid.js index 26529b32..27c53966 100644 --- a/web/js/hid.js +++ b/web/js/hid.js @@ -42,7 +42,7 @@ function Hid() { window.onblur = __releaseAll; __chars_to_codes = __buildCharsToCodes(); - tools.setOnClick($("pak-button"), __clickPasteAsKeysButton); + tools.setOnClick($("hid-pak-button"), __clickPasteAsKeysButton); tools.setOnClick($("hid-reset-button"), __clickResetButton); @@ -57,7 +57,7 @@ function Hid() { __ws = ws; __keyboard.setSocket(ws); __mouse.setSocket(ws); - $("pak-text").disabled = $("pak-button").disabled = $("hid-reset-button").disabled = !ws; + $("hid-pak-text").disabled = $("hid-pak-button").disabled = $("hid-reset-button").disabled = !ws; }; var __releaseAll = function() { @@ -130,7 +130,7 @@ function Hid() { }; var __clickPasteAsKeysButton = function() { - var text = $("pak-text").value.replace(/[^\x00-\x7F]/g, ""); // eslint-disable-line no-control-regex + var text = $("hid-pak-text").value.replace(/[^\x00-\x7F]/g, ""); // eslint-disable-line no-control-regex if (text) { var clipboard_codes = []; var codes_count = 0; @@ -151,10 +151,10 @@ function Hid() { ui.confirm(confirm_msg).then(function(ok) { if (ok) { - $("pak-text").disabled = true; - $("pak-button").disabled = true; - $("pak-led").className = "led-pak-typing"; - $("pak-led").title = "Autotyping..."; + $("hid-pak-text").disabled = true; + $("hid-pak-button").disabled = true; + $("hid-pak-led").className = "led-hid-pak-typing"; + $("hid-pak-led").title = "Autotyping..."; tools.debug("Paste-as-keys:", text); @@ -165,17 +165,17 @@ function Hid() { if (index < clipboard_codes.length && __ws) { iterate(); } else { - $("pak-text").value = ""; - $("pak-text").disabled = false; - $("pak-button").disabled = false; - $("pak-led").className = "led-off"; - $("pak-led").title = ""; + $("hid-pak-text").value = ""; + $("hid-pak-text").disabled = false; + $("hid-pak-button").disabled = false; + $("hid-pak-led").className = "led-off"; + $("hid-pak-led").title = ""; } }); }; iterate(); } else { - $("pak-text").value = ""; + $("hid-pak-text").value = ""; } }); } -- cgit v1.2.3