mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Bugfix: conflicting File object with native JS
Cleanup: Stores and tooltips
This commit is contained in:
parent
1df2e00862
commit
db0d03db83
43 changed files with 204 additions and 295 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { File, FileType } from 'Common/File';
|
||||
import { FileInfo, FileType } from 'Common/File';
|
||||
import {
|
||||
attachmentDownload,
|
||||
serverRequestRaw
|
||||
|
|
@ -44,11 +44,11 @@ export class AttachmentModel extends AbstractModel {
|
|||
static reviveFromJson(json) {
|
||||
const attachment = super.reviveFromJson(json);
|
||||
if (attachment) {
|
||||
attachment.friendlySize = File.friendlySize(json.EstimatedSize);
|
||||
attachment.friendlySize = FileInfo.friendlySize(json.EstimatedSize);
|
||||
attachment.cidWithoutTags = attachment.cid.replace(/^<+/, '').replace(/>+$/, '');
|
||||
|
||||
attachment.fileNameExt = File.getExtension(attachment.fileName);
|
||||
attachment.fileType = File.getType(attachment.fileNameExt, attachment.mimeType);
|
||||
attachment.fileNameExt = FileInfo.getExtension(attachment.fileName);
|
||||
attachment.fileType = FileInfo.getType(attachment.fileNameExt, attachment.mimeType);
|
||||
}
|
||||
return attachment;
|
||||
}
|
||||
|
|
@ -211,13 +211,13 @@ export class AttachmentModel extends AbstractModel {
|
|||
* @returns {string}
|
||||
*/
|
||||
iconClass() {
|
||||
return File.getTypeIconClass(this.fileType)[0];
|
||||
return FileInfo.getTypeIconClass(this.fileType)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
iconText() {
|
||||
return File.getTypeIconClass(this.fileType)[1];
|
||||
return FileInfo.getTypeIconClass(this.fileType)[1];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { pInt } from 'Common/Utils';
|
||||
import { File } from 'Common/File';
|
||||
import { FileInfo } from 'Common/File';
|
||||
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
||||
|
|
@ -51,11 +51,11 @@ export class ComposeAttachmentModel extends AbstractModel {
|
|||
|
||||
friendlySize: () => {
|
||||
const localSize = this.size();
|
||||
return null === localSize ? '' : File.friendlySize(localSize);
|
||||
return null === localSize ? '' : FileInfo.friendlySize(localSize);
|
||||
},
|
||||
|
||||
mimeType: () => File.getContentType(this.fileName()),
|
||||
fileExt: () => File.getExtension(this.fileName())
|
||||
mimeType: () => FileInfo.getContentType(this.fileName()),
|
||||
fileExt: () => FileInfo.getExtension(this.fileName())
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -96,13 +96,13 @@ export class ComposeAttachmentModel extends AbstractModel {
|
|||
* @returns {string}
|
||||
*/
|
||||
iconClass() {
|
||||
return File.getIconClass(this.fileExt(), this.mimeType())[0];
|
||||
return FileInfo.getIconClass(this.fileExt(), this.mimeType())[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
iconText() {
|
||||
return File.getIconClass(this.fileExt(), this.mimeType())[1];
|
||||
return FileInfo.getIconClass(this.fileExt(), this.mimeType())[1];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { serverRequestRaw } from 'Common/Links';
|
|||
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
|
||||
import { File } from 'Common/File';
|
||||
import { FileInfo } from 'Common/File';
|
||||
import { AttachmentCollectionModel } from 'Model/AttachmentCollection';
|
||||
import { EmailCollectionModel } from 'Model/EmailCollection';
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
|
@ -85,7 +85,7 @@ export class MessageModel extends AbstractModel {
|
|||
this.threads = ko.observableArray();
|
||||
|
||||
this.addComputables({
|
||||
attachmentIconClass: () => File.getCombinedIconClass(this.hasAttachments() ? this.attachmentsSpecData() : []),
|
||||
attachmentIconClass: () => FileInfo.getCombinedIconClass(this.hasAttachments() ? this.attachmentsSpecData() : []),
|
||||
threadsLen: () => this.threads.length,
|
||||
isImportant: () => MessagePriority.High === this.priority(),
|
||||
});
|
||||
|
|
@ -169,7 +169,7 @@ export class MessageModel extends AbstractModel {
|
|||
* @returns {string}
|
||||
*/
|
||||
friendlySize() {
|
||||
return File.friendlySize(this.size());
|
||||
return FileInfo.friendlySize(this.size());
|
||||
}
|
||||
|
||||
computeSenderEmail() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue