rework javascript interface for authentication modules
[coquelicot.git] / public / javascripts / coquelicot.auth.simplepass.js
index ad3a142..48967f5 100644 (file)
@@ -1,13 +1,15 @@
-function authenticationData(){
-  return {
-    upload_password: $('#upload_password').val()
-  };
-}
-
-function authenticationFocus(){
-  $('#upload_password').focus();
-}
-
-function authenticationReset() {
-  $('#upload_password').val('');
-}
+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); },
+};