mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-19 14:41:50 +00:00
Varedit now remembers what was in the 'search' field when you click the 'refresh' link. This makes our miserable lives a little less miserable.
Tweaked varedit styles ever so slightly: it will now likely use a "better" monospace font depending on what's on your system. Var names are now bold and also monospace.
The window spawns a tiny bit bigger.
37 lines
1018 B
JavaScript
37 lines
1018 B
JavaScript
function updateSearch() {
|
|
var filter_text = document.getElementById('filter');
|
|
var filter = filter_text.value.toLowerCase();
|
|
|
|
var vars_ol = document.getElementById('vars');
|
|
var lis = vars_ol.children;
|
|
// the above line can be changed to vars_ol.getElementsByTagName("li") to filter child lists too
|
|
// potential todo: implement a per-admin toggle for this
|
|
|
|
for(var i = 0; i < lis.length; i++) {
|
|
var li = lis[i];
|
|
if(filter == "" || li.innerText.toLowerCase().indexOf(filter) != -1) {
|
|
li.style.display = "block";
|
|
} else {
|
|
li.style.display = "none";
|
|
}
|
|
}
|
|
|
|
var refresh_link = document.getElementById('refresh');
|
|
refresh_link.href = refresh_link.getAttribute('data-initial-href') + filter;
|
|
}
|
|
|
|
function selectTextField() {
|
|
var filter_text = document.getElementById('filter');
|
|
filter_text.focus();
|
|
filter_text.select();
|
|
}
|
|
|
|
function loadPage(list) {
|
|
if(list.options[list.selectedIndex].value == "") {
|
|
return;
|
|
}
|
|
|
|
location.href=list.options[list.selectedIndex].value;
|
|
list.selectedIndex = 0;
|
|
}
|