diff options
author | Devaev Maxim <[email protected]> | 2021-07-14 20:06:32 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-07-14 20:06:32 +0300 |
commit | 105928193b50f40facdc0bfc479dc51a06a97efa (patch) | |
tree | a1b6e248ac310fbffc2d13ac8a9d123c80dc52f3 /web | |
parent | d8c373103135d743c91b0a9e9e142625b79a771d (diff) |
two keyboard buttons
Diffstat (limited to 'web')
-rw-r--r-- | web/kvm/index.html | 22 | ||||
-rw-r--r-- | web/kvm/navbar-keyboard.pug | 6 | ||||
-rw-r--r-- | web/kvm/navbar-system.pug | 8 | ||||
-rw-r--r-- | web/kvm/window-about.pug | 2 | ||||
-rw-r--r-- | web/kvm/window-keyboard.pug | 2 | ||||
-rw-r--r-- | web/kvm/window-stream.pug | 2 | ||||
-rw-r--r-- | web/kvm/window-webterm.pug | 2 | ||||
-rw-r--r-- | web/share/js/wm.js | 9 |
8 files changed, 28 insertions, 25 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html index 3d10ed8c..abe00522 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -112,10 +112,10 @@ <tr> <td class="value">Runtime settings & tools</td> <td class="feature-disabled" id="webterm"> - <button class="small" data-force-hide-menu id="show-webterm-button">• Term</button> + <button class="small" data-force-hide-menu data-show-window="webterm-window">• Term</button> </td> <td> - <button class="small" data-force-hide-menu id="show-about-button">• About</button> + <button class="small" data-force-hide-menu data-show-window="about-window">• About</button> </td> <td> <button class="small" data-force-hide-menu id="open-log-button">• Log</button> @@ -168,7 +168,7 @@ </table> <hr> <div class="buttons buttons-row"> - <button class="row33" data-force-hide-menu id="show-stream-button">• Show stream</button> + <button class="row33" data-force-hide-menu data-show-window="stream-window">• Show stream</button> <button class="row33" disabled data-force-hide-menu id="stream-screenshot-button">• Screenshot</button> <button class="row33" disabled id="stream-reset-button">Reset stream</button> </div> @@ -229,7 +229,7 @@ </table> <hr> <div class="buttons buttons-row"> - <button class="row50" data-force-hide-menu id="show-keyboard-button">• Show keyboard</button> + <button class="row50" data-force-hide-menu data-show-window="keyboard-window">• Show keyboard</button> <button class="row50" disabled id="hid-reset-button">Reset HID</button> </div> </div> @@ -456,7 +456,6 @@ <div class="text" style="margin-right: 20px"> <textarea id="hid-pak-text" placeholder="Enter your text here"></textarea> </div> - <hr> <table class="kv"> <tr> <td> @@ -468,7 +467,6 @@ </td> </tr> </table> - <hr> <table class="kv"> <tr> <td>Ask paste confirmation:</td> @@ -483,6 +481,10 @@ <hr> <div class="text"></div> <hr> + <button data-force-hide-menu data-show-window="keyboard-window">• Show keyboard</button> + <hr> + <div class="text"></div> + <hr> <div class="buttons"> <div class="buttons-row"> <button class="row50" data-force-hide-menu data-shortcut="CapsLock">• Caps Lock <img class="inline-lamp hid-keyboard-caps-led led-gray" src="/share/svg/led-square.svg"></button> @@ -530,7 +532,7 @@ <div class="menu" data-dont-hide-menu id="gpio-menu"></div> </li> </ul> - <div class="window window-resizable" id="stream-window" data-show-by-button="show-stream-button"> + <div class="window window-resizable" id="stream-window"> <div class="window-header" id="stream-window-header"> <div class="window-grab">MJPEG</div> <button class="window-button-close">×</button> @@ -564,7 +566,7 @@ </div> </div> </div> - <div class="window" id="keyboard-window" data-show-by-button="show-keyboard-button"> + <div class="window" id="keyboard-window"> <div class="window-header" id="keyboard-window-header"> <div class="window-grab">Virtual Keyboard</div> <button class="window-button-close">×</button> @@ -1411,7 +1413,7 @@ </div> </div> </div> - <div class="window" id="about-window" data-show-by-button="show-about-button"> + <div class="window" id="about-window"> <div class="window-header"> <div class="window-grab">About</div> <button class="window-button-close">×</button> @@ -1893,7 +1895,7 @@ </p> </div> </div> - <div class="window window-resizable" id="webterm-window" data-show-by-button="show-webterm-button" style="width: 640px; height: 480px"> + <div class="window window-resizable" id="webterm-window" style="width: 640px; height: 480px"> <div class="window-header"> <div class="window-grab">Terminal</div> <button class="window-button-close">×</button> diff --git a/web/kvm/navbar-keyboard.pug b/web/kvm/navbar-keyboard.pug index ce526f76..d2c11138 100644 --- a/web/kvm/navbar-keyboard.pug +++ b/web/kvm/navbar-keyboard.pug @@ -6,7 +6,6 @@ li(class="right") hr div(class="text" style="margin-right: 20px") textarea(id="hid-pak-text" placeholder="Enter your text here") - hr table(class="kv") tr td @@ -14,11 +13,14 @@ li(class="right") td using host keymap td select(id="hid-pak-keymap-selector") - hr +menu_switch("hid-pak-ask-switch", "Ask paste confirmation", true, true) hr div(class="text") hr + button(data-force-hide-menu data-show-window="keyboard-window") • Show keyboard + hr + div(class="text") + hr div(class="buttons") div(class="buttons-row") button(data-force-hide-menu data-shortcut="CapsLock" class="row50") diff --git a/web/kvm/navbar-system.pug b/web/kvm/navbar-system.pug index 093fd944..290cc21c 100644 --- a/web/kvm/navbar-system.pug +++ b/web/kvm/navbar-system.pug @@ -9,8 +9,8 @@ li(class="right") table(class="kv" style="width: calc(100% - 20px)") tr td(class="value") Runtime settings & tools - td(id="webterm" class="feature-disabled") #[button(data-force-hide-menu id="show-webterm-button" class="small") • Term] - td #[button(data-force-hide-menu id="show-about-button" class="small") • About] + td(id="webterm" class="feature-disabled") #[button(data-force-hide-menu data-show-window="webterm-window" class="small") • Term] + td #[button(data-force-hide-menu data-show-window="about-window" class="small") • About] td #[button(data-force-hide-menu id="open-log-button" class="small") • Log] td(id="wol" class="feature-disabled") #[button(disabled data-force-hide-menu id="wol-wakeup-button" class="small") • WoL] hr @@ -40,7 +40,7 @@ li(class="right") label(for="stream-mode-radio-janus") H.264 / WebRTC hr div(class="buttons buttons-row") - button(data-force-hide-menu id="show-stream-button" class="row33") • Show stream + button(data-force-hide-menu data-show-window="stream-window" class="row33") • Show stream button(disabled data-force-hide-menu id="stream-screenshot-button" class="row33") • Screenshot button(disabled id="stream-reset-button" class="row33") Reset stream div(id="hid-outputs" class="feature-disabled") @@ -72,5 +72,5 @@ li(class="right") span(class="switch") hr div(class="buttons buttons-row") - button(data-force-hide-menu id="show-keyboard-button" class="row50") • Show keyboard + button(data-force-hide-menu data-show-window="keyboard-window" class="row50") • Show keyboard button(disabled id="hid-reset-button" class="row50") Reset HID diff --git a/web/kvm/window-about.pug b/web/kvm/window-about.pug index 4720c5c4..57e3e99a 100644 --- a/web/kvm/window-about.pug +++ b/web/kvm/window-about.pug @@ -9,7 +9,7 @@ mixin about_tab(name, title, checked=false) else span(class="code-comment") No data -div(id="about-window" class="window" data-show-by-button="show-about-button") +div(id="about-window" class="window") div(class="window-header") div(class="window-grab") About button(class="window-button-close") × diff --git a/web/kvm/window-keyboard.pug b/web/kvm/window-keyboard.pug index 2df36b3b..3c5578a3 100644 --- a/web/kvm/window-keyboard.pug +++ b/web/kvm/window-keyboard.pug @@ -15,7 +15,7 @@ mixin empty_key(width=0) mixin lamp(cls) img(class=`inline-lamp ${cls} led-gray` src=`${svg_dir}/led-square.svg`) -div(id="keyboard-window" class="window" data-show-by-button="show-keyboard-button") +div(id="keyboard-window" class="window") div(id="keyboard-window-header" class="window-header") div(class="window-grab") Virtual Keyboard button(class="window-button-close") × diff --git a/web/kvm/window-stream.pug b/web/kvm/window-stream.pug index d72d25e8..d304ff5e 100644 --- a/web/kvm/window-stream.pug +++ b/web/kvm/window-stream.pug @@ -1,4 +1,4 @@ -div(id="stream-window" class="window window-resizable" data-show-by-button="show-stream-button") +div(id="stream-window" class="window window-resizable") div(id="stream-window-header" class="window-header") div(class="window-grab") MJPEG button(class="window-button-close") × diff --git a/web/kvm/window-webterm.pug b/web/kvm/window-webterm.pug index e6c1d196..d909c14a 100644 --- a/web/kvm/window-webterm.pug +++ b/web/kvm/window-webterm.pug @@ -1,4 +1,4 @@ -div(id="webterm-window" class="window window-resizable" data-show-by-button="show-webterm-button" style="width: 640px; height: 480px") +div(id="webterm-window" class="window window-resizable" style="width: 640px; height: 480px") div(class="window-header") div(class="window-grab") Terminal button(class="window-button-close") × diff --git a/web/share/js/wm.js b/web/share/js/wm.js index 016e39b0..11c95181 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -63,11 +63,6 @@ function __WindowManager() { __makeWindowMovable(el_window); __windows.push(el_window); - if (el_window.hasAttribute("data-show-by-button")) { - let el_show_button = $(el_window.getAttribute("data-show-by-button")); - tools.setOnClick(el_show_button, () => self.showWindow(el_window)); - } - if (el_window.classList.contains("window-resizable") && window.ResizeObserver) { new ResizeObserver(function() { // При переполнении рабочей области сократить размер окна по высоте. @@ -125,6 +120,10 @@ function __WindowManager() { } } + for (let el_button of $$$("button[data-show-window]")) { + tools.setOnClick(el_button, () => self.showWindow($(el_button.getAttribute("data-show-window")))); + } + window.onmouseup = __globalMouseButtonHandler; window.ontouchend = __globalMouseButtonHandler; |