<div class=page id=pg_schools>
<h1>Universities</h1>
- <div class="school" id=PROTO_school onclick="goPage('/school/___id__')">
+ <div class="proto school" id=PROTO_school onclick="goPage('/school/___id__')">
<div class=name>__name__</div>
<div class=desc>__description__</div>
</div>
<div class=page id=pg_courses>
<h1>Courses for <span id=school_name></span></h1>
- <div class=course id=PROTO_course>
+ <div class="proto course" id=PROTO_course>
<div class=dept>__department__</div>
<div class=name>
<a href="javascript:goPage('/course/___id__')">__number__: __name__</a>
<div class=page id=pg_lectures>
- <div class=lectures_head id=PROTO_lectures_head>
+ <div class="proto lectures_head" id=PROTO_lectures_head>
<h1>Lectures for Course __number__ : __name__</h1>
Subject: __subject__<br>
Department: __department__<br>
</div>
- <div class=lectures_instructor id=PROTO_lectures_instructor>
+ <div class="proto lectures_instructor" id=PROTO_lectures_instructor>
Instructor: __name__ (__email__)<br>
</div>
- <div class=lecture id=PROTO_lecture>
+ <div class="proto lecture" id=PROTO_lecture>
<div class=name>
<a href="javascript:goPage('/lecture/___id__')">__name__</a><br>
Created: __date__<br>
<div class=page id=pg_notes>
<h1>Notepads </h1>
- <div class=note id=PROTO_note>
+ <div class="proto note" id=PROTO_note>
<div class=name>
<a href="/note/___id__">__name__</a>
</div>
covered at Harvard from 2008 through 2010.
</p>
<ul>
- <li id=PROTO_archive_subject>
+ <li class=proto id=PROTO_archive_subject>
<a href="javascript:goPage('/archive/subject/__id__')">__name__</a>
</li>
</ul>
<div class=page id=pg_archive_courses>
<h1>Archived Courses</h1>
<ul>
- <li id=PROTO_archive_course>
+ <li class=proto id=PROTO_archive_course>
<a href="javascript:goPage('/archive/course/__id__')">__name__</a>
</li>
</ul>
<div class=page id=pg_archive_notes>
<h1>Archived Notes</h1>
<ul>
- <li id=PROTO_archive_note>
- <a href="/archive/note/___id__">__topic__</a>
+ <li class=proto id=PROTO_archive_note>
+ <a href="javascript:goPage('/archive/note/___id__')">__topic__</a>
</li>
</ul>
+ </div>
+
+
+ <div class=page id=pg_archive_note_display>
+ <div id=PROTO_archive_note_display>
+ <h1>__topic__</h1>
+ <div>__text__</div>
+ </div>
</div>
+function showArchiveNote(matches, cb) {
+
+ var noteId = parseInt(matches[1])
+
+ ProtoDiv.reset("PROTO_archive_note_display")
+
+ $.get("/archive/note/"+noteId, { cache: false }, function(response) {
+
+ var note = response.note
+note = { text: "Hi <i>Mom!</i>", topic: "21st Century Greetings" }
+ if(!note.topic)
+ note.topic = note.text.substr(0, 15)+" ..."
+
+ ProtoDiv.replicate("PROTO_archive_note_display", note)
+
+ })
+
+ cb("archive_note_display")
+}
+
+
+
// go to the account registration page
function showRegister(matches, cb) {
// xxx clear fields?
-function hideAllPages() {
-
- $(".page").fadeOut(100);
-
-}
-
-
var pageVectors = [
{ regex: /^\/(index.html)?$/, func: showHome },
{ regex: /^\/schools/, func: showSchools },
{ regex: /^\/archive\/?$/, func: showArchiveSubjects },
{ regex: /^\/archive\/subject\/([0-9]+)/, func: showArchiveCourses },
{ regex: /^\/archive\/course\/([0-9]+)/, func: showArchiveNotes },
+ { regex: /^\/archive\/note\/([0-9]+)/, func: showArchiveNote },
{ regex: /^\/login/, func: showLogin },
{ regex: /^\/register/, func: showRegister },
{ regex: /^\/press/, func: showPress },
var path = document.location.pathname
- $(".page").fadeOut(100); // hide all pseudo pages
+ $(".page").hide(); //(100); // hide all pseudo pages
for(var i = 0; i < pageVectors.length; i++) {
var vector = pageVectors[i]
function goPage(path) {
var y = 0 + window.pageYOffset
topQueue.push(y)
- var o = {py:(path+"|"+y)}
- history.pushState(o, path, path);
+ history.pushState({}, path, path);
showPage(0);
}