summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-08-19 06:13:45 +0100
committerAndrew Dolgov <[email protected]>2007-08-19 06:13:45 +0100
commita5ae125a8d55f1d387b7f75014d3351581edce85 (patch)
tree1c5d7410dfb3675b716c0c7e7f24f43130c27f86
parent97bcea181a7aa7a0d42c481112b8852f1af337b2 (diff)
allow to mark selected articles as read, L10N bumps
-rw-r--r--functions.php2
-rw-r--r--localized_js.php6
-rw-r--r--viewfeed.js62
3 files changed, 63 insertions, 7 deletions
diff --git a/functions.php b/functions.php
index 31fcd6f46..cefd4917f 100644
--- a/functions.php
+++ b/functions.php
@@ -3142,6 +3142,7 @@
$catchup_page_link = "javascript:catchupPage()";
$catchup_feed_link = "javascript:catchupCurrentFeed()";
+ $catchup_sel_link = "javascript:catchupSelection()";
if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) {
@@ -3182,6 +3183,7 @@
</ul></li>
<li class=\"vsep\">&nbsp;</li>
<li class=\"top\"><a href=\"$catchup_page_link\">".__('Mark as read')."</a><ul>
+ <li onclick=\"$catchup_sel_link\">".__('Selection')."</li>
<li onclick=\"$catchup_page_link\">".__('This page')."</li>
<li onclick=\"$catchup_feed_link\">".__('Entire feed')."</li></ul></li>
";
diff --git a/localized_js.php b/localized_js.php
index 37eed1266..3ce875482 100644
--- a/localized_js.php
+++ b/localized_js.php
@@ -109,9 +109,9 @@ print T_js_decl("No feeds are selected.");
print T_js_decl("Can't add filter: nothing to match on.");
print T_js_decl("Can't subscribe: no feed URL given.");
print T_js_decl("Unsubscribe from %s?");
-#print T_js_decl(
-#print T_js_decl(
-#print T_js_decl(
+print T_js_decl("Mark all visible articles in %s as read?");
+print T_js_decl("Mark all selected articles in %s as read?");
+print T_js_decl("Please enter label title:");
#print T_js_decl(
#print T_js_decl(
#print T_js_decl(
diff --git a/viewfeed.js b/viewfeed.js
index 06296b8e0..d9f2ce50b 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -644,9 +644,19 @@ function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
nc = nc.replace("Unread", "");
nc = nc.replace("Selected", "");
- if (row.className.match("Unread")) {
+ if (set_state == undefined) {
+ if (row.className.match("Unread")) {
+ row.className = nc + "Selected";
+ } else {
+ row.className = nc + "UnreadSelected";
+ }
+ }
+
+ if (set_state == false) {
row.className = nc + "Selected";
- } else {
+ }
+
+ if (set_state == true) {
row.className = nc + "UnreadSelected";
}
}
@@ -871,7 +881,9 @@ function catchupPage() {
var fn = getFeedName(getActiveFeedId(), active_feed_is_cat);
- var str = "Mark all visible articles in " + fn + " as read?";
+ var str = __("Mark all visible articles in %s as read?");
+
+ str = str.replace("%s", fn);
if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str)) {
return;
@@ -888,13 +900,55 @@ function catchupPage() {
}
}
+function catchupSelection() {
+
+ try {
+
+ var rows;
+
+ if (document.getElementById("headlinesList")) {
+ rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
+ } else {
+ rows = cdmGetSelectedArticles();
+ }
+
+ if (rows.length == 0) {
+ alert(__("No articles are selected."));
+ return;
+ }
+
+
+ var fn = getFeedName(getActiveFeedId(), active_feed_is_cat);
+
+ var str = __("Mark all selected articles in %s as read?");
+
+ str = str.replace("%s", fn);
+
+ if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str)) {
+ return;
+ }
+
+ if (document.getElementById("headlinesList")) {
+ selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
+ // selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
+ } else {
+ selectionToggleUnread(true, false, 'viewCurrentFeed()', true)
+ // cdmSelectArticles('none');
+ }
+
+ } catch (e) {
+ exception_error("catchupSelection", e);
+ }
+}
+
+
function labelFromSearch(search, search_mode, match_on, feed_id, is_cat) {
if (!xmlhttp_ready(xmlhttp_rpc)) {
printLockingError();
}
- var title = prompt("Please enter label title:", "");
+ var title = prompt(__("Please enter label title:"), "");
if (title) {