common table for switches

This commit is contained in:
Devaev Maxim 2021-05-19 10:06:50 +03:00
parent 0ab1427c28
commit d18c27744f
3 changed files with 56 additions and 59 deletions

View File

@ -182,9 +182,8 @@
</tr> </tr>
</table> </table>
</div> </div>
<div class="feature-disabled" id="hid-mouse-squash"> <table class="kv">
<hr> <tr class="feature-disabled" id="hid-mouse-squash">
<table class="kv">
<td>Squash relative mouse moves:</td> <td>Squash relative mouse moves:</td>
<td align="right"> <td align="right">
<div class="switch-box"> <div class="switch-box">
@ -192,11 +191,8 @@
<label for="hid-mouse-squash-switch"><span class="switch-inner"></span><span class="switch"></span></label> <label for="hid-mouse-squash-switch"><span class="switch-inner"></span><span class="switch"></span></label>
</div> </div>
</td> </td>
</table> </tr>
</div> <tr class="feature-disabled" id="hid-connect">
<div class="feature-disabled" id="hid-connect">
<hr>
<table class="kv">
<td>Connect HID to Server:</td> <td>Connect HID to Server:</td>
<td align="right"> <td align="right">
<div class="switch-box"> <div class="switch-box">
@ -204,21 +200,17 @@
<label for="hid-connect-switch"><span class="switch-inner"></span><span class="switch"></span></label> <label for="hid-connect-switch"><span class="switch-inner"></span><span class="switch"></span></label>
</div> </div>
</td> </td>
</table> </tr>
</div> <tr>
<hr> <td>Mute HID input events:</td>
<table class="kv"> <td align="right">
<td>Mute HID input events:</td> <div class="switch-box">
<td align="right"> <input type="checkbox" id="hid-mute-switch">
<div class="switch-box"> <label for="hid-mute-switch"><span class="switch-inner"></span><span class="switch"></span></label>
<input type="checkbox" id="hid-mute-switch"> </div>
<label for="hid-mute-switch"><span class="switch-inner"></span><span class="switch"></span></label> </td>
</div> </tr>
</td> <tr class="feature-disabled" id="v3-usb-breaker">
</table>
<hr>
<div class="feature-disabled" id="v3-usb-breaker">
<table class="kv">
<td>Connect main USB to Server:</td> <td>Connect main USB to Server:</td>
<td align="right"> <td align="right">
<div class="switch-box"> <div class="switch-box">
@ -226,9 +218,9 @@
<label for="gpio-switch-__v3_usb_breaker__"><span class="switch-inner"></span><span class="switch"></span></label> <label for="gpio-switch-__v3_usb_breaker__"><span class="switch-inner"></span><span class="switch"></span></label>
</div> </div>
</td> </td>
</table> </tr>
<hr> </table>
</div> <hr>
<div class="buttons buttons-row"> <div class="buttons buttons-row">
<button class="row50" data-force-hide-menu id="show-keyboard-button">&bull; Show keyboard</button> <button class="row50" data-force-hide-menu id="show-keyboard-button">&bull; Show keyboard</button>
<button class="row50" disabled id="hid-reset-button">Reset HID</button> <button class="row50" disabled id="hid-reset-button">Reset HID</button>
@ -435,13 +427,15 @@
</table> </table>
<hr> <hr>
<table class="kv"> <table class="kv">
<td>Infinite loop playback:</td> <tr>
<td align="right"> <td>Infinite loop playback:</td>
<div class="switch-box"> <td align="right">
<input disabled type="checkbox" id="hid-recorder-loop-switch"> <div class="switch-box">
<label for="hid-recorder-loop-switch"><span class="switch-inner"></span><span class="switch"></span></label> <input disabled type="checkbox" id="hid-recorder-loop-switch">
</div> <label for="hid-recorder-loop-switch"><span class="switch-inner"></span><span class="switch"></span></label>
</td> </div>
</td>
</tr>
</table> </table>
<hr> <hr>
<input type="file" id="hid-recorder-new-script-file"> <input type="file" id="hid-recorder-new-script-file">
@ -472,13 +466,15 @@
</table> </table>
<hr> <hr>
<table class="kv"> <table class="kv">
<td>Ask paste confirmation:</td> <tr>
<td align="right"> <td>Ask paste confirmation:</td>
<div class="switch-box"> <td align="right">
<input checked type="checkbox" id="hid-pak-ask-switch"> <div class="switch-box">
<label for="hid-pak-ask-switch"><span class="switch-inner"></span><span class="switch"></span></label> <input checked type="checkbox" id="hid-pak-ask-switch">
</div> <label for="hid-pak-ask-switch"><span class="switch-inner"></span><span class="switch"></span></label>
</td> </div>
</td>
</tr>
</table> </table>
<hr> <hr>
<div class="text"></div> <div class="text"></div>

View File

@ -48,17 +48,14 @@ li(class="right")
tr tr
td Mouse: td Mouse:
td #[div(id="hid-outputs-mouse" class="radio-box")] td #[div(id="hid-outputs-mouse" class="radio-box")]
div(id="hid-mouse-squash" class="feature-disabled") table(class="kv")
hr tr(id="hid-mouse-squash" class="feature-disabled")
+menu_switch("hid-mouse-squash-switch", "Squash relative mouse moves", true, true) +menu_switch_notable("hid-mouse-squash-switch", "Squash relative mouse moves", true, true)
div(id="hid-connect" class="feature-disabled") tr(id="hid-connect" class="feature-disabled")
hr +menu_switch_notable("hid-connect-switch", "Connect HID to Server", true, true)
+menu_switch("hid-connect-switch", "Connect HID to Server", true, true) tr
hr +menu_switch_notable("hid-mute-switch", "Mute HID input events", true, false)
+menu_switch("hid-mute-switch", "Mute HID input events", true, false) tr(id="v3-usb-breaker" class="feature-disabled")
hr
div(id="v3-usb-breaker" class="feature-disabled")
table(class="kv")
td Connect main USB to Server: td Connect main USB to Server:
td(align="right") td(align="right")
div(class="switch-box") div(class="switch-box")
@ -69,7 +66,7 @@ li(class="right")
label(for="gpio-switch-__v3_usb_breaker__") label(for="gpio-switch-__v3_usb_breaker__")
span(class="switch-inner") span(class="switch-inner")
span(class="switch") span(class="switch")
hr hr
div(class="buttons buttons-row") div(class="buttons buttons-row")
button(data-force-hide-menu id="show-keyboard-button" class="row50") &bull; Show keyboard button(data-force-hide-menu id="show-keyboard-button" class="row50") &bull; Show keyboard
button(disabled id="hid-reset-button" class="row50") Reset HID button(disabled id="hid-reset-button" class="row50") Reset HID

View File

@ -13,15 +13,19 @@ mixin menu_message(icon, short, classes="")
sup(style="line-height:1") sup(style="line-height:1")
block block
mixin menu_switch_notable(id, title, enabled, checked)
td #{title}:
td(align="right")
div(class="switch-box")
input(checked=checked disabled=!enabled type="checkbox" id=id)
label(for=id)
span(class="switch-inner")
span(class="switch")
mixin menu_switch(id, title, enabled, checked) mixin menu_switch(id, title, enabled, checked)
table(class="kv") table(class="kv")
td #{title}: tr
td(align="right") +menu_switch_notable(id, title, enabled, checked)
div(class="switch-box")
input(checked=checked disabled=!enabled type="checkbox" id=id)
label(for=id)
span(class="switch-inner")
span(class="switch")
ul(id="navbar") ul(id="navbar")
li(class="left") li(class="left")