summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-11-22 11:11:41 +0100
committerAndrew Dolgov <[email protected]>2006-11-22 11:11:41 +0100
commit7086277caf21c8107c97072126bf6b4058a50593 (patch)
treeed53fe3a6a7d735c1d026c30d57472cf09f7c507 /tt-rss.js
parentbbb416e58b08ae8ad8f7fe30fd83a410ad2d3fad (diff)
add quick action to edit current feed
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js57
1 files changed, 57 insertions, 0 deletions
diff --git a/tt-rss.js b/tt-rss.js
index bf673174f..472c90a6b 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -453,6 +453,10 @@ function quickMenuGo(opid) {
displayDlg("quickAddFeed");
return;
}
+
+ if (opid == "qmcEditFeed") {
+ editFeedDlg(getActiveFeedId());
+ }
if (opid == "qmcRemoveFeed") {
var actid = getActiveFeedId();
@@ -596,4 +600,57 @@ function userSwitch() {
window.location = "tt-rss.php?swu=" + user;
}
+function editFeedDlg(feed) {
+
+ if (!feed) {
+ alert("Please select some feed first.");
+ return;
+ }
+
+ if (xmlhttp_ready(xmlhttp)) {
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
+ param_escape(feed), true);
+ xmlhttp.onreadystatechange=infobox_callback;
+ xmlhttp.send(null);
+ } else {
+ printLockingError();
+ }
+}
+
+/* this functions duplicate those of prefs.js feed editor, with
+ some differences because there is no feedlist */
+
+function feedEditCancel() {
+ closeInfoBox();
+ return false;
+}
+
+function feedEditSave() {
+
+ try {
+
+ if (!xmlhttp_ready(xmlhttp)) {
+ printLockingError();
+ return
+ }
+
+ // FIXME: add parameter validation
+
+ var query = Form.serialize("edit_feed_form");
+
+ notify("Saving feed...");
+
+ xmlhttp.open("POST", "backend.php", true);
+ xmlhttp.onreadystatechange=dlg_frefresh_callback;
+ xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ xmlhttp.send(query);
+
+ closeInfoBox();
+
+ return false;
+
+ } catch (e) {
+ exception_error("feedEditSave (main)", e);
+ }
+}