offline: actions dropdown works

master
Andrew Dolgov 16 years ago
parent d7a1dbbd88
commit 46b84d2998

@ -146,16 +146,29 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
var sel_none_link;
var sel_inv_link;
var catchup_feed_link = "javascript:catchupCurrentFeed()";
var catchup_sel_link = "javascript:catchupSelection()";
var tog_unread_link;
var tog_marked_link;
if ($("content-frame")) {
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()";
} else {
sel_all_link = "javascript:cdmSelectArticles('all')";
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)";
}
tmp += __('Select:')+
@ -174,11 +187,6 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
tmp += "<ul id=\"headlineActionsBody\" style=\"display : none\">";
var tog_unread_link = "";
var tog_marked_link = "";
var catchup_sel_link = "";
var catchup_feed_link = "";
tmp += "<li class=\"insensitive\">"+__('Selection toggle:')+"</li>"+
"<li onclick=\""+tog_unread_link+"\">&nbsp;&nbsp;"+__('Unread')+"</li>"+
"<li onclick=\""+tog_marked_link+"\">&nbsp;&nbsp;"+__('Starred')+"</li>"+

@ -575,7 +575,7 @@ function toggleMark(id, client_only, no_effects) {
}
update_local_feedlist_counters();
if (!no_effects) update_local_feedlist_counters();
if (!client_only) {
debug(query);
@ -973,20 +973,34 @@ function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
} else {
row.className = nc + "UnreadSelected";
}
if (db) {
db.execute("UPDATE articles SET unread = NOT unread WHERE id = ?",
[rows[i]]);
}
}
if (set_state == false) {
row.className = nc + "Selected";
if (db) {
db.execute("UPDATE articles SET unread = 0 WHERE id = ?",
[rows[i]]);
}
}
if (set_state == true) {
row.className = nc + "UnreadSelected";
if (db) {
db.execute("UPDATE articles SET unread = 1 WHERE id = ?",
[rows[i]]);
}
}
}
}
if (rows.length > 0) {
update_local_feedlist_counters();
var cmode = "";
if (set_state == undefined) {
@ -1034,6 +1048,8 @@ function selectionToggleMarked(cdm_mode) {
toggleMark(rows[i], true, true);
}
update_local_feedlist_counters();
if (rows.length > 0) {
var query = "backend.php?op=rpc&subop=markSelected&ids=" +

Loading…
Cancel
Save