From 0ef6d36f5951828132594eec9411802b1f02a3f9 Mon Sep 17 00:00:00 2001 From: ec2-user Date: Mon, 14 Nov 2011 06:02:30 +0000 Subject: [PATCH] more 1page work --- public/index.html | 28 ++++++++++++++++++---------- public/javascripts/main.js | 35 +++++++++++++++++++++++++---------- public/stylesheets/fc2.css | 4 ++++ 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/public/index.html b/public/index.html index 82b0b9a..374cfbf 100644 --- a/public/index.html +++ b/public/index.html @@ -88,7 +88,7 @@

Universities

-
+
__name__
__description__
@@ -98,7 +98,7 @@

Courses for

-
+
__department__
__number__: __name__ @@ -109,15 +109,15 @@
-
+

Lectures for Course __number__ : __name__

Subject: __subject__
Department: __department__
-
+
Instructor: __name__ (__email__)
-
+
__name__
Created: __date__
@@ -129,7 +129,7 @@

Notepads

-
+
@@ -145,7 +145,7 @@ covered at Harvard from 2008 through 2010.

@@ -157,7 +157,7 @@

Archived Courses

@@ -169,11 +169,19 @@

Archived Notes

+
+ + +
+
+

__topic__

+
__text__
+
diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 2e2f38e..d06a72d 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -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 Mom!", 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); } diff --git a/public/stylesheets/fc2.css b/public/stylesheets/fc2.css index 44bd112..2b7ab0c 100644 --- a/public/stylesheets/fc2.css +++ b/public/stylesheets/fc2.css @@ -883,4 +883,8 @@ div.conduct p.vague { -webkit-border-radius: 0.20em; } +.proto { + /*display: none;*/ +} + -- 2.25.1