assorted fixes for keyboard navigation which hopefully don't break everything else
This commit is contained in:
parent
209ebdc644
commit
8292123ebc
|
@ -1,6 +1,5 @@
|
||||||
var _infscroll_disable = 0;
|
var _infscroll_disable = 0;
|
||||||
var _infscroll_request_sent = 0;
|
var _infscroll_request_sent = 0;
|
||||||
var _infscroll_tmp_disable = 0;
|
|
||||||
|
|
||||||
var _search_query = false;
|
var _search_query = false;
|
||||||
var _viewfeed_last = 0;
|
var _viewfeed_last = 0;
|
||||||
|
@ -15,9 +14,7 @@ function viewCategory(cat) {
|
||||||
|
|
||||||
function loadMoreHeadlines() {
|
function loadMoreHeadlines() {
|
||||||
try {
|
try {
|
||||||
console.log("loadMoreHeadlines: " + _infscroll_tmp_disable);
|
console.log("loadMoreHeadlines");
|
||||||
|
|
||||||
if (_infscroll_tmp_disable) return;
|
|
||||||
|
|
||||||
var offset = 0;
|
var offset = 0;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ var loaded_article_ids = [];
|
||||||
var _last_headlines_update = 0;
|
var _last_headlines_update = 0;
|
||||||
var current_first_id = 0;
|
var current_first_id = 0;
|
||||||
|
|
||||||
|
var _catchup_request_sent = false;
|
||||||
|
|
||||||
var has_storage = 'sessionStorage' in window && window['sessionStorage'] !== null;
|
var has_storage = 'sessionStorage' in window && window['sessionStorage'] !== null;
|
||||||
|
|
||||||
function headlines_callback2(transport, offset, background, infscroll_req) {
|
function headlines_callback2(transport, offset, background, infscroll_req) {
|
||||||
|
@ -1319,11 +1321,17 @@ function headlines_scroll_handler(e) {
|
||||||
window.clearTimeout(catchup_timeout_id);
|
window.clearTimeout(catchup_timeout_id);
|
||||||
|
|
||||||
if (!_infscroll_request_sent) {
|
if (!_infscroll_request_sent) {
|
||||||
|
if (catchup_id_batch.length < 10) {
|
||||||
catchup_timeout_id = window.setTimeout('catchupBatchedArticles()',
|
catchup_timeout_id = window.setTimeout('catchupBatchedArticles()',
|
||||||
500);
|
500);
|
||||||
|
} else {
|
||||||
|
catchupBatchedArticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
catchupBatchedArticles();
|
||||||
|
}
|
||||||
|
|
||||||
if (_infscroll_disable) {
|
if (_infscroll_disable) {
|
||||||
var child = $$("#headlines-frame div[id*=RROW]").last();
|
var child = $$("#headlines-frame div[id*=RROW]").last();
|
||||||
|
|
||||||
|
@ -1356,7 +1364,7 @@ function openNextUnreadFeed() {
|
||||||
|
|
||||||
function catchupBatchedArticles() {
|
function catchupBatchedArticles() {
|
||||||
try {
|
try {
|
||||||
if (catchup_id_batch.length > 0 && !_infscroll_request_sent) {
|
if (catchup_id_batch.length > 0 && !_infscroll_request_sent && !_catchup_request_sent) {
|
||||||
|
|
||||||
// make a copy of the array
|
// make a copy of the array
|
||||||
var batch = catchup_id_batch.slice();
|
var batch = catchup_id_batch.slice();
|
||||||
|
@ -1365,16 +1373,18 @@ function catchupBatchedArticles() {
|
||||||
|
|
||||||
console.log(query);
|
console.log(query);
|
||||||
|
|
||||||
|
_catchup_request_sent = true;
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
handle_rpc_json(transport);
|
handle_rpc_json(transport);
|
||||||
|
|
||||||
|
_catchup_request_sent = false;
|
||||||
|
|
||||||
reply = JSON.parse(transport.responseText);
|
reply = JSON.parse(transport.responseText);
|
||||||
var batch = reply.ids;
|
var batch = reply.ids;
|
||||||
|
|
||||||
_infscroll_tmp_disable = 1;
|
|
||||||
|
|
||||||
batch.each(function(id) {
|
batch.each(function(id) {
|
||||||
console.log(id);
|
console.log(id);
|
||||||
var elem = $("RROW-" + id);
|
var elem = $("RROW-" + id);
|
||||||
|
@ -1382,8 +1392,6 @@ function catchupBatchedArticles() {
|
||||||
catchup_id_batch.remove(id);
|
catchup_id_batch.remove(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
_infscroll_tmp_disable = 0;
|
|
||||||
|
|
||||||
updateFloatingTitle(true);
|
updateFloatingTitle(true);
|
||||||
|
|
||||||
} });
|
} });
|
||||||
|
@ -1509,6 +1517,8 @@ function cdmCollapseArticle(event, id, unmark) {
|
||||||
|
|
||||||
function cdmExpandArticle(id, noexpand) {
|
function cdmExpandArticle(id, noexpand) {
|
||||||
try {
|
try {
|
||||||
|
if (getInitParam("cdm_expanded")) return;
|
||||||
|
|
||||||
console.log("cdmExpandArticle " + id);
|
console.log("cdmExpandArticle " + id);
|
||||||
|
|
||||||
if (!$("RROW-" + id)) return false;
|
if (!$("RROW-" + id)) return false;
|
||||||
|
@ -1563,6 +1573,7 @@ function cdmExpandArticle(id, noexpand) {
|
||||||
|
|
||||||
if (!noexpand)
|
if (!noexpand)
|
||||||
toggleUnread(id, 0, true);
|
toggleUnread(id, 0, true);
|
||||||
|
|
||||||
toggleSelected(id);
|
toggleSelected(id);
|
||||||
$("RROW-" + id).addClassName("active");
|
$("RROW-" + id).addClassName("active");
|
||||||
|
|
||||||
|
@ -1702,8 +1713,11 @@ function dismissReadArticles() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we don't really hide rows anymore
|
||||||
function getVisibleArticleIds() {
|
function getVisibleArticleIds() {
|
||||||
var ids = [];
|
return getLoadedArticleIds();
|
||||||
|
|
||||||
|
/*var ids = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -1717,7 +1731,7 @@ function getVisibleArticleIds() {
|
||||||
exception_error("getVisibleArticleIds", e);
|
exception_error("getVisibleArticleIds", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ids;
|
return ids; */
|
||||||
}
|
}
|
||||||
|
|
||||||
function cdmClicked(event, id) {
|
function cdmClicked(event, id) {
|
||||||
|
|
Loading…
Reference in New Issue