}
- $_SESSION["viewfeed:counters_stamp"] = time();
-
outputFeedList($link, $tags);
break; // feeds
$mode = db_escape_string($_REQUEST["mode"]);
$omode = db_escape_string($_REQUEST["omode"]);
- $csync = $_REQUEST["csync"];
-
print "<reply>";
// in prefetch mode we only output requested cids, main article
}
}
-// if (get_pref($link, "SYNC_COUNTERS") || ($mode == "prefetch" && $csync)) {
-
- if (time() - $_SESSION["view:counters_stamp"] > 5 && $mode == "prefetch") {
+ /* if ($mode == "prefetch") {
print "<counters><![CDATA[";
print json_encode(getAllCounters($link, $omode));
print "]]></counters>";
- $_SESSION["view:counters_stamp"] = time();
- }
+ } */
print "</reply>";
break; // view
@$next_unread_feed = db_escape_string($_REQUEST["nuf"]);
@$offset = db_escape_string($_REQUEST["skip"]);
@$vgroup_last_feed = db_escape_string($_REQUEST["vgrlf"]);
- $csync = $_REQUEST["csync"];
$order_by = db_escape_string($_REQUEST["order_by"]);
/* Feed -5 is a special case: it is used to display auxiliary information
/* Updating a label ccache means recalculating all of the caches
* so for performance reasons we don't do that here */
-// if (time() - $_SESSION["viewfeed:ccache_update_stamp"] > 120) {
- if ($feed >= 0) {
- ccache_update($link, $feed, $_SESSION["uid"], $cat_view);
- }
- $_SESSION["viewfeed:ccache_update_stamp"] = time();
-// }
+ if ($feed >= 0) {
+ ccache_update($link, $feed, $_SESSION["uid"], $cat_view);
+ }
set_pref($link, "_DEFAULT_VIEW_MODE", $view_mode);
set_pref($link, "_DEFAULT_VIEW_LIMIT", $limit);
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("20", $timing_info);
- if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop ||
- time() - $_SESSION["viewfeed:counters_stamp"] > 5) {
- if (!$offset) {
- print "<counters><![CDATA[";
- print json_encode(getAllCounters($link, $omode, $feed));
- print "]]></counters>";
- $_SESSION["viewfeed:counters_stamp"] = time();
- }
- }
+ /* if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop || !$offset) {
+ print "<counters><![CDATA[";
+ print json_encode(getAllCounters($link, $omode, $feed));
+ print "]]></counters>";
+ } */
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("30", $timing_info);
var mouse_y = 0;
var mouse_x = 0;
+var counter_timeout_id = false;
+
var resize_enabled = false;
var selection_disabled = false;
var counters_last_request = 0;
query = query + "&omode=flc";
}
- if (!async_counters_work) {
- query = query + "&csync=true";
- }
-
console.log(query);
var container = $("headlinesInnerContainer");
setTimeout("hotkey_prefix_timeout()", 5*1000);
- if (typeof correctPNG != 'undefined') {
- correctPNG();
- }
-
if (getActiveFeedId()) {
//console.log("some feed is open on feedlist refresh, reloading");
//setTimeout("viewCurrentFeed()", 100);
parameters: query,
onComplete: function(transport) {
try {
- all_counters_callback2(transport, true);
+ all_counters_callback2(transport);
} catch (e) {
exception_error("viewfeed/getcounters", e);
}
var date = new Date();
var timestamp = Math.round(date.getTime() / 1000);
- if (timestamp - counters_last_request > 15) {
+ if (timestamp - counters_last_request > 10) {
console.log("scheduling request of counters...");
- window.setTimeout("request_counters_real()", 1000);
+
+ window.clearTimeout(counter_timeout_id);
+ counter_timeout_id = window.setTimeout("request_counters_real()", 1000);
+
counters_last_request = timestamp;
} else {
console.log("request_counters: rate limit reached: " + (timestamp - counters_last_request));
var hotkeys_enabled = true;
var notify_silent = false;
var last_progress_point = 0;
-var async_counters_work = false;
var sanity_check_done = false;
/* add method to remove element from array */
}
-function all_counters_callback2(transport, async_call) {
+function all_counters_callback2(transport) {
try {
- if (async_call) async_counters_work = true;
if (offline_mode) return;
parse_counters_reply(transport);
setcookie("ttrss_lang", $_SESSION["language"],
time() + SESSION_COOKIE_LIFETIME);
}
-
- /* bump counters stamp since we're getting reloaded anyway */
-
- $_SESSION["get_all_counters_stamp"] = time();
}
} else {
+++ /dev/null
-// stolen from http://homepage.ntlworld.com/bobosola/pngtestfixed.htm
-
-function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
- {
- for(var i=0; i<document.images.length; i++)
- {
- var img = document.images[i]
- var imgName = img.src.toUpperCase()
- if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
- {
- var imgID = (img.id) ? "id='" + img.id + "' " : ""
- var imgClass = (img.className) ? "class='" + img.className + "' " : ""
- var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
- var imgStyle = "display:inline-block;" + img.style.cssText
- if (img.align == "left") imgStyle = "float:left;" + imgStyle
- if (img.align == "right") imgStyle = "float:right;" + imgStyle
- if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
- var strNewHTML = "<span " + imgID + imgClass + imgTitle
- + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
- + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
- + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
- img.outerHTML = strNewHTML
- i = i-1
- }
- }
- }
-window.attachEvent("onload", correctPNG);
caller_subop = false;
}
- if (typeof correctPNG != 'undefined') {
- correctPNG();
- }
notify("");
remove_splash();
function filterlist_callback2(transport) {
var container = $('prefContent');
container.innerHTML=transport.responseText;
- if (typeof correctPNG != 'undefined') {
- correctPNG();
- }
notify("");
remove_splash();
}
init_label_inline_editor();
- if (typeof correctPNG != 'undefined') {
- correctPNG();
- }
notify("");
remove_splash();
var first_run = true;
var display_tags = false;
var global_unread = -1;
-var active_title_text = "";
var current_subtitle = "";
var daemon_enabled = false;
//var _qfd_deleted_feed = 0;
tmp = tmp + " - " + current_subtitle;
}
- if (active_title_text.length > 0) {
- tmp = tmp + " > " + active_title_text;
- }
-
if (window.fluid) {
if (global_unread > 0) {
window.fluid.dockBadge = global_unread;
}
function genericSanityCheck() {
-
-// if (!Ajax.getTransport()) fatalError(1);
-
setCookie("ttrss_test", "TEST");
if (getCookie("ttrss_test") != "TEST") {
delCookie("ttrss_test");
-// document.onresize = resize_headlines;
window.onresize=resize_headlines;
var toolbar = document.forms["main_toolbar_form"];
daemon_enabled = getInitParam("daemon_enabled") == 1;
feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
-/* var fl = cache_find_param("FEEDLIST", getInitParam("num_feeds"));
-
- if (fl) {
- render_feedlist(fl);
- if ($("feedList")) {
- request_counters();
- } else {
- setTimeout('updateFeedList(false, false)', 50);
- }
- } else {
- setTimeout('updateFeedList(false, false)', 50);
- } */
-
setTimeout('updateFeedList(false, false)', 50);
console.log("second stage ok");
}
}
-function updateFeedTitle(t) {
- active_title_text = t;
- updateTitle();
-}
-
function toggleDispRead() {
try {
f.innerHTML = "<div class='whiteBox'>" + __('Could not update headlines (missing XML object)') + "</div>";
}
- if (typeof correctPNG != 'undefined') {
- correctPNG();
- }
-
+
if (_cdm_wd_timeout) window.clearTimeout(_cdm_wd_timeout);
if (!$("headlinesList") &&
var date = new Date();
last_article_view = date.getTime() / 1000;
- if (typeof correctPNG != 'undefined') {
- correctPNG();
- }
-
if (_reload_feedlist_after_view) {
setTimeout('updateFeedList(false, false)', 50);
_reload_feedlist_after_view = false;
var crow = $("RROW-" + id);
var article_is_unread = crow.className.match("Unread");
- if (!async_counters_work) {
- query = query + "&csync=true";
- }
-
showArticleInHeadlines(id);
if (!cached_article) {
}
function cache_flush() {
- article_cache = new Array();
+ if (db) {
+ db.execute("DELETE FROM cache");
+ } else if (has_local_storage()) {
+ localStorage.clear();
+ } else {
+ article_cache = new Array();
+ }
}
function cache_invalidate(id) {