move counters processing to different xmlhttp object

master
Andrew Dolgov 18 years ago
parent 7bc4f2517f
commit abbe0154f7

@ -112,6 +112,7 @@ div.postReply {
background-repeat : repeat-x;
height : 100%;
padding : 10px;
margin-left : 1px;
}
div.postReply a {
@ -907,3 +908,100 @@ div.cdmContent a:hover {
color : black;
}
/* layout */
#header {
position : absolute;
white-space: nowrap;
top : 10px;
left : 15px;
right : 5px;
height : 40px;
color : gray;
font-size : x-small;
}
#feeds-holder {
border-width : 1px 1px 1px 0px;
border-style : solid;
border-color : #c0c0c0;
top : 70px;
left : 0px;
position : absolute;
width : 260px;
overflow : auto;
bottom : 50px;
}
#toolbar {
position : absolute;
left : 261px;
padding : 5px 10px 5px 10px;
top : 70px;
right : 0px;
white-space: nowrap;
height : 30px;
background-image : url("images/vgrad_light.png");
background-position : bottom left;
background-repeat : repeat-x;
font-size : small;
}
div.headlines_normal {
position : absolute;
border-width : 1px 0px 0px 0px;
border-style : solid;
border-color : #c0c0c0;
left : 260px;
height : 280px;
top : 105px;
right : 0px;
overflow : auto;
font-size : small;
}
div.headlines_cdm {
position : absolute;
border-width : 1px 0px 1px 0px;
border-style : solid;
border-color : #c0c0c0;
left : 260px;
bottom : 50px;
top : 105px;
right : 0px;
overflow : auto;
font-size : small;
}
#content-frame {
position : absolute;
border-width : 1px 0px 1px 0px;
border-style : solid;
border-color : #c0c0c0;
overflow : auto;
top : 390px;
left : 260px;
bottom : 50px;
right : 0px;
}
#footer {
position : absolute;
bottom : 0px;
height : 30px;
text-align : center;
color : gray;
font-size : x-small;
background-image : url("images/vgrad_light_rev2.png");
background-position : top left;
background-repeat : repeat-x;
background-color : white;
right : 0px;
left : 0px;
padding : 10px;
}
#headlinesContainer {
margin-left : 1px;
background-color : white;
}

@ -1234,6 +1234,7 @@ div.loadingPrompt {
div.whiteBox {
background-color : white;
margin-left : 1px;
text-align : center;
}
/* layout */

@ -16,6 +16,7 @@ var active_feed_is_cat = false;
var number_of_feeds = 0;
var xmlhttp = Ajax.getTransport();
var xmlhttp_ctr = Ajax.getTransport();
var init_params = new Object();
@ -36,25 +37,33 @@ function toggleTags() {
function dlg_frefresh_callback() {
if (xmlhttp.readyState == 4) {
notify(xmlhttp.responseText);
if (getActiveFeedId() == _qfd_deleted_feed) {
var h = document.getElementById("headlines-frame");
if (h) {
h.innerHTML = "<div class='whiteBox'>No feed selected.</div>";
}
}
setTimeout('updateFeedList(false, false)', 50);
closeInfoBox();
}
}
function refetch_callback() {
if (xmlhttp.readyState == 4) {
if (xmlhttp_ctr.readyState == 4) {
try {
var date = new Date();
last_refetch = date.getTime() / 1000;
if (!xmlhttp.responseXML) {
if (!xmlhttp_ctr.responseXML) {
notify("refetch_callback: backend did not return valid XML", true, true);
return;
}
var reply = xmlhttp.responseXML.firstChild;
var reply = xmlhttp_ctr.responseXML.firstChild;
if (!reply) {
notify("refetch_callback: backend did not return expected XML object", true, true);
@ -175,19 +184,19 @@ function scheduleFeedUpdate(force) {
var date = new Date();
if (!xmlhttp_ready(xmlhttp) && last_refetch < date.getTime() / 1000 - 60) {
if (!xmlhttp_ready(xmlhttp_ctr) && last_refetch < date.getTime() / 1000 - 60) {
debug("<b>xmlhttp seems to be stuck, aborting</b>");
xmlhttp.abort();
xmlhttp_ctr.abort();
}
debug("REFETCH query: " + query_str);
if (xmlhttp_ready(xmlhttp)) {
xmlhttp.open("GET", query_str, true);
xmlhttp.onreadystatechange=refetch_callback;
xmlhttp.send(null);
if (xmlhttp_ready(xmlhttp_ctr)) {
xmlhttp_ctr.open("GET", query_str, true);
xmlhttp_ctr.onreadystatechange=refetch_callback;
xmlhttp_ctr.send(null);
} else {
debug("xmlhttp busy");
debug("xmlhttp_ctr busy");
//printLockingError();
}
}

@ -1,7 +1,5 @@
var active_post_id = false;
//var xmlhttp_rpc = Ajax.getTransport();
function headlines_callback() {
if (xmlhttp.readyState == 4) {
debug("headlines_callback");
@ -54,8 +52,6 @@ function view(id, feed_id) {
var query = "backend.php?op=view&id=" + param_escape(id) +
"&feed=" + param_escape(feed_id);
xmlhttp.abort();
if (xmlhttp_ready(xmlhttp)) {
xmlhttp.open("GET", query, true);
xmlhttp.onreadystatechange=article_callback;

Loading…
Cancel
Save