prettify debug output

This commit is contained in:
Andrew Dolgov 2006-03-04 11:35:47 +01:00
parent 8ac0c627eb
commit cf1bc085fa
4 changed files with 9 additions and 27 deletions

View File

@ -849,4 +849,8 @@ function getURLParam(strParamName){
return strReturn; return strReturn;
} }
function leading_zero(p) {
var s = String(p);
if (s.length == 1) s = "0" + s;
return s;
}

View File

@ -1006,7 +1006,7 @@ div.cdmContent a:hover {
border : 1px solid #c0c0c0; border : 1px solid #c0c0c0;
overflow : auto; overflow : auto;
margin : 0px; margin : 0px;
padding : 5px; padding : 0px;
list-style-type : none; list-style-type : none;
} }

View File

@ -709,7 +709,8 @@ function debug(msg) {
} }
var d = new Date(); var d = new Date();
var ts = d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds(); var ts = leading_zero(d.getHours()) + ":" + leading_zero(d.getMinutes()) +
":" + leading_zero(d.getSeconds());
c.innerHTML = "<li>[" + ts + "] " + msg + "</li>" + c.innerHTML; c.innerHTML = "<li>[" + ts + "] " + msg + "</li>" + c.innerHTML;
} }
} }

View File

@ -1,5 +1,4 @@
var active_post_id = false; var active_post_id = false;
var total_unread = 0;
var xmlhttp_rpc = false; var xmlhttp_rpc = false;
@ -24,7 +23,7 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') {
function view(id, feed_id) { function view(id, feed_id) {
// p_notify("Loading article..."); parent.debug("loading article: " + id + "/" + feed_id);
var f_document = parent.frames["feeds-frame"].document; var f_document = parent.frames["feeds-frame"].document;
var h_document = document; var h_document = document;
@ -34,26 +33,6 @@ function view(id, feed_id) {
var crow = h_document.getElementById("RROW-" + id); var crow = h_document.getElementById("RROW-" + id);
/* if (crow.className.match("Unread")) {
var umark = f_document.getElementById("FEEDU-" + feed_id);
umark.innerHTML = umark.innerHTML - 1;
crow.className = crow.className.replace("Unread", "");
if (umark.innerHTML == "0") {
var feedr = f_document.getElementById("FEEDR-" + feed_id);
feedr.className = feedr.className.replace("Unread", "");
var feedctr = f_document.getElementById("FEEDCTR-" + feed_id);
if (feedctr) {
feedctr.className = "invisible";
}
}
total_unread--;
} */
crow.className = crow.className.replace("Unread", ""); crow.className = crow.className.replace("Unread", "");
cleanSelected("headlinesList"); cleanSelected("headlinesList");
@ -92,8 +71,6 @@ function toggleMark(id) {
var vfeedu = f_document.getElementById("FEEDU--1"); var vfeedu = f_document.getElementById("FEEDU--1");
var crow = document.getElementById("RROW-" + id); var crow = document.getElementById("RROW-" + id);
// alert(vfeedu);
if (mark_img.alt != "Reset mark") { if (mark_img.alt != "Reset mark") {
mark_img.src = "images/mark_set.png"; mark_img.src = "images/mark_set.png";
mark_img.alt = "Reset mark"; mark_img.alt = "Reset mark";