提交 286337ea 编写于 作者: T tfennelly

[FIXED JENKINS-24316] Fixed unknown task icon src path construction

上级 5fea6cb5
......@@ -113,7 +113,10 @@ THE SOFTWARE.
<j:set var="iconMetadata" value="${icons.getIconByUrl(attrs.icon)}"/>
</j:if>
<j:set var="icon" value="${rootURL}${icon.startsWith('images/') || icon.startsWith('plugin/') ? h.resourcePath : ''}/${icon}"/>
<j:if test="${!icon.startsWith('/')}">
<j:set var="icon" value="/${icon}"/>
</j:if>
<j:set var="icon" value="${rootURL}${icon.startsWith('images/') || icon.startsWith('plugin/') ? h.resourcePath : ''}${icon}"/>
<j:when test="${enabled==false}">
<div class="task disabled">
<span>
......
......@@ -62,6 +62,9 @@ public class IconTest extends HudsonTestCase {
// class specs not in "normal" order...
assertIconToImageOkay(icons.get(4), "/images/16x16/aborted.png");
assertIconToImageOkay(icons.get(5), "/images/24x24/aborted.png");
// src attribute...
assertIconToImageOkay(icons.get(6), "/plugin/xxx/icon.png");
}
public void testBallColorTd() throws Exception {
......@@ -89,6 +92,9 @@ public class IconTest extends HudsonTestCase {
assertIconToImageOkay(taskDivs.get(2).getElementsByTagName("img").get(0), "/images/16x16/blue.png", "icon-blue icon-sm");
assertIconToImageOkay(taskDivs.get(3).getElementsByTagName("img").get(0), "/images/16x16/blue.png", "icon-blue icon-sm");
assertIconToImageOkay(taskDivs.get(4).getElementsByTagName("img").get(0), "/images/16x16/blue.png", "icon-blue icon-sm");
assertIconToImageOkay(taskDivs.get(5).getElementsByTagName("img").get(0), "/plugin/xxx/icon.png");
assertIconToImageOkay(taskDivs.get(6).getElementsByTagName("img").get(0), "/plugin/xxx/icon.png");
}
public BallColor getBallColorAborted() {
......
......@@ -37,6 +37,11 @@ THE SOFTWARE.
-->
<l:icon class="icon-sm icon-aborted " />
<l:icon class="icon-md icon-aborted" />
<!--
src attribute...
-->
<l:icon src="/plugin/xxx/icon.png" />
</div>
</l:main-panel>
</l:layout>
......
......@@ -35,6 +35,10 @@ THE SOFTWARE.
<l:task href=".." icon="16x16/blue.gif" title="Title"/>
<l:task href=".." icon="images/16x16/blue.gif" title="Title"/>
<l:task href=".." icon="/images/16x16/blue.gif" title="Title"/>
<!-- unknown icon urls... -->
<l:task href=".." icon="/plugin/xxx/icon.png" title="Title"/>
<l:task href=".." icon="plugin/xxx/icon.png" title="Title"/>
</l:tasks>
</l:main-panel>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册