Created
September 24, 2015 09:27
-
-
Save abcang/726185c7c019f3b34abc to your computer and use it in GitHub Desktop.
bitbucket_hide_approved_pull_requests_mod.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name bitbucket_hide_approved_pull_requests mod | |
// @namespace http://abcang.net | |
// @version 0.2 | |
// @description Bitbucket_hide_approved_pull_requests | |
// @author ABCanG | |
// @match https://bitbucket.org/*/*/pull-requests* | |
// @grant none | |
// ==/UserScript== | |
// original https://gist.github.com/asakura-dev/06add1d2a9b362faf928 | |
$('body').append('<style>#hide-approved-pull-requests > button{display: block;float: left;cursor: pointer;outline: none;margin: 0 0 15px 0;padding:5px 10px;background: #ddd;color: #555;font-size: 13px;text-align: center;font-weight:normal;border:none;}#hide-approved-pull-requests > button:hover{background-color: #555;color: #fff;}#hide-approved-pull-requests > button.actived{display: block;float: left;cursor: pointer;margin: 0 0 15px 0;padding:5px 10px;background-color: #555;color: #fff;font-size: 13px;text-align: center;font-weight:normal;border:none;}</style>'); | |
$('#list-pullrequests > header').append('<div class="filter-container" id="hide-approved-pull-requests"><button id="all-pullrequests"class="actived">すべて</button><button id="not-approved-pullrequests">未承認のみ</button></div>'); | |
$('#all-pullrequests').on('click',function(){ | |
if(!$(this).hasClass('actived')){ | |
$(this).addClass('actived'); | |
$('#not-approved-pullrequests').removeClass('actived'); | |
$('.iterable-item:has(.approved)').css('display', ''); | |
} | |
}); | |
$('#not-approved-pullrequests').on('click',function(){ | |
if(!$(this).hasClass('actived')){ | |
$(this).addClass('actived'); | |
$('#all-pullrequests').removeClass('actived'); | |
$('.iterable-item:has(.approved)').css('display', 'none'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment