# HG changeset patch # User Atul Varma # Date 1275543537 25200 # Node ID 14d152040c1d0ef08c6974bf4a22e3917382be77 # Parent 4b66cf5f42bf690aeda40de39e2b5c774579da14 improved web ui diff -r 4b66cf5f42bf -r 14d152040c1d static-files/app.js --- a/static-files/app.js Wed Jun 02 21:43:14 2010 -0700 +++ b/static-files/app.js Wed Jun 02 22:38:57 2010 -0700 @@ -7,6 +7,11 @@ dataType: "text/plain", success: function(response) { cb(JSON.parse(response)); + }, + error: function(xhr, textStatus, errorThrown) { + var log = ("HTTP error: " + xhr.status + " " + + xhr.responseText + "\n"); + cb({success: false, log: log}); } }; jQuery.ajax(options); @@ -17,11 +22,14 @@ $("form").submit( function(event) { event.preventDefault(); + $("#success").hide(); + $("#failure").hide(); jsonRequest( "try", {url: $("#pull-url").val()}, function(data) { if (data.success) { + $("#success .patch").val(data.patch); $("#success").slideDown(); } else { $("#failure .log").text(data.log); diff -r 4b66cf5f42bf -r 14d152040c1d static-files/index.html --- a/static-files/index.html Wed Jun 02 21:43:14 2010 -0700 +++ b/static-files/index.html Wed Jun 02 22:38:57 2010 -0700 @@ -20,10 +20,18 @@ display: none; } + .code { + font-family: Monaco, monospace; + white-space: pre-wrap; + } + + #success .patch { + width: 60em; + height: 20em; + } + #failure .log { color: red; - font-family: Monaco, monospace; - white-space: pre-wrap; } @@ -37,10 +45,11 @@

Yay, we got a patch!

+
-

Alas, failure:

-
+

Alas, failure.

+