Skip to content

Instantly share code, notes, and snippets.

@alexgb
Last active August 29, 2015 14:09
Show Gist options
  • Save alexgb/0fca7ca219a71b9398b7 to your computer and use it in GitHub Desktop.
Save alexgb/0fca7ca219a71b9398b7 to your computer and use it in GitHub Desktop.
var match = location.href.match(/trello\.com\/([[cb])\/(.*)\//),
boardId;
if (match[1] === 'c') {
boardId = window.IdCache.getBoardIdForCard(match[2]);
} else {
boardId = window.IdCache.getBoardId(match[2]);
}
$.ajax('/1/boards/' + boardId).then(function(board) {
localStorage.setItem('copiedLabels', JSON.stringify(board.labelNames));
console.log('Copied labels:', board.labelNames);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment