Skip to content

Instantly share code, notes, and snippets.

@mackuba
Created October 24, 2011 13:04
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 mackuba/1308970 to your computer and use it in GitHub Desktop.
Save mackuba/1308970 to your computer and use it in GitHub Desktop.
Kanbanery multi-task-type filter
javascript:(function() { var list = prompt("Enter list of task types to show, separated by commas (leave empty to show all):"); var wait = $("<p>Please wait…</p>").css({ 'font-size': '20px', 'color': 'white', position: 'absolute', top: '10px', left: '500px', width: '150px' }).appendTo($('body')); setTimeout(function() { if (!list) { $('.task-view').each(function(i, t) { $(t).show() }); } else { $('li.placeholder').each(function(i, pl) { $(pl).view().showRealView() }); var types = _.map(list.split(','), function(el) { return $.trim(el.toLowerCase()) }); $('.task-view').each(function(i, t) { var label = $('.disp-task-type-name', t); var type = $.trim($(label).text().toLowerCase()); if (_.indexOf(types, type) == -1) { $(t).hide(); } else { $(t).show(); } }); } wait.remove(); }, 10);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment