Skip to content

Instantly share code, notes, and snippets.

@O5ten
Created September 15, 2018 21:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save O5ten/d582a120f7def58d85ccb82003ca8129 to your computer and use it in GitHub Desktop.
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