Skip to content

Commit

Permalink
[JENKINS-34019] When displaying timestamps, ignore AnsiColor plugin s…
Browse files Browse the repository at this point in the history
…tyling
  • Loading branch information
StevenGBrown committed Sep 9, 2016
1 parent e08a94f commit c31dc95
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Expand Up @@ -122,6 +122,14 @@ public boolean hasScript() {
return true;
}

/**
* {@inheritDoc}
*/
@Override
public boolean hasStylesheet() {
return true;
}

/**
* {@inheritDoc}
*/
Expand All @@ -146,6 +154,20 @@ public void doScriptJs(StaplerRequest req, StaplerResponse rsp)
rsp.setHeader(HttpHeaders.LOCATION, ResponseImpl.encode(url));
}

/**
* {@inheritDoc}
*/
@Override
@WebMethod(name = "style.css")
public void doStyleCss(StaplerRequest req, StaplerResponse rsp)
throws IOException, ServletException {
// See the comments in doScriptJs for more details.
String url = req.getContextPath() + getResourcePath()
+ "/plugin/timestamper/style.css";
rsp.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
rsp.setHeader(HttpHeaders.LOCATION, ResponseImpl.encode(url));
}

private String getResourcePath() {
Jenkins jenkins = Jenkins.getInstance();
if (jenkins != null) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/webapp/style.css
@@ -0,0 +1,8 @@

/* Override style changes made by the AnsiColor plugin. */
.timestamp {
color: #333;
background-color: white;

This comment has been minimized.

Copy link
@borgstrom

borgstrom Sep 27, 2016

@StevenGBrown -- white is not a good default choice since not all console output has a white background, I suggest this be changed to inherit, which on my Jenkins instance with the material theme looks proper.

This was also commented on in the JIRA ticket: https://issues.jenkins-ci.org/browse/JENKINS-34019?focusedCommentId=271468&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-271468

This comment has been minimized.

Copy link
@StevenGBrown

StevenGBrown Oct 5, 2016

Author Member

This commit has been reverted.

font-weight: normal;
display: inline-block;
}

0 comments on commit c31dc95

Please sign in to comment.