Use case insensitive search on the docs (#87)

This commit is contained in:
Lonami Exo 2017-05-19 09:44:15 +02:00
parent c4447bf226
commit d6bec7481e

View File

@ -205,10 +205,11 @@ function updateSearch() {
contentDiv.style.display = "none"; contentDiv.style.display = "none";
searchDiv.style.display = ""; searchDiv.style.display = "";
var query = searchBox.value.toLowerCase();
var foundRequests = []; var foundRequests = [];
var foundRequestsu = []; var foundRequestsu = [];
for (var i = 0; i < requests.length; ++i) { for (var i = 0; i < requests.length; ++i) {
if (requests[i].toLowerCase().indexOf(searchBox.value) != -1) { if (requests[i].toLowerCase().indexOf(query) != -1) {
foundRequests.push(requests[i]); foundRequests.push(requests[i]);
foundRequestsu.push(requestsu[i]); foundRequestsu.push(requestsu[i]);
} }
@ -217,7 +218,7 @@ function updateSearch() {
var foundTypes = []; var foundTypes = [];
var foundTypesu = []; var foundTypesu = [];
for (var i = 0; i < types.length; ++i) { for (var i = 0; i < types.length; ++i) {
if (types[i].toLowerCase().indexOf(searchBox.value) != -1) { if (types[i].toLowerCase().indexOf(query) != -1) {
foundTypes.push(types[i]); foundTypes.push(types[i]);
foundTypesu.push(typesu[i]); foundTypesu.push(typesu[i]);
} }