aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/stuff/test/auth.js54
1 files changed, 27 insertions, 27 deletions
diff --git a/data/stuff/test/auth.js b/data/stuff/test/auth.js
index a374364..b973e25 100644
--- a/data/stuff/test/auth.js
+++ b/data/stuff/test/auth.js
@@ -110,27 +110,27 @@ jQuery(function($) {
$('#users .active').removeClass('active');
me.addClass('active');
- $('#edit-dialog').data('row', me.data('row')).modal('show');
+ $('#user-edit-dialog').data('row', me.data('row')).modal('show');
// stop event
return false;
});
- $('#add-dialog').on('show.bs.modal', function() {
+ $('#user-add-dialog').on('show.bs.modal', function() {
$.each(['name', 'email', 'password'], function(i, id) {
- $('#add-' + id).val('');
+ $('#user-add-' + id).val('');
});
- $('#add-role').val('guest');
+ $('#user-add-role').val('guest');
});
- $('#add-dialog').on('shown.bs.modal', function() {
- $('#add-name').focus();
+ $('#user-add-dialog').on('shown.bs.modal', function() {
+ $('#user-add-name').focus();
});
- $('#add-name, #add-email, #add-password').keydown(function(ev) {
+ $('#user-add-name, #user-add-email, #user-add-password').keydown(function(ev) {
if (ev.which == 13) {
setTimeout(function() {
- $('#add-confirm').click();
+ $('#user-add-confirm').click();
}, 10);
// stop event
@@ -138,7 +138,7 @@ jQuery(function($) {
}
});
- $('#add-confirm').click(function() {
+ $('#user-add-confirm').click(function() {
var me = $(this);
if (me.hasClass('disabled'))
@@ -148,10 +148,10 @@ jQuery(function($) {
me.toggleClass('disabled').find('.loading').toggleClass('hidden');
send('test/add_user', {
- name: $('#add-name').val(),
- email: $('#add-email').val(),
- password: $('#add-password').val(),
- role: $('#add-role').val(),
+ name: $('#user-add-name').val(),
+ email: $('#user-add-email').val(),
+ password: $('#user-add-password').val(),
+ role: $('#user-add-role').val(),
active: 't',
}).always(function() {
// toggle loading
@@ -161,14 +161,14 @@ jQuery(function($) {
}).done(function(r) {
console.log(r);
reload();
- $('#add-dialog').modal('hide');
+ $('#user-add-dialog').modal('hide');
});
// stop event
return false;
});
- $('#edit-dialog').on('show.bs.modal', function() {
+ $('#user-edit-dialog').on('show.bs.modal', function() {
var row = $(this).data('row');
$.each({
@@ -176,23 +176,23 @@ jQuery(function($) {
email: 'email',
role: 'role_name',
}, function(id, col) {
- $('#edit-' + id).val(row[col]);
+ $('#user-edit-' + id).val(row[col]);
});
});
- $('#edit-dialog').on('shown.bs.modal', function() {
- $('#edit-name').focus();
+ $('#user-edit-dialog').on('shown.bs.modal', function() {
+ $('#user-edit-name').focus();
});
- $('#edit-dialog').on('hide.bs.modal', function() {
+ $('#user-edit-dialog').on('hide.bs.modal', function() {
// clear highlight
$('#users .active').removeClass('active');
});
- $('#edit-name, #edit-email').keydown(function(ev) {
+ $('#user-edit-name, #user-edit-email').keydown(function(ev) {
if (ev.which == 13) {
setTimeout(function() {
- $('#edit-confirm').click();
+ $('#user-edit-confirm').click();
}, 10);
// stop event
@@ -200,9 +200,9 @@ jQuery(function($) {
}
});
- $('#edit-confirm').click(function() {
+ $('#user-edit-confirm').click(function() {
var me = $(this),
- user_id = $('#edit-dialog').data('row').user_id;
+ user_id = $('#user-edit-dialog').data('row').user_id;
if (me.hasClass('disabled'))
return false;
@@ -212,9 +212,9 @@ jQuery(function($) {
send('test/edit_user', {
user_id: user_id,
- name: $('#edit-name').val(),
- email: $('#edit-email').val(),
- role: $('#edit-role').val(),
+ name: $('#user-edit-name').val(),
+ email: $('#user-edit-email').val(),
+ role: $('#user-edit-role').val(),
}).always(function() {
// toggle loading
me.toggleClass('disabled').find('.loading').toggleClass('hidden');
@@ -223,7 +223,7 @@ jQuery(function($) {
}).done(function(r) {
console.log(r);
reload();
- $('#edit-dialog').modal('hide');
+ $('#user-edit-dialog').modal('hide');
});
// stop event