Skip to content
Permalink
Browse files

[FIXED JENKINS-15510]

Added the "unknown" image and honor the running image properly for running jobs.
  • Loading branch information...
kohsuke committed Mar 1, 2013
1 parent bb17874 commit 3bc147f658537c8ec299be441a9b8eae24a1efa0
Showing with 13 additions and 7 deletions.
  1. +13 −7 src/main/java/org/jenkinsci/plugins/badge/BadgeActionFactory.java
@@ -15,13 +15,16 @@
*/
@Extension
public class BadgeActionFactory extends TransientProjectActionFactory {
private final StatusImage[] images = new StatusImage[4];
private final StatusImage[] images;

public BadgeActionFactory() throws IOException {
images[0] = new StatusImage("failure.png");
images[1] = new StatusImage("unstable.png");
images[2] = new StatusImage("success.png");
images[3] = new StatusImage("running.png");
images = new StatusImage[] {
new StatusImage("failure.png"),
new StatusImage("unstable.png"),
new StatusImage("success.png"),
new StatusImage("running.png"),
new StatusImage("unknown.png")
};
}

@Override
@@ -30,7 +33,10 @@ public BadgeActionFactory() throws IOException {
}

public StatusImage getImage(BallColor color) {
switch (color.noAnime()) {
if (color.isAnimated())
return images[3];

switch (color) {
case RED:
case ABORTED:
return images[0];
@@ -39,7 +45,7 @@ public StatusImage getImage(BallColor color) {
case BLUE:
return images[2];
default:
return images[3];
return images[4];
}
}

0 comments on commit 3bc147f

Please sign in to comment.
You can’t perform that action at this time.