diff options
Diffstat (limited to 'data/assets')
-rw-r--r-- | data/assets/js/admin/users.js (renamed from data/assets/test/tab-users.js) | 63 |
1 files changed, 3 insertions, 60 deletions
diff --git a/data/assets/test/tab-users.js b/data/assets/js/admin/users.js index d60e348..a5eef0f 100644 --- a/data/assets/test/tab-users.js +++ b/data/assets/js/admin/users.js @@ -1,5 +1,6 @@ jQuery(function($) { "use strict"; + var TEMPLATES = new LuigiTemplate.Cache({ user: [ "<a ", @@ -59,7 +60,7 @@ jQuery(function($) { } function reload() { - var btn = $('#reload'), + var btn = $('#users-reload'), list = $('#users'); // show loading @@ -88,17 +89,6 @@ jQuery(function($) { return false; } - // old test, not used any more - function set_user(user_id) { - return send('test/set_user', { - user_id: user_id, - }).fail(function(r) { - alert('Error ' + r.responseText); - }).done(function(r) { - // do nothing - }); - } - $('#users-q').on('search-update', function() { filter(); }); @@ -230,54 +220,7 @@ jQuery(function($) { return false; }); - $('#login-dialog').on('show.bs.modal', function() { - $('#login-email').val(''); - $('#login-password').val(''); - }); - - $('#login-dialog').on('shown.bs.modal', function() { - $('#login-email').focus(); - }); - - $('#login-confirm').click(function() { - var me = $(this); - - if (me.hasClass('disabled')) - return false; - - // toggle loading - me.toggleClass('disabled').find('.loading').toggleClass('hidden'); - - send('test/login', { - email: $('#login-email').val(), - password: $('#login-password').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); - $('#login-dialog').modal('hide'); - }); - - // stop event - return false; - }); - - $('#login-user, #login-password').keydown(function(ev) { - if (ev.which == 13) { - setTimeout(function() { - // trigger login - $('#login-confirm').click(); - }, 10); - - // stop event - return false; - } - }); - - $('#reload').click(reload); + $('#users-reload').click(reload); // load users $('#admin-tab-users').on('show.bs.tab', function() { |