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_none_link;
var sel_inv_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")) { if ($("content-frame")) {
sel_all_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, '', true)"; sel_all_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, '', true)";
sel_unread_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true)"; sel_unread_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true)";
sel_none_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false)"; sel_none_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false)";
sel_inv_link = "javascript:invertHeadlineSelection()"; sel_inv_link = "javascript:invertHeadlineSelection()";
tog_unread_link = "javascript:selectionToggleUnread()";
tog_marked_link = "javascript:selectionToggleMarked()";
} else { } else {
sel_all_link = "javascript:cdmSelectArticles('all')"; sel_all_link = "javascript:cdmSelectArticles('all')";
sel_unread_link = "javascript:cdmSelectArticles('unread')"; sel_unread_link = "javascript:cdmSelectArticles('unread')";
sel_none_link = "javascript:cdmSelectArticles('none')"; sel_none_link = "javascript:cdmSelectArticles('none')";
sel_inv_link = "javascript:invertHeadlineSelection()"; sel_inv_link = "javascript:invertHeadlineSelection()";
tog_unread_link = "javascript:selectionToggleUnread(true)";
tog_marked_link = "javascript:selectionToggleMarked(true)";
} }
tmp += __('Select:')+ 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\">"; 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>"+ tmp += "<li class=\"insensitive\">"+__('Selection toggle:')+"</li>"+
"<li onclick=\""+tog_unread_link+"\">&nbsp;&nbsp;"+__('Unread')+"</li>"+ "<li onclick=\""+tog_unread_link+"\">&nbsp;&nbsp;"+__('Unread')+"</li>"+
"<li onclick=\""+tog_marked_link+"\">&nbsp;&nbsp;"+__('Starred')+"</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) { if (!client_only) {
debug(query); debug(query);
@ -973,20 +973,34 @@ function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
} else { } else {
row.className = nc + "UnreadSelected"; row.className = nc + "UnreadSelected";
} }
if (db) {
db.execute("UPDATE articles SET unread = NOT unread WHERE id = ?",
[rows[i]]);
}
} }
if (set_state == false) { if (set_state == false) {
row.className = nc + "Selected"; row.className = nc + "Selected";
if (db) {
db.execute("UPDATE articles SET unread = 0 WHERE id = ?",
[rows[i]]);
}
} }
if (set_state == true) { if (set_state == true) {
row.className = nc + "UnreadSelected"; row.className = nc + "UnreadSelected";
if (db) {
db.execute("UPDATE articles SET unread = 1 WHERE id = ?",
[rows[i]]);
}
} }
} }
} }
if (rows.length > 0) { if (rows.length > 0) {
update_local_feedlist_counters();
var cmode = ""; var cmode = "";
if (set_state == undefined) { if (set_state == undefined) {
@ -1034,6 +1048,8 @@ function selectionToggleMarked(cdm_mode) {
toggleMark(rows[i], true, true); toggleMark(rows[i], true, true);
} }
update_local_feedlist_counters();
if (rows.length > 0) { if (rows.length > 0) {
var query = "backend.php?op=rpc&subop=markSelected&ids=" + var query = "backend.php?op=rpc&subop=markSelected&ids=" +

Loading…
Cancel
Save