diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/kvm/index.html | 6 | ||||
-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/share/js/kvm/main.js | 3 | ||||
-rw-r--r-- | web/share/js/wm.js | 5 |
6 files changed, 11 insertions, 9 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html index fdfb5dd9..3fd7a57c 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -456,7 +456,7 @@ </div> </li> </ul> - <div class="window window-resizable" id="stream-window" data-close-confirm="Do you want to close the stream? This action will temporarily stop<br>the video transmission until you open the broadcast again.<br>This can be useful for saving traffic."> + <div class="window window-resizable" id="stream-window" data-close-confirm="Do you want to close the stream? This action will temporarily stop<br>the video transmission until you open the broadcast again.<br>This can be useful for saving traffic." data-show-by-button="show-stream-button"> <div class="window-header" id="stream-window-header"> <div class="window-grab">Stream</div> <button class="window-button-close">×</button> @@ -494,7 +494,7 @@ </div> </div> </div> - <div class="window" id="keyboard-window"> + <div class="window" id="keyboard-window" data-show-by-button="show-keyboard-button"> <div class="window-header" id="keyboard-window-header"> <div class="window-grab">Virtual Keyboard</div> <button class="window-button-close">×</button> @@ -1338,7 +1338,7 @@ </div> </div> </div> - <div class="window" id="about-window"> + <div class="window" id="about-window" data-show-by-button="show-about-button"> <div class="window-header"> <div class="window-grab">About</div> <button class="window-button-close">×</button> diff --git a/web/kvm/window-about.pug b/web/kvm/window-about.pug index 17d1c04b..0c7da8bf 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") +div(id="about-window" class="window" data-show-by-button="show-about-button") 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 986ca91f..95322f2b 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") +div(id="keyboard-window" class="window" data-show-by-button="show-keyboard-button") 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 2595fe3b..dc083600 100644 --- a/web/kvm/window-stream.pug +++ b/web/kvm/window-stream.pug @@ -2,7 +2,7 @@ - confirm_msg += "the video transmission until you open the broadcast again.<br>"; - confirm_msg += "This can be useful for saving traffic."; -div(id="stream-window" class="window window-resizable" data-close-confirm=confirm_msg) +div(id="stream-window" class="window window-resizable" data-close-confirm=confirm_msg data-show-by-button="show-stream-button") div(id="stream-window-header" class="window-header") div(class="window-grab") Stream button(class="window-button-close") × diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js index dde873c7..8150a852 100644 --- a/web/share/js/kvm/main.js +++ b/web/share/js/kvm/main.js @@ -40,9 +40,6 @@ export function main() { initWindowManager(); - tools.setOnClick($("show-about-button"), () => wm.showWindow($("about-window"))); - tools.setOnClick($("show-keyboard-button"), () => wm.showWindow($("keyboard-window"))); - tools.setOnClick($("show-stream-button"), () => wm.showWindow($("stream-window"))); tools.setOnClick($("open-log-button"), () => window.open("/api/log?seek=3600&follow=1", "_blank")); wm.showWindow($("stream-window")); diff --git a/web/share/js/wm.js b/web/share/js/wm.js index 11d86155..b74e2626 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -63,6 +63,11 @@ 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() { // При переполнении рабочей области сократить размер окна по высоте. |