kreativgebiet / taskana

Application wrapper for Asana web application
http://kreativgebiet.github.io/taskana
11 stars 7 forks source link

Keyboard Shortcuts (under the Task Menu) don't work #7

Open mountainash opened 4 years ago

mountainash commented 4 years ago

No actions are triggered.

mountainash commented 4 years ago

I tried to re-create the keyboard short-cuts that Asana has as I figure they’ll be unlikely to change. But every time I trigger a TAB key, their website has an error and needs reloading. I’ll keep trying.

var _tab_on = new KeyboardEvent('keydown', {
    key: 'Tab',
    code: 'tab',
    keyCode: 9,
    which: 9
});
document.dispatchEvent(_tab_on);
mountainash commented 4 years ago

Looking into the 14.8 MB !!!! Javascript file running Asana - https://d3ki9tyy5l5ruj.cloudfront.net/compressed/build/bundles/c62a8798bcbcee63f855772110bf2f2b3dabc013/apps/asana/bundle.js to see what can be hooked on to.

14.8 MB... need to make sure that Taskana is caching - that's massive!

mountainash commented 4 years ago

So Asana is written in React making it very hard to hook to anything solid inside the minified code. Went back to trying to recreate keyboard combos in Javascript. It's possible, but Asana still doesn't like the Tab key. Here's a little keycombo trigger script:

function keySequence(keys) {
  for (var keys = keys.split(' '); keys.length;) {
    nextKey = keys.shift();
    window.dispatchEvent(new KeyboardEvent('keydown', {key: nextKey}))
  }
}
keySequence('Tab q');