Fork me on GitHub

Why MG doesn't exactly do the same like before?

24/05/2012 development

First of all, this will be a development post, so maybe incomprehensible for someone.

Roland F. pointed out, what is the problem:

Just one thing: drag up was not only go to inbox in the original version. go back to the inbox or the label/folder of the current mail would be better.

I know that and I would like that too. But it is impossible. My first idea was to emulate Gmail's hotkeys.

Drag left or right is equivalent pressing j or k. I wanted to trigger key down javascript event. I made this simple code:

var event = document.createEvent("KeyboardEvents");
event.initKeyboardEvent('keypress', true, true, null, key, 100, '');
event.keyCode = key.charCodeAt(0);
event.charCode = key.charCodeAt(0);
document.dispatchEvent(event);

Where key variable is j or k. Unfortunately chome has a bug: keyCode and charCode is read-only in webkit (probably gmail is using those). If I decided to make firefox version, it is functioning normally. I tried with TextEvent, jQuery keydown, keypress and keyup events too. Neither works.

If you have any free minutes, write a comment here for hurry up Chrome developers. Any ideas are welcome!

This is a dead-end road. I decided to switch to mouse click event and it roughly works! Drag up gesture is clicking on the 'Inbox' button, I wanted to target the 'Back to somewhere' button but it failed. I will try it again later.

I would like to make a built-in notification when fire at every new release, so when it's done the next release will be  goes to market.