Permalink
Browse files

format compiler errors with line breaks

  • Loading branch information...
1 parent 186d96b commit e265888acae0395ee7f6d01d6c2ebe8cb09e65fd @darius darius committed Aug 19, 2012
Showing with 13 additions and 3 deletions.
  1. +13 −3 static/ghclive.js
View
@@ -104,11 +104,21 @@ function scrollToBottom(elem) { // pass in the id of the element you want scroll
}
function load() {
$.get('/loader', function(res) {
- console.log("" + res);
- if ("" + res === "Main,Helper")
+ if ("" + res === "Main,Helper") {
$("#editormessages").text("");
- else
+ } else if (typeof res === "string") {
+ var em = $("#editormessages");
+ em.empty();
+ var lines = res.split("\n");
+ for (var i = 0; i < lines.length; ++i) {
+ console.log('line ' + i + ': ' + lines[i]);
+ em.append(lines[i]);
+ if (lines[i+1])
+ em.append($('<br>'));
+ }
+ } else { // just paranoia
$("#editormessages").text("" + res);
+ }
});
}

0 comments on commit e265888

Please sign in to comment.