prefs: some async work (4)
This commit is contained in:
parent
60715b53d5
commit
23e51f4092
102
prefs.js
102
prefs.js
|
@ -53,12 +53,6 @@ function replace_pubkey_callback() {
|
|||
}
|
||||
}
|
||||
|
||||
function feedlist_callback() {
|
||||
if (xmlhttp.readyState == 4) {
|
||||
return feedlist_callback2(xmlhttp);
|
||||
}
|
||||
}
|
||||
|
||||
function feedlist_callback2(transport) {
|
||||
|
||||
try {
|
||||
|
@ -102,13 +96,6 @@ function filterlist_callback2(transport) {
|
|||
remove_splash();
|
||||
}
|
||||
|
||||
|
||||
function filterlist_callback() {
|
||||
if (xmlhttp.readyState == 4) {
|
||||
filterlist_callback2(xmlhttp);
|
||||
}
|
||||
}
|
||||
|
||||
function labellist_callback2(transport) {
|
||||
|
||||
try {
|
||||
|
@ -566,10 +553,7 @@ function removeSelectedUsers() {
|
|||
|
||||
function removeSelectedFilters() {
|
||||
|
||||
if (!xmlhttp_ready(xmlhttp)) {
|
||||
printLockingError();
|
||||
return
|
||||
}
|
||||
try {
|
||||
|
||||
var sel_rows = getSelectedFilters();
|
||||
|
||||
|
@ -580,15 +564,23 @@ function removeSelectedFilters() {
|
|||
if (ok) {
|
||||
notify_progress("Removing selected filters...");
|
||||
|
||||
xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+
|
||||
param_escape(sel_rows.toString()), true);
|
||||
xmlhttp.onreadystatechange=filterlist_callback;
|
||||
xmlhttp.send(null);
|
||||
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."));
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
exception_error("removeSelectedFilters", e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -831,31 +823,24 @@ function userEditSave() {
|
|||
|
||||
function filterEditSave() {
|
||||
|
||||
if (!xmlhttp_ready(xmlhttp)) {
|
||||
printLockingError();
|
||||
return
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
} */
|
||||
try {
|
||||
|
||||
notify_progress("Saving filter...");
|
||||
|
||||
var query = Form.serialize("filter_edit_form");
|
||||
var query = "backend.php?" + Form.serialize("filter_edit_form");
|
||||
|
||||
closeInfoBox();
|
||||
|
||||
document.getElementById("create_filter_btn").disabled = false;
|
||||
|
||||
xmlhttp.open("GET", "backend.php?" + query, true);
|
||||
xmlhttp.onreadystatechange=filterlist_callback;
|
||||
xmlhttp.send(null);
|
||||
new Ajax.Request(query, {
|
||||
onComplete: function(transport) {
|
||||
filterlist_callback2(transport);
|
||||
} });
|
||||
|
||||
} catch (e) {
|
||||
exception_error("filterEditSave", e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1031,21 +1016,24 @@ function validateOpmlImport() {
|
|||
}
|
||||
|
||||
function updateFilterList(sort_key) {
|
||||
|
||||
if (!xmlhttp_ready(xmlhttp)) {
|
||||
printLockingError();
|
||||
return
|
||||
}
|
||||
try {
|
||||
|
||||
var filter_search = document.getElementById("filter_search");
|
||||
var search = "";
|
||||
if (filter_search) { search = filter_search.value; }
|
||||
|
||||
xmlhttp.open("GET", "backend.php?op=pref-filters&sort=" +
|
||||
var query = "backend.php?op=pref-filters&sort=" +
|
||||
param_escape(sort_key) +
|
||||
"&search=" + param_escape(search), true);
|
||||
xmlhttp.onreadystatechange=filterlist_callback;
|
||||
xmlhttp.send(null);
|
||||
"&search=" + param_escape(search);
|
||||
|
||||
new Ajax.Request(query, {
|
||||
onComplete: function(transport) {
|
||||
filterlist_callback2(transport);
|
||||
} });
|
||||
|
||||
} catch (e) {
|
||||
exception_error("updateFilterList", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1951,10 +1939,7 @@ function removeFilter(id, title) {
|
|||
|
||||
function unsubscribeFeed(id, title) {
|
||||
|
||||
if (!xmlhttp_ready(xmlhttp)) {
|
||||
printLockingError();
|
||||
return
|
||||
}
|
||||
try {
|
||||
|
||||
var msg = __("Unsubscribe from %s?").replace("%s", title);
|
||||
|
||||
|
@ -1965,13 +1950,18 @@ function unsubscribeFeed(id, title) {
|
|||
|
||||
notify_progress("Removing feed...");
|
||||
|
||||
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+
|
||||
param_escape(id), true);
|
||||
xmlhttp.onreadystatechange=filterlist_callback;
|
||||
xmlhttp.send(null);
|
||||
var query = "backend.php?op=pref-feeds&subop=remove&ids="+
|
||||
param_escape(id);
|
||||
|
||||
new Ajax.Request(query, {
|
||||
onComplete: function(transport) {
|
||||
feedlist_callback2(transport);
|
||||
} });
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (e) {
|
||||
exception_error("unsubscribeFeed", e);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue