merge of '79070131b527d8b1a88014a212b6f2fafc9a1490'

and 'd794ef4e02f1e288bc12d1379cbaba6e67be4e25'

Monotone-Parent: 79070131b527d8b1a88014a212b6f2fafc9a1490
Monotone-Parent: d794ef4e02f1e288bc12d1379cbaba6e67be4e25
Monotone-Revision: 2a121cef9785165904cbe9effa330ad47ba45099

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-08-10T14:15:50
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-08-10 14:15:50 +00:00
5 changed files with 83 additions and 55 deletions
+47 -4
View File
@@ -27,6 +27,9 @@ var queryParameters;
var menus = new Array();
var search = {};
var sorting = {};
var dialogs = {};
var dialogActive = false;
var dialogsStack = new Array();
var lastClickedRow = -1;
@@ -1070,7 +1073,7 @@ function folderSubscriptionCallback(http) {
http.callbackData["method"](http.callbackData["data"]);
}
else
window.alert(_("Unable to subscribe to that folder!"));
showAlertDialog(_("Unable to subscribe to that folder!"));
document.subscriptionAjaxRequest = null;
}
else
@@ -1106,7 +1109,7 @@ function folderUnsubscriptionCallback(http) {
http.callbackData["method"](http.callbackData["data"]);
}
else
window.alert(_("Unable to unsubscribe from that folder!"));
showAlertDialog(_("Unable to unsubscribe from that folder!"));
}
}
@@ -1126,7 +1129,7 @@ function unsubscribeFromFolder(folderUrl, owner, refreshCallback,
triggerAjaxRequest(url, folderUnsubscriptionCallback, rfCbData);
}
else
window.alert(_("You cannot unsubscribe from a folder that you own!"));
showAlertDialog(_("You cannot unsubscribe from a folder that you own!"));
}
}
@@ -1742,13 +1745,53 @@ function createButton(id, caption, action) {
return newButton;
}
function showAlertDialog(label) {
var div = $("bgDialogDiv");
if (div && div.visible()) {
dialogsStack.push(label);
return;
}
else {
_showAlertDialog(label);
}
}
function _showAlertDialog(label) {
var dialog = null;
if (dialogs[label])
dialog = dialogs[label];
if (dialog) {
$("bgDialogDiv").show();
}
else {
var fields = createElement("p");
fields.appendChild(createButton(null,
_("OK"),
onBodyClickDialogHandler));
dialog = createDialog(null,
_("Warning"),
label,
fields,
"none");
document.body.appendChild(dialog);
dialogs[label] = dialog;
}
dialog.show();
}
function onBodyClickDialogHandler() {
$$("DIV.dialog").each(function(div) {
if (div.visible())
div.hide();
});
$("bgDialogDiv").hide();
if (dialogsStack.length > 0) {
var label = dialogsStack.first();
dialogsStack.splice(0, 1);
_showAlertDialog.delay(0.1, label);
}
else
$("bgDialogDiv").hide();
}
function readCookie(name) {