feed editor: add button to unsubscribe feed
This commit is contained in:
parent
a44db887de
commit
c8d5dcfe2b
|
@ -364,7 +364,13 @@
|
|||
<input type=\"submit\" class=\"button\"
|
||||
onclick=\"return feedEditSave()\" value=\"".__('Save')."\">
|
||||
<input type='submit' class='button'
|
||||
onclick=\"return feedEditCancel()\" value=\"".__('Cancel')."\"></div>";
|
||||
onclick=\"return feedEditCancel()\" value=\"".__('Cancel')."\">
|
||||
<div style=\"float : left\">
|
||||
|
||||
<input type='submit' class='button'
|
||||
onclick='return unsubscribeFeed($feed_id, \"$title\")' value=\"".__('Unsubscribe')."\">
|
||||
|
||||
</div>";
|
||||
|
||||
print "</div>";
|
||||
|
||||
|
|
28
prefs.js
28
prefs.js
|
@ -2182,3 +2182,31 @@ function removeFilter(id, title) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function unsubscribeFeed(id, title) {
|
||||
|
||||
if (!xmlhttp_ready(xmlhttp)) {
|
||||
printLockingError();
|
||||
return
|
||||
}
|
||||
|
||||
var msg = __("Unsubscribe from %s?").replace("%s", title);
|
||||
|
||||
var ok = confirm(msg);
|
||||
|
||||
if (ok) {
|
||||
closeInfoBox();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -604,8 +604,12 @@ function quickMenuGo(opid) {
|
|||
}
|
||||
}
|
||||
|
||||
function unsubscribeFeed(feed_id) {
|
||||
function unsubscribeFeed(feed_id, title) {
|
||||
|
||||
|
||||
var msg = __("Unsubscribe from %s?").replace("%s", title);
|
||||
|
||||
if (title == undefined || confirm(msg)) {
|
||||
notify_progress("Removing feed...");
|
||||
|
||||
var query = "backend.php?op=pref-feeds&quiet=1&subop=remove&ids=" + feed_id;
|
||||
|
@ -614,7 +618,7 @@ function unsubscribeFeed(feed_id) {
|
|||
onComplete: function(transport) {
|
||||
dlg_frefresh_callback(transport, feed_id);
|
||||
} });
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue