add link to invert headline/article selection (closes #216)

This commit is contained in:
Andrew Dolgov 2008-08-18 07:21:35 +01:00
parent 965fb2af0d
commit e75d70b5a8
2 changed files with 43 additions and 0 deletions

View file

@ -3918,6 +3918,7 @@
$sel_all_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, '', true)";
$sel_unread_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true)";
$sel_none_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false)";
$sel_inv_link = "javascript:invertHeadlineSelection()";
$tog_unread_link = "javascript:selectionToggleUnread()";
$tog_marked_link = "javascript:selectionToggleMarked()";
@ -3929,6 +3930,8 @@
$sel_unread_link = "javascript:cdmSelectArticles('unread')";
$sel_none_link = "javascript:cdmSelectArticles('none')";
$sel_inv_link = "javascript:invertHeadlineSelection()";
$tog_unread_link = "javascript:selectionToggleUnread(true)";
$tog_marked_link = "javascript:selectionToggleMarked(true)";
$tog_published_link = "javascript:selectionTogglePublished(true)";
@ -3945,6 +3948,7 @@
".__('Select:')."
<a href=\"$sel_all_link\">".__('All')."</a>,
<a href=\"$sel_unread_link\">".__('Unread')."</a>,
<a href=\"$sel_inv_link\">".__('Invert')."</a>,
<a href=\"$sel_none_link\">".__('None')."</a></li>
<li class=\"vsep\">&nbsp;</li>
<li class=\"top\">".__('Actions...')."<ul>

View file

@ -1850,6 +1850,45 @@ function hideReadHeadlines() {
}
}
function invertHeadlineSelection() {
try {
var rows = new Array();
var r = false;
if (!isCdmMode()) {
r = document.getElementsByTagName("TR");
} else {
r = document.getElementsByTagName("DIV");
}
for (var i = 0; i < r.length; i++) {
if (r[i].id && r[i].id.match("RROW-")) {
rows.push(r[i]);
}
}
for (var i = 0; i < rows.length; i++) {
var nc = rows[i].className;
var id = rows[i].id.replace("RROW-", "");
var cb = document.getElementById("RCHK-" + id);
if (!rows[i].className.match("Selected")) {
nc = nc + "Selected";
cb.checked = true;
} else {
nc = nc.replace("Selected", "");
cb.checked = false;
}
rows[i].className = nc;
}
} catch (e) {
exception_error("invertHeadlineSelection", e);
}
}
function getArticleUnderPointer() {
return post_under_pointer;
}