mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Typescript (first look)
This commit is contained in:
parent
3217303a65
commit
a74a92638a
17 changed files with 356 additions and 289 deletions
|
|
@ -11,6 +11,7 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
Spec = require('Common/Spec'),
|
||||
Links = require('Common/Links'),
|
||||
Audio = require('Common/Audio'),
|
||||
|
||||
|
|
@ -102,7 +103,7 @@
|
|||
this.friendlySize = Utils.friendlySize(this.estimatedSize);
|
||||
this.cidWithOutTags = this.cid.replace(/^<+/, '').replace(/>+$/, '');
|
||||
|
||||
this.fileNameExt = Utils.getFileExtension(this.fileName);
|
||||
this.fileNameExt = Spec.getFileExtension(this.fileName);
|
||||
this.fileType = AttachmentModel.staticFileType(this.fileNameExt, this.mimeType);
|
||||
|
||||
bResult = true;
|
||||
|
|
@ -488,7 +489,7 @@
|
|||
|
||||
aTypes = _.uniq(_.compact(_.map(aData, function (aItem) {
|
||||
return aItem ? AttachmentModel.staticFileType(
|
||||
Utils.getFileExtension(aItem[0]), aItem[1]) : '';
|
||||
Spec.getFileExtension(aItem[0]), aItem[1]) : '';
|
||||
})));
|
||||
|
||||
if (aTypes && 1 === aTypes.length && aTypes[0])
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
Spec = require('Common/Spec'),
|
||||
|
||||
AttachmentModel = require('Model/Attachment'),
|
||||
|
||||
|
|
@ -67,11 +68,11 @@
|
|||
}, this);
|
||||
|
||||
this.mimeType = ko.computed(function () {
|
||||
return Utils.mimeContentType(this.fileName());
|
||||
return Spec.mimeContentType(this.fileName());
|
||||
}, this);
|
||||
|
||||
this.fileExt = ko.computed(function () {
|
||||
return Utils.getFileExtension(this.fileName());
|
||||
return Spec.getFileExtension(this.fileName());
|
||||
}, this);
|
||||
|
||||
this.regDisposables([this.progressText, this.progressStyle, this.title, this.friendlySize, this.mimeType, this.fileExt]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue