function feedlist_callback2(transport) {
try {
- debug("feedlist_callback2");
+ console.log("feedlist_callback2");
if (!transport_error_check(transport)) return;
render_feedlist(transport.responseText);
} catch (e) {
try {
//if (!getActiveFeedId()) return;
- debug("viewNextFeedPage: calling viewfeed(), p: " + parseInt(_feed_cur_page+1));
+ console.log("viewNextFeedPage: calling viewfeed(), p: " + parseInt(_feed_cur_page+1));
viewfeed(getActiveFeedId(), undefined, activeFeedIsCat(), undefined,
undefined, parseInt(_feed_cur_page+1));
var date = new Date();
var timestamp = Math.round(date.getTime() / 1000);
- debug("<b>" + _infscroll_request_sent + " : " + timestamp + "</b>");
+ console.log("<b>" + _infscroll_request_sent + " : " + timestamp + "</b>");
if (_infscroll_request_sent && _infscroll_request_sent + 30 > timestamp) {
- debug("infscroll request in progress, aborting");
+ console.log("infscroll request in progress, aborting");
return;
}
force_nocache = true;
}
-// debug("IS_CAT_STORED: " + activeFeedIsCat() + ", IS_CAT: " + is_cat);
+// console.log("IS_CAT_STORED: " + activeFeedIsCat() + ", IS_CAT: " + is_cat);
if (subop == "MarkAllRead") {
query = query + "&csync=true";
}
- debug(query);
+ console.log(query);
var container = $("headlinesInnerContainer");
}
cache_check = cache_check_param(cache_prefix + feed, unread_ctr);
- debug("headline cache check: " + cache_check);
+ console.log("headline cache check: " + cache_check);
}
if (cache_check) {
var query = "?op=feeds&subop=catsort&corder=" +
param_escape(ordered_cats.toString());
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", { parameters: query });
}
try {
loading_set_progress(90);
- debug("in feedlist init");
+ console.log("in feedlist init");
hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
document.onkeydown = hotkey_handler;
}
if (getActiveFeedId()) {
- //debug("some feed is open on feedlist refresh, reloading");
+ //console.log("some feed is open on feedlist refresh, reloading");
//setTimeout("viewCurrentFeed()", 100);
} else {
if (getInitParam("cdm_auto_catchup") != 1 && get_feed_unread(-3) > 0) {
function init_collapsable_feedlist() {
try {
- debug("init_collapsable_feedlist");
+ console.log("init_collapsable_feedlist");
var theme = getInitParam("theme");
var options = getInitParam("theme_options");
if (offline_mode) return;
- debug("requesting counters...");
+ console.log("requesting counters...");
var query = "?op=rpc&subop=getAllCounters";
// timestamp - counters_last_request > 10) {
if (timestamp - counters_last_request > 15) {
- debug("scheduling request of counters...");
+ console.log("scheduling request of counters...");
window.setTimeout("request_counters_real()", 1000);
counters_last_request = timestamp;
} else {
- debug("request_counters: rate limit reached: " + (timestamp - counters_last_request));
+ console.log("request_counters: rate limit reached: " + (timestamp - counters_last_request));
}
} catch (e) {
}
}
-function is_opera() {
- return window.opera;
-}
+/* create console.log if it doesn't exist */
+
+if (!window.console) console = {};
+console.log = console.log || function(msg) { debug(msg); };
+console.warn = console.warn || function(msg) { debug(msg); };
+console.error = console.error || function(msg) { debug(msg); };
function exception_error(location, e, ext_info) {
var msg = format_exception_error(location, e);
- if (!ext_info) ext_info = "N/A";
+ if (!ext_info) ext_info = false;
disableHotkeys();
ebc.innerHTML =
"<div><b>Error message:</b></div>" +
- "<pre>" + msg + "</pre>" +
- "<div><b>Additional information:</b></div>" +
- "<textarea readonly=\"1\">" + ext_info + "</textarea>";
-
+ "<pre>" + msg + "</pre>";
+
+ if (ext_info) {
+ ebc.innerHTML += "<div><b>Additional information:</b></div>" +
+ "<textarea readonly=\"1\">" + ext_info + "</textarea>";
+ }
+
+ ebc.innerHTML += "<div><b>Stack trace:</b></div>" +
+ "<textarea readonly=\"1\">" + e.stack + "</textarea>";
+
} else {
alert(msg);
}
msg = "Exception: " + e + "\nFunction: " + location + "()";
}
- debug("<b>EXCEPTION: " + msg + "</b>");
+ console.error("EXCEPTION: " + msg);
return msg;
}
d.setTime(d.getTime() + (lifetime * 1000));
}
- debug("setCookie: " + name + " => " + value + ": " + d);
+ console.log("setCookie: " + name + " => " + value + ": " + d);
int_setCookie(name, value, d, path, domain, secure);
var feeds_stored = number_of_feeds;
- debug("Feed counters, C: " + feeds_found + ", S:" + feeds_stored);
+ console.log("Feed counters, C: " + feeds_found + ", S:" + feeds_stored);
if (feeds_stored != feeds_found) {
number_of_feeds = feeds_found;
if (feeds_stored != 0 && feeds_found != 0) {
- debug("Subscribed feed number changed, refreshing feedlist");
+ console.log("Subscribed feed number changed, refreshing feedlist");
setTimeout('updateFeedList(false, false)', 50);
}
} else {
if (offline_mode) return;
- debug("<b>all_counters_callback2 IN: " + transport + "</b>");
+ console.log("<b>all_counters_callback2 IN: " + transport + "</b>");
parse_counters_reply(transport);
- debug("<b>all_counters_callback2 OUT: " + transport + "</b>");
+ console.log("<b>all_counters_callback2 OUT: " + transport + "</b>");
} catch (e) {
exception_error("all_counters_callback2", e, transport);
try {
- debug("resort_category: " + node + " CM=" + cat_mode);
+ console.log("resort_category: " + node + " CM=" + cat_mode);
var by_unread = feedsSortByUnread();
}
function resort_feedlist() {
- debug("resort_feedlist");
+ console.log("resort_feedlist");
if ($("FCATLIST--1")) {
try {
- debug("hideOrShowFeeds: " + hide);
+ console.log("hideOrShowFeeds: " + hide);
if ($("FCATLIST--1")) {
node = $("feedList"); // no categories
}
- // debug("hideOrShowFeedsCategory: " + node + " (" + hide + ")");
+ // console.log("hideOrShowFeedsCategory: " + node + " (" + hide + ")");
var cat_unread = 0;
if (!node) {
- debug("hideOrShowFeeds: passed node is null, aborting");
+ console.log("hideOrShowFeeds: passed node is null, aborting");
return;
}
- // debug("cat: " + node.id);
+ // console.log("cat: " + node.id);
if (node.hasChildNodes() && node.firstChild.nextSibling != false) {
for (i = 0; i < node.childNodes.length; i++) {
node.childNodes[i].className != "error" &&
node.childNodes[i].className != "tag");
- // debug(node.childNodes[i].id + " --> " + has_unread);
+ // console.log(node.childNodes[i].id + " --> " + has_unread);
if (hide && !has_unread) {
//node.childNodes[i].style.display = "none";
}
}
- // debug("end cat: " + node.id + " unread " + cat_unread);
+ // console.log("end cat: " + node.id + " unread " + cat_unread);
if (cat_node) {
if (cat_unread == 0) {
if (cat_node.style == undefined) {
- debug("ERROR: supplied cat_node " + cat_node +
+ console.log("ERROR: supplied cat_node " + cat_node +
" has no styles. WTF?");
return;
}
try {
cat_node.style.display = "list-item";
} catch (e) {
- debug(e);
+ console.log(e);
}
}
}
-// debug("unread for category: " + cat_unread);
+// console.log("unread for category: " + cat_unread);
} catch (e) {
exception_error("hideOrShowFeedsCategory", e);
var content = $(content_id);
if (!content) {
- debug("[selectTableRows] Element " + content_id + " not found.");
+ console.log("[selectTableRows] Element " + content_id + " not found.");
return;
}
var content = $(content_id);
if (!content) {
- debug("[getSelectedTableRowIds] Element " + content_id + " not found.");
+ console.log("[getSelectedTableRowIds] Element " + content_id + " not found.");
return new Array();
}
return s;
}
+function make_timestamp() {
+ var d = new Date();
+
+ return leading_zero(d.getHours()) + ":" + leading_zero(d.getMinutes()) +
+ ":" + leading_zero(d.getSeconds());
+}
+
+
function closeErrorBox() {
if (Element.visible("errorBoxShadow")) {
function infobox_callback2(transport) {
try {
- debug("infobox_callback2");
+ console.log("infobox_callback2");
var box = $('infoBox');
var query = Form.serialize("feed_add_form");
- debug("subscribe q: " + query);
+ console.log("subscribe q: " + query);
Form.disable("feed_add_form");
c.removeChild(c.lastChild);
}
- var d = new Date();
- var ts = leading_zero(d.getHours()) + ":" + leading_zero(d.getMinutes()) +
- ":" + leading_zero(d.getSeconds());
+ var ts = make_timestamp();
c.innerHTML = "<li class=\"" + debug_last_class + "\"><span class=\"debugTS\">[" + ts + "]</span> " +
msg + "</li>" + c.innerHTML;
}
}
if (!form) {
- debug("filterDlgCheckType: can't find form!");
+ console.log("filterDlgCheckType: can't find form!");
return;
}
}
if (!form) {
- debug("filterDlgCheckAction: can't find form!");
+ console.log("filterDlgCheckAction: can't find form!");
return;
}
var action_param = $("filter_dlg_param_box");
if (!action_param) {
- debug("filterDlgCheckAction: can't find action param box!");
+ console.log("filterDlgCheckAction: can't find action param box!");
return;
}
}
if (!form) {
- debug("filterDlgCheckAction: can't find form!");
+ console.log("filterDlgCheckAction: can't find form!");
return;
}
if (!limit) limit = 3;
- debug("getRelativePostIds: " + id + " limit=" + limit);
+ console.log("getRelativePostIds: " + id + " limit=" + limit);
var ids = new Array();
var container = $("headlinesList");
function openArticleInNewWindow(id) {
try {
- debug("openArticleInNewWindow: " + id);
+ console.log("openArticleInNewWindow: " + id);
var query = "?op=rpc&subop=getArticleLink&id=" + id;
var wname = "ttrss_article_" + id;
- debug(query + " " + wname);
+ console.log(query + " " + wname);
var w = window.open("", wname);
var link = transport.responseXML.getElementsByTagName("link")[0];
var id = transport.responseXML.getElementsByTagName("id")[0];
- debug("open_article received link: " + link);
+ console.log("open_article received link: " + link);
if (link && id) {
var wname = "ttrss_article_" + id.firstChild.nodeValue;
- debug("link url: " + link.firstChild.nodeValue + ", wname " + wname);
+ console.log("link url: " + link.firstChild.nodeValue + ", wname " + wname);
var w = window.open(link.firstChild.nodeValue, wname);
try {
if (p < last_progress_point || !Element.visible("overlay")) return;
- debug("<b>loading_set_progress : " + p + " (" + last_progress_point + ")</b>");
+ console.log("<b>loading_set_progress : " + p + " (" + last_progress_point + ")</b>");
var o = $("l_progress_i");
function remove_splash() {
if (Element.visible("overlay")) {
- debug("about to remove splash, OMG!");
+ console.log("about to remove splash, OMG!");
Element.hide("overlay");
- debug("removed splash!");
+ console.log("removed splash!");
}
}
var ts = Math.round(date.getTime() / 1000);
if (hotkey_prefix_pressed && ts - hotkey_prefix_pressed >= 5) {
- debug("hotkey_prefix seems to be stuck, aborting");
+ console.log("hotkey_prefix seems to be stuck, aborting");
hotkey_prefix_pressed = false;
hotkey_prefix = false;
Element.hide('cmdline');
if (confirm(__("Remove stored feed icon?"))) {
var query = "backend.php?op=pref-feeds&subop=removeicon&feed_id=" + param_escape(id);
- debug(query);
+ console.log(query);
notify_progress("Removing feed icon...", true);
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) {
var query = "?op=pref-feeds&subop=remove&ids="+
param_escape(sel_rows.toString());
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
var query = "?op=rpc&subop=purge&ids="+
param_escape(sel_rows.toString()) + "&days=" + pr;
- debug(query);
+ console.log(query);
new Ajax.Request("prefs.php", {
parameters: query,
function piggie(enable) {
if (enable) {
- debug("I LOVEDED IT!");
+ console.log("I LOVEDED IT!");
var piggie = $("piggie");
Element.show(piggie);
if (!noupdate) {
- debug("selectTab: " + id + "(NU: " + noupdate + ")");
+ console.log("selectTab: " + id + "(NU: " + noupdate + ")");
notify_progress("Loading, please wait...");
return fatalError(error_code, reply.getAttribute("error-msg"));
}
- debug("sanity check ok");
+ console.log("sanity check ok");
var params = reply.nextSibling;
if (params) {
- debug('reading init-params...');
+ console.log('reading init-params...');
var param = params.firstChild;
while (param) {
var k = param.getAttribute("key");
var v = param.getAttribute("value");
- debug(k + " => " + v);
+ console.log(k + " => " + v);
init_params[k] = v;
param = param.nextSibling;
}
if (getURLParam('debug')) {
Element.show("debug_output");
- debug('debug mode activated');
+ console.log('debug mode activated');
}
loading_set_progress(30);
var query = Form.serialize("pref_prefs_form");
query = query + "&subop=reset-config";
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
}
if (!hotkeys_enabled) {
- debug("hotkeys disabled");
+ console.log("hotkeys disabled");
return;
}
cmdline.innerHTML = keychar;
Element.show(cmdline);
- debug("KP: PREFIX=" + keycode + " CHAR=" + keychar);
+ console.log("KP: PREFIX=" + keycode + " CHAR=" + keychar);
return;
}
if (keycode == 68 && shift_key) { // d
if (!Element.visible("debug_output")) {
Element.show("debug_output");
- debug('debug mode activated');
+ console.log('debug mode activated');
} else {
Element.hide("debug_output");
}
}
if (hotkey_prefix) {
- debug("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
+ console.log("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
} else {
- debug("KP: CODE=" + keycode + " CHAR=" + keychar);
+ console.log("KP: CODE=" + keycode + " CHAR=" + keychar);
}
} catch (e) {
var query = Form.serialize("pref_prefs_form");
query = query + "&subop=save-config";
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
div#errorBox textarea {
width : 100%;
- height : 200px;
+ height : 100px;
}
div#errorBox input {
function getActiveFeedId() {
try {
- debug("gAFID: " + _active_feed_id);
+ console.log("gAFID: " + _active_feed_id);
return _active_feed_id;
} catch (e) {
exception_error("getActiveFeedId", e);
function setActiveFeedId(id, is_cat) {
try {
- debug("sAFID(" + id + ", " + is_cat + ")");
+ console.log("sAFID(" + id + ", " + is_cat + ")");
_active_feed_id = id;
if (is_cat != undefined) {
try {
- debug("toggleTags: " + show_all + "; " + display_tags);
+ console.log("toggleTags: " + show_all + "; " + display_tags);
var p = $("dispSwitchPrompt");
return fatalError(error_code, reply.getAttribute("error-msg"));
}
- debug("sanity check ok");
+ console.log("sanity check ok");
var params = reply.nextSibling;
if (params) {
- debug('reading init-params...');
+ console.log('reading init-params...');
var param = params.firstChild;
while (param) {
var k = param.getAttribute("key");
var v = param.getAttribute("value");
- debug(k + " => " + v);
+ console.log(k + " => " + v);
init_params[k] = v;
if (db) {
function scheduleFeedUpdate(force) {
- debug("in scheduleFeedUpdate");
+ console.log("in scheduleFeedUpdate");
/* if (!daemon_enabled && !daemon_refresh_only) {
notify_progress("Updating feeds...", true);
query_str = query_str + "&omode=" + omode;
query_str = query_str + "&uctr=" + global_unread;
- debug("REFETCH query: " + query_str);
+ console.log("REFETCH query: " + query_str);
new Ajax.Request("backend.php", {
parameters: query_str,
// notify("Loading feed list...");
// }
- debug("<b>updateFeedList</b>");
+ console.log("<b>updateFeedList</b>");
if (offline_mode) return render_offline_feedlist();
// var feeds_frame = $("feeds-frame");
// feeds_frame.src = query_str;
- debug("updateFeedList Q=" + query_str);
+ console.log("updateFeedList Q=" + query_str);
new Ajax.Request("backend.php", {
parameters: query_str,
notify_progress("Marking all feeds as read...");
- debug("catchupAllFeeds Q=" + query_str);
+ console.log("catchupAllFeeds Q=" + query_str);
new Ajax.Request("backend.php", {
parameters: query_str,
if (getURLParam('debug')) {
Element.show("debug_output");
- debug('debug mode activated');
+ console.log('debug mode activated');
}
var params = "&ua=" + param_escape(navigator.userAgent);
try {
- debug("resize_headlines: " + delta_x + ":" + delta_y);
+ console.log("resize_headlines: " + delta_x + ":" + delta_y);
var h_frame = $("headlines-frame");
var c_frame = $("content-frame");
}
}
- debug("resize_headlines: HOR-mode: " + hor_offset);
+ console.log("resize_headlines: HOR-mode: " + hor_offset);
c_frame.style.width = (400 + hor_offset) + "px";
h_frame.style.right = c_frame.offsetWidth - 1 + "px";
}
}
- debug("resize_headlines: VER-mode: " + ver_offset);
+ console.log("resize_headlines: VER-mode: " + ver_offset);
h_frame.style.height = (300 - ver_offset) + "px";
setTimeout('updateFeedList(false, false)', 50);
- debug("second stage ok");
+ console.log("second stage ok");
loading_set_progress(60);
ver_offset = parseInt(getCookie("ttrss_offset_ver"));
hor_offset = parseInt(getCookie("ttrss_offset_hor"));
- debug("got offsets from cookies: ver " + ver_offset + " hor " + hor_offset);
+ console.log("got offsets from cookies: ver " + ver_offset + " hor " + hor_offset);
/* fuck IE */
if (isNaN(hor_offset)) hor_offset = 0;
if (isNaN(ver_offset)) ver_offset = 0;
- debug("offsets from cookies [x:y]: " + hor_offset + ":" + ver_offset);
+ console.log("offsets from cookies [x:y]: " + hor_offset + ":" + ver_offset);
resize_headlines();
function parse_runtime_info(elem) {
if (!elem) {
- debug("parse_runtime_info: elem is null, aborting");
+ console.log("parse_runtime_info: elem is null, aborting");
return;
}
var param = elem.firstChild;
- debug("parse_runtime_info: " + param);
+ console.log("parse_runtime_info: " + param);
while (param) {
var k = param.getAttribute("key");
var v = param.getAttribute("value");
- debug("RI: " + k + " => " + v);
+ console.log("RI: " + k + " => " + v);
if (k == "num_feeds") {
init_params[k] = v;
function collapse_feedlist() {
try {
- debug("collapse_feedlist");
+ console.log("collapse_feedlist");
var theme = getInitParam("theme");
if (theme != "" &&
}
if (!hotkeys_enabled) {
- debug("hotkeys disabled");
+ console.log("hotkeys disabled");
return;
}
cmdline.innerHTML = keychar;
Element.show(cmdline);
- debug("KP: PREFIX=" + keycode + " CHAR=" + keychar + " TS=" + ts);
+ console.log("KP: PREFIX=" + keycode + " CHAR=" + keychar + " TS=" + ts);
return true;
}
if (keycode == 68 && shift_key) { // d
if (!Element.visible("debug_output")) {
Element.show("debug_output");
- debug('debug mode activated');
+ console.log('debug mode activated');
} else {
Element.hide("debug_output");
}
}
if (hotkey_prefix) {
- debug("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
+ console.log("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
} else {
- debug("KP: CODE=" + keycode + " CHAR=" + keychar);
+ console.log("KP: CODE=" + keycode + " CHAR=" + keychar);
}
function catchup_callback2(transport, callback) {
try {
- debug("catchup_callback2 " + transport + ", " + callback);
+ console.log("catchup_callback2 " + transport + ", " + callback);
notify("");
all_counters_callback2(transport);
if (callback) {
loading_set_progress(100);
- debug("headlines_callback2 [page=" + feed_cur_page + "]");
+ console.log("headlines_callback2 [page=" + feed_cur_page + "]");
if (!transport_error_check(transport)) return;
var f = $("headlines-frame");
try {
if (feed_cur_page == 0) {
- debug("resetting headlines scrollTop");
+ console.log("resetting headlines scrollTop");
f.scrollTop = 0;
}
} catch (e) { };
}
} else {
- debug("headlines_callback: returned no data");
+ console.log("headlines_callback: returned no data");
f.innerHTML = "<div class='whiteBox'>" + __('Could not update headlines (missing XML data)') + "</div>";
}
} else {
if (headlines) {
if (headlines_count > 0) {
- debug("adding some more headlines...");
+ console.log("adding some more headlines...");
var c = $("headlinesList");
c.innerHTML = c.innerHTML + headlines.firstChild.nodeValue;
- debug("restore selected ids: " + ids);
+ console.log("restore selected ids: " + ids);
for (var i = 0; i < ids.length; i++) {
markHeadline(ids[i]);
}
} else {
- debug("no new headlines received");
+ console.log("no new headlines received");
}
} else {
- debug("headlines_callback: returned no data");
+ console.log("headlines_callback: returned no data");
notify_error("Error while trying to load more headlines");
}
if (articles) {
for (var i = 0; i < articles.length; i++) {
var a_id = articles[i].getAttribute("id");
- debug("found id: " + a_id);
+ console.log("found id: " + a_id);
cache_inject(a_id, articles[i].firstChild.nodeValue);
}
} else {
- debug("no cached articles received");
+ console.log("no cached articles received");
}
if (counters) {
- debug("parsing piggybacked counters: " + counters);
+ console.log("parsing piggybacked counters: " + counters);
parse_counters(counters, false);
} else {
- debug("counters container not found in reply, requesting...");
+ console.log("counters container not found in reply, requesting...");
request_counters();
}
if (runtime_info) {
- debug("parsing runtime info: " + runtime_info[0]);
+ console.log("parsing runtime info: " + runtime_info[0]);
parse_runtime_info(runtime_info[0]);
} else {
- debug("counters container not found in reply");
+ console.log("counters container not found in reply");
}
} else {
- debug("headlines_callback: returned no XML object");
+ console.log("headlines_callback: returned no XML object");
f.innerHTML = "<div class='whiteBox'>" + __('Could not update headlines (missing XML object)') + "</div>";
}
if (!$("headlinesList") &&
getActiveFeedId() != -3 &&
getInitParam("cdm_auto_catchup") == 1) {
- debug("starting CDM watchdog");
+ console.log("starting CDM watchdog");
_cdm_wd_timeout = window.setTimeout("cdmWatchdog()", 5000);
_cdm_wd_vishist = new Array();
} else {
- debug("not in CDM mode or watchdog disabled");
+ console.log("not in CDM mode or watchdog disabled");
}
_feed_cur_page = feed_cur_page;
function article_callback2(transport, id) {
try {
- debug("article_callback2 " + id);
+ console.log("article_callback2 " + id);
if (!transport.responseText && db) {
offlineConfirmModeChange();
}
if (id != last_requested_article) {
- debug("requested article id is out of sequence, aborting");
+ console.log("requested article id is out of sequence, aborting");
return;
}
active_post_id = id;
- debug("looking for articles to cache...");
+ console.log("looking for articles to cache...");
var articles = transport.responseXML.getElementsByTagName("article");
for (var i = 0; i < articles.length; i++) {
var a_id = articles[i].getAttribute("id");
- debug("found id: " + a_id);
+ console.log("found id: " + a_id);
if (a_id == active_post_id) {
- debug("active article, rendering...");
+ console.log("active article, rendering...");
render_article(articles[i].firstChild.nodeValue);
}
var reply = transport.responseXML.firstChild.firstChild;
} else {
- debug("article_callback: returned no XML object");
+ console.log("article_callback: returned no XML object");
//var f = $("content-frame");
//f.innerHTML = "<div class='whiteBox'>" + __('Could not display article (missing XML object)') + "</div>";
}
var counters = transport.responseXML.getElementsByTagName("counters")[0];
if (counters) {
- debug("parsing piggybacked counters: " + counters);
+ console.log("parsing piggybacked counters: " + counters);
parse_counters(counters, false);
} else {
- debug("counters container not found in reply, requesting...");
+ console.log("counters container not found in reply, requesting...");
request_counters();
}
}
function view(id) {
try {
- debug("loading article: " + id);
+ console.log("loading article: " + id);
if (offline_mode) return view_offline(id);
var cached_article = cache_find(id);
- debug("cache check result: " + (cached_article != false));
+ console.log("cache check result: " + (cached_article != false));
enableHotkeys();
hideAuxDlg();
}
}
- debug("additional ids: " + cids_to_request.toString());
+ console.log("additional ids: " + cids_to_request.toString());
/* additional info for piggyback counters */
try {
var elem = effect.effects[0].element;
- debug("tMark_afh_off : " + elem.id);
+ console.log("tMark_afh_off : " + elem.id);
if (elem) {
elem.src = elem.src.replace("mark_set", "mark_unset");
try {
var elem = effect.effects[0].element;
- debug("tPub_afh_off : " + elem.id);
+ console.log("tPub_afh_off : " + elem.id);
if (elem) {
elem.src = elem.src.replace("pub_set", "pub_unset");
if (!no_effects) update_local_feedlist_counters();
if (!client_only) {
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
var rel_offset_top = row.offsetTop - container.scrollTop;
var rel_offset_bottom = row.offsetTop + row.offsetHeight - container.scrollTop;
- debug("Rtop: " + rel_offset_top + " Rbtm: " + rel_offset_bottom);
- debug("Vport: " + viewport);
+ console.log("Rtop: " + rel_offset_top + " Rbtm: " + rel_offset_bottom);
+ console.log("Vport: " + viewport);
if (rel_offset_top <= 0 || rel_offset_top > viewport) {
container.scrollTop = row.offsetTop;
query = "?op=rpc&subop=delete&ids=" + param_escape(rows);
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
query = "?op=rpc&subop="+op+"&ids=" + param_escape(rows);
- debug(query);
+ console.log(query);
for (var i = 0; i < rows.length; i++) {
cache_invalidate(rows[i]);
query = "?op=rpc&subop=setArticleTags&" + query;
- debug(query);
+ console.log(query);
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
try {
- debug("tags saved...");
+ console.log("tags saved...");
closeInfoBox();
notify("");
}
function cdmScrollViewport(where) {
- debug("cdmScrollViewport: " + where);
+ console.log("cdmScrollViewport: " + where);
var ctr = $("headlinesInnerContainer");
if (ctr.scrollTop <= e.offsetTop && e.offsetTop + e.offsetHeight <=
ctr.scrollTop + ctr.offsetHeight) {
-// debug(e.id + " is visible " + e.offsetTop + "." +
+// console.log(e.id + " is visible " + e.offsetTop + "." +
// (e.offsetTop + e.offsetHeight) + " vs " + ctr.scrollTop + "." +
// (ctr.scrollTop + ctr.offsetHeight));
e = e.nextSibling;
}
- debug("cdmWatchdog, ids= " + ids.toString());
+ console.log("cdmWatchdog, ids= " + ids.toString());
if (ids.length > 0) {
function cache_inject(id, article, param) {
try {
if (!cache_check_param(id, param)) {
- debug("cache_article: miss: " + id + " [p=" + param + "]");
+ console.log("cache_article: miss: " + id + " [p=" + param + "]");
if (db) {
}
} else {
- debug("cache_article: hit: " + id + " [p=" + param + "]");
+ console.log("cache_article: hit: " + id + " [p=" + param + "]");
}
} catch (e) {
exception_error("cache_inject", e);
while (i < article_cache.length) {
if (article_cache[i]["id"] == id) {
- debug("cache_invalidate: removed id " + id);
+ console.log("cache_invalidate: removed id " + id);
article_cache.splice(i, 1);
return true;
}
}
}
- debug("cache_invalidate: id not found: " + id);
+ console.log("cache_invalidate: id not found: " + id);
return false;
} catch (e) {
exception_error("cache_invalidate", e);
if (post_under_pointer == id && !cache_check(id)) {
- debug("trying to preload article " + id);
+ console.log("trying to preload article " + id);
var neighbor_ids = getRelativePostIds(id, 1);
cids_to_request.push(neighbor_ids[i]);
}
}
- debug("additional ids: " + cids_to_request.toString());
+ console.log("additional ids: " + cids_to_request.toString());
cids_to_request.push(id);
var id = articles[i].getAttribute("id");
if (!cache_check(id)) {
cache_inject(id, articles[i].firstChild.nodeValue);
- debug("preloaded article: " + id);
+ console.log("preloaded article: " + id);
}
}
} });
var toolbar_form = document.forms["main_toolbar_form"];
- debug((e.scrollTop + e.offsetHeight) + " vs " + e.scrollHeight + " dis? " +
+ console.log((e.scrollTop + e.offsetHeight) + " vs " + e.scrollHeight + " dis? " +
_infscroll_disable);
if (e.scrollTop + e.offsetHeight > e.scrollHeight - 100) {
if (!_infscroll_disable) {
- debug("more cowbell!");
+ console.log("more cowbell!");
viewNextFeedPage();
}
}