Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jenkins Folder Icon Modificator
//Put in $JENKINS_HOME/userContent/FolderIconModificator.js
//Using the Simple Theme Plugin you then add /userContent/FolderIconModificator.js as a JavaScript URL
(function(){
setTimeout(function(){
jQuery('.job-status-').map(function(i, job){
return job.id;
}.bind(this)).each(function(i, imageUrl){
jQuery.ajax({
type: "HEAD",
async: true,
url: '/userContent/' + imageUrl + '.png',
success: function(message){
var iconElement = jQuery('#' + imageUrl + ' > td:nth-child(1) > img')[0];
iconElement.src = '/userContent/' + imageUrl + '.png';
iconElement.removeClassName("icon-folder");
if(iconElement.style.height.indexOf('32px') != -1){
iconElement.setStyle("height: 40px; width: 40px; padding: 0 0 0 2px; margin 8px;")
}else{
iconElement.setStyle("padding: 0 0 0 2px; margin 8px;")
}
}.bind(this)
});
}.bind(this));
}, 300);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment