From 35f3c923c47a94af018ff2b41d8c37a5956a9d37 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 25 Nov 2005 16:14:45 +0100 Subject: [PATCH] select all/none prompt for pref tables + related API --- backend.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- functions.js | 39 ++++++++++++++++++++++++++++++++++++++- tt-rss.css | 5 +++++ 3 files changed, 89 insertions(+), 5 deletions(-) diff --git a/backend.php b/backend.php index a831028a..aa0c271a 100644 --- a/backend.php +++ b/backend.php @@ -1187,8 +1187,16 @@ if (db_num_rows($result) != 0) { print "
PLACEHOLDER
"; - + print "

"; + print " @@ -1415,7 +1423,17 @@ if (db_num_rows($result) != 0) { - print "

+ Select: + All, + None + "; + print "
  Select
"; + print "

"; + + print ""; @@ -1614,7 +1632,15 @@ if (db_num_rows($result) != 0) { print "

+ Select: + All, + None + "; + print "
SelectTitle
"; - + + print " @@ -1865,7 +1891,15 @@ if (db_num_rows($result) != 0) { print "

+ Select: + All, + None + "; + print "
SelectFilter expression FeedMatch
"; - + + print "
+ Select: + All, + None + "; + print "
SelectSQL expression (?) @@ -2468,6 +2502,14 @@ print "

"; + print " diff --git a/functions.js b/functions.js index fcf22b73..c03e623f 100644 --- a/functions.js +++ b/functions.js @@ -199,7 +199,21 @@ function getLastVisibleHeadlineId() { function markHeadline(id) { var row = document.getElementById("RROW-" + id); if (row) { - row.className = row.className + "Selected"; + var is_active = false; + + if (row.className.match("Active")) { + is_active = true; + } + row.className = row.className.replace("Selected", ""); + row.className = row.className.replace("Active", ""); + row.className = row.className.replace("Insensitive", ""); + + if (is_active) { + row.className = row.className = "Active"; + } + + row.className = row.className + "Selected"; + } } @@ -427,7 +441,30 @@ function hideOrShowFeeds(doc, hide) { function fatalError(code) { window.location = "error.php?c=" + param_escape(code); +} + +function selectTableRow(r, do_select) { + r.className = r.className.replace("Selected", ""); + + if (do_select) { + r.className = r.className + "Selected"; + } +} + +function selectTableRowsByIdPrefix(content_id, prefix, do_select) { + var content = document.getElementById(content_id); + + if (!content) { + alert("[selectTableRows] Element " + content_id + " not found."); + return; + } + + for (i = 0; i < content.rows.length; i++) { + if (content.rows[i].id.match(prefix)) { + selectTableRow(content.rows[i], do_select); + } + } } function getSelectedTableRowIds(content_id, prefix) { diff --git a/tt-rss.css b/tt-rss.css index 6c9735c4..d32a3908 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -666,3 +666,8 @@ table.innerFeedTable td { margin : 0px; padding : 0px; } + +td.selectPrompt { + font-size : x-small; + color : gray; +} -- 2.39.5
+ Select: + All, + None + "; + print "
Select Username