Skip to content

Instantly share code, notes, and snippets.

@shesek
Last active October 8, 2015 22:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shesek/3401315 to your computer and use it in GitHub Desktop.
Save shesek/3401315 to your computer and use it in GitHub Desktop.
Trello - view cards you can work on
javascript:(function(){var a,b;a=function(a){return function(){return!!~(this.alt||this.title).indexOf(a)}}($(".member-avatar").attr("title").match(/\(([\w\-]+)\)$/)[1]),b=function(){var b;return!(b=$(this).find(".member img,.member-initials")).length||b.filter(a).length},$("#board").addClass("filtering").find(".list-card").addClass("hide").filter(b).removeClass("hide")})()
# Shows cards that are "workable" by you, meaning they're either assigned to you or unassigned.
# Press "x" to return to normal mode.
# I got annoyed by having to manually look for cards that I can work on when pulling cards from the sprint to WIP,
# so I hacked that together.
is_me = do (me = $(".member-avatar").attr("title").match(/\(([\w\-]+)\)$/)[1]) ->
-> !!~(@alt or @title).indexOf me
is_workable = ->
not (members=$(this).find '.member img,.member-initials').length \
or (members.filter is_me).length
$("#board").addClass("filtering")
.find(".list-card").addClass("hide")
.filter(is_workable).removeClass("hide")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment