summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-25 16:14:45 +0100
committerAndrew Dolgov <[email protected]>2005-11-25 16:14:45 +0100
commit35f3c923c47a94af018ff2b41d8c37a5956a9d37 (patch)
treeb443eb4f10c750d02bef2abd97386a7025963d12 /functions.js
parent04f6df27b991f9811ab4ee1b79151f7c1667df36 (diff)
select all/none prompt for pref tables + related API
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js39
1 files changed, 38 insertions, 1 deletions
diff --git a/functions.js b/functions.js
index fcf22b73b..c03e623f2 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) {