Skip to content

Instantly share code, notes, and snippets.

@alexkuc
Created Apr 30, 2020
Embed
What would you like to do?
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