Added search clear button.

Ylian Saint-Hilaire committed Feb 18, 2021 at 14:27 UTC 44eada08884994196740b2159469a6cc4300b0fc
4 files changed +6 -5
public/images/x16.png
Binary files /dev/null and b/public/images/x16.png differ
public/images/x32.png
Binary files /dev/null and b/public/images/x32.png differ
translate/translate.json
+4 -4
@@ -27860,7 +27860,7 @@
27860 "xloc": [
27861 "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->5",
27862 "default.handlebars->31->578",
27863 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->9->1"
27863 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11->1"
27864 ]
27865 },
27866 {
@@ -28044,7 +28044,7 @@
28044 "zh-cht": "線上",
28045 "xloc": [
28046 "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->7",
28047 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11->1",
28047 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13->1",
28048 "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->DevFilterSelect->3"
28049 ]
28050 },
@@ -28107,7 +28107,7 @@
28107 "zh-chs": "仅显示在线设备",
28108 "zh-cht": "只顯示在線裝置",
28109 "xloc": [
28110 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11"
28110 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13"
28111 ]
28112 },
28113 {
@@ -35798,7 +35798,7 @@
35798 "zh-chs": "显示设备操作系统名称",
35799 "zh-cht": "顯示裝置操作系統名稱",
35800 "xloc": [
35801 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->9"
35801 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11"
35802 ]
35803 },
35804 {
views/default.handlebars
+2 -1
@@ -248,7 +248,7 @@
248 &nbsp;&nbsp;<input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />&nbsp;
249 <input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />&nbsp;
250 <input id=SearchInput type=search autocomplete=off placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />&nbsp;
251 -
251 + <span id=SearchInputClearButton style="display:none;position:relative"><img src="images/x16.png" type="button" onclick="clearDeviceSearch()" style="position:absolute;cursor:pointer;left:-18px;top:-8px" srcset="images/x32.png 2x"/></span>
252 <select id=DevFilterSelect onchange=onOnlineCheckBox(event) title="Device Filter">
253 <option value=0>All</option>
254 <option value=1>Online</option>
@@ -4819,6 +4819,7 @@
4819
4820 function onSearchInputChanged() {
4821 var x = Q('SearchInput').value.toLowerCase().trim(); putstore('_search', Q('SearchInput').value);
4822 + QV('SearchInputClearButton', x != '');
4823 var userSearch = null, ipSearch = null, groupSearch = null, tagSearch = null, agentTagSearch = null, wscSearch = null;
4824 if (x.startsWith("user:".toLowerCase())) { userSearch = x.substring("user:".length); }
4825 else if (x.startsWith("u:".toLowerCase())) { userSearch = x.substring("u:".length); }