Skip to content
Permalink
Browse files
[JENKINS-34019] When displaying timestamps, ignore AnsiColor plugin s…
…tyling
  • Loading branch information
StevenGBrown committed Sep 9, 2016
1 parent e08a94f commit c31dc9571d5d1121d3f7e43d81059e0818e58b7a
Showing with 30 additions and 0 deletions.
  1. +22 −0 src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2.java
  2. +8 −0 src/main/webapp/style.css
@@ -122,6 +122,14 @@ public boolean hasScript() {
return true;
}

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

/**
* {@inheritDoc}
*/
@@ -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) {
@@ -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.