}
-function replace_pubkey_callback() {
- if (xmlhttp.readyState == 4) {
- try {
- var link = document.getElementById("pubGenAddress");
-
- if (xmlhttp.responseXML) {
+function replace_pubkey_callback(transport) {
+ try {
+ var link = document.getElementById("pubGenAddress");
- var new_link = xmlhttp.responseXML.getElementsByTagName("link")[0];
+ if (transport.responseXML) {
- if (new_link) {
- link.href = new_link.firstChild.nodeValue;
- //link.innerHTML = new_link.firstChild.nodeValue;
+ var new_link = transport.responseXML.getElementsByTagName("link")[0];
- new Effect.Highlight(link);
+ if (new_link) {
+ link.href = new_link.firstChild.nodeValue;
+ //link.innerHTML = new_link.firstChild.nodeValue;
- notify_info("Published feed URL changed.");
- } else {
- notify_error("Could not change feed URL.");
- }
+ new Effect.Highlight(link);
+ notify_info("Published feed URL changed.");
} else {
notify_error("Could not change feed URL.");
}
- } catch (e) {
- exception_error("replace_pubkey_callback", e);
+
+ } else {
+ notify_error("Could not change feed URL.");
}
+ } catch (e) {
+ exception_error("replace_pubkey_callback", e);
}
}
}
}
-function feed_browser_callback() {
- var container = document.getElementById('prefContent');
- if (xmlhttp.readyState == 4) {
- container.innerHTML=xmlhttp.responseText;
- notify("");
- remove_splash();
- }
-}
-
function userlist_callback() {
var container = document.getElementById('prefContent');
if (xmlhttp.readyState == 4) {
}
}
-function prefslist_callback() {
- var container = document.getElementById('prefContent');
- if (xmlhttp.readyState == 4) {
- container.innerHTML=xmlhttp.responseText;
+function prefslist_callback2(transport) {
+ try {
+ var container = document.getElementById('prefContent');
+ container.innerHTML=transport.responseText;
notify("");
remove_splash();
- }
-}
-
-function gethelp_callback() {
- var container = document.getElementById('prefHelpBox');
- if (xmlhttp.readyState == 4) {
-
- container.innerHTML = xmlhttp.responseText;
- container.style.display = "block";
-
+ } catch (e) {
+ exception_error("prefslist_callback2", e);
}
}
notify_info(transport.responseText);
}
-function prefs_reset_callback() {
- if (xmlhttp.readyState == 4) {
- notify_info(xmlhttp.responseText);
+function prefs_reset_callback2(transport) {
+ try {
+ notify_info(transport.responseText);
selectTab();
- }
+ } catch (e) {
+ exception_error("prefs_reset_callback2", e);
+ }
}
function updatePrefsList() {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
+ var query = "backend.php?op=pref-prefs";
- xmlhttp.open("GET", "backend.php?op=pref-prefs", true);
- xmlhttp.onreadystatechange=prefslist_callback;
- xmlhttp.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ prefslist_callback2(transport);
+ } });
}
function categorizeSelectedFeeds() {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
-
var sel_rows = getSelectedFeeds();
var cat_sel = document.getElementById("sfeed_set_fcat");
query = query + "&subop=reset-config";
debug(query);
- xmlhttp.open("POST", "backend.php", true);
- xmlhttp.onreadystatechange=prefs_reset_callback;
- xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xmlhttp.send(query);
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ prefs_reset_callback2(transport);
+ } });
+
}
} catch (e) {
notify_progress("Trying to change address...");
- xmlhttp.open("GET", "backend.php?op=rpc&subop=regenPubKey");
- xmlhttp.onreadystatechange=replace_pubkey_callback;
- xmlhttp.send(null);
+ var query = "backend.php?op=rpc&subop=regenPubKey";
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ replace_pubkey_callback(transport);
+ } });
+
}
return false;