Created by
Abdulrazaq Omar
| // ==UserScript==
// @name Jira Admin Project Searcher
// @match http*://*/*/project/ViewProjects.jspa
// @grant none
// ==/UserScript==
(function() {
'use strict';
// create case-insensitive text selector
jQuery.expr[":"].icontains = function(obj,index,meta) {
return jQuery(obj).text().toUpperCase().indexOf(meta[3].toUpperCase()) >= 0;
};
var nameSearchBox = AJS.$("<input type='text' placeholder='search...'>");
AJS.$("#project-list th:nth-child(2)").first().append(AJS.$("<br>")).append(nameSearchBox);
nameSearchBox.keyup(function() {
AJS.$('#project-list>tbody>tr').css('display','none');
AJS.$('#project-list td[data-cell-type="name"] a:icontains("' + this.value + '")').each(
function() {
AJS.$(this).parent().parent().css('display','');
}
);
});
var keySearchBox = AJS.$("<input type='text' placeholder='search...'>");
AJS.$("#project-list th:nth-child(3)").first().append(AJS.$("<br>")).append(keySearchBox);
keySearchBox.keyup(function() {
AJS.$('#project-list>tbody>tr').css('display','none');
AJS.$('#project-list td[data-cell-type="key"]:icontains("' + this.value + '")').each(
function() {
AJS.$(this).parent().css('display','');
}
);
});
})();
|