3 $('#id_q').labelify({labelledClass: 'blur'});
5 target = $('#login-register-window div.target');
7 $('#show-registration-form').click(function() {
8 $('#login-form').hide();
9 $('#registration-form').show();
12 $('#show-login-form').click(function() {
13 $('#registration-form').hide();
14 $('#login-form').show();
17 $('#registration-form').ajaxForm({
19 beforeSubmit: function() {
20 $('#registration-form input[type=submit]')
21 .attr('disabled', 'disabled')
22 .after('<img src="/media/img/indicator.gif" style="margin-left: 0.5em"/>');
24 success: function(response) {
25 if (response.success) {
26 location.reload(true);
28 $('#registration-form span.error').remove();
29 $.each(response.errors, function(id, errors) {
30 $('#id_registration-' + id).before('<span class="error">' + errors[0] + '</span>');
32 $('#registration-form input[type=submit]').removeAttr('disabled');
33 $('#registration-form img').remove();
38 $('#login-form').ajaxForm({
40 beforeSubmit: function() {
41 $('#login-form input[type=submit]')
42 .attr('disabled', 'disabled')
43 .after('<img src="/media/img/indicator.gif" style="margin-left: 0.5em"/>');
45 success: function(response) {
46 if (response.success) {
47 location.reload(true);
49 $('#login-form span.error').remove();
50 $.each(response.errors, function(id, errors) {
51 $('#id_login-' + id).before('<span class="error">' + errors[0] + '</span>');
53 $('#login-form input[type=submit]').removeAttr('disabled');
54 $('#login-form img').remove();
59 $('#login-register-window').jqm({
62 trigger: '#login-register-link',
63 onShow: function(hash) {
64 var offset = $(hash.t).offset();
65 hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top});
66 $('div.header', hash.w).css({width: $(hash.t).width()});
70 $('#login-register-window').labelify({labelledClass: 'blur'});