Skip to content

Instantly share code, notes, and snippets.

@dracos
Last active December 15, 2015 23:59
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 dracos/5344812 to your computer and use it in GitHub Desktop.
Save dracos/5344812 to your computer and use it in GitHub Desktop.
This basic GM script adds a "Pull requests only" tickbox to your dashboard issue pages on GitHub; clicking it hides non-PR issues. It doesn't work over pagination (without a refresh) or other things like that.
// ==UserScript==
// @name GitHub Assigned Issues Pull Requests tickbox
// @namespace github-assigned-issues-pull-requests
// @version 1.0
// @description Show only pull requests on the Assigned Issues dashboard page (e.g. https://github.com/dashboard/issues/assigned or the similar org page)
// @match *://github.com/dashboard/issues/*
// @match *://github.com/organizations/*/dashboard/issues/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @author Matthew Somerville >> https://github.com/dracos
// ==/UserScript==
$('.issues-list-options').append('<div class="button-group"><label><input type="checkbox" id="pull_requests_only" value="1"> Pull requests only</label></div>');
$('#pull_requests_only').change(function(){
var lis = $('.mini-icon-issue-opened').add('.mini-icon-issue-closed').closest('li'),
count = $('.filter-item.selected span.count');
if ($(this).prop("checked")) {
lis.hide();
var c = count.text();
count.data('c', c);
count.text(c-lis.length);
} else {
lis.show();
count.text(count.data('c'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment