aboutsummaryrefslogtreecommitdiff
path: root/data/stuff
diff options
context:
space:
mode:
Diffstat (limited to 'data/stuff')
-rw-r--r--data/stuff/test/auth.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/data/stuff/test/auth.js b/data/stuff/test/auth.js
index 103be82..1bba095 100644
--- a/data/stuff/test/auth.js
+++ b/data/stuff/test/auth.js
@@ -88,6 +88,31 @@ jQuery(function($) {
return false;
});
+ $('#create-user').click(function() {
+ var me = $(this);
+
+ // toggle loading
+ me.toggleClass('disabled').find('.loading').toggleClass('hidden');
+
+ send('test/add_user', {
+ name: $('#user-name').val(),
+ active: 't',
+ email: $('#user-email').val(),
+ password: $('#user-password').val(),
+ role: $('#user-role').val(),
+ }).always(function() {
+ // toggle loading
+ me.toggleClass('disabled').find('.loading').toggleClass('hidden');
+ }).fail(function(r) {
+ alert('Error ' + r.responseText);
+ }).done(function(r) {
+ console.log(r);
+ });
+
+ // stop event
+ return false;
+ });
+
$('#reload').click(reload);
// load users