Skip to content

Instantly share code, notes, and snippets.

@tkrkt
Last active March 28, 2016 15:04
Show Gist options
  • Save tkrkt/6d2c4d67c340c1c5082b to your computer and use it in GitHub Desktop.
Save tkrkt/6d2c4d67c340c1c5082b to your computer and use it in GitHub Desktop.
Trelloで何もカード選択してない時でもカーソルキー効くようにするグリモン
// ==UserScript==
// @name TrelloCardSelector
// @namespace jp.tkrkt
// @description フォーカスしてない時でもキーボードでカードを選択
// @include https://trello.com/b/*/*
// @version 1.1
// @grant none
// ==/UserScript==
document.addEventListener('keydown', (event) => {
if (36 < event.keyCode && event.keyCode < 41) { // is cursor key
if (!document.querySelector('.list-card.active-card')) { // is not active
var firstItem = document.querySelector('.list-card');
firstItem.dispatchEvent(new MouseEvent('mousemove'));
return false;
}
}
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment