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 $('.fragment-text').toggle(
18 function() { $(this).addClass('fragment-text-full').removeClass('fragment-text'); },
19 function() { $(this).addClass('fragment-text').removeClass('fragment-text-full'); }
21 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
22 function() { $(this).css({background: '#FFF'}); }
25 $('#registration-form').ajaxForm({
27 beforeSubmit: function() {
28 $('#registration-form input[type=submit]')
29 .attr('disabled', 'disabled')
30 .after('<img src="/media/img/indicator.gif" style="margin-left: 0.5em"/>');
32 success: function(response) {
33 if (response.success) {
34 location.reload(true);
36 $('#registration-form span.error').remove();
37 $.each(response.errors, function(id, errors) {
38 $('#id_registration-' + id).before('<span class="error">' + errors[0] + '</span>');
40 $('#registration-form input[type=submit]').removeAttr('disabled');
41 $('#registration-form img').remove();
46 $('#login-form').ajaxForm({
48 beforeSubmit: function() {
49 $('#login-form input[type=submit]')
50 .attr('disabled', 'disabled')
51 .after('<img src="/media/img/indicator.gif" style="margin-left: 0.5em"/>');
53 success: function(response) {
54 if (response.success) {
55 location.reload(true);
57 $('#login-form span.error').remove();
58 $.each(response.errors, function(id, errors) {
59 $('#id_login-' + id).before('<span class="error">' + errors[0] + '</span>');
61 $('#login-form input[type=submit]').removeAttr('disabled');
62 $('#login-form img').remove();
67 $('#login-register-window').jqm({
70 trigger: '#login-register-link',
71 onShow: function(hash) {
72 var offset = $(hash.t).offset();
73 hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top});
74 $('div.header', hash.w).css({width: $(hash.t).width()});
78 $('#login-register-window').labelify({labelledClass: 'blur'});