toggle hide/display only unread feeds, All feeds: button ops changed into selector
This commit is contained in:
parent
aa5f9f5fec
commit
3745788e89
|
@ -135,7 +135,7 @@
|
|||
<script type=\"text/javascript\" src=\"functions.js\"></script>
|
||||
<script type=\"text/javascript\" src=\"feedlist.js\"></script>
|
||||
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
||||
</head><body>";
|
||||
</head><body onload=\"init()\">";
|
||||
|
||||
print "<ul class=\"feedList\" id=\"feedList\">";
|
||||
|
||||
|
@ -147,7 +147,7 @@
|
|||
FROM ttrss_entries WHERE marked = true AND unread = true");
|
||||
$num_starred = db_fetch_result($result, 0, "num_starred");
|
||||
|
||||
$class = "odd";
|
||||
$class = "virt";
|
||||
|
||||
if ($num_starred > 0) $class .= "Unread";
|
||||
|
||||
|
@ -172,7 +172,7 @@
|
|||
|
||||
$count = db_fetch_result($tmp_result, 0, "count");
|
||||
|
||||
$class = "odd";
|
||||
$class = "label";
|
||||
|
||||
if ($count > 0) {
|
||||
$class .= "Unread";
|
||||
|
@ -215,7 +215,7 @@
|
|||
|
||||
// $class = ($lnum % 2) ? "even" : "odd";
|
||||
|
||||
$class = "odd";
|
||||
$class = "feed";
|
||||
|
||||
if ($unread > 0) $class .= "Unread";
|
||||
|
||||
|
|
|
@ -88,4 +88,8 @@ function viewfeed(feed, skip, subop, doc) {
|
|||
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1);
|
||||
|
||||
}
|
||||
|
|
21
functions.js
21
functions.js
|
@ -396,3 +396,24 @@ function popupHelp(tid) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function hideOrShowFeeds(doc, hide) {
|
||||
|
||||
var css_rules = doc.styleSheets[0].cssRules;
|
||||
|
||||
for (i = 0; i < css_rules.length; i++) {
|
||||
var rule = css_rules[i];
|
||||
|
||||
if (rule.selectorText == "ul.feedList li.feed") {
|
||||
if (!hide) {
|
||||
rule.style.display = "block";
|
||||
} else {
|
||||
rule.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
40
tt-rss.css
40
tt-rss.css
|
@ -153,6 +153,31 @@ li.oddSelected a, li.evenSelected a,
|
|||
color : #5050aa;
|
||||
}
|
||||
|
||||
ul.feedlist
|
||||
li.virtSelected,
|
||||
li.virtUnreadSelected,
|
||||
li.feedSelected,
|
||||
li.labelSelected,
|
||||
li.feedUnreadSelected,
|
||||
li.labelUnreadSelected {
|
||||
background-color : white;
|
||||
}
|
||||
|
||||
ul.feedlist
|
||||
li.feedSelected a,
|
||||
li.labelSelected a,
|
||||
li.feedUnreadSelected a,
|
||||
li.labelUnreadSelected a,
|
||||
li.virtSelected a,
|
||||
li.virtUnreadSelected a,
|
||||
li.virtSelectedUnread a {
|
||||
color : #5050aa;
|
||||
}
|
||||
|
||||
ul.feedList li.feed {
|
||||
display : block;
|
||||
}
|
||||
|
||||
ul.feedList img {
|
||||
margin : 0px 3px 0px 0px;
|
||||
width : 16px;
|
||||
|
@ -285,12 +310,12 @@ a.button {
|
|||
font-size : small;
|
||||
}
|
||||
|
||||
.evenUnreadSelected, .evenSelectedUnread {
|
||||
.evenUnreadSelected, .evenSelectedUnread, {
|
||||
background-color : #e0e0ff;
|
||||
font-weight : bold;
|
||||
}
|
||||
|
||||
.oddUnreadSelected, .oddSelectedUnread {
|
||||
.oddUnreadSelected, .oddSelectedUnread, .feedSelectedUnread, {
|
||||
background-color : #e0e0ff;
|
||||
font-weight : bold;
|
||||
}
|
||||
|
@ -303,6 +328,17 @@ a.button {
|
|||
background-color : #e0e0ff;
|
||||
}
|
||||
|
||||
.feedUnreadSelected, .feedSelectedUnread,
|
||||
.virtUnreadSelected, .virtSelectedUnread,
|
||||
.labelUnreadSelected, .labelSelectedUnread {
|
||||
background-color : #e0e0ff;
|
||||
font-weight : bold;
|
||||
}
|
||||
|
||||
.feedUnread, .labelUnread, .virtUnread {
|
||||
font-weight : bold;
|
||||
}
|
||||
|
||||
.disabledButton {
|
||||
border : 1px solid #c0c0c0;
|
||||
background-color : white;
|
||||
|
|
40
tt-rss.js
40
tt-rss.js
|
@ -12,6 +12,7 @@ var search_query = "";
|
|||
var search_mode = "";
|
||||
|
||||
var display_tags = false;
|
||||
//var display_read_feeds = true;
|
||||
|
||||
var global_unread = 0;
|
||||
|
||||
|
@ -524,3 +525,42 @@ function qfdDelete(feed_id) {
|
|||
xmlhttp.send(null);
|
||||
}
|
||||
|
||||
|
||||
function allFeedsMenuGo() {
|
||||
var chooser = document.getElementById("allFeedsChooser");
|
||||
|
||||
var opname = chooser[chooser.selectedIndex].text;
|
||||
|
||||
if (opname == "Update") {
|
||||
scheduleFeedUpdate(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (opname == "Mark as read") {
|
||||
catchupAllFeeds();
|
||||
return;
|
||||
}
|
||||
|
||||
if (opname == "Toggle display read") {
|
||||
toggleDispRead();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function toggleDispRead() {
|
||||
var hide_read_feeds = (getCookie("ttrss_vf_hreadf") == 1);
|
||||
|
||||
hide_read_feeds = !hide_read_feeds;
|
||||
|
||||
var feeds_doc = window.frames["feeds-frame"].document;
|
||||
|
||||
hideOrShowFeeds(feeds_doc, hide_read_feeds);
|
||||
|
||||
if (hide_read_feeds) {
|
||||
setCookie("ttrss_vf_hreadf", 1);
|
||||
} else {
|
||||
setCookie("ttrss_vf_hreadf", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
14
tt-rss.php
14
tt-rss.php
|
@ -62,15 +62,17 @@
|
|||
src="backend.php?op=error&msg=Loading,%20please wait..."
|
||||
id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
|
||||
|
||||
<p align="center">All feeds:
|
||||
<div align="center">All feeds:
|
||||
|
||||
<input class="button" type="submit"
|
||||
onclick="javascript:scheduleFeedUpdate(true)" value="Update">
|
||||
<select id="allFeedsChooser">
|
||||
<option>Update</option>
|
||||
<option>Mark as read</option>
|
||||
<option>Toggle display read</option>
|
||||
</select>
|
||||
|
||||
<input class="button" type="submit"
|
||||
onclick="javascript:catchupAllFeeds()" value="Mark as read">
|
||||
<input type="submit" class="button" onclick="allFeedsMenuGo()" value="Go">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td valign="top" class="headlinesToolbarBox">
|
||||
|
|
|
@ -176,6 +176,10 @@ li.oddSelected a, li.evenSelected a,
|
|||
font-size:8pt;
|
||||
}
|
||||
|
||||
ul.feedList li.even, li.odd {
|
||||
display : block;
|
||||
}
|
||||
|
||||
ul.feedList img {
|
||||
margin : 0px 3px 0px 0px;
|
||||
width : 16px;
|
||||
|
@ -328,6 +332,18 @@ a.button {
|
|||
background-color : #e0e0ff;
|
||||
}
|
||||
|
||||
.feedUnreadSelected, .feedSelectedUnread,
|
||||
.virtUnreadSelected, .virtSelectedUnread,
|
||||
.labelUnreadSelected, .labelSelectedUnread {
|
||||
background-color : #e0e0ff;
|
||||
font-weight : bold;
|
||||
}
|
||||
|
||||
.feedUnread, .labelUnread, .virtUnread {
|
||||
font-weight : bold;
|
||||
}
|
||||
|
||||
|
||||
.disabledButton {
|
||||
border : 1px solid #c0c0c0;
|
||||
background-color : white;
|
||||
|
|
Loading…
Reference in New Issue