-
= __('Subscribe to feed') ?>
= __('Edit selected feeds') ?>
diff --git a/classes/rpc.php b/classes/rpc.php
index e0753a08e..2bbaf4135 100755
--- a/classes/rpc.php
+++ b/classes/rpc.php
@@ -80,18 +80,6 @@ class RPC extends Handler_Protected {
}
}
- function addfeed() {
- $feed = clean($_REQUEST['feed']);
- $cat = clean($_REQUEST['cat']);
- $need_auth = isset($_REQUEST['need_auth']);
- $login = $need_auth ? clean($_REQUEST['login']) : '';
- $pass = $need_auth ? clean($_REQUEST['pass']) : '';
-
- $rc = Feeds::subscribe_to_feed($feed, $cat, $login, $pass);
-
- print json_encode(array("result" => $rc));
- }
-
function togglepref() {
$key = clean($_REQUEST["key"]);
set_pref($key, !get_pref($key));
diff --git a/js/App.js b/js/App.js
index 3a31438c5..5c2d7726c 100644
--- a/js/App.js
+++ b/js/App.js
@@ -838,7 +838,7 @@ const App = {
if (this.is_prefs) {
this.hotkey_actions["feed_subscribe"] = () => {
- CommonDialogs.quickAddFeed();
+ CommonDialogs.subscribeToFeed();
};
this.hotkey_actions["create_label"] = () => {
@@ -994,7 +994,7 @@ const App = {
Feeds.toggleUnread();
};
this.hotkey_actions["feed_subscribe"] = () => {
- CommonDialogs.quickAddFeed();
+ CommonDialogs.subscribeToFeed();
};
this.hotkey_actions["feed_debug_update"] = () => {
if (!Feeds.activeIsCat() && parseInt(Feeds.getActive()) > 0) {
@@ -1139,7 +1139,7 @@ const App = {
Feeds.search();
break;
case "qmcAddFeed":
- CommonDialogs.quickAddFeed();
+ CommonDialogs.subscribeToFeed();
break;
case "qmcDigest":
window.location.href = "backend.php?op=digest";
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js
index 60c3e2a84..492467b7f 100644
--- a/js/CommonDialogs.js
+++ b/js/CommonDialogs.js
@@ -77,15 +77,93 @@ const CommonDialogs = {
return false;
},
- quickAddFeed: function() {
- xhrPost("backend.php",
- {op: "feeds", method: "quickAddFeed"},
- (transport) => {
-
+ subscribeToFeed: function() {
+ xhrJson("backend.php",
+ {op: "feeds", method: "subscribeToFeed"},
+ (reply) => {
const dialog = new fox.SingleUseDialog({
- id: "feedAddDlg",
title: __("Subscribe to Feed"),
- content: transport.responseText,
+ content: `
+
+ `,
show_error: function (msg) {
const elem = $("fadd_error_message");
@@ -114,7 +192,7 @@ const CommonDialogs = {
} catch (e) {
Element.hide("feed_add_spinner");
alert(__("Failed to parse output. This can indicate server timeout and/or network issues. Backend output was logged to browser console."));
- console.log('quickAddFeed, backend returned:' + transport.responseText);
+ console.log('subscribeToFeed, backend returned:' + transport.responseText);
return;
}