diff --git a/html/index.html b/html/index.html
index 06eccbd..57964b1 100644
--- a/html/index.html
+++ b/html/index.html
@@ -1,30 +1,33 @@
- Gosigner. A simple HMA SHA1 Signer
+ Gosigner. A simple HMAC SHA1 Signer
+
diff --git a/static/css/sandbar-forms.css b/static/css/sandbar-forms.css
index 4adfa9c..dad1543 100644
--- a/static/css/sandbar-forms.css
+++ b/static/css/sandbar-forms.css
@@ -3,7 +3,6 @@ div.sandbar-form {
color: #666;
margin: 10px;
margin-top: 20px;
- font-size: 12px;
}
div.sandbar-form input.textfield {
@@ -12,6 +11,8 @@ div.sandbar-form input.textfield {
border: 1px solid #ccc;
padding: 5px;
color: #4d4d4d;
+ background: #F5F5F5;
+ width: 100%;
}
div.sandbar-form textarea {
@@ -20,6 +21,8 @@ div.sandbar-form textarea {
border: 1px solid #ccc;
padding: 5px;
color: #4d4d4d;
+ background: #F5F5F5;
+ width: 100%;
}
div.sandbar-form span.group-title {
@@ -50,7 +53,6 @@ div.sandbar-form input.sandbar-button {
div.sandbar-form div.error-message {
height: 24px;
padding-left: 24px;
- background: url(../images/warning.png) no-repeat 4px 0px;
color: red;
vertical-align: bottom;
}
@@ -75,7 +77,6 @@ div.sandbar-form div.field-label span.required {
div.sandbar-form div.form-header {
padding: 3px;
- background: #e8ecf5 url(../images/form_blue_edit.png) no-repeat 4px 4px;
border: 1px solid #C0C0C0;
margin-bottom: 10px;
padding-left: 30px;
@@ -85,13 +86,15 @@ div.sandbar-form div.form-header table {
width: 100%;
}
-div.sandbar-form span.form-title {
+div.sandbar-form div.form-title {
font-family: Arial, Verdana, Arial, Helvetica, sans-serif;
- font-size: 18px;
+ font-size: 28px;
font-weight: bold;
height: 40px;
vertical-align: top;
color: #666666;
+ width: 100%;
+ background-color: #C0C0C0;
}
div.form-header span.header-buttons {
diff --git a/static/css/sandbar.css b/static/css/sandbar.css
index ee3e9c5..6af864a 100644
--- a/static/css/sandbar.css
+++ b/static/css/sandbar.css
@@ -1,9 +1,17 @@
html, body {
font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
+ font-size: 16px;
background-color: #ffffff;
}
+#sandbar-form {
+ margin: 50px auto;
+ width: 620px;
+ display: block;
+ outline 0 none;
+ vertical-align: baseline;
+}
+
div.error, div.message, div.warning, div.help {
background-color: #ffffcc;
border: 1px solid #ccc;
diff --git a/static/javascripts/application.js b/static/javascripts/application.js
index 71e91b9..102a314 100644
--- a/static/javascripts/application.js
+++ b/static/javascripts/application.js
@@ -2,6 +2,14 @@ var Signature = Backbone.Model.extend({
url: function() {
var base = "sign";
return base;
+ },
+ validate: function(attrs){
+ if (_(attrs.Content).trim().length == 0) {
+ return "You should put some conent to be signed :)."
+ }
+ if ((attrs.Key).trim().length == 0) {
+ return "Where is the Key to sign?"
+ }
}
});
@@ -17,8 +25,13 @@ var App = {
App.Views.Index = Backbone.View.extend({
events: {
"submit form" : "sign",
+ "click [name=Content]" : "clear"
},
+ clear: function(){
+ $("#sign").css('visibility','hidden');
+ },
+
initialize: function() {
_.bindAll(this, 'render');
this.model.bind('change', this.render);
@@ -42,10 +55,15 @@ App.Views.Index = Backbone.View.extend({
success: function(model, resp) {
self.model = model;
self.render();
+ $("#sign").css('visibility', 'visible');
self.delegateEvents();
},
- error: function() {
- alert('Failed to sign.');
+ error: function(self, error) {
+ if (error) {
+ alert(error);
+ } else {
+ alert('Failed to sign.');
+ }
}
});
return false;