Cleanup some code

This commit is contained in:
djmaze 2020-09-19 13:53:14 +02:00
parent 3ea2f5f452
commit 9fc5a3ff6a
6 changed files with 31 additions and 25 deletions

View file

@ -91,23 +91,23 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|js/* |1.14.0 |native |
|----------- |--------: |--------: |
|admin.js |2.130.942 | 855.381 |
|app.js |4.184.455 |2.498.825 |
|admin.js |2.130.942 | 855.305 |
|app.js |4.184.455 |2.494.229 |
|boot.js | 671.522 | 5.777 |
|libs.js | 647.614 | 326.075 |
|libs.js | 647.614 | 320.872 |
|polyfills.js | 325.834 | 0 |
|TOTAL |7.960.367 |3.686.058 |
|TOTAL |7.960.367 |3.676.183 |
|js/min/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|--------------- |--------: |--------: |--------: |--------: |--------: |
|admin.min.js | 252.147 | 117.342 | 73.657 | 33.520 | 28.941 |
|app.min.js | 511.202 | 340.862 |140.462 | 89.653 | 72.639 |
|admin.min.js | 252.147 | 117.361 | 73.657 | 33.500 | 28.906 |
|app.min.js | 511.202 | 340.564 |140.462 | 89.522 | 72.478 |
|boot.min.js | 66.007 | 3.117 | 22.567 | 1.563 | 1.333 |
|libs.min.js | 572.545 | 302.989 |176.720 | 94.417 | 83.208 |
|libs.min.js | 572.545 | 297.806 |176.720 | 93.005 | 82.087 |
|polyfills.min.js | 32.452 | 0 | 11.312 | 0 | 0 |
|TOTAL |1.434.353 | 764.310 |424.718 |219.153 |186.121 |
|TOTAL |1.434.353 | 758.848 |424.718 |217.590 |184.804 |
670.043 bytes (205.565 gzip) is almost 50% smaller and it feels faster.
675.505 bytes (207.128 gzip) is around 48% smaller and faster.
### CSS changes
@ -132,9 +132,9 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|css/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|-------------- |-------: |-------: |------: |------: |------: |
|app.css | 340.334 | 254.033 | 46,959 | 36.648 | 30.815 |
|app.min.css | 274.791 | 207.558 | 39.618 | 32.050 | 27.234 |
|boot.css | | 2.538 | | 837 | 668 |
|app.css | 340.334 | 254.180 | 46,959 | 36.648 | 30.815 |
|app.min.css | 274.791 | 207.630 | 39.618 | 32.050 | 27.234 |
|boot.css | | 2.534 | | 837 | 668 |
|boot.min.css | | 2.055 | | 732 | 560 |

View file

@ -90,6 +90,7 @@ ko.bindingHandlers.emailsTags = {
}
};
// Start dragging selected messages
ko.bindingHandlers.draggable = {
init: (element, fValueAccessor) => {
if (!rl.settings.app('mobile')) {
@ -98,6 +99,7 @@ ko.bindingHandlers.draggable = {
}
};
// Drop selected messages on folder
ko.bindingHandlers.droppable = {
init: (element, fValueAccessor) => {
if (!rl.settings.app('mobile')) {

View file

@ -67,6 +67,21 @@ class ComposeAttachmentModel extends AbstractModel {
]);
}
static fromAttachment(item)
{
const attachment = new ComposeAttachmentModel(
item.download,
item.fileName,
item.estimatedSize,
item.isInline,
item.isLinked,
item.cid,
item.contentLocation
);
attachment.fromMessage = true;
return attachment;
}
/**
* @param {AjaxJsonComposeAttachment} json
* @returns {boolean}

View file

@ -1390,17 +1390,7 @@ class ComposePopupView extends AbstractViewNext {
}
if (add) {
const attachment = new ComposeAttachmentModel(
item.download,
item.fileName,
item.estimatedSize,
item.isInline,
item.isLinked,
item.cid,
item.contentLocation
);
attachment.fromMessage = true;
const attachment = ComposeAttachmentModel.fromAttachment(item);
attachment.cancel = this.cancelAttachmentHelper(item.download);
attachment
.waiting(false)

View file

@ -85,7 +85,6 @@
"gulp-util": "3.0.8",
"gulp-zip": "5.0.1",
"jquery": "^3.5.1",
"knockout-sortable": "1.2.0",
"moment": "2.24.0",
"node-fs": "0.1.7",
"openpgp": "2.6.2",

View file

@ -88,7 +88,7 @@ config.paths.js = {
'vendors/qr.js/qr.min.js', // fixed (license)
'vendors/bootstrap/js/bootstrap.native.min.js', // fixed
'vendors/knockout/build/output/knockout-latest.js',
'node_modules/knockout-sortable/build/knockout-sortable.min.js ',
'vendors/knockout-sortable/build/knockout-sortable.min.js ',
'node_modules/simplestatemanager/dist/ssm.min.js',
'vendors/lightgallery/dist/js/lightgallery.min.js', // license
'vendors/lightgallery/dist/js/lg-fullscreen.min.js',