3 ms·
I whipped up a quick implementation of Send & Archive for fun which you can hook up with something like Greasemonkey: O.require(['mail', 'compose'], function
by chrismorgan 9y ago
I whipped up a quick implementation of Send & Archive for fun which you can hook up with something like Greasemonkey:
O.require(['mail', 'compose'], function () {
const composeController = FastMail.mail.screens.compose;
const mailActions = FastMail.mail.actions;
const mailToolbar = FastMail.views.mailToolbar;
mailToolbar.registerView('sendArchive', new O.ButtonView({
type: 's-send',
icon: 'icon-paper-plane',
_isSending: O.bind(composeController, 'instance.isSending'),
_mayMove: O.bind(mailActions, 'mayMove'),
isDisabled: function () {
return this.get('_isSending') || !this.get('_mayMove');
}.property('_isSending', '_mayMove'),
label: O.loc('Send & Archive'),
target: {
doIt: function () {
composeController.fire('send');
mailActions.archive();
}
},
method: 'doIt',
shortcut: 'cmd-shift-enter', // (Fairly arbitrarily chosen.)
}));
const config = O.clone(mailToolbar._configs.compose);
config.left.splice(config.left.indexOf('send'), 0, 'sendArchive', '-');
mailToolbar.registerConfig('compose', config);
});
It’s not elegant, but it works. It’ll probably break when the web UI switches to JMAP some time next year.