See ChangeLog.

Monotone-Parent: 0bc4e04aaead15b626a732a223ebf47ee22e73f0
Monotone-Revision: 28cde64403e65a1ebeda3a984650fd31d8614f29

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2012-05-29T14:20:06
This commit is contained in:
Francis Lachapelle
2012-05-29 14:20:06 +00:00
parent 439248ee89
commit 19ea16d5ba
9 changed files with 57 additions and 72 deletions

View File

@@ -1,3 +1,18 @@
2012-05-29 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/UIxMailEditor.js (validateEditorInput):
merged with onValidate.
(onValidate): don't force the subject to be defined, but alert
the user.
* UI/MailerUI/UIxMailView.m (-messageSubject): don't set the
subject to "Untitled" if it's not set.
* UI/MailPartViewers/UIxMailPartMessageViewer.m (-messageSubject): idem.
* UI/MailerUI/UIxMailEditor.m (-validateForSend): don't force the
subject to be defined.
2012-05-28 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/SchedulerUI.js (validateUploadForm): hide

View File

@@ -165,7 +165,7 @@
subject = [baseSubject decodedHeader];
if (![subject length])
subject = [self labelForKey: @"Untitled"];
subject = @"";
return subject;
}

View File

@@ -283,9 +283,9 @@
= "The messages could not be moved to the trash folder. Would you like to delete them immediately?";
/* Message editing */
"error_validationfailed" = "Validation failed";
"error_missingsubject" = "Subject is missing";
"error_missingrecipients" = "No recipients specified";
"error_missingsubject" = "The message has no subject. Are you sure you want to send it?";
"error_missingrecipients" = "Please specify at least one recipient.";
"Send Anyway" = "Send Anyway";
/* Message sending */
"cannot send message: (smtp) all recipients discarded" = "Cannot send message: all recipients are invalid.";

View File

@@ -653,10 +653,7 @@ static NSArray *infoKeys = nil;
if (![self hasOneOrMoreRecipients])
error = [NSException exceptionWithHTTPStatus: 400 /* Bad Request */
reason: @"Please select a recipient!"];
else if ([[self subject] length] == 0)
error = [NSException exceptionWithHTTPStatus: 400 /* Bad Request */
reason: @"Please set a subject!"];
reason: [self labelForKey: @"error_missingrecipients"]];
else
error = nil;

View File

@@ -192,7 +192,7 @@
baseSubject = [[message valueForKey: @"envelope"] subject];
subject = [baseSubject decodedHeader];
if (![subject length])
subject = [self labelForKey: @"Untitled"];
subject = @"";
return [subject stringByEscapingHTMLString];
}

View File

@@ -96,8 +96,6 @@ static NSString *mailETag = nil;
NSString *subject;
subject = [[self clientObject] decodedSubject];
if (![subject length])
subject = [self labelForKey: @"Untitled"];
return subject;
}

View File

@@ -12,25 +12,6 @@ var Contact = {
deleteContactsRequestCount: null
};
function validateEditorInput(sender) {
var errortext = "";
var field;
field = document.pageform.subject;
if (field.value == "")
errortext = errortext + labels.error_missingsubject + "\n";
if (!hasRecipients())
errortext = errortext + labels.error_missingrecipients + "\n";
if (errortext.length > 0) {
alert(labels.error_validationfailed + ":\n"
+ errortext);
return false;
}
return true;
}
function openContactsFolder(contactsFolder, reload, idx) {
if ((contactsFolder && contactsFolder != Contact.currentAddressBook)
|| reload) {

View File

@@ -237,7 +237,7 @@ TABLE#contactsList TD#mailHeader
DIV.contactSelection
{
z-index: 10;
z-index: 1;
background: inherit;
position: absolute;
bottom: 0em;

View File

@@ -107,51 +107,45 @@ function insertContact(inputNode, contactName, contactEmail) {
/* mail editor */
function validateEditorInput() {
var errortext = "";
var field;
field = document.pageform.subject;
if (field.value == "")
errortext = errortext + _("error_missingsubject") + "\n";
if (!hasRecipients())
errortext = errortext + _("error_missingrecipients") + "\n";
if (errortext.length > 0) {
alert(_("error_validationfailed") + ":\n" + errortext);
return false;
function onValidate(onSuccess) {
if (document.pageform.action != "send") {
if (!hasRecipients()) {
showAlertDialog(_("error_missingrecipients"));
}
else if (document.pageform.subject.value == "") {
showConfirmDialog(_("Warning"), _("error_missingsubject"), onValidateDone.bind(this, onSuccess), null, _("Send anyway"), _("Cancel"));
}
else {
onValidateDone(onSuccess);
}
}
return true;
}
function onValidate(event) {
var rc = false;
function onValidateDone(onSuccess) {
var input = currentAttachmentInput();
if (input)
input.parentNode.removeChild(input);
if (document.pageform.action != "send"
&& validateEditorInput()) {
var input = currentAttachmentInput();
if (input)
input.parentNode.removeChild(input);
var toolbar = document.getElementById("toolbar");
if (!document.busyAnim)
document.busyAnim = startAnimation(toolbar);
var lastRow = $("lastRow");
lastRow.down("select").name = "popup_last";
var toolbar = document.getElementById("toolbar");
if (!document.busyAnim)
document.busyAnim = startAnimation(toolbar);
window.shouldPreserve = true;
var lastRow = $("lastRow");
lastRow.down("select").name = "popup_last";
window.shouldPreserve = true;
document.pageform.action = "send";
AIM.submit($(document.pageform), {'onComplete' : onPostComplete});
if (typeof onSuccess == 'function')
onSuccess();
document.pageform.action = "send";
disposeDialog();
AIM.submit($(document.pageform), {'onComplete' : onPostComplete});
rc = true;
}
return rc;
return true;
}
function onPostComplete(response) {
@@ -184,9 +178,9 @@ function onPostComplete(response) {
}
function clickedEditorSend() {
if (onValidate()) {
document.pageform.submit();
}
onValidate(function() {
document.pageform.submit();
});
return false;
}