Skip to content

Instantly share code, notes, and snippets.

@djm
Forked from Geekfish/bookmarklets.js
Created September 26, 2016 13:22
Show Gist options
  • Save djm/4c5f0e25f0916f0470096053c3b2247d to your computer and use it in GitHub Desktop.
Save djm/4c5f0e25f0916f0470096053c3b2247d to your computer and use it in GitHub Desktop.
Trello Card bookmarklets
// Get Card's last URL segment (eg 4468-fix-the-login-page):
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('', window.location.href.split("/").pop().split("#")[0])})()
// Get Card's full hash (eg 5731b92ef660293533517de9) :
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}$('.js-more-menu').click(); prompt('', $('.js-export-json').attr('href').split("/")[2]); $('.js-more-menu').click();})()
// Get Card's unique id (board-independent, eg rKBmQeOk) :
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}$('.js-more-menu').click(); prompt('', $('.js-short-url').attr('value').split("/").slice(-1)[0]); $('.js-more-menu').click();})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment