New Message View (with attachments thumbnails)

This commit is contained in:
RainLoop Team 2014-12-24 21:55:18 +04:00
parent 1c7f1928c7
commit 06e6f1a2da
22 changed files with 3046 additions and 162 deletions

View file

@ -27,6 +27,7 @@
this.friendlySize = '';
this.isInline = false;
this.isLinked = false;
this.isThumbnail = false;
this.cid = '';
this.cidWithOutTags = '';
this.contentLocation = '';
@ -56,6 +57,7 @@
AttachmentModel.prototype.friendlySize = '';
AttachmentModel.prototype.isInline = false;
AttachmentModel.prototype.isLinked = false;
AttachmentModel.prototype.isThumbnail = false;
AttachmentModel.prototype.cid = '';
AttachmentModel.prototype.cidWithOutTags = '';
AttachmentModel.prototype.contentLocation = '';
@ -78,6 +80,7 @@
this.estimatedSize = Utils.pInt(oJsonAttachment.EstimatedSize);
this.isInline = !!oJsonAttachment.IsInline;
this.isLinked = !!oJsonAttachment.IsLinked;
this.isThumbnail = !!oJsonAttachment.IsThumbnail;
this.cid = oJsonAttachment.CID;
this.contentLocation = oJsonAttachment.ContentLocation;
this.download = oJsonAttachment.Download;
@ -106,6 +109,14 @@
);
};
/**
* @return {boolean}
*/
AttachmentModel.prototype.hasThumbnail = function ()
{
return this.isThumbnail;
};
/**
* @return {boolean}
*/
@ -132,6 +143,14 @@
!this.isPdf() && !this.isText() && !this.isImage();
};
/**
* @return {boolean}
*/
AttachmentModel.prototype.hasPreview = function ()
{
return this.isImage() || this.isPdf() || this.isText() || this.isFramed();
};
/**
* @return {string}
*/
@ -148,6 +167,15 @@
return Links.attachmentPreview(this.download);
};
/**
* @return {string}
*/
AttachmentModel.prototype.linkThumbnailPreviewStyle = function ()
{
return !this.hasThumbnail() ? '' :
'background:url(' + Links.attachmentThumbnailPreview(this.download) + ')';
};
/**
* @return {string}
*/