From 10fe6a00ea595d35334d0c6779778fa7eeb45d86 Mon Sep 17 00:00:00 2001 From: ec2-user Date: Sun, 13 Nov 2011 21:03:16 +0000 Subject: [PATCH] notes list partly working w/1page --- public/index.html | 6 +++--- public/javascripts/main.js | 31 +++++++++++-------------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/public/index.html b/public/index.html index 9e64cb7..639de7d 100644 --- a/public/index.html +++ b/public/index.html @@ -127,9 +127,9 @@ -
-

Notepads for

-
+
+

Notepads

+
diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 294427e..8d8eaf6 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -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 }, -- 2.25.1