From 5f51022a734a7554e0afc6c121644309723f91db Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 May 2006 14:41:57 +0100 Subject: [PATCH] combined mode improvements (add toggle read link, set post as read when link is clicked) --- backend.php | 17 +++++++++++++---- tt-rss.css | 12 +++++++++++- viewfeed.js | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/backend.php b/backend.php index 51551314e..081bd7726 100644 --- a/backend.php +++ b/backend.php @@ -1148,9 +1148,14 @@ print "
"; - print "
$updated_fmt
"; + print "
$updated_fmt, + Toggle unread +
"; - print "".$line["title"].""; + print "".$line["title"].""; if ($line["feed_title"]) { print " (".$line["feed_title"].")"; @@ -1159,12 +1164,16 @@ print "
"; print "
" . $line["content_preview"] . "
"; - + print "
$marked_pic
-
+
"; +# print "
+# Toggle unread
"; + print "
"; } diff --git a/tt-rss.css b/tt-rss.css index edbb31161..a38159835 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -895,7 +895,7 @@ div.cdmArticleSelected, div.cdmArticleUnreadSelected { padding : 10px; } -div.cdmArticleUnread div.cdmHeader a, div.cdmArticleUnreadSelected div.cdmHeader a { +div.cdmArticleUnread div.cdmHeader a.title, div.cdmArticleUnreadSelected div.cdmHeader a { font-weight : bold; } @@ -923,6 +923,7 @@ div.cdmHeader a:hover { } div.cdmContent { + margin-bottom : 5px; } a.warning { @@ -1011,6 +1012,15 @@ div.cdmContent a:hover { color : black; } +a.cdmToggleLink { + color : #808080; + font-size : x-small; +} + +a.cdmToggleLink:hover { + color : #5050aa; +} + .noborder { border-width : 0px; } diff --git a/viewfeed.js b/viewfeed.js index 8ad6c5207..809d36d4e 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -207,6 +207,42 @@ function localHotkeyHandler(keycode) { } +function toggleUnread(id, cmode) { + try { + if (!xmlhttp_ready(xmlhttp_rpc)) { + printLockingError(); + return; + } + + var row = document.getElementById("RROW-" + id); + if (row) { + var nc = row.className; + nc = nc.replace("Unread", ""); + nc = nc.replace("Selected", ""); + + if (row.className.match("Unread")) { + row.className = nc; + } else { + row.className = nc + "Unread"; + } + + if (!cmode) cmode = 2; + + var query = "backend.php?op=rpc&subop=catchupSelected&ids=" + + param_escape(id) + "&cmode=" + param_escape(cmode); + + xmlhttp_rpc.open("GET", query, true); + xmlhttp_rpc.onreadystatechange=all_counters_callback; + xmlhttp_rpc.send(null); + + } + + + } catch (e) { + exception_error("toggleUnread", e); + } +} + function selectionToggleUnread(cdm_mode) { try { if (!xmlhttp_ready(xmlhttp_rpc)) {