Skip to content

Commit 4c6fc68

Browse files
Allow setting the target attribute for summary links
1 parent 81caa4e commit 4c6fc68

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

core/src/main/resources/lib/hudson/summary.jelly

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ THE SOFTWARE.
3535
<st:attribute name="href">
3636
where the summary icon links to.
3737
</st:attribute>
38+
<st:attribute name="newWindow" type="boolean">
39+
if true, hyperlink will open in a new window.
40+
</st:attribute>
3841
<st:attribute name="iconOnly" type="boolean">
3942
if true, hyperlink will only cover the icon, not the body.
4043
</st:attribute>
@@ -51,9 +54,18 @@ THE SOFTWARE.
5154
<td style="vertical-align:middle">
5255
<j:choose>
5356
<j:when test="${attrs.href!=null &amp;&amp; !attrs.iconOnly}">
54-
<a href="${attrs.href}">
55-
<d:invokeBody />
56-
</a>
57+
<j:choose>
58+
<j:when test="${attrs.newWindow}">
59+
<a href="${attrs.href}" target="_blank" rel="noopener noreferrer">
60+
<d:invokeBody />
61+
</a>
62+
</j:when>
63+
<j:otherwise>
64+
<a href="${attrs.href}">
65+
<d:invokeBody />
66+
</a>
67+
</j:otherwise>
68+
</j:choose>
5769
</j:when>
5870
<j:otherwise>
5971
<d:invokeBody />

0 commit comments

Comments
 (0)