Skip to content

Commit

Permalink
[JENKINS-18518] Link into consoleFull*
Browse files Browse the repository at this point in the history
An indication link now includes the id of the location in the
console output. The destination is shifted down so that it is
not obscured by the jenkins breadcrumb header.
  • Loading branch information
K. R. Walker committed Jun 9, 2014
1 parent 88bec15 commit 3600702
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Expand Up @@ -64,7 +64,11 @@ public String getAfter() {
* @param id the id for the line, to refer to in links.
*/
public void addFocus(String id) {
this.before += "<span id=\"" + id + "\">";
// This style should shift the anchor down below the header so that it's visible.
// "&nbsp;" may be required to make this work for WebKit-based browsers.
this.before += "<a id=\"" + id + "\" style=\""
+ "display:block;position:relative;top:-2em;visibility:hidden"
+ "\">&nbsp;</a>";
}

/**
Expand Down
Expand Up @@ -66,7 +66,6 @@ private void addToHelperMap(FoundFailureCause cause) {
AnnotationHelper matchingHelper = helperMap.get(matchingString);
if (matchingHelper == null) {
matchingHelper = new AnnotationHelper();
matchingHelper.addAfter("</span>");
}
matchingHelper.addTitle(cause.getName());
matchingHelper.addFocus(indication.getMatchingHash() + cause.getId());
Expand Down
Expand Up @@ -119,7 +119,7 @@ def displayCauses(cause, indent, links) {
br {}
cause.getIndications().each { indication ->
if (links?.buildUrl != null) {
a(href: "${rootURL}/${links.buildUrl}" + "consoleFull"
a(href: "${rootURL}/${links.buildUrl}" + "consoleFull#" + indication.matchingHash + cause.id
, class: "model-link") {
text(_("Indication") + " " + (index++))
}
Expand Down
Expand Up @@ -128,7 +128,7 @@ def displayCauses(cause, run, indent, links) {
}
br {}
cause.getIndications().each { indication ->
a(href: "${rootURL}/${links.buildUrl}" + "consoleFull"
a(href: "${rootURL}/${links.buildUrl}" + "consoleFull#" + indication.matchingHash + cause.id
, class: "model-link") {
text(_("Indication") + " " + (index++))
}
Expand Down

0 comments on commit 3600702

Please sign in to comment.