}
}
-function feedlist_callback() {
- if (xmlhttp.readyState == 4) {
- return feedlist_callback2(xmlhttp);
- }
-}
-
function feedlist_callback2(transport) {
try {
remove_splash();
}
-
-function filterlist_callback() {
- if (xmlhttp.readyState == 4) {
- filterlist_callback2(xmlhttp);
- }
-}
-
function labellist_callback2(transport) {
try {
function removeSelectedFilters() {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
-
- var sel_rows = getSelectedFilters();
-
- if (sel_rows.length > 0) {
-
- var ok = confirm(__("Remove selected filters?"));
+ try {
- if (ok) {
- notify_progress("Removing selected filters...");
+ var sel_rows = getSelectedFilters();
- xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
- param_escape(sel_rows.toString()), true);
- xmlhttp.onreadystatechange=filterlist_callback;
- xmlhttp.send(null);
+ if (sel_rows.length > 0) {
+
+ var ok = confirm(__("Remove selected filters?"));
+
+ if (ok) {
+ notify_progress("Removing selected filters...");
+
+ var query = "backend.php?op=pref-filters&subop=remove&ids="+
+ param_escape(sel_rows.toString());
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ filterlist_callback2(transport);
+ } });
+
+ }
+ } else {
+ alert(__("No filters are selected."));
}
- } else {
- alert(__("No filters are selected."));
+
+ } catch (e) {
+ exception_error("removeSelectedFilters", e);
}
return false;
function filterEditSave() {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
+ try {
-/* if (!is_opera()) {
- var reg_exp = document.forms["filter_edit_form"].reg_exp.value;
+ notify_progress("Saving filter...");
- if (reg_exp.length == 0) {
- alert("Filter expression field cannot be blank.");
- return;
- }
- } */
-
- notify_progress("Saving filter...");
-
- var query = Form.serialize("filter_edit_form");
-
- closeInfoBox();
+ var query = "backend.php?" + Form.serialize("filter_edit_form");
+
+ closeInfoBox();
+
+ document.getElementById("create_filter_btn").disabled = false;
- document.getElementById("create_filter_btn").disabled = false;
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ filterlist_callback2(transport);
+ } });
- xmlhttp.open("GET", "backend.php?" + query, true);
- xmlhttp.onreadystatechange=filterlist_callback;
- xmlhttp.send(null);
+ } catch (e) {
+ exception_error("filterEditSave", e);
+ }
return false;
}
}
function updateFilterList(sort_key) {
+ try {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
+ var filter_search = document.getElementById("filter_search");
+ var search = "";
+ if (filter_search) { search = filter_search.value; }
+
+ var query = "backend.php?op=pref-filters&sort=" +
+ param_escape(sort_key) +
+ "&search=" + param_escape(search);
- var filter_search = document.getElementById("filter_search");
- var search = "";
- if (filter_search) { search = filter_search.value; }
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ filterlist_callback2(transport);
+ } });
- xmlhttp.open("GET", "backend.php?op=pref-filters&sort=" +
- param_escape(sort_key) +
- "&search=" + param_escape(search), true);
- xmlhttp.onreadystatechange=filterlist_callback;
- xmlhttp.send(null);
+ } catch (e) {
+ exception_error("updateFilterList", e);
+ }
}
function unsubscribeFeed(id, title) {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
-
- var msg = __("Unsubscribe from %s?").replace("%s", title);
-
- var ok = confirm(msg);
-
- if (ok) {
- closeInfoBox();
+ try {
- notify_progress("Removing feed...");
+ var msg = __("Unsubscribe from %s?").replace("%s", title);
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
- param_escape(id), true);
- xmlhttp.onreadystatechange=filterlist_callback;
- xmlhttp.send(null);
+ var ok = confirm(msg);
+
+ if (ok) {
+ closeInfoBox();
+
+ notify_progress("Removing feed...");
+
+ var query = "backend.php?op=pref-feeds&subop=remove&ids="+
+ param_escape(id);
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ feedlist_callback2(transport);
+ } });
+ }
+
+ } catch (e) {
+ exception_error("unsubscribeFeed", e);
}
return false;
- return false;
-
}
function feedsEditSave() {