Use `type="search"` for search input fields

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/768

So that the input fields can gain extra built-in
browser widgets useful in search fields.
This commit is contained in:
Raymond Hill 2019-11-03 13:14:29 -05:00
parent 3dc0686ba5
commit da253bf80c
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
4 changed files with 8 additions and 13 deletions

View File

@ -122,21 +122,16 @@ body[dir="rtl"] #pageSelector {
opacity: 1; opacity: 1;
} }
#netInspector #filterInput { #netInspector #filterInput {
border: 1px solid gray;
display: inline-flex; display: inline-flex;
} }
#netInspector #filterInput > input { #netInspector #filterInput > input {
min-width: 18em; border: 0;
min-width: 16em;
} }
#netInspector #filterExprButton { #netInspector #filterExprButton {
position: absolute;
transform: scaleY(-1); transform: scaleY(-1);
} }
body[dir="ltr"] #netInspector #filterExprButton {
right: 0;
}
body[dir="rtl"] #netInspector #filterExprButton {
left: 0;
}
#netInspector #filterExprButton:hover { #netInspector #filterExprButton:hover {
background-color: transparent; background-color: transparent;
} }

View File

@ -32,7 +32,7 @@
<button type="button" class="custom iconifiable" id="importButton"><span class="fa">&#xf019;</span><span data-i18n="rulesImport"></span></button> <button type="button" class="custom iconifiable" id="importButton"><span class="fa">&#xf019;</span><span data-i18n="rulesImport"></span></button>
<button type="button" class="custom iconifiable important disabled" id="editSaveButton"><span class="fa">&#xf0c7;</span><span data-i18n="rulesEditSave"></span></button> <button type="button" class="custom iconifiable important disabled" id="editSaveButton"><span class="fa">&#xf0c7;</span><span data-i18n="rulesEditSave"></span></button>
</div> </div>
<div id="ruleFilter"><span class="fa">&#xf0b0;</span>&ensp;<input type="text" size="20"></div> <div id="ruleFilter"><span class="fa">&#xf0b0;</span>&ensp;<input type="search" size="20"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -96,11 +96,11 @@
} }
function queryTextFromSearchWidget(cm) { function queryTextFromSearchWidget(cm) {
return getSearchState(cm).widget.querySelector('input[type="text"]').value; return getSearchState(cm).widget.querySelector('input[type="search"]').value;
} }
function queryTextToSearchWidget(cm, q) { function queryTextToSearchWidget(cm, q) {
var input = getSearchState(cm).widget.querySelector('input[type="text"]'); var input = getSearchState(cm).widget.querySelector('input[type="search"]');
if ( typeof q === 'string' && q !== input.value ) { if ( typeof q === 'string' && q !== input.value ) {
input.value = q; input.value = q;
} }
@ -310,7 +310,7 @@
'<div class="cm-search-widget">' + '<div class="cm-search-widget">' +
'<span class="fa-icon fa-icon-ro">search</span>&ensp;' + '<span class="fa-icon fa-icon-ro">search</span>&ensp;' +
'<span class="cm-search-widget-input">' + '<span class="cm-search-widget-input">' +
'<input type="text">' + '<input type="search">' +
'<span class="cm-search-widget-count">' + '<span class="cm-search-widget-count">' +
'<span><!-- future use --></span><span>0</span>' + '<span><!-- future use --></span><span>0</span>' +
'</span>' + '</span>' +

View File

@ -54,7 +54,7 @@
<span id="filterExprGroup"> <span id="filterExprGroup">
<span id="filterButton" class="button fa-icon" data-i18n-title="loggerRowFiltererButtonTip">filter</span> <span id="filterButton" class="button fa-icon" data-i18n-title="loggerRowFiltererButtonTip">filter</span>
<span id="filterInput"> <span id="filterInput">
<input type="text" placeholder="logFilterPrompt"> <input type="search" placeholder="logFilterPrompt">
<span id="filterExprButton" class="button fa-icon expanded" data-i18n-title="loggerRowFiltererBuiltinTip">angle-up</span> <span id="filterExprButton" class="button fa-icon expanded" data-i18n-title="loggerRowFiltererBuiltinTip">angle-up</span>
<div id="filterExprPicker"> <div id="filterExprPicker">
<div><span data-filtex="!" data-i18n="loggerRowFiltererBuiltinNot"></span><span data-filtex="\t--\t|\t<<\t|\t##" data-i18n="loggerRowFiltererBuiltinBlocked"></span><span data-filtex="\t\+\+\t|\t\*\*\t|\t#@#" data-i18n="loggerRowFiltererBuiltinAllowed"></span></div> <div><span data-filtex="!" data-i18n="loggerRowFiltererBuiltinNot"></span><span data-filtex="\t--\t|\t<<\t|\t##" data-i18n="loggerRowFiltererBuiltinBlocked"></span><span data-filtex="\t\+\+\t|\t\*\*\t|\t#@#" data-i18n="loggerRowFiltererBuiltinAllowed"></span></div>