Skip to content
Permalink
Browse files

[JENKINS-16571] Prefix all static icon URLs with RESOURCE_PREFIX.

  • Loading branch information...
uhafner committed Feb 12, 2013
1 parent edc8228 commit 5c7bcfb3959873569d545c3adbcf682791af4a95
11 pom.xml
@@ -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>

@@ -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>
@@ -58,6 +63,6 @@
</plugins>
</build>

</project>
</project>


@@ -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;
@@ -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;
}
@@ -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;

@@ -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;
}

/**
@@ -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;
@@ -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());

0 comments on commit 5c7bcfb

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