Mercurial > bzezpatch
changeset 8:be87610d9abb
added loading throbber, a few other css changes
author | Atul Varma <avarma@mozilla.com> |
---|---|
date | Wed, 02 Jun 2010 23:25:13 -0700 |
parents | 7e455c3a7ad1 |
children | 8345b393df5b |
files | static-files/app.js static-files/index.html |
diffstat | 2 files changed, 19 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/static-files/app.js Wed Jun 02 23:06:07 2010 -0700 +++ b/static-files/app.js Wed Jun 02 23:25:13 2010 -0700 @@ -22,12 +22,16 @@ $("form").submit( function(event) { event.preventDefault(); + if ($("form").hasClass("thinking")) + return; $("#success").hide(); $("#failure").hide(); + $("form").addClass("thinking"); jsonRequest( "try", {url: $("#pull-url").val()}, function(data) { + $("form").removeClass("thinking"); if (data.success) { $("#success .patch").val(data.patch); $("#success").slideDown();
--- a/static-files/index.html Wed Jun 02 23:06:07 2010 -0700 +++ b/static-files/index.html Wed Jun 02 23:25:13 2010 -0700 @@ -9,10 +9,12 @@ } input { - border: 1px solid gray; + border: none; + padding: 0.25em; } input[type=text] { + border: 1px dotted gray; width: 40em; } @@ -33,6 +35,17 @@ #failure .log { color: red; } + + form { + padding-left: 2em; + line-height: 2em; + } + + .thinking { + background-image: url('ajax-loader.gif'); + background-repeat: no-repeat; + background-position: top left; + } </style> </head> <body> @@ -41,7 +54,7 @@ URL of HG repository containing your changes: <input id="pull-url" type="text"/> </div> - <input type="submit"> + <input type="submit" value="Make Patch"> </form> <div id="success"> <p>Yay, we got a patch!</p>