See Changelog.
Monotone-Parent: f1cd0d304e65e52a50441f7062e35bd9f5716f98 Monotone-Revision: d51fb546b2097f0d48a9b928bab71c9956c7c7f3 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-08-19T14:19:24 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
86415633a3
commit
071f5b858f
|
@ -1,3 +1,8 @@
|
|||
2010-08-19 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/generic.js (showPromptDialog): new
|
||||
function to replace window.prompt().
|
||||
|
||||
2010-08-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/iCalEvent+SOGo.m (-quickRecord): we now
|
||||
|
|
|
@ -444,7 +444,7 @@ function onToolbarDeleteSelectedContacts(event) {
|
|||
var label = _("Are you sure you want to delete the selected contacts?");
|
||||
var fields = createElement("p");
|
||||
fields.appendChild(createButton("confirmBtn", _("Yes"), onToolbarDeleteSelectedContactsConfirm.bind(fields, dialogId)));
|
||||
fields.appendChild(createButton("cancelBtn", _("No"), onBodyClickDialogHandler));
|
||||
fields.appendChild(createButton("cancelBtn", _("No"), disposeDialog));
|
||||
var dialog = createDialog(dialogId,
|
||||
_("Confirmation"),
|
||||
label,
|
||||
|
@ -476,7 +476,7 @@ function onToolbarDeleteSelectedContactsConfirm(dialogId) {
|
|||
rows[i]);
|
||||
}
|
||||
|
||||
onBodyClickDialogHandler();
|
||||
disposeDialog();
|
||||
}
|
||||
|
||||
function onContactDeleteEventCallback(http) {
|
||||
|
@ -648,12 +648,16 @@ function refreshContacts(cname) {
|
|||
}
|
||||
|
||||
function onAddressBookNew(event) {
|
||||
var dialogId = "newAddressBookDialog";
|
||||
createFolder(window.prompt(_("Name of the Address Book"), ""),
|
||||
appendAddressBook);
|
||||
showPromptDialog(_("New addressbook..."), _("Name of the Address Book"), onAddressBookNewConfirm);
|
||||
preventDefault(event);
|
||||
}
|
||||
|
||||
function onAddressBookNewConfirm() {
|
||||
if (this.value.length > 0)
|
||||
createFolder(this.value, appendAddressBook);
|
||||
disposeDialog();
|
||||
}
|
||||
|
||||
function appendAddressBook(name, folder) {
|
||||
var owner;
|
||||
var result = true;
|
||||
|
@ -820,7 +824,7 @@ function deletePersonalAddressBook(folderId) {
|
|||
deletePersonalAddressBookConfirm.bind(fields)));
|
||||
fields.appendChild(createButton(dialogId + "cancelBtn",
|
||||
"No",
|
||||
onBodyClickDialogHandler));
|
||||
disposeDialog));
|
||||
dialog = createDialog(dialogId,
|
||||
_("Confirmation"),
|
||||
label,
|
||||
|
@ -847,7 +851,7 @@ function deletePersonalAddressBookConfirm(event) {
|
|||
= triggerAjaxRequest(url, deletePersonalAddressBookCallback,
|
||||
folderId);
|
||||
|
||||
onBodyClickDialogHandler();
|
||||
disposeDialog();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1018,8 +1022,20 @@ function onAddressBookModify(event) {
|
|||
|
||||
if (UserLogin == selected.getAttribute("owner")) {
|
||||
var currentName = selected.innerHTML;
|
||||
var newName = window.prompt(_("Address Book Name"),
|
||||
showPromptDialog(_("Properties"),
|
||||
_("Address Book Name"),
|
||||
onAddressBookModifyConfirm,
|
||||
currentName);
|
||||
}
|
||||
else
|
||||
showAlertDialog(_("Unable to rename that folder!"));
|
||||
}
|
||||
|
||||
function onAddressBookModifyConfirm() {
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var newName = this.value;
|
||||
var currentName = this.getAttribute("previousValue");
|
||||
if (newName && newName.length > 0
|
||||
&& newName != currentName) {
|
||||
var url = (URLForFolderID(selected.getAttribute("id"))
|
||||
|
@ -1027,8 +1043,7 @@ function onAddressBookModify(event) {
|
|||
triggerAjaxRequest(url, folderRenameCallback,
|
||||
{node: selected, name: newName});
|
||||
}
|
||||
} else
|
||||
showAlertDialog(_("Unable to rename that folder!"));
|
||||
disposeDialog();
|
||||
}
|
||||
|
||||
function folderRenameCallback(http) {
|
||||
|
|
|
@ -2045,7 +2045,11 @@ function saveFoldersStateCallback(http) {
|
|||
}
|
||||
|
||||
function onMenuCreateFolder(event) {
|
||||
var name = window.prompt(_("Name :"), "");
|
||||
showPromptDialog(_("New Folder..."), _("Name :"), onMenuCreateFolderConfirm);
|
||||
}
|
||||
|
||||
function onMenuCreateFolderConfirm(event) {
|
||||
var name = this.value;
|
||||
if (name && name.length > 0) {
|
||||
var folderID = document.menuTarget.getAttribute("dataname");
|
||||
var urlstr = URLForFolderID(folderID) + "/createFolder?name=" + encodeURIComponent(name);
|
||||
|
@ -2053,11 +2057,15 @@ function onMenuCreateFolder(event) {
|
|||
triggerAjaxRequest(urlstr, folderOperationCallback,
|
||||
errorLabel.formatted(name));
|
||||
}
|
||||
disposeDialog();
|
||||
}
|
||||
|
||||
function onMenuRenameFolder(event) {
|
||||
var name = window.prompt(_("Enter the new name of your folder :"),
|
||||
"");
|
||||
showPromptDialog(_("Rename Folder..."), _("Enter the new name of your folder :"), onMenuRenameFolderConfirm);
|
||||
}
|
||||
|
||||
function onMenuRenameFolderConfirm() {
|
||||
var name = this.value;
|
||||
if (name && name.length > 0) {
|
||||
var folderID = document.menuTarget.getAttribute("dataname");
|
||||
var urlstr = URLForFolderID(folderID) + "/renameFolder?name=" + name;
|
||||
|
@ -2065,6 +2073,7 @@ function onMenuRenameFolder(event) {
|
|||
triggerAjaxRequest(urlstr, folderOperationCallback,
|
||||
errorLabel.formatted(name));
|
||||
}
|
||||
disposeDialog();
|
||||
}
|
||||
|
||||
function onMenuDeleteFolder(event) {
|
||||
|
|
|
@ -2349,18 +2349,26 @@ function updateCalendarProperties(calendarID, calendarName, calendarColor) {
|
|||
}
|
||||
|
||||
function onCalendarNew(event) {
|
||||
createFolder(window.prompt(_("Name of the Calendar"), ""),
|
||||
appendCalendar);
|
||||
showPromptDialog(_("New Calendar..."), _("Name of the Calendar"), onCalendarNewConfirm);
|
||||
preventDefault(event);
|
||||
}
|
||||
|
||||
function onCalendarNewConfirm() {
|
||||
createFolder(this.value, appendCalendar);
|
||||
disposeDialog();
|
||||
}
|
||||
|
||||
function onCalendarAdd(event) {
|
||||
openUserFolderSelector(onFolderSubscribeCB, "calendar");
|
||||
preventDefault(event);
|
||||
}
|
||||
|
||||
function onCalendarWebAdd(event) {
|
||||
var calendarUrl = window.prompt(_("URL of the Calendar"), "");
|
||||
showPromptDialog(_("Subscribe to a web calendar..."), _("URL of the Calendar"), onCalendarWebAddConfirm);
|
||||
}
|
||||
|
||||
function onCalendarWebAddConfirm() {
|
||||
var calendarUrl = this.value;
|
||||
if (calendarUrl) {
|
||||
if (document.addWebCalendarRequest) {
|
||||
document.addWebCalendarRequest.aborted = true;
|
||||
|
@ -2370,6 +2378,7 @@ function onCalendarWebAdd(event) {
|
|||
document.addWebCalendarRequest =
|
||||
triggerAjaxRequest (url, addWebCalendarCallback);
|
||||
}
|
||||
disposeDialog();
|
||||
}
|
||||
function addWebCalendarCallback (http) {
|
||||
var data = http.responseText.evalJSON(true);
|
||||
|
@ -2380,7 +2389,7 @@ function addWebCalendarCallback (http) {
|
|||
changeCalendarDisplay();
|
||||
}
|
||||
else {
|
||||
alert (_("An error occured while importing calendar."));
|
||||
showAlertDialog (_("An error occured while importing calendar."));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,6 @@ function onSelectPrivacy(event) {
|
|||
node = $(node).up("A");
|
||||
popupToolbarMenu(node, "privacy-menu");
|
||||
Event.stop(event);
|
||||
// preventDefault(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ function onMailIdentitySignatureClick(event) {
|
|||
fields.appendChild(createButton("okBtn", _("OK"),
|
||||
onMailIdentitySignatureOK));
|
||||
fields.appendChild(createButton("cancelBtn", _("Cancel"),
|
||||
onBodyClickDialogHandler.bind(document.body, dialogId)));
|
||||
disposeDialog.bind(document.body, dialogId)));
|
||||
var dialog = createDialog(dialogId,
|
||||
_("Signature"),
|
||||
label,
|
||||
|
|
|
@ -580,16 +580,32 @@ DIV.dialog.right DIV
|
|||
|
||||
DIV.dialog.none
|
||||
{ position: relative;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
opacity: 1;
|
||||
margin: 100px auto; /* top margin could be dynamically set depending on window height */ }
|
||||
|
||||
DIV.dialog.none DIV
|
||||
{ padding: 10px;
|
||||
padding-bottom: 31px; }
|
||||
{ padding: 10px; }
|
||||
|
||||
DIV.dialog HR
|
||||
{ clear: both;
|
||||
height: 0px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
color: #fff;
|
||||
border: 0px; }
|
||||
|
||||
DIV.dialog.none H3
|
||||
{ margin: 0; }
|
||||
|
||||
DIV.dialog.none P
|
||||
{ margin: 0px;
|
||||
padding: 5px 0px; }
|
||||
|
||||
DIV.dialog.none P.prompt
|
||||
{ text-align: right; }
|
||||
|
||||
DIV#bgDialogDiv
|
||||
{ position: absolute;
|
||||
top: 0px; left: 0px;
|
||||
|
|
|
@ -1737,7 +1737,7 @@ function createDialog(id, title, legend, content, positionClass) {
|
|||
else {
|
||||
bgDiv = createElement("div", "bgDialogDiv", ["bgDialog"]);
|
||||
document.body.appendChild(bgDiv);
|
||||
bgDiv.observe("click", onBodyClickDialogHandler);
|
||||
bgDiv.observe("click", disposeDialog);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1752,6 +1752,7 @@ function createDialog(id, title, legend, content, positionClass) {
|
|||
}
|
||||
if (content)
|
||||
subdiv.appendChild(content);
|
||||
createElement("hr", null, null, null, null, subdiv);
|
||||
|
||||
return newDialog;
|
||||
}
|
||||
|
@ -1780,9 +1781,7 @@ function showAlertDialog(label) {
|
|||
}
|
||||
|
||||
function _showAlertDialog(label) {
|
||||
var dialog = null;
|
||||
if (dialogs[label])
|
||||
dialog = dialogs[label];
|
||||
var dialog = dialogs[label];
|
||||
if (dialog) {
|
||||
$("bgDialogDiv").show();
|
||||
}
|
||||
|
@ -1790,7 +1789,7 @@ function _showAlertDialog(label) {
|
|||
var fields = createElement("p");
|
||||
fields.appendChild(createButton(null,
|
||||
_("OK"),
|
||||
onBodyClickDialogHandler));
|
||||
disposeDialog));
|
||||
dialog = createDialog(null,
|
||||
_("Warning"),
|
||||
label,
|
||||
|
@ -1802,7 +1801,39 @@ function _showAlertDialog(label) {
|
|||
dialog.show();
|
||||
}
|
||||
|
||||
function onBodyClickDialogHandler() {
|
||||
function showPromptDialog(title, label, callback, defaultValue) {
|
||||
var dialog = dialogs[label];
|
||||
v = defaultValue?defaultValue:"";
|
||||
if (dialog) {
|
||||
$("bgDialogDiv").show();
|
||||
dialog.down("input").value = v;
|
||||
}
|
||||
else {
|
||||
var fields = createElement("p", null, ["prompt"]);
|
||||
fields.appendChild(document.createTextNode(label));
|
||||
var input = createElement("input", null, "textField",
|
||||
{ type: "text", "value": v },
|
||||
{ previousValue: v });
|
||||
fields.appendChild(input);
|
||||
fields.appendChild(createButton(null,
|
||||
_("OK"),
|
||||
callback.bind(input)));
|
||||
fields.appendChild(createButton(null,
|
||||
"Cancel",
|
||||
disposeDialog));
|
||||
dialog = createDialog(null,
|
||||
title,
|
||||
null,
|
||||
fields,
|
||||
"none");
|
||||
document.body.appendChild(dialog);
|
||||
dialogs[label] = dialog;
|
||||
}
|
||||
dialog.show();
|
||||
dialog.down("input").focus();
|
||||
}
|
||||
|
||||
function disposeDialog() {
|
||||
$$("DIV.dialog").each(function(div) {
|
||||
if (div.visible())
|
||||
div.hide();
|
||||
|
|
|
@ -7,8 +7,6 @@ FORM
|
|||
margin: 0px; }
|
||||
|
||||
/* generic */
|
||||
DIV#bgDialogDiv
|
||||
{ filter: alpha(opacity=30); }
|
||||
|
||||
SPAN.disabledToolbarButton
|
||||
{ filter: alpha(opacity=40); }
|
||||
|
@ -34,6 +32,9 @@ UL#userList
|
|||
DIV.tabsContainer > DIV.scrollToolbar > A > SPAN
|
||||
{ line-height: 12px; }
|
||||
|
||||
DIV.dialog.none DIV
|
||||
{ padding-bottom: 0px; }
|
||||
|
||||
DIV#bgDialogDiv
|
||||
{ filter: alpha(opacity=30); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue