add preferences tab

This commit is contained in:
Andrew Dolgov 2005-11-16 18:53:50 +01:00
parent 4668523d7c
commit 4255b24ccf
2 changed files with 33 additions and 0 deletions

View File

@ -94,6 +94,19 @@ function labellist_callback() {
p_notify(""); p_notify("");
} }
} }
function prefslist_callback() {
var container = document.getElementById('prefContent');
if (xmlhttp.readyState == 4) {
container.innerHTML=xmlhttp.responseText;
p_notify("");
}
}
function notify_callback() { function notify_callback() {
var container = document.getElementById('notify'); var container = document.getElementById('notify');
if (xmlhttp.readyState == 4) { if (xmlhttp.readyState == 4) {
@ -708,6 +721,21 @@ function updateLabelList() {
xmlhttp.send(null); xmlhttp.send(null);
} }
function updatePrefsList() {
if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
p_notify("Loading, please wait...");
xmlhttp.open("GET", "backend.php?op=pref-prefs", true);
xmlhttp.onreadystatechange=prefslist_callback;
xmlhttp.send(null);
}
function selectTab(id) { function selectTab(id) {
if (id == "feedConfig") { if (id == "feedConfig") {
@ -716,6 +744,8 @@ function selectTab(id) {
updateFilterList(); updateFilterList();
} else if (id == "labelConfig") { } else if (id == "labelConfig") {
updateLabelList(); updateLabelList();
} else if (id == "genConfig") {
updatePrefsList();
} }
var tab = document.getElementById(active_tab + "Tab"); var tab = document.getElementById(active_tab + "Tab");

View File

@ -45,6 +45,9 @@
<input id="labelConfigTab" class="prefsTab" type="submit" value="Label Editor" <input id="labelConfigTab" class="prefsTab" type="submit" value="Label Editor"
onclick="selectTab('labelConfig')"> onclick="selectTab('labelConfig')">
<? } ?> <? } ?>
<input id="genConfigTab" class="prefsTab" type="submit" value="User Preferences"
onclick="selectTab('genConfig')">
</td> </td>
<td class="prefsToolbar" valign="middle" align="right"> <td class="prefsToolbar" valign="middle" align="right">
<input type="submit" onclick="gotoMain()" class="button" value="Return to main"> <input type="submit" onclick="gotoMain()" class="button" value="Return to main">