Skip to content

Instantly share code, notes, and snippets.

@alexkuc
Created April 30, 2020 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkuc/bf8f70894b78f45a000905f32a78ec5b to your computer and use it in GitHub Desktop.
Save alexkuc/bf8f70894b78f45a000905f32a78ec5b to your computer and use it in GitHub Desktop.
Open Trello card, hover over task item, press shift+F1… Now your task's text is copied to clipboard!
// I have used this script with Tampermonkey to automatically inject it
const $ = window.$;
window.task = '';
const bind = () => {
$('.checklist-item-details-text').each( (i, el) => {
if ( el.classList.contains('mouseenter-event') ) { return };
$(el).mouseenter( e => { window.task = e.currentTarget.innerText } );
el.classList.add('mouseenter-event');
});
};
$(document).keydown( e => {
if (e.keyCode === 112 && e.shiftKey) { navigator.clipboard.writeText(window.task) }
});
function check() {
if ($('body.window-up').length) {
bind();
return setTimeout(check, 1000);
}
return setTimeout(check, 1000);
}
check();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment