mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Add TEST and PDF attachment preview (close #40)
This commit is contained in:
parent
50f16ea7b7
commit
a8a21f42f7
7 changed files with 99 additions and 10 deletions
|
|
@ -53,7 +53,7 @@ AttachmentModel.prototype.initByJson = function (oJsonAttachment)
|
|||
var bResult = false;
|
||||
if (oJsonAttachment && 'Object/Attachment' === oJsonAttachment['@Object'])
|
||||
{
|
||||
this.mimeType = oJsonAttachment.MimeType;
|
||||
this.mimeType = (oJsonAttachment.MimeType || '').toLowerCase();
|
||||
this.fileName = oJsonAttachment.FileName;
|
||||
this.estimatedSize = Utils.pInt(oJsonAttachment.EstimatedSize);
|
||||
this.isInline = !!oJsonAttachment.IsInline;
|
||||
|
|
@ -90,7 +90,16 @@ AttachmentModel.prototype.isImage = function ()
|
|||
*/
|
||||
AttachmentModel.prototype.isText = function ()
|
||||
{
|
||||
return 'text/' === this.mimeType.substr(0, 5);
|
||||
return 'text/' === this.mimeType.substr(0, 5) &&
|
||||
-1 === Utils.inArray(this.mimeType, ['text/html']);
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
AttachmentModel.prototype.isPdf = function ()
|
||||
{
|
||||
return Globals.bAllowPdfPreview && 'application/pdf' === this.mimeType;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue