var init_params = new Array();
+var caller_subop = false;
+
function expand_feed_callback() {
if (xmlhttp.readyState == 4) {
try {
container.innerHTML=xmlhttp.responseText;
selectTab("feedConfig", true);
- if (active_feed_cat) {
- var row = document.getElementById("FCATR-" + active_feed_cat);
- if (row) {
- if (!row.className.match("Selected")) {
- row.className = row.className + "Selected";
- }
- }
- var checkbox = document.getElementById("FCCHK-" + active_feed_cat);
- if (checkbox) {
- checkbox.checked = true;
- }
+ if (caller_subop) {
+ var tuple = caller_subop.split(":");
+ if (tuple[0] == 'editFeed') {
+ window.setTimeout('editFeed('+tuple[1]+')', 100);
+ }
+
+ caller_subop = false;
}
notify("");
} else {
notify("Adding feed...");
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&feed_url=" +
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&from=tt-rss&feed_url=" +
param_escape(link.value), true);
xmlhttp.onreadystatechange=feedlist_callback;
xmlhttp.send(null);
} else {
notify("Adding feed category...");
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=addCat&cat=" +
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=add&cat=" +
param_escape(cat.value), true);
- xmlhttp.onreadystatechange=feedlist_callback;
+ xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);
link.value = "";
active_feed_cat = cat;
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCat&id=" +
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=edit&id=" +
param_escape(cat), true);
- xmlhttp.onreadystatechange=feedlist_callback;
+ xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);
}
if (ok) {
notify("Removing selected categories...");
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=remove&ids="+
param_escape(sel_rows.toString()), true);
- xmlhttp.onreadystatechange=feedlist_callback;
+ xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);
}
// notify("Operation cancelled.");
- xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
- xmlhttp.onreadystatechange=feedlist_callback;
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats", true);
+ xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);
return false;
var query = Form.serialize("feed_cat_edit_form");
xmlhttp.open("GET", "backend.php?" + query, true);
- xmlhttp.onreadystatechange=feedlist_callback;
+ xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);
active_feed_cat = false;
return
}
- if (!is_opera()) {
+/* if (!is_opera()) {
var sql_exp = document.forms["label_edit_form"].sql_exp.value;
var description = document.forms["label_edit_form"].description.value;
alert("Caption field cannot be blank.");
return false;
}
- }
+ } */
closeInfoBox();
return
}
- if (!is_opera()) {
+/* if (!is_opera()) {
var reg_exp = document.forms["filter_edit_form"].reg_exp.value;
if (reg_exp.length == 0) {
alert("Filter expression field cannot be blank.");
return;
}
- }
+ } */
notify("Saving filter...");
}
-function selectTab(id, noupdate) {
+function selectTab(id, noupdate, subop) {
// alert(id);
return
}
+ try {
+ var c = document.getElementById('prefContent');
+ c.scrollTop = 0;
+ } catch (e) { };
+
if (!noupdate) {
debug("selectTab: " + id + "(NU: " + noupdate + ")");
document.onkeydown = pref_hotkey_handler;
+ var tab = getURLParam('tab');
+
+ caller_subop = getURLParam('subop');
+
+ if (tab) {
+ active_tab = tab;
+ }
+
if (navigator.userAgent.match("Opera")) {
setTimeout("selectTab()", 500);
} else {
} else if (kind == "fcat") {
opbarid = "catOpToolbar";
nrow = "FCATR-";
- nchk = "FCHK-";
+ nchk = "FCCHK-";
lname = "prefFeedCatList";
} else if (kind == "filter") {
opbarid = "filterOpToolbar";
}
}
+function userSwitch() {
+ var chooser = document.getElementById("userSwitch");
+ var user = chooser[chooser.selectedIndex].value;
+ window.location = "prefs.php?swu=" + user;
+}
+
+function editFeedCats() {
+ if (!xmlhttp_ready(xmlhttp)) {
+ printLockingError();
+ return
+ }
+
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats", true);
+ xmlhttp.onreadystatechange=infobox_callback;
+ xmlhttp.send(null);
+}
+
+function showFeedsWithErrors() {
+ displayDlg('feedUpdateErrors');
+}
+