Skip to content
Snippets Groups Projects
Commit 12b9d158 authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #436 from nextcloud/feature/compose-new-message-shortcut

Add keyboard shortcut to compose a new message
parents f9a2c78f 188ad791
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,10 @@
<p>{{t 'Speed up your Mail experience with these quick shortcuts.'}}</p>
<dl>
<div>
<dt><kbd>C</kbd></dt>
<dd>{{t 'Compose new message'}}</dd>
</div>
<div>
<dt><kbd>K</kbd> or <kbd></kbd></dt>
<dd>{{t 'Newer message'}}</dd>
......
......@@ -39,7 +39,7 @@ define([
});
/* when everything went as expected on attachment upload */
it('uploads a new attachment on the server', function() {
it('uploads a new attachment on the server', function(done) {
spyOn(OC, 'generateUrl').and.returnValue('index.php/apps/mail/attachments');
jasmine.Ajax.stubRequest('index.php/apps/mail/attachments').andReturn({
......@@ -55,14 +55,16 @@ define([
.then(function(attachment, fileId) {
expect(jasmine.Ajax.requests.count()).toBe(1);
expect(jasmine.Ajax.requests.mostRecent().url).toBe('index.php/apps/mail/attachments');
done();
})
.catch(function(attachment) {
fail('Attachment upload is not supposed to fail');
.catch(function(error) {
console.error(error);
done.fail('Attachment upload is not supposed to fail', error);
});
});
/* when an error occurred on server side on attachment upload */
it('handles errors during attachment uploads', function() {
it('handles errors during attachment uploads', function(done) {
spyOn(OC, 'generateUrl').and.returnValue('index.php/apps/mail/attachments');
jasmine.Ajax.stubRequest('index.php/apps/mail/attachments').andReturn({
......@@ -75,11 +77,12 @@ define([
promise
.then(function(attachment, fileId) {
fail('Attachment upload is supposed to fail');
done.fail('Attachment upload is supposed to fail');
})
.catch(function(attachment) {
expect(jasmine.Ajax.requests.count()).toBe(1);
expect(jasmine.Ajax.requests.mostRecent().url).toBe('index.php/apps/mail/attachments');
done();
});
});
......
......@@ -179,6 +179,11 @@ define(function(require) {
event.preventDefault();
Radio.message.trigger('messagesview:message:prev');
break;
case 67:
// 'c' -> show new message composer
event.preventDefault();
Radio.ui.trigger('composer:show');
break;
case 82:
// 'r' -> refresh list of messages
event.preventDefault();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment