/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
$(document).ready(function(){
	$('#passwordChanger').hide();
	
	/* Blurs body and opens password changer */
	$('li[name="changePwd"]').click(function(e){
		e.stopPropagation();
		$('#popoutMenu').stop(false, false).slideUp(300);
		popoutMenu=0;
	    $('body *').not('#passwordChanger, #passwordChanger *').animate({
		opacity:0.4}, 400);
		$('#passwordChanger').fadeIn(300);
		$('#passwordChanger').css('z-index', 3000);
	});
	
	$('body').click(function(e){
		$('#formContainer').fadeOut(300);
		$('#passwordChanger').fadeOut(300);
		$('body *').animate({
		opacity:1}, 400);
		$('#changePassword')[0].reset();
	});
	
	$('#passwordChanger').click(function(e){
		e.stopPropagation();
	});
	
	$('#formContainer').click(function(e){
		e.stopPropagation();
	});
	
	$('#popoutLink').click(function(e){
		if(popoutMenu==0){
			$('#popoutMenu').stop(false, true).slideDown(300);
			popoutMenu=1;
			e.stopPropagation();
		// FIXA SÅ MENYN INTE KOMMER UPP IGEN
		}
		else if(popoutMenu==1){
			$('#popoutMenu').stop(false, false).slideUp(300);	
			popoutMenu=0;
			e.stopPropagation();
		}
	});
	
	$('#loginLink').click(function(e){
		var target = $('#formContainer');
		if(target.is(":hidden")){
			target.fadeIn(300);
			$('#username').focus();
			e.stopPropagation();
		}
		else{
			target.fadeOut(300);
		}
		
	});
});

window.onkeyup = function(event){
	if(event.keyCode==27){
		$('#formContainer').fadeOut(300);
		$('#passwordChanger').fadeOut(300);
		$('body *').animate({
		opacity:1}, 400);
		$('#changePassword')[0].reset();
	}
}

/* Closing password changer and reactivates body */
function cancelPasswordChange(){
	$('#passwordChanger').fadeOut(300);
	$('body *').animate({
	opacity:1}, 400);
	$('#changePassword')[0].reset();
}