/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
85.2.1 by a11emmjo
Combined bannermenu with startview to get correct start-page.
1
/* TODO: cHANGE THIS FILE ENTIRELY!!! CHANGE CALLED ID'S AND CLASSES */
67.1.6 by a11emmjo
Replaced bannermenu/topmenu/header... on login-page.
2
85.2.1 by a11emmjo
Combined bannermenu with startview to get correct start-page.
3
/* Functions that run when the page loads */
4
$(document).ready(function() {
90.1.2 by a11emmjo
Made a standard css-file to be used for the whole lenasys-page.
5
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
6
	/* Makes the bannermenu scrollable horizontally but not vertically */
7
	$('#bannerBody').scrollToFixed();
8
90.1.8 by a11emmjo
Fixed some redirect-links.
9
	/* Sets the click-function for the usermenubutton */
90.1.2 by a11emmjo
Made a standard css-file to be used for the whole lenasys-page.
10
	$('#bannerUserMenuButton').click(function(e){
90.1.8 by a11emmjo
Fixed some redirect-links.
11
		
12
		$.get('ajax/isLoggedIn', function(response) {
13
			if(response == 'yes') {
14
				// If the user is logged in and the usermenu-div is hidden it's shown.
15
				if($('#dropdownUserMenu').is(':hidden')) {
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
16
					// TODO: Secure that the courseblock-div is hidden when the usermenu-div is oppened.
17
					/*
90.1.9 by a11emmjo
Updated branch.
18
					if($('#dropdownMenuCourseBlock').is(':visible')) {
19
						$('#dropdownMenuCourseBlock').hide();
20
					}
21
					$('#dropdownUserMenu').load('bannermenu.php #dropdownUserMenu');
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
22
					*/
90.1.8 by a11emmjo
Fixed some redirect-links.
23
					$('#dropdownUserMenu').show();
24
				}
25
				// If the user is logged in and the usermenu-div is shown it's hidden.
26
				else {
27
					$('#dropdownUserMenu').hide();
28
				}
29
			}
30
			else {
31
				// If the user is not logged in and the popup-div is hidden it's filled and shown.
32
				if($('#popup').is(':hidden')) {
83.2.16 by elof.bigestans at gmail
* Merged trunk AND
33
					$('#popup').load('ajax/popup/login', function(){
90.1.8 by a11emmjo
Fixed some redirect-links.
34
						$('#popup').show();
83.2.16 by elof.bigestans at gmail
* Merged trunk AND
35
						$("#popup .hint").click(loginHint);
90.1.8 by a11emmjo
Fixed some redirect-links.
36
					});
37
				}
38
				// If the user is not logged in and the popup-div shows it's hidden.
39
				else {
40
					$('#popup').hide();
41
				}
42
			}
43
		});
90.1.2 by a11emmjo
Made a standard css-file to be used for the whole lenasys-page.
44
		
45
	});
90.1.5 by a11emmjo
Added popup-div to bannermenu.
46
	
90.1.9 by a11emmjo
Updated branch.
47
	// TODO: Refresh the div with it's php before show.
48
	/* Expand and collapse courses in dropdown menu */
49
	$('#dropdownMenuExpandCourses').click(function(){
50
	
51
		// If the course block is collapsed it's expanded.
52
		if($('#dropdownMenuCourseBlock').is(':hidden')) {
53
			$('#dropdownMenuCourseBlock').show();
54
		}
55
		// If the course block is expanded it's collapsed .
56
		else {
57
			$('#dropdownMenuCourseBlock').hide();
58
		}
90.1.5 by a11emmjo
Added popup-div to bannermenu.
59
60
	});
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
61
});