See ChangeLog

Monotone-Parent: 5016da15e7302739b395754fe5a9d170409343ae
Monotone-Revision: f6a0b62965278336b461dac36045bfae5fc07f0a

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-08-12T17:56:18
This commit is contained in:
Ludovic Marcotte
2010-08-12 17:56:18 +00:00
parent a6df60d4d8
commit 89d3d4b413
7 changed files with 78 additions and 11 deletions
+33 -10
View File
@@ -27,6 +27,7 @@ var logConsole;
var logWindow = null;
var queryParameters;
var recoveryRequest = null;
var menus = new Array();
var search = {};
@@ -246,15 +247,26 @@ function createHTTPClient() {
function onAjaxRequestStateChange(http) {
try {
if (http.readyState == 4
&& activeAjaxRequests > 0) {
if (!http.aborted)
http.callback(http);
activeAjaxRequests--;
checkAjaxRequestsState();
http.onreadystatechange = Prototype.emptyFunction;
http.callback = Prototype.emptyFunction;
http.callbackData = null;
if (http.readyState == 4) {
if (http.status == 0 && usesCASAuthentication) {
activeAjaxRequests--;
checkAjaxRequestsState();
recoveryRequest = http;
var urlstr = ApplicationBaseURL;
if (!urlstr.endsWith('/'))
urlstr += '/';
urlstr += ("../../recover");
window.open(urlstr, "_blank");
}
else if (activeAjaxRequests > 0) {
if (!http.aborted)
http.callback(http);
activeAjaxRequests--;
checkAjaxRequestsState();
http.onreadystatechange = Prototype.emptyFunction;
http.callback = Prototype.emptyFunction;
http.callbackData = null;
}
}
}
catch(e) {
@@ -276,6 +288,16 @@ function onAjaxRequestStateChange(http) {
}
}
function recoverRequest() {
if (recoveryRequest) {
triggerAjaxRequest(recoveryRequest.url,
recoveryRequest.callback,
recoveryRequest.callbackData,
recoveryRequest.paramHeaders);
recoveryRequest = null;
}
}
/* taken from Lightning */
function getContrastingTextColor(bgColor) {
var calcColor = bgColor.substring(1);
@@ -299,9 +321,10 @@ function triggerAjaxRequest(url, callback, userdata, content, headers) {
http.open("POST", url, true);
http.url = url;
http.paramHeaders = headers;
http.callback = callback;
http.callbackData = userdata;
http.onreadystatechange = function() { onAjaxRequestStateChange(http);};
http.onreadystatechange = function() { onAjaxRequestStateChange(http); };
// = function() {
// // log ("state changed (" + http.readyState + "): " + url);
// };