summaryrefslogtreecommitdiff
path: root/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-24 06:57:37 +0100
committerAndrew Dolgov <[email protected]>2009-01-24 06:57:37 +0100
commit163723c4e63a964aedabfab2bd5c0ba849ded3f4 (patch)
treee2443bc30a9f0754a1ba745b1d63f00b1e5a6943 /prefs.js
parente4d4442cdb77e53e3813de6a2d3f22f6f83db47c (diff)
prefs: code cleanup
Diffstat (limited to 'prefs.js')
-rw-r--r--prefs.js166
1 files changed, 51 insertions, 115 deletions
diff --git a/prefs.js b/prefs.js
index 9ded65453..377c9aac8 100644
--- a/prefs.js
+++ b/prefs.js
@@ -416,103 +416,81 @@ function addUser() {
function editUser(id) {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
+ try {
- disableHotkeys();
+ disableHotkeys();
- notify_progress("Loading, please wait...");
+ notify_progress("Loading, please wait...");
- selectTableRowsByIdPrefix('prefUserList', 'UMRR-', 'UMCHK-', false);
- selectTableRowById('UMRR-'+id, 'UMCHK-'+id, true);
+ selectTableRowsByIdPrefix('prefUserList', 'UMRR-', 'UMCHK-', false);
+ selectTableRowById('UMRR-'+id, 'UMCHK-'+id, true);
- disableContainerChildren("userOpToolbar", false);
+ disableContainerChildren("userOpToolbar", false);
- xmlhttp.open("GET", "backend.php?op=pref-users&subop=edit&id=" +
- param_escape(id), true);
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
+ var query = "backend.php?op=pref-users&subop=edit&id=" +
+ param_escape(id);
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ infobox_callback2(transport);
+ } });
+ } catch (e) {
+ exception_error("editUser", e);
+ }
+
}
function editFilter(id) {
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
+ try {
- disableHotkeys();
+ disableHotkeys();
- notify_progress("Loading, please wait...");
+ notify_progress("Loading, please wait...");
-// document.getElementById("create_filter_btn").disabled = true;
+ disableContainerChildren("filterOpToolbar", false);
- disableContainerChildren("filterOpToolbar", false);
+ selectTableRowsByIdPrefix('prefFilterList', 'FILRR-', 'FICHK-', false);
+ selectTableRowById('FILRR-'+id, 'FICHK-'+id, true);
- selectTableRowsByIdPrefix('prefFilterList', 'FILRR-', 'FICHK-', false);
- selectTableRowById('FILRR-'+id, 'FICHK-'+id, true);
+ var query = "backend.php?op=pref-filters&subop=edit&id=" +
+ param_escape(id);
- xmlhttp.open("GET", "backend.php?op=pref-filters&subop=edit&id=" + param_escape(id), true);
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ infobox_callback2(transport);
+ } });
+ } catch (e) {
+ exception_error("editFilter", e);
+ }
}
function editFeed(feed) {
-// notify("Editing feed...");
-
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
-
- disableHotkeys();
-
- notify_progress("Loading, please wait...");
-
-/* document.getElementById("subscribe_to_feed_btn").disabled = true;
-
try {
- document.getElementById("top25_feeds_btn").disabled = true;
- } catch (e) {
- // this button is not always available, no-op if not found
- } */
-
- // clean selection from all rows & select row being edited
- selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-', 'FRCHK-', false);
- selectTableRowById('FEEDR-'+feed, 'FRCHK-'+feed, true);
-
- disableContainerChildren("feedOpToolbar", false);
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
- param_escape(feed), true);
-
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
-
-}
-
-function editFeedCat(cat) {
+ disableHotkeys();
+
+ notify_progress("Loading, please wait...");
+
+ // clean selection from all rows & select row being edited
+ selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-', 'FRCHK-', false);
+ selectTableRowById('FEEDR-'+feed, 'FRCHK-'+feed, true);
+
+ disableContainerChildren("feedOpToolbar", false);
+
+ var query = "backend.php?op=pref-feeds&subop=editfeed&id=" +
+ param_escape(feed);
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ infobox_callback2(transport);
+ } });
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
+ } catch (e) {
+ exception_error("editFeed", e);
}
-
- disableHotkeys();
-
- notify_progress("Loading, please wait...");
-
- active_feed_cat = cat;
-
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats&action=edit&id=" +
- param_escape(cat), true);
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
-
}
function getSelectedLabels() {
@@ -774,29 +752,6 @@ function feedEditCancel() {
return false;
}
-function feedCatEditCancel() {
-
- if (!xmlhttp_ready(xmlhttp)) {
- printLockingError();
- return
- }
-
- active_feed_cat = false;
-
- try {
- document.getElementById("subscribe_to_feed_btn").disabled = false;
- document.getElementById("top25_feeds_btn").disabled = false;
- } catch (e) {
- // this button is not always available, no-op if not found
- }
-
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats", true);
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
-
- return false;
-}
-
function feedEditSave() {
try {
@@ -1087,25 +1042,6 @@ function editSelectedFeeds() {
}
-function editSelectedFeedCat() {
- var rows = getSelectedFeedCats();
-
- if (rows.length == 0) {
- alert(__("No categories are selected."));
- return;
- }
-
- if (rows.length > 1) {
- alert(__("Please select only one category."));
- return;
- }
-
- notify("");
-
- editFeedCat(rows[0]);
-
-}
-
function piggie(enable) {
if (enable) {
debug("I LOVEDED IT!");