Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-16571] Prefix all static icon URLs with RESOURCE_PREFIX.
  • Loading branch information
uhafner committed Feb 12, 2013
1 parent edc8228 commit 5c7bcfb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
11 changes: 8 additions & 3 deletions pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-pom</artifactId>
<version>1.40</version>
<version>1.41</version>
<relativePath>../analysis-pom/pom.xml</relativePath>
</parent>

Expand All @@ -17,6 +17,11 @@
<url>http://wiki.jenkins-ci.org/x/CwDgAQ</url>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ant</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>de.java2html</groupId>
<artifactId>java2html</artifactId>
Expand Down Expand Up @@ -58,6 +63,6 @@
</plugins>
</build>

</project>
</project>


Expand Up @@ -7,6 +7,8 @@

import javax.annotation.CheckForNull;

import jenkins.model.Jenkins;

import org.jvnet.localizer.Localizable;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -338,7 +340,7 @@ protected GraphConfiguration createConfiguration(final List<BuildResultGraph> av
public String getIconFileName() {
ResultAction<?> lastAction = getLastAction();
if (lastAction != null && lastAction.getResult().hasAnnotations()) {
return iconUrl;
return Jenkins.RESOURCE_PATH + "/" + iconUrl;
}
return null;
}
Expand Down
Expand Up @@ -3,6 +3,8 @@
import java.util.List;
import java.util.Map;

import jenkins.model.Jenkins;

import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.StaplerProxy;

Expand Down Expand Up @@ -166,7 +168,11 @@ public String getSmallImageName() {
* @return the URL of the image
*/
protected String getSmallImage() {
return getDescriptor().getIconUrl();
return createStaticIconUrl(getDescriptor().getIconUrl());
}

private String createStaticIconUrl(final String iconUrl) {
return Jenkins.RESOURCE_PATH + "/" + iconUrl;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/hudson/plugins/analysis/core/BuildResult.java
Expand Up @@ -13,6 +13,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import jenkins.model.Jenkins;

import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
Expand Down Expand Up @@ -1388,9 +1390,7 @@ private String getReferenceBuildUrl() {
* @return the icon for the build result
*/
public String getResultIcon() {
String rootUrl = Hudson.getInstance().getRootUrl();

String message = "<img src=\"" + rootUrl + "/images/16x16/%s\" alt=\"%s\" title=\"%s\"/>";
String message = "<img src=\"" + Jenkins.RESOURCE_PATH + "/images/16x16/%s\" alt=\"%s\" title=\"%s\"/>";
if (pluginResult == Result.FAILURE) {
return String.format(message, FAILED,
hudson.model.Messages.BallColor_Failed(), hudson.model.Messages.BallColor_Failed());
Expand Down

0 comments on commit 5c7bcfb

Please sign in to comment.