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>
|
2010-08-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* SoObjects/Appointments/iCalEvent+SOGo.m (-quickRecord): we now
|
* 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 label = _("Are you sure you want to delete the selected contacts?");
|
||||||
var fields = createElement("p");
|
var fields = createElement("p");
|
||||||
fields.appendChild(createButton("confirmBtn", _("Yes"), onToolbarDeleteSelectedContactsConfirm.bind(fields, dialogId)));
|
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,
|
var dialog = createDialog(dialogId,
|
||||||
_("Confirmation"),
|
_("Confirmation"),
|
||||||
label,
|
label,
|
||||||
|
@ -476,7 +476,7 @@ function onToolbarDeleteSelectedContactsConfirm(dialogId) {
|
||||||
rows[i]);
|
rows[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
onBodyClickDialogHandler();
|
disposeDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onContactDeleteEventCallback(http) {
|
function onContactDeleteEventCallback(http) {
|
||||||
|
@ -648,12 +648,16 @@ function refreshContacts(cname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAddressBookNew(event) {
|
function onAddressBookNew(event) {
|
||||||
var dialogId = "newAddressBookDialog";
|
showPromptDialog(_("New addressbook..."), _("Name of the Address Book"), onAddressBookNewConfirm);
|
||||||
createFolder(window.prompt(_("Name of the Address Book"), ""),
|
|
||||||
appendAddressBook);
|
|
||||||
preventDefault(event);
|
preventDefault(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onAddressBookNewConfirm() {
|
||||||
|
if (this.value.length > 0)
|
||||||
|
createFolder(this.value, appendAddressBook);
|
||||||
|
disposeDialog();
|
||||||
|
}
|
||||||
|
|
||||||
function appendAddressBook(name, folder) {
|
function appendAddressBook(name, folder) {
|
||||||
var owner;
|
var owner;
|
||||||
var result = true;
|
var result = true;
|
||||||
|
@ -820,7 +824,7 @@ function deletePersonalAddressBook(folderId) {
|
||||||
deletePersonalAddressBookConfirm.bind(fields)));
|
deletePersonalAddressBookConfirm.bind(fields)));
|
||||||
fields.appendChild(createButton(dialogId + "cancelBtn",
|
fields.appendChild(createButton(dialogId + "cancelBtn",
|
||||||
"No",
|
"No",
|
||||||
onBodyClickDialogHandler));
|
disposeDialog));
|
||||||
dialog = createDialog(dialogId,
|
dialog = createDialog(dialogId,
|
||||||
_("Confirmation"),
|
_("Confirmation"),
|
||||||
label,
|
label,
|
||||||
|
@ -847,7 +851,7 @@ function deletePersonalAddressBookConfirm(event) {
|
||||||
= triggerAjaxRequest(url, deletePersonalAddressBookCallback,
|
= triggerAjaxRequest(url, deletePersonalAddressBookCallback,
|
||||||
folderId);
|
folderId);
|
||||||
|
|
||||||
onBodyClickDialogHandler();
|
disposeDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1018,19 +1022,30 @@ function onAddressBookModify(event) {
|
||||||
|
|
||||||
if (UserLogin == selected.getAttribute("owner")) {
|
if (UserLogin == selected.getAttribute("owner")) {
|
||||||
var currentName = selected.innerHTML;
|
var currentName = selected.innerHTML;
|
||||||
var newName = window.prompt(_("Address Book Name"),
|
showPromptDialog(_("Properties"),
|
||||||
currentName);
|
_("Address Book Name"),
|
||||||
if (newName && newName.length > 0
|
onAddressBookModifyConfirm,
|
||||||
&& newName != currentName) {
|
currentName);
|
||||||
var url = (URLForFolderID(selected.getAttribute("id"))
|
}
|
||||||
+ "/renameFolder?name=" + escape(newName.utf8encode()));
|
else
|
||||||
triggerAjaxRequest(url, folderRenameCallback,
|
|
||||||
{node: selected, name: newName});
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
showAlertDialog(_("Unable to rename that folder!"));
|
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"))
|
||||||
|
+ "/renameFolder?name=" + escape(newName.utf8encode()));
|
||||||
|
triggerAjaxRequest(url, folderRenameCallback,
|
||||||
|
{node: selected, name: newName});
|
||||||
|
}
|
||||||
|
disposeDialog();
|
||||||
|
}
|
||||||
|
|
||||||
function folderRenameCallback(http) {
|
function folderRenameCallback(http) {
|
||||||
if (http.readyState == 4) {
|
if (http.readyState == 4) {
|
||||||
if (isHttpStatus204(http.status)) {
|
if (isHttpStatus204(http.status)) {
|
||||||
|
|
|
@ -2045,7 +2045,11 @@ function saveFoldersStateCallback(http) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMenuCreateFolder(event) {
|
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) {
|
if (name && name.length > 0) {
|
||||||
var folderID = document.menuTarget.getAttribute("dataname");
|
var folderID = document.menuTarget.getAttribute("dataname");
|
||||||
var urlstr = URLForFolderID(folderID) + "/createFolder?name=" + encodeURIComponent(name);
|
var urlstr = URLForFolderID(folderID) + "/createFolder?name=" + encodeURIComponent(name);
|
||||||
|
@ -2053,11 +2057,15 @@ function onMenuCreateFolder(event) {
|
||||||
triggerAjaxRequest(urlstr, folderOperationCallback,
|
triggerAjaxRequest(urlstr, folderOperationCallback,
|
||||||
errorLabel.formatted(name));
|
errorLabel.formatted(name));
|
||||||
}
|
}
|
||||||
|
disposeDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMenuRenameFolder(event) {
|
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) {
|
if (name && name.length > 0) {
|
||||||
var folderID = document.menuTarget.getAttribute("dataname");
|
var folderID = document.menuTarget.getAttribute("dataname");
|
||||||
var urlstr = URLForFolderID(folderID) + "/renameFolder?name=" + name;
|
var urlstr = URLForFolderID(folderID) + "/renameFolder?name=" + name;
|
||||||
|
@ -2065,6 +2073,7 @@ function onMenuRenameFolder(event) {
|
||||||
triggerAjaxRequest(urlstr, folderOperationCallback,
|
triggerAjaxRequest(urlstr, folderOperationCallback,
|
||||||
errorLabel.formatted(name));
|
errorLabel.formatted(name));
|
||||||
}
|
}
|
||||||
|
disposeDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMenuDeleteFolder(event) {
|
function onMenuDeleteFolder(event) {
|
||||||
|
|
|
@ -2349,18 +2349,26 @@ function updateCalendarProperties(calendarID, calendarName, calendarColor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCalendarNew(event) {
|
function onCalendarNew(event) {
|
||||||
createFolder(window.prompt(_("Name of the Calendar"), ""),
|
showPromptDialog(_("New Calendar..."), _("Name of the Calendar"), onCalendarNewConfirm);
|
||||||
appendCalendar);
|
|
||||||
preventDefault(event);
|
preventDefault(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onCalendarNewConfirm() {
|
||||||
|
createFolder(this.value, appendCalendar);
|
||||||
|
disposeDialog();
|
||||||
|
}
|
||||||
|
|
||||||
function onCalendarAdd(event) {
|
function onCalendarAdd(event) {
|
||||||
openUserFolderSelector(onFolderSubscribeCB, "calendar");
|
openUserFolderSelector(onFolderSubscribeCB, "calendar");
|
||||||
preventDefault(event);
|
preventDefault(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCalendarWebAdd(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 (calendarUrl) {
|
||||||
if (document.addWebCalendarRequest) {
|
if (document.addWebCalendarRequest) {
|
||||||
document.addWebCalendarRequest.aborted = true;
|
document.addWebCalendarRequest.aborted = true;
|
||||||
|
@ -2370,6 +2378,7 @@ function onCalendarWebAdd(event) {
|
||||||
document.addWebCalendarRequest =
|
document.addWebCalendarRequest =
|
||||||
triggerAjaxRequest (url, addWebCalendarCallback);
|
triggerAjaxRequest (url, addWebCalendarCallback);
|
||||||
}
|
}
|
||||||
|
disposeDialog();
|
||||||
}
|
}
|
||||||
function addWebCalendarCallback (http) {
|
function addWebCalendarCallback (http) {
|
||||||
var data = http.responseText.evalJSON(true);
|
var data = http.responseText.evalJSON(true);
|
||||||
|
@ -2380,7 +2389,7 @@ function addWebCalendarCallback (http) {
|
||||||
changeCalendarDisplay();
|
changeCalendarDisplay();
|
||||||
}
|
}
|
||||||
else {
|
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");
|
node = $(node).up("A");
|
||||||
popupToolbarMenu(node, "privacy-menu");
|
popupToolbarMenu(node, "privacy-menu");
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
// preventDefault(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ function onMailIdentitySignatureClick(event) {
|
||||||
fields.appendChild(createButton("okBtn", _("OK"),
|
fields.appendChild(createButton("okBtn", _("OK"),
|
||||||
onMailIdentitySignatureOK));
|
onMailIdentitySignatureOK));
|
||||||
fields.appendChild(createButton("cancelBtn", _("Cancel"),
|
fields.appendChild(createButton("cancelBtn", _("Cancel"),
|
||||||
onBodyClickDialogHandler.bind(document.body, dialogId)));
|
disposeDialog.bind(document.body, dialogId)));
|
||||||
var dialog = createDialog(dialogId,
|
var dialog = createDialog(dialogId,
|
||||||
_("Signature"),
|
_("Signature"),
|
||||||
label,
|
label,
|
||||||
|
|
|
@ -580,16 +580,32 @@ DIV.dialog.right DIV
|
||||||
|
|
||||||
DIV.dialog.none
|
DIV.dialog.none
|
||||||
{ position: relative;
|
{ position: relative;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
margin: 100px auto; /* top margin could be dynamically set depending on window height */ }
|
margin: 100px auto; /* top margin could be dynamically set depending on window height */ }
|
||||||
|
|
||||||
DIV.dialog.none DIV
|
DIV.dialog.none DIV
|
||||||
{ padding: 10px;
|
{ padding: 10px; }
|
||||||
padding-bottom: 31px; }
|
|
||||||
|
DIV.dialog HR
|
||||||
|
{ clear: both;
|
||||||
|
height: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
color: #fff;
|
||||||
|
border: 0px; }
|
||||||
|
|
||||||
DIV.dialog.none H3
|
DIV.dialog.none H3
|
||||||
{ margin: 0; }
|
{ margin: 0; }
|
||||||
|
|
||||||
|
DIV.dialog.none P
|
||||||
|
{ margin: 0px;
|
||||||
|
padding: 5px 0px; }
|
||||||
|
|
||||||
|
DIV.dialog.none P.prompt
|
||||||
|
{ text-align: right; }
|
||||||
|
|
||||||
DIV#bgDialogDiv
|
DIV#bgDialogDiv
|
||||||
{ position: absolute;
|
{ position: absolute;
|
||||||
top: 0px; left: 0px;
|
top: 0px; left: 0px;
|
||||||
|
|
|
@ -1737,7 +1737,7 @@ function createDialog(id, title, legend, content, positionClass) {
|
||||||
else {
|
else {
|
||||||
bgDiv = createElement("div", "bgDialogDiv", ["bgDialog"]);
|
bgDiv = createElement("div", "bgDialogDiv", ["bgDialog"]);
|
||||||
document.body.appendChild(bgDiv);
|
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)
|
if (content)
|
||||||
subdiv.appendChild(content);
|
subdiv.appendChild(content);
|
||||||
|
createElement("hr", null, null, null, null, subdiv);
|
||||||
|
|
||||||
return newDialog;
|
return newDialog;
|
||||||
}
|
}
|
||||||
|
@ -1780,9 +1781,7 @@ function showAlertDialog(label) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _showAlertDialog(label) {
|
function _showAlertDialog(label) {
|
||||||
var dialog = null;
|
var dialog = dialogs[label];
|
||||||
if (dialogs[label])
|
|
||||||
dialog = dialogs[label];
|
|
||||||
if (dialog) {
|
if (dialog) {
|
||||||
$("bgDialogDiv").show();
|
$("bgDialogDiv").show();
|
||||||
}
|
}
|
||||||
|
@ -1790,7 +1789,7 @@ function _showAlertDialog(label) {
|
||||||
var fields = createElement("p");
|
var fields = createElement("p");
|
||||||
fields.appendChild(createButton(null,
|
fields.appendChild(createButton(null,
|
||||||
_("OK"),
|
_("OK"),
|
||||||
onBodyClickDialogHandler));
|
disposeDialog));
|
||||||
dialog = createDialog(null,
|
dialog = createDialog(null,
|
||||||
_("Warning"),
|
_("Warning"),
|
||||||
label,
|
label,
|
||||||
|
@ -1802,7 +1801,39 @@ function _showAlertDialog(label) {
|
||||||
dialog.show();
|
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) {
|
$$("DIV.dialog").each(function(div) {
|
||||||
if (div.visible())
|
if (div.visible())
|
||||||
div.hide();
|
div.hide();
|
||||||
|
|
|
@ -7,8 +7,6 @@ FORM
|
||||||
margin: 0px; }
|
margin: 0px; }
|
||||||
|
|
||||||
/* generic */
|
/* generic */
|
||||||
DIV#bgDialogDiv
|
|
||||||
{ filter: alpha(opacity=30); }
|
|
||||||
|
|
||||||
SPAN.disabledToolbarButton
|
SPAN.disabledToolbarButton
|
||||||
{ filter: alpha(opacity=40); }
|
{ filter: alpha(opacity=40); }
|
||||||
|
@ -34,6 +32,9 @@ UL#userList
|
||||||
DIV.tabsContainer > DIV.scrollToolbar > A > SPAN
|
DIV.tabsContainer > DIV.scrollToolbar > A > SPAN
|
||||||
{ line-height: 12px; }
|
{ line-height: 12px; }
|
||||||
|
|
||||||
|
DIV.dialog.none DIV
|
||||||
|
{ padding-bottom: 0px; }
|
||||||
|
|
||||||
DIV#bgDialogDiv
|
DIV#bgDialogDiv
|
||||||
{ filter: alpha(opacity=30); }
|
{ filter: alpha(opacity=30); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue