Skip to content

Instantly share code, notes, and snippets.

@zolotov
Created April 6, 2011 07:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zolotov/905279 to your computer and use it in GitHub Desktop.
Save zolotov/905279 to your computer and use it in GitHub Desktop.
function highlight(stackTraceDiv) {
//replace filenames to link
var text = stackTraceDiv.html();
var highlighted = text.replace(/[0-9a-z_A-Z\-\.\/]+:\d+/g, '<a class="ide-link" href="/?message=$&">$&</a>');
stackTraceDiv.html(highlighted);
//bind links click event
$('a.ide-link').click(function(e) {
e.preventDefault();
var url = $(this).attr("href");
$.getJSON('http://localhost:8091' + url + '&callback=?', function(json) {
//do nothing
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment