/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
83.2.14 by elof.bigestans at gmail
* Started work on the viewStudents functionality... So far, displaying users works and it outputs correct and standardized html.
1
$(document).ready(function() {
2
3
	$("#addStudentButton").click(function(e) {
4
		e.stopPropagation();
5
		e.preventDefault();
6
		$("#popup").load(
7
			"ajax/popup/addStudents",
8
			function() {
9
				$("#popup").fadeIn(300).click(function(e) {e.stopPropagation();});
83.2.15 by elof.bigestans at gmail
Continuing work on viewstudents
10
				$("#popup .cancelButton").click(cancelHandler);
83.2.14 by elof.bigestans at gmail
* Started work on the viewStudents functionality... So far, displaying users works and it outputs correct and standardized html.
11
			}
12
		);
13
	});
14
83.2.15 by elof.bigestans at gmail
Continuing work on viewstudents
15
	$(".editStudentDetailsButton").click(function(e) {
16
		e.stopPropagation();
17
		e.preventDefault();
18
19
		var username = $(this).parent().prevAll(".username").html();
20
		var name = $(this).parent().prevAll(".name").html();
21
		var email = $(this).parent().prevAll(".email").html();
22
23
		$("#popup").load(
24
			"ajax/popup/editStudentDetails",
25
			function() {
26
				$("#popup #usernameDisplay").html(username);
27
				$("#popup #username").val(username);
28
				$("#popup #studentName").val(name);
29
				$("#popup #studentEmail").val(email);
30
				$("#popup").fadeIn(300).click(function(e){e.stopPropagation();});
31
				$("#popup .cancelButton").click(cancelHandler);
32
			}
33
		)
34
35
	});
36
83.2.14 by elof.bigestans at gmail
* Started work on the viewStudents functionality... So far, displaying users works and it outputs correct and standardized html.
37
	$("html").click(function(e) {
38
		e.stopPropagation();
39
		e.preventDefault();
40
		$("#popup").fadeOut(300, function() { $(this).html("")});
41
	});
42
43
	$("#viewStudents table tr:even").addClass("even");
44
	$("#viewStudents table tr:odd").addClass("odd");
83.2.15 by elof.bigestans at gmail
Continuing work on viewstudents
45
});
46
47
function cancelHandler(e) {
48
	e.stopPropagation();
49
	e.preventDefault();
50
	$("#popup").fadeOut(300, function() { $(this).find(".popup").remove(); });
51
}