Files
VOREStation/html/search.js
Drathek 7c8bb85de3 Whitespace Standardization [MDB IGNORE] (#15748)
* Update settings

* Whitespace changes

* Comment out merger hooks in gitattributes

Corrupt maps would have to be resolved in repo before hooks could be updated

* Revert "Whitespace changes"

This reverts commit afbdd1d844.

* Whitespace again minus example

* Gitignore example changelog

* Restore changelog merge setting

* Keep older dmi hook attribute until hooks can be updated

* update vscode settings too

* Renormalize remaining

* Revert "Gitignore example changelog"

This reverts commit de22ad375d.

* Attempt to normalize example.yml (and another file I guess)

* Try again
2024-02-20 11:28:51 +01:00

33 lines
885 B
JavaScript

function selectTextField(){
var filter_text = document.getElementById('filter');
filter_text.focus();
filter_text.select();
}
function updateSearch(){
var input_form = document.getElementById('filter');
var filter = input_form.value.toLowerCase();
input_form.value = filter;
var table = document.getElementById('searchable');
var alt_style = 'norm';
for(var i = 0; i < table.rows.length; i++){
try{
var row = table.rows[i];
if(row.className == 'title') continue;
var found=0;
for(var j = 0; j < row.cells.length; j++){
var cell = row.cells[j];
if(cell.innerText.toLowerCase().indexOf(filter) != -1){
found=1;
break;
}
}
if(found == 0) row.style.display='none';
else{
row.style.display='block';
row.className = alt_style;
if(alt_style == 'alt') alt_style = 'norm';
else alt_style = 'alt';
}
}catch(err) { }
}
}