/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codeigniter/js/viewStudents.js

  • Committer: Gustav Hatvigsson
  • Date: 2013-05-30 12:50:06 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130530125006-f2pn1oto36ydp30f
Added some licensing information that needs to be filled out.
Authors need to fill out/in file names and who is the owner
of them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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();});
 
10
                                $("#popup .cancelButton").click(cancelHandler);
 
11
                        }
 
12
                );
 
13
        });
 
14
 
 
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
 
 
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");
 
45
});
 
46
 
 
47
function cancelHandler(e) {
 
48
        e.stopPropagation();
 
49
        e.preventDefault();
 
50
        $("#popup").fadeOut(300, function() { $(this).find(".popup").remove(); });
 
51
}
 
 
b'\\ No newline at end of file'