diff options
author | Andrew Dolgov <[email protected]> | 2008-07-25 08:48:15 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2008-07-25 08:48:15 +0100 |
commit | 7bce63e76833eea0e1de4887cfad63127ca755c9 (patch) | |
tree | 001c31a4197fc515593a50faba7cd3fafe15969e | |
parent | abaf02111e4dac9f1e36cc63d2aa324deae05f96 (diff) |
add quick unsubscribe button to prefs/feedlist
-rw-r--r-- | modules/pref-feeds.php | 8 | ||||
-rw-r--r-- | prefs.js | 28 | ||||
-rw-r--r-- | tt-rss.css | 9 |
3 files changed, 44 insertions, 1 deletions
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 8041b8cc1..f1c9bfd6f 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -968,6 +968,7 @@ $cat_id = $line["cat_id"]; $edit_title = htmlspecialchars($line["title"]); + $feed_title = $edit_title; $edit_cat = htmlspecialchars($line["category"]); $hidden = sql_bool_to_bool($line["hidden"]); @@ -1063,6 +1064,11 @@ $parent_title)</span>"; } + $ops = "<span class=\"feedOps\"> + (<a title=\"".__('Unsubscribe')."\" + href='javascript:removeFeed($feed_id, \"$feed_title\")'>x</a>) + </span>"; + print "<td $onclick>" . "$edit_title $parent_title" . "</td>"; if ($show_last_article_info) { @@ -1070,7 +1076,7 @@ "$last_article</td>"; } - print "<td $onclick align='right'>$last_updated</td>"; + print "<td align='right'>$ops $last_updated</td>"; print "</tr>"; @@ -508,6 +508,7 @@ function editFeed(feed) { xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); + return false; } function editFeedCat(cat) { @@ -691,6 +692,33 @@ function removeSelectedFeeds() { return false; } +function removeFeed(id, title) { + + if (!xmlhttp_ready(xmlhttp)) { + printLockingError(); + return + } + + if (id) { + + var msg = __("Unsubscribe from %s?").replace("%s", title); + + var ok = confirm(msg); + + if (ok) { + + notify_progress("Unsubscribing..."); + + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=remove&ids="+ + param_escape(id), true); + xmlhttp.onreadystatechange=feedlist_callback; + xmlhttp.send(null); + } + } + + return false; +} + function clearSelectedFeeds() { if (!xmlhttp_ready(xmlhttp)) { diff --git a/tt-rss.css b/tt-rss.css index 43a76229b..a7e8ff849 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -442,6 +442,15 @@ div.feedEditSearch { float : right; } +table.prefFeedList span.feedOps { + display : none; + margin-right : 1em; +} + +table.prefFeedList tr:hover span.feedOps { + display : inline; +} + table.prefFeedList td.feedEditCat { font-weight : bold; border-width : 0px 0px 1px 0px; |