提交 2d05008d 编写于 作者: K Kohsuke Kawaguchi

reducing the visibility of the markup

上级 2f7fbafd
......@@ -86,6 +86,16 @@ public abstract class AbstractMarkupText {
addMarkup(startPos,endPos,"<a href='"+url+"'>","</a>");
}
/**
* Inserts an A tag that surrounds the given position.
* But this hyperlink is less visible.
*
* @since 1.395
*/
public void addHyperlinkLowKey( int startPos, int endPos, String url ) {
addMarkup(startPos,endPos,"<a class='lowkey' href='"+url+"'>","</a>");
}
/**
* Adds a start tag and end tag around the entire text
*/
......
......@@ -32,7 +32,7 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
else
return null; // unexpected format. abort.
}
text.addHyperlink(charPos,end,annotateClassName(line.substring(charPos,end)));
text.addHyperlinkLowKey(charPos,end,annotateClassName(line.substring(charPos,end)));
return new ConsoleAnnotator() {
public ConsoleAnnotator annotate(Object context, MarkupText text) {
......@@ -40,7 +40,7 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
Matcher m = STACK_TRACE_ELEMENT.matcher(line);
if (m.find()) {// allow the match to happen in the middle of a line to cope with prefix. Ant and Maven put them, among many other tools.
text.addHyperlink(m.start()+4,m.end(),annotateMethodName(m.group(1),m.group(2),m.group(3),Integer.parseInt(m.group(4))));
text.addHyperlinkLowKey(m.start()+4,m.end(),annotateMethodName(m.group(1),m.group(2),m.group(3),Integer.parseInt(m.group(4))));
return this;
}
......@@ -49,7 +49,7 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
int s = idx + CAUSED_BY.length();
int e = line.indexOf(':', s);
if (e<0) e = line.length();
text.addHyperlink(s,e,annotateClassName(line.substring(s,e)));
text.addHyperlinkLowKey(s,e,annotateClassName(line.substring(s,e)));
return this;
}
......@@ -65,13 +65,11 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
// TODO; separate out the annotations and mark up
private String annotateMethodName(String className, String methodName, String sourceFileName, int lineNumber) {
// for now
return "http://grepcode.com/search/?query="+className+'.'+methodName+"&entity=method";
return "http://stacktrace.hudson-labs.org/search/?query="+className+'.'+methodName+"&entity=method";
}
private String annotateClassName(String className) {
// for now
return "http://grepcode.com/search?query="+className;
return "http://stacktrace.hudson-labs.org/search?query="+className;
}
@Extension
......@@ -97,5 +95,5 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
private static final String CAUSED_BY = "Caused by: ";
private static final Pattern AND_MORE = Pattern.compile("\t... [0-9]+ more");
private static final Pattern AND_MORE = Pattern.compile("\t... [0-9]+ more\n");
}
......@@ -143,6 +143,21 @@ a:visited {
color: #5c3566;
}
a.lowkey:link {
text-decoration: none;
color: inherit;
}
a.lowkey:hover {
text-decoration: underline;
color: inherit;
}
a.lowkey:visited {
text-decoration: none;
color: inherit;
}
/* tip - anchors of class info */
a.tip {
position:relative;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册