var f = $("headlines-frame");
try {
if (reply.offset == 0) {
- debug("resetting headlines scrollTop");
+ console.log("resetting headlines scrollTop");
f.scrollTop = 0;
}
} catch (e) { };
var marked = sync_ok[i].getAttribute("marked");
if (id) {
- debug("synced offline info for id " + id);
+ console.log("synced offline info for id " + id);
if (unread != undefined && marked != undefined) {
db.execute("UPDATE articles SET "+
}
}
- debug("downloaded articles: " + articles_found + " limit: " + limit);
+ console.log("downloaded articles: " + articles_found + " limit: " + limit);
articles_synced += articles_found;
if (articles_found >= limit || has_sync_data) {
sync_timer = window.setTimeout("update_offline_data("+(stage+1)+")",
3*1000);
- debug("<b>update_offline_data: done " + stage + " HSD: " +
+ console.log("<b>update_offline_data: done " + stage + " HSD: " +
has_sync_data + "</b>");
} else {
window.setTimeout("offlineDownloadStart()", 180*1000);
- debug("update_offline_data: finished");
+ console.log("update_offline_data: finished");
var pic = $("offlineModePic");
rs.close();
- debug("update_offline_data: stage " + stage);
+ console.log("update_offline_data: stage " + stage);
query = query + "&stage=" + stage;
sync_in_progress = true;
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
function gotoOffline() {
-// debug("[Local store] currentVersion = " + store.currentVersion);
+// console.log("[Local store] currentVersion = " + store.currentVersion);
if (offlineArticlesStored() == 0) {
var timerId = window.setInterval(function() {
if (store.currentVersion) {
window.clearInterval(timerId);
- debug("[Local store] sync complete: " + store.currentVersion);
+ console.log("[Local store] sync complete: " + store.currentVersion);
//window.location.href = "tt-rss.php";
notify_info("Tiny Tiny RSS is in offline mode.");
} else if (store.updateStatus == 3) {
- debug("[Local store] sync error: " + store.lastErrorMessage);
+ console.log("[Local store] sync error: " + store.lastErrorMessage);
notify_error(store.lastErrorMessage, true);
} }, 500);
}
function label_local_add_article(id, label_id) {
try {
- //debug("label_local_add_article " + id + " => " + label_id);
+ //console.log("label_local_add_article " + id + " => " + label_id);
var rs = db.execute("SELECT COUNT(id) FROM article_labels WHERE "+
"id = ? AND label_id = ?", [id, label_id]);
var timerId = window.setInterval(function() {
if (store.currentVersion) {
window.clearInterval(timerId);
- debug("[Local store] sync complete: " + store.currentVersion);
+ console.log("[Local store] sync complete: " + store.currentVersion);
} else if (store.updateStatus == 3) {
- debug("[Local store] sync error: " + store.lastErrorMessage);
+ console.log("[Local store] sync error: " + store.lastErrorMessage);
} }, 500);
} catch (e) {
exception_error("offlineConfirmModeChange", e);
}
}
+
+function printFeedEntry(id, title, row_class, unread, icon) {
+
+ var tmp = "";
+ var fctr_class = "";
+ var feed_icon = "";
+
+ if (unread > 0) {
+ row_class += "Unread";
+ fctr_class = "feedCtrHasUnread";
+ } else {
+ fctr_class = "feedCtrNoUnread";
+ }
+
+ if (icon) {
+ feed_icon = "<img id='FIMG-"+id+"' src='" + icon + "'>";
+ } else {
+ feed_icon = "<img id='FIMG-"+id+"' src='images/blank_icon.gif'>";
+ }
+
+ var link = "<a title=\"FIXME\" id=\"FEEDL-"+id+"\""+
+ "href=\"javascript:viewfeed('"+id+"', '', false, '', false, 0);\">"+
+ title + "</a>";
+
+ tmp += "<li id='FEEDR-"+id+"' class="+row_class+">" + feed_icon +
+ "<span id=\"FEEDN-"+id+"\">" + link + "</span>";
+
+ tmp += " <span class='"+fctr_class+"' id=\"FEEDCTR-"+id+"\">" +
+ "(<span id=\"FEEDU-"+id+"\">"+unread+"</span>)</span>";
+
+ tmp += "</li>";
+
+ return tmp;
+}
+
+