rework javascript interface for authentication modules
[coquelicot.git] / public / javascripts / coquelicot.auth.simplepass.js
index 27861ea..48967f5 100644 (file)
@@ -1,9 +1,15 @@
-function authenticationData(){
-       return {
-               upload_password: $('#upload_password').val()
-       };
-}
-
-function authenticationFocus(){
-       $('#upload_password').focus();
-}
+var authentication = {
+  getData: function() {
+    return {
+      upload_password: $('#upload_password').val()
+    };
+  },
+  focus: function() {
+    $('#upload_password').focus();
+  },
+  handleAccept: function() { alert('success!'); },
+  handleReject: function() {
+    $('#upload_password').val('');
+  },
+  handleFailure: function(status) { alert('failure!' + status); },
+};