notes list partly working w/1page
authorec2-user <ec2-user@fcdev4.finalsclub.org>
Sun, 13 Nov 2011 21:03:16 +0000 (21:03 +0000)
committerec2-user <ec2-user@fcdev4.finalsclub.org>
Sun, 13 Nov 2011 21:03:16 +0000 (21:03 +0000)
public/index.html
public/javascripts/main.js

index 9e64cb70896cf03f820fdd09ee47d5d9563f056d..639de7db7705ea9e5b9878ef75c277e387b91e5f 100644 (file)
 
 
 
-                       <div class=page id=pg_pads>
-                               <h1>Notepads for <span id=lecture_name></span></h1>
-                               <div class=pad id=PROTO_pad>
+                       <div class=page id=pg_notes>
+                               <h1>Notepads </h1>
+                               <div class=note id=PROTO_note>
                                        <div class=name>
                                                <a href="">__name__</a>
                                        </div>
index 294427ecdd7253be116c0fb7d060f5a960546f5c..8d8eaf65a55cf7543b3f0e06936ae56f8e3be4c1 100644 (file)
@@ -105,31 +105,21 @@ function showLectures(matches, cb) {
 
 
 
+// go to the page that lists the note taking sessions for a specific lecture
+function showNotes(matches, cb) {
 
-// go to the page that lists the lectures for a specific course
-var pads = []
-function goPads(lectureId) {
-       ProtoDiv.reset("PROTO_pad");
-       hideAllPages();
+       var lectureId = matches[1]
+
+       ProtoDiv.reset("PROTO_note");
+       
        $.get("/lecture/"+lectureId, {}, function(response) {
 
-response = {
-       lecture: {
-               name: "Foo Lecture",
-               pads: [
-                       { _id: 1, name: "pad 1" },
-                       { _id: 2, name: "pad 2" },
-               ]
-       }
-}
-               pads = []
+               var notes = []
                if(typeof response == 'object') {
-                       var lecture = response.lecture
-                       $("#lecture_name").html(lecture.name);
-                       pads = course.pads
+                       notes = course.notes
                }
-               ProtoDiv.replicate("PROTO_pad", lectures);
-               goPage("pads")
+               ProtoDiv.replicate("PROTO_note", lectures);
+               cb("notes")
        });
 }
 
@@ -196,6 +186,7 @@ var pageVectors = [
        { regex: /^\/schools/, func: showSchools },
        { regex: /^\/school\/([a-f0-9]{24})/, func: showCourses },
        { regex: /^\/course\/([a-f0-9]{24})/, func: showLectures },
+       { regex: /^\/lecture\/([a-f0-9]{24})/, func: showNotes },
        { regex: /^\/login/, func: showLogin },
        { regex: /^\/register/, func: showRegister },
        { regex: /^\/press/, func: showPress },