mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-05 20:54:12 +08:00
Сheck attachments on compose (Closes #161)
This commit is contained in:
parent
d80a9e8485
commit
97d3f4a13c
28 changed files with 201 additions and 168 deletions
|
@ -53,6 +53,7 @@ function PopupsComposeViewModel()
|
|||
this.savedOrSendingText = ko.observable('');
|
||||
|
||||
this.emptyToError = ko.observable(false);
|
||||
this.attachmentsInProcessError = ko.observable(false);
|
||||
this.showCcAndBcc = ko.observable(false);
|
||||
|
||||
this.cc.subscribe(fCcAndBccCheckHelper, this);
|
||||
|
@ -161,20 +162,19 @@ function PopupsComposeViewModel()
|
|||
}
|
||||
}, this);
|
||||
|
||||
this.attachmentsInProcess.subscribe(function (aValue) {
|
||||
if (this.attachmentsInProcessError() && Utils.isArray(aValue) && 0 === aValue.length)
|
||||
{
|
||||
this.attachmentsInProcessError(false);
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.editorResizeThrottle = _.throttle(_.bind(this.editorResize, this), 100);
|
||||
|
||||
this.resizer.subscribe(function () {
|
||||
this.editorResizeThrottle();
|
||||
}, this);
|
||||
|
||||
this.canBeSended = ko.computed(function () {
|
||||
return !this.sending() &&
|
||||
!this.saving() &&
|
||||
0 === this.attachmentsInProcess().length &&
|
||||
0 < this.to().length
|
||||
;
|
||||
}, this);
|
||||
|
||||
this.canBeSendedOrSaved = ko.computed(function () {
|
||||
return !this.sending() && !this.saving();
|
||||
}, this);
|
||||
|
@ -198,7 +198,11 @@ function PopupsComposeViewModel()
|
|||
aFlagsCache = []
|
||||
;
|
||||
|
||||
if (0 === sTo.length)
|
||||
if (0 < this.attachmentsInProcess().length)
|
||||
{
|
||||
this.attachmentsInProcessError(true);
|
||||
}
|
||||
else if (0 === sTo.length)
|
||||
{
|
||||
this.emptyToError(true);
|
||||
}
|
||||
|
@ -1463,6 +1467,7 @@ PopupsComposeViewModel.prototype.reset = function ()
|
|||
this.savedTime(0);
|
||||
this.savedOrSendingText('');
|
||||
this.emptyToError(false);
|
||||
this.attachmentsInProcessError(false);
|
||||
this.showCcAndBcc(false);
|
||||
|
||||
this.attachments([]);
|
||||
|
|
|
@ -101,6 +101,9 @@
|
|||
<div class="b-appachments pull-left" data-bind="visible: 0 < attachments().length">
|
||||
<div data-bind="template: { name: 'ComposeAttachment', foreach: attachmentsInReady }"></div>
|
||||
<div data-bind="template: { name: 'ComposeAttachmentInProcess', foreach: attachmentsInProcess }"></div>
|
||||
<span class="help-block error-desc" data-bind="visible: attachmentsInProcessError">
|
||||
<span class="i18n" data-i18n-text="COMPOSE/ATTACHMENTS_UPLOAD_ERROR_DESC"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="b-attachment-place" data-bind="visible: addAttachmentEnabled() && dragAndDropEnabled() && dragAndDropVisible(), initDom: composeUploaderDropPlace, css: {'dragAndDropOver': dragAndDropOver}">
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Gesendet"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Betreff"
|
||||
EMPTY_TO_ERROR_DESC = "Geben Sie bitte mindestens einen Empfänger an"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Empfangsbestätigung anfordern"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -219,6 +219,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Sent"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Subject"
|
||||
EMPTY_TO_ERROR_DESC = "Please specify at least one recipient"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Enviado"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Asunto"
|
||||
EMPTY_TO_ERROR_DESC = "Por favor especifique al menos un destinatario"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Solicitar confirmación de lectura"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Envoyé"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Sujet"
|
||||
EMPTY_TO_ERROR_DESC = "Merci de spécifier au minimum un destinataire"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Demander une confirmation de lecture"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Küldő"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Tárgy"
|
||||
EMPTY_TO_ERROR_DESC = "Please specify at least one recipient"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Sent"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Viðfangsefni"
|
||||
EMPTY_TO_ERROR_DESC = "Vinsamlegast taktu fram að minnsta kosti einn viðtakanda"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -219,6 +219,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Inviato il"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Oggetto"
|
||||
EMPTY_TO_ERROR_DESC = "Specifica almeno un destinatario"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Richiedi conferma di lettura"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Sent"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Subject"
|
||||
EMPTY_TO_ERROR_DESC = "Please specify at least one recipient"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "開封確認を要求しますか?"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "참조"
|
|||
FORWARD_MESSAGE_TOP_SENT = "보냄"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "제목"
|
||||
EMPTY_TO_ERROR_DESC = "수신인을 한 명 이상 선택하세요"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Nosūtīts"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Tēma"
|
||||
EMPTY_TO_ERROR_DESC = "Pievienojat vismaz vienu saņēmēju"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Verzonden"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Onderwerp"
|
||||
EMPTY_TO_ERROR_DESC = "Gelieve minstens 1 ontvanger aan te duiden"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Sendt"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Emne"
|
||||
EMPTY_TO_ERROR_DESC = "Vennligst oppgi minst én mottaker"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -217,6 +217,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Wysłany"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Temat"
|
||||
EMPTY_TO_ERROR_DESC = "Wprowadź co najmniej jednego odbiorcę"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Żądaj potwierdzenia odbioru"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -219,6 +219,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Enviar"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Assunto"
|
||||
EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Pedir um recibo de leitura"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Enviar"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Assunto"
|
||||
EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Pedir um recibo de leitura"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -217,6 +217,7 @@ FORWARD_MESSAGE_TOP_CC = "Copie"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Primit la"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Subiect"
|
||||
EMPTY_TO_ERROR_DESC = "Vă rugăm să specificați cel puțin un destinatar"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Cere confirmare de citire"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "Копия"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Отправлено"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Тема"
|
||||
EMPTY_TO_ERROR_DESC = "Укажите как минимум одного получателя"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Запрос о прочтении письма"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "Kópia"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Odoslať"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Predmet"
|
||||
EMPTY_TO_ERROR_DESC = "Zadajte prosím aspoň jedného príjemcu"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Vyžiadať potvrdenie o prečítaní"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "Копія"
|
|||
FORWARD_MESSAGE_TOP_SENT = "Надіслано"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "Тема"
|
||||
EMPTY_TO_ERROR_DESC = "Вкажіть як мінімум одного отримувача"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Запит про прочитання листа"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "抄送"
|
|||
FORWARD_MESSAGE_TOP_SENT = "发送"
|
||||
FORWARD_MESSAGE_TOP_SUBJECT = "主题"
|
||||
EMPTY_TO_ERROR_DESC = "请至少选择一位接收人"
|
||||
ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet"
|
||||
BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt"
|
||||
|
||||
[POPUPS_ASK]
|
||||
|
|
|
@ -8763,6 +8763,7 @@ function PopupsComposeViewModel()
|
|||
this.savedOrSendingText = ko.observable('');
|
||||
|
||||
this.emptyToError = ko.observable(false);
|
||||
this.attachmentsInProcessError = ko.observable(false);
|
||||
this.showCcAndBcc = ko.observable(false);
|
||||
|
||||
this.cc.subscribe(fCcAndBccCheckHelper, this);
|
||||
|
@ -8871,20 +8872,19 @@ function PopupsComposeViewModel()
|
|||
}
|
||||
}, this);
|
||||
|
||||
this.attachmentsInProcess.subscribe(function (aValue) {
|
||||
if (this.attachmentsInProcessError() && Utils.isArray(aValue) && 0 === aValue.length)
|
||||
{
|
||||
this.attachmentsInProcessError(false);
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.editorResizeThrottle = _.throttle(_.bind(this.editorResize, this), 100);
|
||||
|
||||
this.resizer.subscribe(function () {
|
||||
this.editorResizeThrottle();
|
||||
}, this);
|
||||
|
||||
this.canBeSended = ko.computed(function () {
|
||||
return !this.sending() &&
|
||||
!this.saving() &&
|
||||
0 === this.attachmentsInProcess().length &&
|
||||
0 < this.to().length
|
||||
;
|
||||
}, this);
|
||||
|
||||
this.canBeSendedOrSaved = ko.computed(function () {
|
||||
return !this.sending() && !this.saving();
|
||||
}, this);
|
||||
|
@ -8908,7 +8908,11 @@ function PopupsComposeViewModel()
|
|||
aFlagsCache = []
|
||||
;
|
||||
|
||||
if (0 === sTo.length)
|
||||
if (0 < this.attachmentsInProcess().length)
|
||||
{
|
||||
this.attachmentsInProcessError(true);
|
||||
}
|
||||
else if (0 === sTo.length)
|
||||
{
|
||||
this.emptyToError(true);
|
||||
}
|
||||
|
@ -10173,6 +10177,7 @@ PopupsComposeViewModel.prototype.reset = function ()
|
|||
this.savedTime(0);
|
||||
this.savedOrSendingText('');
|
||||
this.emptyToError(false);
|
||||
this.attachmentsInProcessError(false);
|
||||
this.showCcAndBcc(false);
|
||||
|
||||
this.attachments([]);
|
||||
|
|
4
rainloop/v/0.0.0/static/js/app.min.js
vendored
4
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue