blob: 8ee543bf38dd48c94e21ab7145173c3e25445721 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/**
* @todo preventDefault() not working in IE 6 and 7
* @todo Close link should be reusable
*/
$("document").ready(function() {
$("#gLoginLink").click(function(event){
event.preventDefault();
var url = $("#gLoginLink a").attr("href");
$.get(url, function(data) {
$('#gLoginLink').hide();
$("#gLoginMenu").append('<li><a href="#">X</a></li>');
$("#gLoginMenu li:last").addClass("gClose").show();
$("#gLoginMenu .gClose a").click(function(){
$("#gLoginForm").remove();
$("#gLoginMenu .gClose").remove();
$("#gLoginLink").show();
$("input#gUsername").val("");
$("input#gPassword").val("");
});
$("#gLoginFormContainer").html(data).hide().fadeIn();
ajaxify_login_form();
});
});
});
function ajaxify_login_form() {
$("form#gLoginForm").ajaxForm({
target: "#gLoginFormContainer",
success: function(responseText, statusText) {
if (!responseText) {
window.location.reload();
} else {
ajaxify_login_form();
}
}
});
}
|