more 1page work
authorec2-user <ec2-user@fcdev4.finalsclub.org>
Mon, 14 Nov 2011 06:02:30 +0000 (06:02 +0000)
committerec2-user <ec2-user@fcdev4.finalsclub.org>
Mon, 14 Nov 2011 06:02:30 +0000 (06:02 +0000)
public/index.html
public/javascripts/main.js
public/stylesheets/fc2.css

index 82b0b9a3028eec35beefcddd8fc00d737c0b68c2..374cfbfa67252670c7a2584999af8e9e599abb55 100644 (file)
@@ -88,7 +88,7 @@
 
                        <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>
@@ -98,7 +98,7 @@
 
                        <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>
 
 
index 2e2f38e82367530ddc731b9633a8ce0627f596f8..d06a72d8024549de962e7ba500940de6df27d21a 100644 (file)
@@ -202,6 +202,28 @@ function showArchiveNotes(matches, cb) {
 
 
 
+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?
@@ -231,13 +253,6 @@ function showConduct(matches, cb) {
 
 
 
-function hideAllPages() {
-
-       $(".page").fadeOut(100);
-
-}
-
-
 var pageVectors = [
        { regex: /^\/(index.html)?$/, func: showHome },
        { regex: /^\/schools/, func: showSchools },
@@ -247,6 +262,7 @@ var pageVectors = [
        { 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 },
@@ -259,7 +275,7 @@ function showPage(y) {
 
        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]
@@ -299,8 +315,7 @@ var topQueue = [0]
 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);
 }
 
index 44bd112a13597361524cf4307d89ded9469bdc39..2b7ab0c6eed5081df562f56b50445f554d1433ed 100644 (file)
@@ -883,4 +883,8 @@ div.conduct p.vague {
        -webkit-border-radius: 0.20em;
 }
 
+.proto {
+       /*display: none;*/
+}
+