mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-05 04:34:24 +08:00
"Edit as New" functionality (close #39)
This commit is contained in:
parent
b0593b813e
commit
6ecb7006f8
22 changed files with 67 additions and 11 deletions
|
@ -66,7 +66,8 @@ Enums.ComposeType = {
|
|||
'ReplyAll': 'replyall',
|
||||
'Forward': 'forward',
|
||||
'ForwardAsAttachment': 'forward-as-attachment',
|
||||
'Draft': 'draft'
|
||||
'Draft': 'draft',
|
||||
'EditAsNew': 'editasnew'
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,6 +51,7 @@ function MailBoxMessageViewViewModel()
|
|||
this.replyAllCommand = createCommandHelper(Enums.ComposeType.ReplyAll);
|
||||
this.forwardCommand = createCommandHelper(Enums.ComposeType.Forward);
|
||||
this.forwardAsAttachmentCommand = createCommandHelper(Enums.ComposeType.ForwardAsAttachment);
|
||||
this.editAsNewCommand = createCommandHelper(Enums.ComposeType.EditAsNew);
|
||||
|
||||
this.messageVisibilityCommand = Utils.createCommand(this, Utils.emptyFunction, this.messageVisibility);
|
||||
|
||||
|
|
|
@ -714,6 +714,19 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
|
|||
this.subject(sSubject);
|
||||
this.prepearMessageAttachments(oMessage, sComposeType);
|
||||
|
||||
this.aDraftInfo = Utils.isNonEmptyArray(aDraftInfo) && 3 === aDraftInfo.length ? aDraftInfo : null;
|
||||
this.sInReplyTo = oMessage.sInReplyTo;
|
||||
this.sReferences = oMessage.sReferences;
|
||||
break;
|
||||
|
||||
case Enums.ComposeType.EditAsNew:
|
||||
this.to(fEmailArrayToStringLineHelper(oMessage.to));
|
||||
this.cc(fEmailArrayToStringLineHelper(oMessage.cc));
|
||||
this.bcc(fEmailArrayToStringLineHelper(oMessage.bcc));
|
||||
|
||||
this.subject(sSubject);
|
||||
this.prepearMessageAttachments(oMessage, sComposeType);
|
||||
|
||||
this.aDraftInfo = Utils.isNonEmptyArray(aDraftInfo) && 3 === aDraftInfo.length ? aDraftInfo : null;
|
||||
this.sInReplyTo = oMessage.sInReplyTo;
|
||||
this.sReferences = oMessage.sReferences;
|
||||
|
@ -754,7 +767,8 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
|
|||
break;
|
||||
}
|
||||
|
||||
if (bSignatureToAll && '' !== sSignature)
|
||||
if (bSignatureToAll && '' !== sSignature &&
|
||||
Enums.ComposeType.EditAsNew !== sComposeType)
|
||||
{
|
||||
sText = Utils.convertPlainTextToHtml(this.convertSignature(sSignature,
|
||||
fEmailArrayToStringLineHelper(oMessage.from, true))) + '<br />' + sText;
|
||||
|
@ -1312,6 +1326,7 @@ PopupsComposeViewModel.prototype.prepearMessageAttachments = function (oMessage,
|
|||
|
||||
case Enums.ComposeType.Forward:
|
||||
case Enums.ComposeType.Draft:
|
||||
case Enums.ComposeType.EditAsNew:
|
||||
bAdd = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,13 @@
|
|||
<span class="i18n" data-i18n-text="MESSAGE/BUTTON_FORWARD_AS_ATTACHMENT"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="e-item" data-bind="visible: !$root.isDraftFolder()">
|
||||
<a class="e-link" data-bind="command: $root.editAsNewCommand">
|
||||
<i class="icon-pencil"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="MESSAGE/BUTTON_EDIT_AS_NEW"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider" data-bind="visible: !$root.isDraftFolder()"></li>
|
||||
<li class="e-item">
|
||||
<a target="_blank" class="e-link" data-bind="click: function () { if (message()) { message().viewPopupMessage(); }}">
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Antworten"
|
|||
BUTTON_REPLY_ALL = "Allen antworten"
|
||||
BUTTON_FORWARD = "Weiterleiten"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Als Anhang weiterleiten"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Bilder anzeigen"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "In neuem Fenster anzeigen"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Reply"
|
|||
BUTTON_REPLY_ALL = "Reply All"
|
||||
BUTTON_FORWARD = "Forward"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Forward as attachment"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Display external images"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "View in separate window"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Responder"
|
|||
BUTTON_REPLY_ALL = "Responder Todos"
|
||||
BUTTON_FORWARD = "Reenviar"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Reenviar con adjuntos"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Mostrar imágenes"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Ver en una ventana nueva"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Répondre"
|
|||
BUTTON_REPLY_ALL = "Répondre à tous"
|
||||
BUTTON_FORWARD = "Transférer"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Transférer comme pièce-jointe"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Afficher les images"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "L'expéditeur a demandé à être prévenu lorsque vous lirez ce message."
|
||||
BUTTON_IN_NEW_WINDOW = "Voir dans une nouvelle fenêtre"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Svara"
|
|||
BUTTON_REPLY_ALL = "Svara öllum"
|
||||
BUTTON_FORWARD = "Áframsenda"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Áframsenda sem viðhengi"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Sýna myndir"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Skoða í öðrum glugga"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "답장"
|
|||
BUTTON_REPLY_ALL = "모두 답장"
|
||||
BUTTON_FORWARD = "전달"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "첨부파일로 전달"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "외부이미지 표시"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "분할화면에서 보기"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Atbildēt"
|
|||
BUTTON_REPLY_ALL = "Atbildēt visiem"
|
||||
BUTTON_FORWARD = "Pārsūtīt"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Pārsūtīt kā pielikumu"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Rādīt attēlus"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Skatīt jaunā logā"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Antwoorden"
|
|||
BUTTON_REPLY_ALL = "Allen beantwoorden"
|
||||
BUTTON_FORWARD = "Doorsturen"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Doorsturen als bijlage"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Toon afbeeldingen"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Toon in nieuw venster"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Svar"
|
|||
BUTTON_REPLY_ALL = "Svar alle"
|
||||
BUTTON_FORWARD = "Frem"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Videresend som vedlegg"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Vis eksterne bilder"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Vis i eget vindu"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Odpowiedz"
|
|||
BUTTON_REPLY_ALL = "Odpowiedz wszystkim"
|
||||
BUTTON_FORWARD = "Przekaż dalej"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Przekaż jako załącznik"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Wyświetl obrazy poniżej"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Wyświetl w osobnym oknie"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Responder"
|
|||
BUTTON_REPLY_ALL = "Responder a todos"
|
||||
BUTTON_FORWARD = "Enviar"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Enviar como anexo"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Exibir Imagens"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Ver em janela separada"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Responder"
|
|||
BUTTON_REPLY_ALL = "Responder a todos"
|
||||
BUTTON_FORWARD = "Enviar"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Enviar como anexo"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "Exibir Imagens"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "Ver em janela separada"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "Ответить на Письмо"
|
|||
BUTTON_REPLY_ALL = "Ответить Всем"
|
||||
BUTTON_FORWARD = "Переслать"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "Переслать как файл"
|
||||
BUTTON_EDIT_AS_NEW = "Редактировать как новое"
|
||||
BUTTON_SHOW_IMAGES = "Показать внешние изображения в письме"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "Уведомить отправителя о прочтении этого сообщения."
|
||||
BUTTON_IN_NEW_WINDOW = "В отдельном окне"
|
||||
|
|
|
@ -99,6 +99,7 @@ BUTTON_REPLY = "回复"
|
|||
BUTTON_REPLY_ALL = "全部回复"
|
||||
BUTTON_FORWARD = "转发"
|
||||
BUTTON_FORWARD_AS_ATTACHMENT = "带附件转发"
|
||||
BUTTON_EDIT_AS_NEW = "Edit as New"
|
||||
BUTTON_SHOW_IMAGES = "显示外部图片"
|
||||
BUTTON_NOTIFY_READ_RECEIPT = "The sender has asked to be notified when you read this message."
|
||||
BUTTON_IN_NEW_WINDOW = "在新窗口中查看"
|
||||
|
|
|
@ -344,7 +344,8 @@ Enums.ComposeType = {
|
|||
'ReplyAll': 'replyall',
|
||||
'Forward': 'forward',
|
||||
'ForwardAsAttachment': 'forward-as-attachment',
|
||||
'Draft': 'draft'
|
||||
'Draft': 'draft',
|
||||
'EditAsNew': 'editasnew'
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
2
rainloop/v/0.0.0/static/js/admin.min.js
vendored
2
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -344,7 +344,8 @@ Enums.ComposeType = {
|
|||
'ReplyAll': 'replyall',
|
||||
'Forward': 'forward',
|
||||
'ForwardAsAttachment': 'forward-as-attachment',
|
||||
'Draft': 'draft'
|
||||
'Draft': 'draft',
|
||||
'EditAsNew': 'editasnew'
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -8722,6 +8723,19 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
|
|||
this.subject(sSubject);
|
||||
this.prepearMessageAttachments(oMessage, sComposeType);
|
||||
|
||||
this.aDraftInfo = Utils.isNonEmptyArray(aDraftInfo) && 3 === aDraftInfo.length ? aDraftInfo : null;
|
||||
this.sInReplyTo = oMessage.sInReplyTo;
|
||||
this.sReferences = oMessage.sReferences;
|
||||
break;
|
||||
|
||||
case Enums.ComposeType.EditAsNew:
|
||||
this.to(fEmailArrayToStringLineHelper(oMessage.to));
|
||||
this.cc(fEmailArrayToStringLineHelper(oMessage.cc));
|
||||
this.bcc(fEmailArrayToStringLineHelper(oMessage.bcc));
|
||||
|
||||
this.subject(sSubject);
|
||||
this.prepearMessageAttachments(oMessage, sComposeType);
|
||||
|
||||
this.aDraftInfo = Utils.isNonEmptyArray(aDraftInfo) && 3 === aDraftInfo.length ? aDraftInfo : null;
|
||||
this.sInReplyTo = oMessage.sInReplyTo;
|
||||
this.sReferences = oMessage.sReferences;
|
||||
|
@ -8762,7 +8776,8 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
|
|||
break;
|
||||
}
|
||||
|
||||
if (bSignatureToAll && '' !== sSignature)
|
||||
if (bSignatureToAll && '' !== sSignature &&
|
||||
Enums.ComposeType.EditAsNew !== sComposeType)
|
||||
{
|
||||
sText = Utils.convertPlainTextToHtml(this.convertSignature(sSignature,
|
||||
fEmailArrayToStringLineHelper(oMessage.from, true))) + '<br />' + sText;
|
||||
|
@ -9320,6 +9335,7 @@ PopupsComposeViewModel.prototype.prepearMessageAttachments = function (oMessage,
|
|||
|
||||
case Enums.ComposeType.Forward:
|
||||
case Enums.ComposeType.Draft:
|
||||
case Enums.ComposeType.EditAsNew:
|
||||
bAdd = true;
|
||||
break;
|
||||
}
|
||||
|
@ -12102,6 +12118,7 @@ function MailBoxMessageViewViewModel()
|
|||
this.replyAllCommand = createCommandHelper(Enums.ComposeType.ReplyAll);
|
||||
this.forwardCommand = createCommandHelper(Enums.ComposeType.Forward);
|
||||
this.forwardAsAttachmentCommand = createCommandHelper(Enums.ComposeType.ForwardAsAttachment);
|
||||
this.editAsNewCommand = createCommandHelper(Enums.ComposeType.EditAsNew);
|
||||
|
||||
this.messageVisibilityCommand = Utils.createCommand(this, Utils.emptyFunction, this.messageVisibility);
|
||||
|
||||
|
|
10
rainloop/v/0.0.0/static/js/app.min.js
vendored
10
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