mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 08:24:50 +03:00
Use jQuery.slim
Underscore.js _.uniq(_.compact( to native Array.filter((value, index, self) => !!value && self.indexOf(value) == index) Underscore.js _.compact to native Array.filter(value => !!value) Underscore.js _.uniq to native Array.filter((value, index, self) => self.indexOf(value) == index) Underscore.js _.values to native Object.values Underscore.js _.flatten to native Array.flat Underscore.js _.union to native Array.concat + unique filter Underscore.js _.reduce to native Array.reduce Underscore.js _.escape replaced with advanced htmlspecialchars() Underscore.js _.memoize replaced Now Underscore.js is a slim custom version (only _.debounce, _.defer & _.throttle)
This commit is contained in:
parent
996a71ad8a
commit
dca0ff02ed
27 changed files with 515 additions and 353 deletions
|
|
@ -453,11 +453,11 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
|||
// aTo = [],
|
||||
// EmailModel = require('Model/Email').default,
|
||||
// fParseEmailLine = function(sLine) {
|
||||
// return sLine ? _.compact([window.decodeURIComponent(sLine)].map(sItem => {
|
||||
// return sLine ? [window.decodeURIComponent(sLine)].map(sItem => {
|
||||
// var oEmailModel = new EmailModel();
|
||||
// oEmailModel.parse(sItem);
|
||||
// return '' !== oEmailModel.email ? oEmailModel : null;
|
||||
// })) : null;
|
||||
// }).filter(value => !!value) : null;
|
||||
// }
|
||||
// ;
|
||||
//
|
||||
|
|
@ -477,26 +477,24 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
|||
listIndex = 0;
|
||||
|
||||
const div = $('<div>'),
|
||||
dynamicEls = _.compact(
|
||||
this.message().attachments().map(item => {
|
||||
if (item && !item.isLinked && item.isImage()) {
|
||||
if (item === attachment) {
|
||||
index = listIndex;
|
||||
}
|
||||
|
||||
listIndex += 1;
|
||||
|
||||
return {
|
||||
src: item.linkPreview(),
|
||||
thumb: item.linkThumbnail(),
|
||||
subHtml: item.fileName,
|
||||
downloadUrl: item.linkPreview()
|
||||
};
|
||||
dynamicEls = this.message().attachments().map(item => {
|
||||
if (item && !item.isLinked && item.isImage()) {
|
||||
if (item === attachment) {
|
||||
index = listIndex;
|
||||
}
|
||||
|
||||
return null;
|
||||
})
|
||||
);
|
||||
listIndex += 1;
|
||||
|
||||
return {
|
||||
src: item.linkPreview(),
|
||||
thumb: item.linkThumbnail(),
|
||||
subHtml: item.fileName,
|
||||
downloadUrl: item.linkPreview()
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}).filter(value => !!value);
|
||||
|
||||
if (0 < dynamicEls.length) {
|
||||
div.on('onBeforeOpen.lg', () => {
|
||||
|
|
@ -885,7 +883,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
|
|||
|
||||
getAttachmentsHashes() {
|
||||
const atts = this.message() ? this.message().attachments() : [];
|
||||
return _.compact(atts.map(item => (item && !item.isLinked && item.checked() ? item.download : '')));
|
||||
return atts.map(item => (item && !item.isLinked && item.checked() ? item.download : '')).filter(value => !!value);
|
||||
}
|
||||
|
||||
downloadAsZip() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue