-
authorec2-user <ec2-user@fcdev4.finalsclub.org>
Tue, 15 Nov 2011 00:39:53 +0000 (00:39 +0000)
committerec2-user <ec2-user@fcdev4.finalsclub.org>
Tue, 15 Nov 2011 00:39:53 +0000 (00:39 +0000)
public/index-jacob.html [new file with mode: 0644]
public/index-joe.html [new file with mode: 0644]
public/index.html [deleted file]
public/index2.html [deleted file]
public/javascripts/main-jacob.js [new file with mode: 0644]
public/javascripts/main-joe.js [new file with mode: 0644]
public/javascripts/main.js [deleted file]
public/javascripts/main2.js [deleted file]

diff --git a/public/index-jacob.html b/public/index-jacob.html
new file mode 100644 (file)
index 0000000..1a5f79a
--- /dev/null
@@ -0,0 +1,411 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+
+       <head>
+               <title>FinalsClub.org</title>
+
+               <!-- XXX Some SEO here would be nice -->
+
+               <link rel='stylesheet' href='/stylesheets/fc2.css'>
+
+               <script type='text/javascript' src='/javascripts/jquery.min.js'></script>
+               <script type='text/javascript' src='/javascripts/es5-shim.min.js'></script>
+               <script type='text/javascript' src='/javascripts/protodiv.js'></script>
+               <script type='text/javascript' src='/javascripts/main.js'></script>
+               <script type='text/javascript' src='/socket.io/socket.io.js'></script>
+
+               <meta name="viewport" content="width=device-width,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0">
+               <meta name="apple-touch-icon" href=""> <!-- XXX -->
+               <meta name="icon" href="">
+
+       </head>
+
+       <body>
+
+               <div class="masthead">
+                       <div class="logbar">
+                               <div class="loginstatus">&nbsp;</div>
+                       </div>
+                       <div class="navbar">
+                               <table>
+                                       <tr>
+                                               <td>
+                                                       <a href="/"><img src="/images/finals-club-wht.png" class="logo"/></a>
+                                               </td>
+                                               <td class="menu">
+                                                       <a href="/schools">Start Here!</a>
+                                                       <a href="http://blog.finalsclub.org">Blog</a>
+                                                       <a href="/archive">Archive</a>
+                                                       <a href="/press">Press</a>
+                                                       <a href="/register">Create an Account</a>
+                                                       <a href="/login" class="special">Login</a>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </div>
+                       <div class="logbar">&nbsp;</div>
+               </div>
+
+               <div id="topofcontent"></div>
+
+
+
+               <div class="content">
+                       <style>
+                               /* The is here is because it's related less to "styling" and more to UI "behavior" */
+                               .page { display: none; }
+                       </style>
+
+
+
+
+                       <div class=page id=pg_home>
+                               <div class="contenthome">
+                                       <div class="tagline">
+                                               <p>
+                                               Welcome to FinalsClub.org, a 501(c)(3) non-profit
+                                               open education project dedicated to helping college
+                                               students collaborate, learn, and share their
+                                               knowledge freely online.
+                                               </p>
+                                               <p>
+                                               Please create an account with your school email address
+                                               to try our tools or browse our course archive to learn
+                                               something new.
+                                               Thank you for helping us improve access to education,
+                                               one lecture at a time.
+                                               </p>
+                                               <p></p>
+                                               <div id="learnsomething" class="button green">Learn something &gt;&gt; </div>
+                                               <p></p>
+                                               <iframe src="http://player.vimeo.com/video/30647271?title=0&amp;byline=0&amp;portrait=0" width="350" height="250" frameborder="0" webkitallowfullscreen="webkitAllowFullScreen" allowfullscreen="allowFullScreen"></iframe>
+                                       </div>
+                               </div>
+                               
+                       </div>
+
+
+
+                       <div class=page id=pg_schools>
+                               <h1>Universities</h1>
+                               <div class="proto school" id=PROTO_school onclick="goPage('/school/___id__')">
+                                       <div class=name>__name__</div>
+                                       <div class=desc>__description__</div>
+                               </div>
+                       </div>
+
+
+
+                       <div class=page id=pg_courses>
+                               <h1>Courses for <span id=school_name></span></h1>
+                               <div class="proto course" id=PROTO_course>
+                                       <div class=dept>__department__</div>
+                                       <div class=name>
+                                               <a href="/course/___id__">__number__: __name__</a>
+                                       </div>
+                               </div>
+                       </div>
+
+
+
+                       <div class=page id=pg_lectures>
+                               <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="proto lectures_instructor" id=PROTO_lectures_instructor>
+                                       Instructor: __name__ (__email__)<br>
+                               </div>
+                               <div class="proto lecture" id=PROTO_lecture>
+                                       <div class=name>
+                                               <a href="/lecture/___id__">__name__</a><br>
+                                               Created: __date__<br>
+                                       </div>
+                               </div>
+                       </div>
+
+
+
+                       <div class=page id=pg_notes>
+                               <h1>Notepads </h1>
+                               <div class="proto note" id=PROTO_note>
+                                       <div class=name>
+                                               <a href="/note/___id__">__name__</a>
+                                       </div>
+                               </div>
+                       </div>
+
+
+
+                       <div class=page id=pg_archive_subjects>
+                               <h1>Archived Subjects</h1>
+                               <p>
+                               Please browse our archive of past courses
+                               covered at Harvard from 2008 through 2010.
+                               </p>
+                               <ul>
+                                       <li class=proto id=PROTO_archive_subject>
+                                               <a href="/archive/subject/__id__">__name__</a>
+                                       </li>
+                               </ul>
+
+                       </div>
+
+
+
+                       <div class=page id=pg_archive_courses>
+                               <h1>Archived Courses</h1>
+                               <ul>
+                                       <li class=proto id=PROTO_archive_course>
+                                               <a href="/archive/course/__id__">__name__</a>
+                                       </li>
+                               </ul>
+
+                       </div>
+
+
+
+                       <div class=page id=pg_archive_notes>
+                               <h1>Archived Notes</h1>
+                               <ul>
+                                       <li class=proto id=PROTO_archive_note>
+                                               <a href="/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>
+
+
+
+                       <div class=page id=pg_register>
+                               <h1>Create an Account</h1>
+                               <form id="credentials" action="/register" method="POST">
+                                       <div class="zarea">
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="email">Email</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="text" name="email">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="password">Password</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="password" name="password">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="school">School</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <select name="school">
+                                                                       <option value="Berkeley">Berkeley</option>
+                                                                       <option value="Brown">Brown</option>
+                                                                       <option value="Columbia">Columbia</option>
+                                                                       <option value="Cornell">Cornell</option>
+                                                                       <option value="Dartmouth">Dartmouth</option>
+                                                                       <option value="Harvard">Harvard</option>
+                                                                       <option value="MIT">MIT</option>
+                                                                       <option value="Princeton">Princeton</option>
+                                                                       <option value="Stanford">Stanford</option>
+                                                                       <option value="UPenn">UPenn</option>
+                                                                       <option value="University of Texas">University of Texas</option>
+                                                                       <option value="Yale">Yale</option>
+                                                                       <option value="Other">Other</option>
+                                                               </select>
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="name">Name</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="text" name="name">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="affil">Affiliation</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <select name="affil">
+                                                                       <option value="Student">Student</option>
+                                                                       <option value="Teachers Assistant">Teachers Assistant</option>
+                                                               </select>
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               &nbsp;
+                                                       </div>
+                                                       <div class="field">
+                                                               <button>Register</button>
+                                                       </div>
+                                               </div>
+                                       </div>
+                               </form>
+                       </div>
+
+
+
+                       <div class=page id=pg_login>
+                               <h1>Login</h1>
+                               <form id="credentials" action="/login" method="POST">
+                                       <div class="zarea">
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="email">Email</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="text" name="email" size="15" value="joe@sleepless.com">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="password">Password</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="password" name="password" size="15">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">&nbsp;
+                                                       </div>
+                                                       <div class="field">
+                                                               <button class="major">Login</button>
+                                                               <span class="reglink">
+                                                                       <a href="/resetpw">Forgot password?</a>
+                                                               </span>
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">&nbsp;
+                                                       </div>
+                                                       <div class="field">
+                                                               <span class="reglink">
+                                                                       <a href="/register">Create an Account</a>
+                                                               </span>
+                                                       </div>
+                                               </div>
+                                       </div>
+                               </form>
+                       </div>
+
+
+                       <div class=page id=pg_conduct>
+                               <div class="conduct">
+                                       <h1>Code of Conduct</h1>
+                                       <p class="academic">
+                                               <img src="/images/keep-it-academic.png" alt="Keep it academic.">
+                                       </p>
+                                       <p class="vague">
+                                               This directive is deliberately vague to
+                                               accommodate creative humor, insight, and exploration.<br>
+                                               Disruptive or irrelevant material, however,
+                                               will be subject to removal.<br>
+                                               Just keep it academic, and we'll all be better off.<br>
+                                       </p>
+                               </div>
+                       </div>
+
+
+
+
+                       <div class=page id=pg_press>
+                               <h1>FinalsClub in the Press</h1>
+                               <div class="press">
+                                       <img src="/images/boston.com.png" class="press">
+                                       <p class="date">December 13, 2009</p>
+                                       <p>Plenty of Harvard graduates have traded on the fame and prestige of their alma mater, but few have done so the way Andrew Magliozzi has. The year he graduated, 2005, he started a tutoring company located steps from Harvard Yard, with a name, Veritas, that is the motto of his storied alma mater.</p>
+                                       <p>Then, two years ago, Magliozzi started up a side project called Finalsclub.org.</p>
+                                       <p class="readmore">
+                                       <a href="http://www.boston.com/bostonglobe/ideas/articles/2009/12/13/freeharvardeducationcom">Read more ...</a>
+                                       </p>
+                               </div>
+                               <hr>
+                               <div class="press">
+                                       <img src="/images/harvard-crimson.jpg" class="press">
+                                       <p class="date">Wednesday, February 18, 2009</p>
+                                       <p>A rapidly growing course preparatory Web site, FinalsClub.org, is moving forward with a plan to expand its site in spite of controversy over the legality of the venture. </p>
+                                       <p>The Web site, which allows students to share notes, create study groups, and blog about lectures and sections, recently hired 10 Harvard College students to serve as BETA testers for the site. </p>
+                                       <p class="readmore">
+                                       <a href="http://www.thecrimson.com/article/2009/2/18/finalscluborg-passes-punch-span-stylefont-weight-boldcorrection">Read more ...</a>
+                                       </p>
+                               </div>
+                               <hr>
+                               <div class="press">
+                                       <img src="/images/blown-to-bits.png" class="press">
+                                       <p class="date">September 27th, 2009</p>
+                                       <p>Computer Science professor and former Dean of Harvard, Harry Lewis, embraces FinalsClub's work and its guiding principle of open education.  Even as Harvard University has not been wholly sympathetic to the FinalsClub mission, invoking the Copyright Act of 1976, assuming a similar position to other major institutions such as University of Texas, Lewis supports working towards the proverbial "temple of the free exchange of ideas."  A course he taught in the Harvard Extension School was also shared freely online.  </p>
+                                       <p class="readmore">
+                                       <a href="http://www.bitsbook.com/2009/09/a-harvard-skirmish-in-the-copyright-wars">Read more ...</a>
+                                       </p>
+                               </div>
+                       </div>
+
+
+
+
+                       <div class=page id=pg_notfound>
+                               <h1>Page Not Found</h1>
+                               Sorry, there is no content for this page.
+                       </div>
+
+
+
+
+               </div>
+
+
+
+
+               <div class="footer">
+                       <table>
+                               <tr>
+                                       <td class="col1">
+                                               <div class="logo">
+                                                       <img src="/images/finals-club-wht.png" title="FinalsClub.org" class="lilogo"/>
+                                               </div>
+                                               <div>Copyright 2011</div>
+                                               <div>All Rights Reserved</div>
+                                       </td>
+                                       <td class="col2">
+                                               <a href="/conduct">Code of Conduct</a>
+                                               <a href="http://blog.finalsclub.org/about.html">About</a>
+                                               <a href="http://blog.finalsclub.org/contact.html">Contact</a>
+                                               <a href="http://blog.finalsclub.org/legal.html">Legal</a>
+                                               <a href="http://blog.finalsclub.org/team.html">Team</a>
+                                       </td>
+                               </tr>
+                       </table>
+               </div>
+               <div class="footerer">
+                       <p>
+                               This work is licensed under a
+                               Creative Commons Attribution-ShareAlike 3.0
+                               United States License
+                       </p>
+                       <p>
+                               <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/us/88x31.png"/></a>
+                               <a href="http://mixpanel.com/f/partner"><img alt="Real Time Web Analytics" src="http://mixpanel.com/site_media/images/partner/badge_blue.png" style="border-width:0;margin:2px;"/></a>
+                       </p>
+               </div>
+
+
+
+
+       </body>
+</html>
diff --git a/public/index-joe.html b/public/index-joe.html
new file mode 100644 (file)
index 0000000..17d9028
--- /dev/null
@@ -0,0 +1,371 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+       <!-- 
+                Currently tested with:
+                                               Mac             Windows
+                                        ______________________
+                       Chrome  |       15              -
+                       Safari  |       5               -
+                       FF              |       8               8
+                       IE              |       N/A             9
+       -->
+
+       <head>
+               <title>FinalsClub.org</title>
+
+               <!-- XXX Some SEO here would be nice -->
+               <link rel='stylesheet' href='/stylesheets/fc2.css'>
+
+               <script type='text/javascript' src='/javascripts/jquery.min.js'></script>
+               <script type='text/javascript' src='/javascripts/es5-shim.min.js'></script>
+               <script type='text/javascript' src='/socket.io/socket.io.js'></script>
+               <script type='text/javascript' src='/javascripts/protodiv.js'></script>
+               <script type='text/javascript' src='/javascripts/main.js'></script>
+
+               <meta name="viewport" content="width=device-width,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0">
+               <meta name="apple-touch-icon" href=""> <!-- XXX -->
+               <meta name="icon" href="">
+
+       </head>
+       <body>
+               <div class="masthead">
+                       <div class="logbar">
+                               <div class="loginstatus">&nbsp;</div>
+                       </div>
+                       <div class="navbar">
+                               <table>
+                                       <tr>
+                                               <td>
+                                                       <a href="/"><img src="/images/finals-club-wht.png" class="logo"/></a>
+                                               </td>
+                                               <td class="menu">
+                                                       <a href="javascript:goPage('/schools')">Start Here!</a>
+                                                       <a href="http://blog.finalsclub.org">Blog</a>
+                                                       <a href="javascript:goPage('/archive')">Archive</a>
+                                                       <a href="javascript:goPage('/press')">Press</a>
+                                                       <a href="javascript:goPage('/register')">Create an Account</a>
+                                                       <a href="javascript:goPage('/login')" class="special">Login</a>
+                                               </td>
+                                       </tr>
+                               </table>
+                       </div>
+                       <div class="logbar">&nbsp;</div>
+               </div>
+
+               <div id="topofcontent"></div>
+
+               <div class="content">
+                       <style>
+                               /* The is here is because it's related less to "styling" and more to UI "behavior" */
+                               .page { display: none; }
+                       </style>
+                       <div class=page id=pg_home>
+                               <div class="contenthome">
+                                       <div class="tagline">
+                                               <p>
+                                               Welcome to FinalsClub.org, a 501(c)(3) non-profit
+                                               open education project dedicated to helping college
+                                               students collaborate, learn, and share their
+                                               knowledge freely online.
+                                               </p>
+                                               <p>
+                                               Please create an account with your school email address
+                                               to try our tools or browse our course archive to learn
+                                               something new.
+                                               Thank you for helping us improve access to education,
+                                               one lecture at a time.
+                                               </p>
+                                               <p></p>
+                                               <div id="learnsomething" class="button green">Learn something &gt;&gt; </div>
+                                               <p></p>
+                                               <iframe src="http://player.vimeo.com/video/30647271?title=0&amp;byline=0&amp;portrait=0" width="350" height="250" frameborder="0" webkitallowfullscreen="webkitAllowFullScreen" allowfullscreen="allowFullScreen"></iframe>
+                                       </div>
+                               </div>
+                       </div>
+
+                       <div class=page id=pg_schools>
+                               <h1>Universities</h1>
+                               <div class="proto school" id=PROTO_school onclick="goPage('/school/___id__')">
+                                       <div class=name>__name__</div>
+                                       <div class=desc>__description__</div>
+                               </div>
+                       </div>
+
+                       <div class=page id=pg_courses>
+                               <h1>Courses for <span id=school_name></span></h1>
+                               <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>
+                               </div>
+                       </div>
+
+                       <div class=page id=pg_lectures>
+                               <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="proto lectures_instructor" id=PROTO_lectures_instructor>
+                                       Instructor: __name__ (__email__)<br>
+                               </div>
+                               <div class="proto lecture" id=PROTO_lecture>
+                                       <div class=name>
+                                               <a href="javascript:goPage('/lecture/___id__')">__name__</a><br>
+                                               Created: __date__<br>
+                                       </div>
+                               </div>
+                       </div>
+
+                       <div class=page id=pg_notes>
+                               <h1>Notepads </h1>
+                               <div class="proto note" id=PROTO_note>
+                                       <div class=name>
+                                               <a href="/note/___id__">__name__</a>
+                                       </div>
+                               </div>
+                       </div>
+
+                       <div class=page id=pg_archive_subjects>
+                               <h1>Archived Subjects</h1>
+                               <p>
+                               Please browse our archive of past courses
+                               covered at Harvard from 2008 through 2010.
+                               </p>
+                               <ul>
+                                       <li class=proto id=PROTO_archive_subject>
+                                               <a href="javascript:goPage('/archive/subject/__id__')">__name__</a>
+                                       </li>
+                               </ul>
+                       </div>
+
+                       <div class=page id=pg_archive_courses>
+                               <h1>Archived Courses</h1>
+                               <ul>
+                                       <li class=proto id=PROTO_archive_course>
+                                               <a href="javascript:goPage('/archive/course/__id__')">__name__</a>
+                                       </li>
+                               </ul>
+                       </div>
+
+                       <div class=page id=pg_archive_notes>
+                               <h1>Archived Notes</h1>
+                               <ul>
+                                       <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>
+<pre>__err__</pre>
+                               </div>
+                       </div>
+
+                       <div class=page id=pg_register>
+                               <h1>Create an Account</h1>
+                               <form id="credentials" action="/register" method="POST">
+                                       <div class="zarea">
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="email">Email</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="text" name="email">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="password">Password</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="password" name="password">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="school">School</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <select name="school">
+                                                                       <option value="Berkeley">Berkeley</option>
+                                                                       <option value="Brown">Brown</option>
+                                                                       <option value="Columbia">Columbia</option>
+                                                                       <option value="Cornell">Cornell</option>
+                                                                       <option value="Dartmouth">Dartmouth</option>
+                                                                       <option value="Harvard">Harvard</option>
+                                                                       <option value="MIT">MIT</option>
+                                                                       <option value="Princeton">Princeton</option>
+                                                                       <option value="Stanford">Stanford</option>
+                                                                       <option value="UPenn">UPenn</option>
+                                                                       <option value="University of Texas">University of Texas</option>
+                                                                       <option value="Yale">Yale</option>
+                                                                       <option value="Other">Other</option>
+                                                               </select>
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="name">Name</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="text" name="name">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="affil">Affiliation</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <select name="affil">
+                                                                       <option value="Student">Student</option>
+                                                                       <option value="Teachers Assistant">Teachers Assistant</option>
+                                                               </select>
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               &nbsp;
+                                                       </div>
+                                                       <div class="field">
+                                                               <button>Register</button>
+                                                       </div>
+                                               </div>
+                                       </div>
+                               </form>
+                       </div>
+
+                       <div class=page id=pg_login>
+                               <h1>Login</h1>
+                               <form id="credentials" action="/login" method="POST">
+                                       <div class="zarea">
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="email">Email</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="text" name="email" size="15" value="joe@sleepless.com">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">
+                                                               <label for="password">Password</label>
+                                                       </div>
+                                                       <div class="field">
+                                                               <input type="password" name="password" size="15">
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">&nbsp;
+                                                       </div>
+                                                       <div class="field">
+                                                               <button class="major">Login</button>
+                                                               <span class="reglink">
+                                                                       <a href="/resetpw">Forgot password?</a>
+                                                               </span>
+                                                       </div>
+                                               </div>
+                                               <div class="row">
+                                                       <div class="label">&nbsp;
+                                                       </div>
+                                                       <div class="field">
+                                                               <span class="reglink">
+                                                                       <a href="/register">Create an Account</a>
+                                                               </span>
+                                                       </div>
+                                               </div>
+                                       </div>
+                               </form>
+                       </div>
+
+                       <div class=page id=pg_conduct>
+                               <div class="conduct">
+                                       <h1>Code of Conduct</h1>
+                                       <p class="academic">
+                                               <img src="/images/keep-it-academic.png" alt="Keep it academic.">
+                                       </p>
+                                       <p class="vague">
+                                               This directive is deliberately vague to
+                                               accommodate creative humor, insight, and exploration.<br>
+                                               Disruptive or irrelevant material, however,
+                                               will be subject to removal.<br>
+                                               Just keep it academic, and we'll all be better off.<br>
+                                       </p>
+                               </div>
+                       </div>
+
+                       <div class=page id=pg_press>
+                               <h1>FinalsClub in the Press</h1>
+                               <div class="press">
+                                       <img src="/images/boston.com.png" class="press">
+                                       <p class="date">December 13, 2009</p>
+                                       <p>Plenty of Harvard graduates have traded on the fame and prestige of their alma mater, but few have done so the way Andrew Magliozzi has. The year he graduated, 2005, he started a tutoring company located steps from Harvard Yard, with a name, Veritas, that is the motto of his storied alma mater.</p>
+                                       <p>Then, two years ago, Magliozzi started up a side project called Finalsclub.org.</p>
+                                       <p class="readmore">
+                                       <a href="http://www.boston.com/bostonglobe/ideas/articles/2009/12/13/freeharvardeducationcom">Read more ...</a>
+                                       </p>
+                               </div>
+                               <hr>
+                               <div class="press">
+                                       <img src="/images/harvard-crimson.jpg" class="press">
+                                       <p class="date">Wednesday, February 18, 2009</p>
+                                       <p>A rapidly growing course preparatory Web site, FinalsClub.org, is moving forward with a plan to expand its site in spite of controversy over the legality of the venture. </p>
+                                       <p>The Web site, which allows students to share notes, create study groups, and blog about lectures and sections, recently hired 10 Harvard College students to serve as BETA testers for the site. </p>
+                                       <p class="readmore">
+                                       <a href="http://www.thecrimson.com/article/2009/2/18/finalscluborg-passes-punch-span-stylefont-weight-boldcorrection">Read more ...</a>
+                                       </p>
+                               </div>
+                               <hr>
+                               <div class="press">
+                                       <img src="/images/blown-to-bits.png" class="press">
+                                       <p class="date">September 27th, 2009</p>
+                                       <p>Computer Science professor and former Dean of Harvard, Harry Lewis, embraces FinalsClub's work and its guiding principle of open education.  Even as Harvard University has not been wholly sympathetic to the FinalsClub mission, invoking the Copyright Act of 1976, assuming a similar position to other major institutions such as University of Texas, Lewis supports working towards the proverbial "temple of the free exchange of ideas."  A course he taught in the Harvard Extension School was also shared freely online.  </p>
+                                       <p class="readmore">
+                                       <a href="http://www.bitsbook.com/2009/09/a-harvard-skirmish-in-the-copyright-wars">Read more ...</a>
+                                       </p>
+                               </div>
+                       </div>
+                       <div class=page id=pg_notfound>
+                               <h1>Page Not Found</h1>
+                               Sorry, there is no content for this page.
+                       </div>
+               </div>
+
+               <div class="footer">
+                       <table>
+                               <tr>
+                                       <td class="col1">
+                                               <div class="logo">
+                                                       <img src="/images/finals-club-wht.png" title="FinalsClub.org" class="lilogo"/>
+                                               </div>
+                                               <div>Copyright 2011</div>
+                                               <div>All Rights Reserved</div>
+                                       </td>
+                                       <td class="col2">
+                                               <a href="javascript:goPage('/conduct')">Code of Conduct</a>
+                                               <a href="http://blog.finalsclub.org/about.html">About</a>
+                                               <a href="http://blog.finalsclub.org/contact.html">Contact</a>
+                                               <a href="http://blog.finalsclub.org/legal.html">Legal</a>
+                                               <a href="http://blog.finalsclub.org/team.html">Team</a>
+                                       </td>
+                               </tr>
+                       </table>
+               </div>
+               <div class="footerer">
+                       <p>
+                               This work is licensed under a
+                               Creative Commons Attribution-ShareAlike 3.0
+                               United States License
+                       </p>
+                       <p>
+                               <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/us/88x31.png"/></a>
+                               <a href="http://mixpanel.com/f/partner"><img alt="Real Time Web Analytics" src="http://mixpanel.com/site_media/images/partner/badge_blue.png" style="border-width:0;margin:2px;"/></a>
+                       </p>
+               </div>
+
+       </body>
+</html>
diff --git a/public/index.html b/public/index.html
deleted file mode 100644 (file)
index 17d9028..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-       <!-- 
-                Currently tested with:
-                                               Mac             Windows
-                                        ______________________
-                       Chrome  |       15              -
-                       Safari  |       5               -
-                       FF              |       8               8
-                       IE              |       N/A             9
-       -->
-
-       <head>
-               <title>FinalsClub.org</title>
-
-               <!-- XXX Some SEO here would be nice -->
-               <link rel='stylesheet' href='/stylesheets/fc2.css'>
-
-               <script type='text/javascript' src='/javascripts/jquery.min.js'></script>
-               <script type='text/javascript' src='/javascripts/es5-shim.min.js'></script>
-               <script type='text/javascript' src='/socket.io/socket.io.js'></script>
-               <script type='text/javascript' src='/javascripts/protodiv.js'></script>
-               <script type='text/javascript' src='/javascripts/main.js'></script>
-
-               <meta name="viewport" content="width=device-width,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0">
-               <meta name="apple-touch-icon" href=""> <!-- XXX -->
-               <meta name="icon" href="">
-
-       </head>
-       <body>
-               <div class="masthead">
-                       <div class="logbar">
-                               <div class="loginstatus">&nbsp;</div>
-                       </div>
-                       <div class="navbar">
-                               <table>
-                                       <tr>
-                                               <td>
-                                                       <a href="/"><img src="/images/finals-club-wht.png" class="logo"/></a>
-                                               </td>
-                                               <td class="menu">
-                                                       <a href="javascript:goPage('/schools')">Start Here!</a>
-                                                       <a href="http://blog.finalsclub.org">Blog</a>
-                                                       <a href="javascript:goPage('/archive')">Archive</a>
-                                                       <a href="javascript:goPage('/press')">Press</a>
-                                                       <a href="javascript:goPage('/register')">Create an Account</a>
-                                                       <a href="javascript:goPage('/login')" class="special">Login</a>
-                                               </td>
-                                       </tr>
-                               </table>
-                       </div>
-                       <div class="logbar">&nbsp;</div>
-               </div>
-
-               <div id="topofcontent"></div>
-
-               <div class="content">
-                       <style>
-                               /* The is here is because it's related less to "styling" and more to UI "behavior" */
-                               .page { display: none; }
-                       </style>
-                       <div class=page id=pg_home>
-                               <div class="contenthome">
-                                       <div class="tagline">
-                                               <p>
-                                               Welcome to FinalsClub.org, a 501(c)(3) non-profit
-                                               open education project dedicated to helping college
-                                               students collaborate, learn, and share their
-                                               knowledge freely online.
-                                               </p>
-                                               <p>
-                                               Please create an account with your school email address
-                                               to try our tools or browse our course archive to learn
-                                               something new.
-                                               Thank you for helping us improve access to education,
-                                               one lecture at a time.
-                                               </p>
-                                               <p></p>
-                                               <div id="learnsomething" class="button green">Learn something &gt;&gt; </div>
-                                               <p></p>
-                                               <iframe src="http://player.vimeo.com/video/30647271?title=0&amp;byline=0&amp;portrait=0" width="350" height="250" frameborder="0" webkitallowfullscreen="webkitAllowFullScreen" allowfullscreen="allowFullScreen"></iframe>
-                                       </div>
-                               </div>
-                       </div>
-
-                       <div class=page id=pg_schools>
-                               <h1>Universities</h1>
-                               <div class="proto school" id=PROTO_school onclick="goPage('/school/___id__')">
-                                       <div class=name>__name__</div>
-                                       <div class=desc>__description__</div>
-                               </div>
-                       </div>
-
-                       <div class=page id=pg_courses>
-                               <h1>Courses for <span id=school_name></span></h1>
-                               <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>
-                               </div>
-                       </div>
-
-                       <div class=page id=pg_lectures>
-                               <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="proto lectures_instructor" id=PROTO_lectures_instructor>
-                                       Instructor: __name__ (__email__)<br>
-                               </div>
-                               <div class="proto lecture" id=PROTO_lecture>
-                                       <div class=name>
-                                               <a href="javascript:goPage('/lecture/___id__')">__name__</a><br>
-                                               Created: __date__<br>
-                                       </div>
-                               </div>
-                       </div>
-
-                       <div class=page id=pg_notes>
-                               <h1>Notepads </h1>
-                               <div class="proto note" id=PROTO_note>
-                                       <div class=name>
-                                               <a href="/note/___id__">__name__</a>
-                                       </div>
-                               </div>
-                       </div>
-
-                       <div class=page id=pg_archive_subjects>
-                               <h1>Archived Subjects</h1>
-                               <p>
-                               Please browse our archive of past courses
-                               covered at Harvard from 2008 through 2010.
-                               </p>
-                               <ul>
-                                       <li class=proto id=PROTO_archive_subject>
-                                               <a href="javascript:goPage('/archive/subject/__id__')">__name__</a>
-                                       </li>
-                               </ul>
-                       </div>
-
-                       <div class=page id=pg_archive_courses>
-                               <h1>Archived Courses</h1>
-                               <ul>
-                                       <li class=proto id=PROTO_archive_course>
-                                               <a href="javascript:goPage('/archive/course/__id__')">__name__</a>
-                                       </li>
-                               </ul>
-                       </div>
-
-                       <div class=page id=pg_archive_notes>
-                               <h1>Archived Notes</h1>
-                               <ul>
-                                       <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>
-<pre>__err__</pre>
-                               </div>
-                       </div>
-
-                       <div class=page id=pg_register>
-                               <h1>Create an Account</h1>
-                               <form id="credentials" action="/register" method="POST">
-                                       <div class="zarea">
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="email">Email</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="text" name="email">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="password">Password</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="password" name="password">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="school">School</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <select name="school">
-                                                                       <option value="Berkeley">Berkeley</option>
-                                                                       <option value="Brown">Brown</option>
-                                                                       <option value="Columbia">Columbia</option>
-                                                                       <option value="Cornell">Cornell</option>
-                                                                       <option value="Dartmouth">Dartmouth</option>
-                                                                       <option value="Harvard">Harvard</option>
-                                                                       <option value="MIT">MIT</option>
-                                                                       <option value="Princeton">Princeton</option>
-                                                                       <option value="Stanford">Stanford</option>
-                                                                       <option value="UPenn">UPenn</option>
-                                                                       <option value="University of Texas">University of Texas</option>
-                                                                       <option value="Yale">Yale</option>
-                                                                       <option value="Other">Other</option>
-                                                               </select>
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="name">Name</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="text" name="name">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="affil">Affiliation</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <select name="affil">
-                                                                       <option value="Student">Student</option>
-                                                                       <option value="Teachers Assistant">Teachers Assistant</option>
-                                                               </select>
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               &nbsp;
-                                                       </div>
-                                                       <div class="field">
-                                                               <button>Register</button>
-                                                       </div>
-                                               </div>
-                                       </div>
-                               </form>
-                       </div>
-
-                       <div class=page id=pg_login>
-                               <h1>Login</h1>
-                               <form id="credentials" action="/login" method="POST">
-                                       <div class="zarea">
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="email">Email</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="text" name="email" size="15" value="joe@sleepless.com">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="password">Password</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="password" name="password" size="15">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">&nbsp;
-                                                       </div>
-                                                       <div class="field">
-                                                               <button class="major">Login</button>
-                                                               <span class="reglink">
-                                                                       <a href="/resetpw">Forgot password?</a>
-                                                               </span>
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">&nbsp;
-                                                       </div>
-                                                       <div class="field">
-                                                               <span class="reglink">
-                                                                       <a href="/register">Create an Account</a>
-                                                               </span>
-                                                       </div>
-                                               </div>
-                                       </div>
-                               </form>
-                       </div>
-
-                       <div class=page id=pg_conduct>
-                               <div class="conduct">
-                                       <h1>Code of Conduct</h1>
-                                       <p class="academic">
-                                               <img src="/images/keep-it-academic.png" alt="Keep it academic.">
-                                       </p>
-                                       <p class="vague">
-                                               This directive is deliberately vague to
-                                               accommodate creative humor, insight, and exploration.<br>
-                                               Disruptive or irrelevant material, however,
-                                               will be subject to removal.<br>
-                                               Just keep it academic, and we'll all be better off.<br>
-                                       </p>
-                               </div>
-                       </div>
-
-                       <div class=page id=pg_press>
-                               <h1>FinalsClub in the Press</h1>
-                               <div class="press">
-                                       <img src="/images/boston.com.png" class="press">
-                                       <p class="date">December 13, 2009</p>
-                                       <p>Plenty of Harvard graduates have traded on the fame and prestige of their alma mater, but few have done so the way Andrew Magliozzi has. The year he graduated, 2005, he started a tutoring company located steps from Harvard Yard, with a name, Veritas, that is the motto of his storied alma mater.</p>
-                                       <p>Then, two years ago, Magliozzi started up a side project called Finalsclub.org.</p>
-                                       <p class="readmore">
-                                       <a href="http://www.boston.com/bostonglobe/ideas/articles/2009/12/13/freeharvardeducationcom">Read more ...</a>
-                                       </p>
-                               </div>
-                               <hr>
-                               <div class="press">
-                                       <img src="/images/harvard-crimson.jpg" class="press">
-                                       <p class="date">Wednesday, February 18, 2009</p>
-                                       <p>A rapidly growing course preparatory Web site, FinalsClub.org, is moving forward with a plan to expand its site in spite of controversy over the legality of the venture. </p>
-                                       <p>The Web site, which allows students to share notes, create study groups, and blog about lectures and sections, recently hired 10 Harvard College students to serve as BETA testers for the site. </p>
-                                       <p class="readmore">
-                                       <a href="http://www.thecrimson.com/article/2009/2/18/finalscluborg-passes-punch-span-stylefont-weight-boldcorrection">Read more ...</a>
-                                       </p>
-                               </div>
-                               <hr>
-                               <div class="press">
-                                       <img src="/images/blown-to-bits.png" class="press">
-                                       <p class="date">September 27th, 2009</p>
-                                       <p>Computer Science professor and former Dean of Harvard, Harry Lewis, embraces FinalsClub's work and its guiding principle of open education.  Even as Harvard University has not been wholly sympathetic to the FinalsClub mission, invoking the Copyright Act of 1976, assuming a similar position to other major institutions such as University of Texas, Lewis supports working towards the proverbial "temple of the free exchange of ideas."  A course he taught in the Harvard Extension School was also shared freely online.  </p>
-                                       <p class="readmore">
-                                       <a href="http://www.bitsbook.com/2009/09/a-harvard-skirmish-in-the-copyright-wars">Read more ...</a>
-                                       </p>
-                               </div>
-                       </div>
-                       <div class=page id=pg_notfound>
-                               <h1>Page Not Found</h1>
-                               Sorry, there is no content for this page.
-                       </div>
-               </div>
-
-               <div class="footer">
-                       <table>
-                               <tr>
-                                       <td class="col1">
-                                               <div class="logo">
-                                                       <img src="/images/finals-club-wht.png" title="FinalsClub.org" class="lilogo"/>
-                                               </div>
-                                               <div>Copyright 2011</div>
-                                               <div>All Rights Reserved</div>
-                                       </td>
-                                       <td class="col2">
-                                               <a href="javascript:goPage('/conduct')">Code of Conduct</a>
-                                               <a href="http://blog.finalsclub.org/about.html">About</a>
-                                               <a href="http://blog.finalsclub.org/contact.html">Contact</a>
-                                               <a href="http://blog.finalsclub.org/legal.html">Legal</a>
-                                               <a href="http://blog.finalsclub.org/team.html">Team</a>
-                                       </td>
-                               </tr>
-                       </table>
-               </div>
-               <div class="footerer">
-                       <p>
-                               This work is licensed under a
-                               Creative Commons Attribution-ShareAlike 3.0
-                               United States License
-                       </p>
-                       <p>
-                               <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/us/88x31.png"/></a>
-                               <a href="http://mixpanel.com/f/partner"><img alt="Real Time Web Analytics" src="http://mixpanel.com/site_media/images/partner/badge_blue.png" style="border-width:0;margin:2px;"/></a>
-                       </p>
-               </div>
-
-       </body>
-</html>
diff --git a/public/index2.html b/public/index2.html
deleted file mode 100644 (file)
index 1a5f79a..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-
-       <head>
-               <title>FinalsClub.org</title>
-
-               <!-- XXX Some SEO here would be nice -->
-
-               <link rel='stylesheet' href='/stylesheets/fc2.css'>
-
-               <script type='text/javascript' src='/javascripts/jquery.min.js'></script>
-               <script type='text/javascript' src='/javascripts/es5-shim.min.js'></script>
-               <script type='text/javascript' src='/javascripts/protodiv.js'></script>
-               <script type='text/javascript' src='/javascripts/main.js'></script>
-               <script type='text/javascript' src='/socket.io/socket.io.js'></script>
-
-               <meta name="viewport" content="width=device-width,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0">
-               <meta name="apple-touch-icon" href=""> <!-- XXX -->
-               <meta name="icon" href="">
-
-       </head>
-
-       <body>
-
-               <div class="masthead">
-                       <div class="logbar">
-                               <div class="loginstatus">&nbsp;</div>
-                       </div>
-                       <div class="navbar">
-                               <table>
-                                       <tr>
-                                               <td>
-                                                       <a href="/"><img src="/images/finals-club-wht.png" class="logo"/></a>
-                                               </td>
-                                               <td class="menu">
-                                                       <a href="/schools">Start Here!</a>
-                                                       <a href="http://blog.finalsclub.org">Blog</a>
-                                                       <a href="/archive">Archive</a>
-                                                       <a href="/press">Press</a>
-                                                       <a href="/register">Create an Account</a>
-                                                       <a href="/login" class="special">Login</a>
-                                               </td>
-                                       </tr>
-                               </table>
-                       </div>
-                       <div class="logbar">&nbsp;</div>
-               </div>
-
-               <div id="topofcontent"></div>
-
-
-
-               <div class="content">
-                       <style>
-                               /* The is here is because it's related less to "styling" and more to UI "behavior" */
-                               .page { display: none; }
-                       </style>
-
-
-
-
-                       <div class=page id=pg_home>
-                               <div class="contenthome">
-                                       <div class="tagline">
-                                               <p>
-                                               Welcome to FinalsClub.org, a 501(c)(3) non-profit
-                                               open education project dedicated to helping college
-                                               students collaborate, learn, and share their
-                                               knowledge freely online.
-                                               </p>
-                                               <p>
-                                               Please create an account with your school email address
-                                               to try our tools or browse our course archive to learn
-                                               something new.
-                                               Thank you for helping us improve access to education,
-                                               one lecture at a time.
-                                               </p>
-                                               <p></p>
-                                               <div id="learnsomething" class="button green">Learn something &gt;&gt; </div>
-                                               <p></p>
-                                               <iframe src="http://player.vimeo.com/video/30647271?title=0&amp;byline=0&amp;portrait=0" width="350" height="250" frameborder="0" webkitallowfullscreen="webkitAllowFullScreen" allowfullscreen="allowFullScreen"></iframe>
-                                       </div>
-                               </div>
-                               
-                       </div>
-
-
-
-                       <div class=page id=pg_schools>
-                               <h1>Universities</h1>
-                               <div class="proto school" id=PROTO_school onclick="goPage('/school/___id__')">
-                                       <div class=name>__name__</div>
-                                       <div class=desc>__description__</div>
-                               </div>
-                       </div>
-
-
-
-                       <div class=page id=pg_courses>
-                               <h1>Courses for <span id=school_name></span></h1>
-                               <div class="proto course" id=PROTO_course>
-                                       <div class=dept>__department__</div>
-                                       <div class=name>
-                                               <a href="/course/___id__">__number__: __name__</a>
-                                       </div>
-                               </div>
-                       </div>
-
-
-
-                       <div class=page id=pg_lectures>
-                               <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="proto lectures_instructor" id=PROTO_lectures_instructor>
-                                       Instructor: __name__ (__email__)<br>
-                               </div>
-                               <div class="proto lecture" id=PROTO_lecture>
-                                       <div class=name>
-                                               <a href="/lecture/___id__">__name__</a><br>
-                                               Created: __date__<br>
-                                       </div>
-                               </div>
-                       </div>
-
-
-
-                       <div class=page id=pg_notes>
-                               <h1>Notepads </h1>
-                               <div class="proto note" id=PROTO_note>
-                                       <div class=name>
-                                               <a href="/note/___id__">__name__</a>
-                                       </div>
-                               </div>
-                       </div>
-
-
-
-                       <div class=page id=pg_archive_subjects>
-                               <h1>Archived Subjects</h1>
-                               <p>
-                               Please browse our archive of past courses
-                               covered at Harvard from 2008 through 2010.
-                               </p>
-                               <ul>
-                                       <li class=proto id=PROTO_archive_subject>
-                                               <a href="/archive/subject/__id__">__name__</a>
-                                       </li>
-                               </ul>
-
-                       </div>
-
-
-
-                       <div class=page id=pg_archive_courses>
-                               <h1>Archived Courses</h1>
-                               <ul>
-                                       <li class=proto id=PROTO_archive_course>
-                                               <a href="/archive/course/__id__">__name__</a>
-                                       </li>
-                               </ul>
-
-                       </div>
-
-
-
-                       <div class=page id=pg_archive_notes>
-                               <h1>Archived Notes</h1>
-                               <ul>
-                                       <li class=proto id=PROTO_archive_note>
-                                               <a href="/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>
-
-
-
-                       <div class=page id=pg_register>
-                               <h1>Create an Account</h1>
-                               <form id="credentials" action="/register" method="POST">
-                                       <div class="zarea">
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="email">Email</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="text" name="email">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="password">Password</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="password" name="password">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="school">School</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <select name="school">
-                                                                       <option value="Berkeley">Berkeley</option>
-                                                                       <option value="Brown">Brown</option>
-                                                                       <option value="Columbia">Columbia</option>
-                                                                       <option value="Cornell">Cornell</option>
-                                                                       <option value="Dartmouth">Dartmouth</option>
-                                                                       <option value="Harvard">Harvard</option>
-                                                                       <option value="MIT">MIT</option>
-                                                                       <option value="Princeton">Princeton</option>
-                                                                       <option value="Stanford">Stanford</option>
-                                                                       <option value="UPenn">UPenn</option>
-                                                                       <option value="University of Texas">University of Texas</option>
-                                                                       <option value="Yale">Yale</option>
-                                                                       <option value="Other">Other</option>
-                                                               </select>
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="name">Name</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="text" name="name">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="affil">Affiliation</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <select name="affil">
-                                                                       <option value="Student">Student</option>
-                                                                       <option value="Teachers Assistant">Teachers Assistant</option>
-                                                               </select>
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               &nbsp;
-                                                       </div>
-                                                       <div class="field">
-                                                               <button>Register</button>
-                                                       </div>
-                                               </div>
-                                       </div>
-                               </form>
-                       </div>
-
-
-
-                       <div class=page id=pg_login>
-                               <h1>Login</h1>
-                               <form id="credentials" action="/login" method="POST">
-                                       <div class="zarea">
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="email">Email</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="text" name="email" size="15" value="joe@sleepless.com">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">
-                                                               <label for="password">Password</label>
-                                                       </div>
-                                                       <div class="field">
-                                                               <input type="password" name="password" size="15">
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">&nbsp;
-                                                       </div>
-                                                       <div class="field">
-                                                               <button class="major">Login</button>
-                                                               <span class="reglink">
-                                                                       <a href="/resetpw">Forgot password?</a>
-                                                               </span>
-                                                       </div>
-                                               </div>
-                                               <div class="row">
-                                                       <div class="label">&nbsp;
-                                                       </div>
-                                                       <div class="field">
-                                                               <span class="reglink">
-                                                                       <a href="/register">Create an Account</a>
-                                                               </span>
-                                                       </div>
-                                               </div>
-                                       </div>
-                               </form>
-                       </div>
-
-
-                       <div class=page id=pg_conduct>
-                               <div class="conduct">
-                                       <h1>Code of Conduct</h1>
-                                       <p class="academic">
-                                               <img src="/images/keep-it-academic.png" alt="Keep it academic.">
-                                       </p>
-                                       <p class="vague">
-                                               This directive is deliberately vague to
-                                               accommodate creative humor, insight, and exploration.<br>
-                                               Disruptive or irrelevant material, however,
-                                               will be subject to removal.<br>
-                                               Just keep it academic, and we'll all be better off.<br>
-                                       </p>
-                               </div>
-                       </div>
-
-
-
-
-                       <div class=page id=pg_press>
-                               <h1>FinalsClub in the Press</h1>
-                               <div class="press">
-                                       <img src="/images/boston.com.png" class="press">
-                                       <p class="date">December 13, 2009</p>
-                                       <p>Plenty of Harvard graduates have traded on the fame and prestige of their alma mater, but few have done so the way Andrew Magliozzi has. The year he graduated, 2005, he started a tutoring company located steps from Harvard Yard, with a name, Veritas, that is the motto of his storied alma mater.</p>
-                                       <p>Then, two years ago, Magliozzi started up a side project called Finalsclub.org.</p>
-                                       <p class="readmore">
-                                       <a href="http://www.boston.com/bostonglobe/ideas/articles/2009/12/13/freeharvardeducationcom">Read more ...</a>
-                                       </p>
-                               </div>
-                               <hr>
-                               <div class="press">
-                                       <img src="/images/harvard-crimson.jpg" class="press">
-                                       <p class="date">Wednesday, February 18, 2009</p>
-                                       <p>A rapidly growing course preparatory Web site, FinalsClub.org, is moving forward with a plan to expand its site in spite of controversy over the legality of the venture. </p>
-                                       <p>The Web site, which allows students to share notes, create study groups, and blog about lectures and sections, recently hired 10 Harvard College students to serve as BETA testers for the site. </p>
-                                       <p class="readmore">
-                                       <a href="http://www.thecrimson.com/article/2009/2/18/finalscluborg-passes-punch-span-stylefont-weight-boldcorrection">Read more ...</a>
-                                       </p>
-                               </div>
-                               <hr>
-                               <div class="press">
-                                       <img src="/images/blown-to-bits.png" class="press">
-                                       <p class="date">September 27th, 2009</p>
-                                       <p>Computer Science professor and former Dean of Harvard, Harry Lewis, embraces FinalsClub's work and its guiding principle of open education.  Even as Harvard University has not been wholly sympathetic to the FinalsClub mission, invoking the Copyright Act of 1976, assuming a similar position to other major institutions such as University of Texas, Lewis supports working towards the proverbial "temple of the free exchange of ideas."  A course he taught in the Harvard Extension School was also shared freely online.  </p>
-                                       <p class="readmore">
-                                       <a href="http://www.bitsbook.com/2009/09/a-harvard-skirmish-in-the-copyright-wars">Read more ...</a>
-                                       </p>
-                               </div>
-                       </div>
-
-
-
-
-                       <div class=page id=pg_notfound>
-                               <h1>Page Not Found</h1>
-                               Sorry, there is no content for this page.
-                       </div>
-
-
-
-
-               </div>
-
-
-
-
-               <div class="footer">
-                       <table>
-                               <tr>
-                                       <td class="col1">
-                                               <div class="logo">
-                                                       <img src="/images/finals-club-wht.png" title="FinalsClub.org" class="lilogo"/>
-                                               </div>
-                                               <div>Copyright 2011</div>
-                                               <div>All Rights Reserved</div>
-                                       </td>
-                                       <td class="col2">
-                                               <a href="/conduct">Code of Conduct</a>
-                                               <a href="http://blog.finalsclub.org/about.html">About</a>
-                                               <a href="http://blog.finalsclub.org/contact.html">Contact</a>
-                                               <a href="http://blog.finalsclub.org/legal.html">Legal</a>
-                                               <a href="http://blog.finalsclub.org/team.html">Team</a>
-                                       </td>
-                               </tr>
-                       </table>
-               </div>
-               <div class="footerer">
-                       <p>
-                               This work is licensed under a
-                               Creative Commons Attribution-ShareAlike 3.0
-                               United States License
-                       </p>
-                       <p>
-                               <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/us/88x31.png"/></a>
-                               <a href="http://mixpanel.com/f/partner"><img alt="Real Time Web Analytics" src="http://mixpanel.com/site_media/images/partner/badge_blue.png" style="border-width:0;margin:2px;"/></a>
-                       </p>
-               </div>
-
-
-
-
-       </body>
-</html>
diff --git a/public/javascripts/main-jacob.js b/public/javascripts/main-jacob.js
new file mode 100644 (file)
index 0000000..41b9f0f
--- /dev/null
@@ -0,0 +1,376 @@
+
+/*
+
+This is the core logic for the main page.
+It implements most page transitions by showing and hiding DIV elements
+in the page with javascript+jquery
+
+*/
+
+
+/* Convert a JSON string to an object, or null if unparseable */
+function j2o(json) { try { return JSON.parse(json); } catch(e) { return null; } }
+
+/* Convert an object to a JSON string (just easier to type than "JSON.stringify" */
+function o2j(obj) { return JSON.stringify(obj); }
+
+
+
+function showHome(cb) {
+       cb("home");
+}
+
+
+
+// go to the page that lists the schools
+function showSchools(response, cb) {
+
+  var path = window.location.pathname;
+
+       ProtoDiv.reset("PROTO_school");
+
+
+      var schools = []
+      if(typeof response == 'object') {
+        schools = response.schools
+      }
+
+      ProtoDiv.replicate("PROTO_school", schools);
+
+      cb("schools");
+
+}
+
+
+
+// go to the page that lists the courses for a specific school
+function showCourses(response, cb) {
+
+  var path = window.location.pathname;
+
+
+       ProtoDiv.reset("PROTO_course");
+
+               var courses = []
+               if(typeof response == 'object') {
+                       var school = response.school
+                       $("#school_name").html(school.name);
+                       courses = school.courses
+               }
+
+               ProtoDiv.replicate("PROTO_course", courses);
+
+               cb("courses")
+}
+
+
+
+
+// go to the page that lists the lectures for a specific course
+function showLectures(response, cb) {
+
+  var path = window.location.pathname;
+  
+
+       ProtoDiv.reset("PROTO_lecture");
+       
+               ProtoDiv.reset("PROTO_lectures_head")
+               ProtoDiv.reset("PROTO_lectures_instructor")
+               ProtoDiv.reset("PROTO_lecture")
+
+               if(typeof response == 'object') {
+
+                       var course = response.course
+                       if(course)
+                               ProtoDiv.replicate("PROTO_lectures_head", [course])
+
+                       var instructor = response.instructor
+                       if(instructor)
+                               ProtoDiv.replicate("PROTO_lectures_instructor", [instructor])
+
+                       var lectures = response.lectures
+                       if(lectures)
+                               ProtoDiv.replicate("PROTO_lecture", lectures);
+
+               }
+
+               cb("lectures")
+}
+
+
+
+// go to the page that lists the note taking sessions for a specific lecture
+function showNotes(response, cb) {
+
+  var path = window.location.pathname;
+
+
+       ProtoDiv.reset("PROTO_note");
+       
+               if(typeof response == 'object') {
+
+                       var course = response.course
+                       //if(course)
+                       //      ProtoDiv.replicate("PROTO_lectures_head", [course])
+
+                       var instructor = response.instructor
+                       //if(instructor)
+                       //      ProtoDiv.replicate("PROTO_lectures_instructor", [instructor])
+
+                       var lecture = response.lecture
+                       //if(lecture)
+                       //      ProtoDiv.replicate("PROTO_lecture", lectures);
+
+                       var notes = response.notes
+                       if(notes)
+                               ProtoDiv.replicate("PROTO_note", notes);
+
+               }
+
+               cb("notes")
+}
+
+
+// go to the page that lists the archived subject names
+function showArchiveSubjects(response, cb) {
+
+  var path = window.location.pathname;
+
+       ProtoDiv.reset("PROTO_archive_subject")
+
+               var subjects = response.subjects
+
+               ProtoDiv.replicate("PROTO_archive_subject", subjects)
+
+       cb("archive_subjects")
+}
+
+
+
+function showArchiveCourses(response, cb) {
+
+  var path = window.location.pathname;
+
+
+       ProtoDiv.reset("PROTO_archive_course")
+
+               var courses = response.courses
+
+               ProtoDiv.replicate("PROTO_archive_course", courses)
+
+       cb("archive_courses")
+}
+
+
+
+function showArchiveNotes(response, cb) {
+
+  var path = window.location.pathname;
+
+
+       ProtoDiv.reset("PROTO_archive_note")
+
+               var notes = response.notes
+               $.each(notes, function(i, note) {
+                       if(!note.topic)
+                               note.topic = note._id//note.text.substr(0, 15)+" ..."
+               })
+
+               ProtoDiv.replicate("PROTO_archive_note", notes)
+
+       cb("archive_notes")
+}
+
+
+
+function showArchiveNote(response, cb) {
+
+  var path = window.location.pathname;
+
+
+       ProtoDiv.reset("PROTO_archive_note_display")
+
+               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(response, cb) {
+       // xxx clear fields?
+       // xxx change FORM to use AJAX
+       cb("register");
+}
+
+
+function showLogin(response, cb) {
+       cb("login");
+}
+
+
+
+
+// go to the press articles page
+function showPress(response, cb) {
+       cb("press");
+}
+
+
+// go to the "code of conduct" page
+function showConduct(response, cb) {
+       cb("conduct");
+}
+
+
+
+
+var pageVectors = [
+       { regex: /^\/(index.html)?$/, func: showHome },
+       { 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: /^\/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 },
+       { regex: /^\/conduct/, func: showConduct },
+];
+
+var testVectors = {
+  schools: showSchools,
+  school: showCourses,
+  course: showLectures,
+  lecture: showNotes,
+  archive: showArchiveSubjects,
+  archivesubject: showArchiveCourses,
+  archivecourse: showArchiveNotes,
+  archivenote: showArchiveNote,
+  login: showLogin,
+  press: showPress,
+  conduct: showConduct
+}
+
+/* Do and show the appropriate thing, based on the pages current URL */
+function showPage(y) {
+
+       var path = document.location.pathname
+
+  var mainSlug = path.match(/((?:[a-z][a-z]+))/) ? path.match(/((?:[a-z][a-z]+))/)[1].toLowerCase() : '';
+  if (mainSlug === 'archive') {
+    var archiveSlugs = path.match(/((?:[a-z][a-z]+))\/((?:[a-z][a-z0-9_]*))/);
+    if (archiveSlugs) {
+      mainSlug = mainSlug + archiveSlugs[2];
+    }
+  }
+
+       $(".page").hide(); //(100);             // hide all pseudo pages
+
+  if (testVectors[mainSlug]) {
+    return $.get(path, { cache: false }, function(response) {
+      if (response.status === 'error') {
+        console.log(response.message)
+        $("#pg_notfound").fadeIn(100);
+        window.scroll(0, 0)
+        return;
+      }
+      testVectors[mainSlug](response, function(pageId) {
+        $("#pg_"+pageId).fadeIn(100);
+        window.scroll(0, y)
+      })
+    });
+  } else if (path === '/') {
+    return showHome(function(pageId) {
+      $("#pg_"+pageId).fadeIn(100);
+      window.scroll(0, y)
+    })
+  }
+
+  $("#pg_notfound").fadeIn(100);
+  window.scroll(0, 0)
+  /*
+       for(var i = 0; i < pageVectors.length; i++) {
+               var vector = pageVectors[i]
+               var matches = path.match(vector.regex)
+               if(matches) {
+                       vector.func(function(pageId) {
+
+                               $("#pg_"+pageId).fadeIn(100);
+
+                               window.scroll(0, y)
+
+                       })
+                       break
+               }
+       }
+  
+
+       if(i == pageVectors.length) {
+       }
+       // scroll to top of page (as if we'd done a real page fetch)
+       /*$('html, body').animate({
+               scrollTop: $("#topofcontent").offset().top
+       }, 100);*/
+
+}
+
+
+
+
+/* Simulates a page load.
+       'path' is something like "/schools", etc.
+       A page fetch doesn't really happen.
+       Based on what path looks like, an appropriate DIV is shown, and action taken
+*/
+var topQueue = [0]
+function goPage(path) {
+       var y = 0 + window.pageYOffset
+       topQueue.push(y)
+       history.pushState({}, path, path);
+       showPage(0);
+}
+
+
+/* Simulates a "back" browser navigation.  */
+function goBack(event) {
+       var y = topQueue.pop()
+       showPage( y );
+}
+
+
+       window.onpopstate = goBack
+
+  $('a[href^=/]').live('click', function(e) {
+    var path = e.target.pathname || '/';
+    var checkNote = path.match(/((?:[a-z][a-z]+))/);
+    if (checkNote && checkNote[1] == 'note') {
+      return true;
+    } else {
+      goPage(path)
+      return false;
+    }
+  })
+$(document).ready(function() {
+
+       // This code executes after the page has been fully loaded
+
+
+       // xxx older FF browsers don't fire a page load/reload - deal with it somehow.
+       // showPage( 0 );               // needed for some older browsers, redundant for chrome
+
+})
+
+
+
+
+
diff --git a/public/javascripts/main-joe.js b/public/javascripts/main-joe.js
new file mode 100644 (file)
index 0000000..e81bff2
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+This is the core logic for the main page.
+It implements most page transitions by showing and hiding DIV elements
+in the page with javascript+jquery
+*/
+
+/* Convert a JSON string to an object, or null if unparseable */
+function j2o(json) { try { return JSON.parse(json); } catch(e) { return null; } }
+
+/* Convert an object to a JSON string (just easier to type than "JSON.stringify" */
+function o2j(obj) { return JSON.stringify(obj); }
+
+function showHome(matches, cb) {
+       cb("home");
+}
+
+// go to the page that lists the schools
+function showSchools(matches, cb) {
+       ProtoDiv.reset("PROTO_school");
+       $.get("/schools", { cache: false }, function(response) {
+               var schools = [];
+               if(typeof response == 'object') {
+                       schools = response.schools;
+               }
+               ProtoDiv.replicate("PROTO_school", schools);
+               cb("schools");
+       });
+}
+
+// go to the page that lists the courses for a specific school
+function showCourses(matches, cb) {
+       var schoolId = matches[1];
+       ProtoDiv.reset("PROTO_course");
+       $.get("/school/"+schoolId, { cache: false }, function(response) {
+               var courses = [];
+               if(typeof response == 'object') {
+                       var school = response.school;
+                       $("#school_name").html(school.name);
+                       courses = school.courses;
+               }
+               ProtoDiv.replicate("PROTO_course", courses);
+               cb("courses");
+       });
+}
+
+// go to the page that lists the lectures for a specific course
+function showLectures(matches, cb) {
+       var courseId = matches[1];
+       ProtoDiv.reset("PROTO_lecture");
+       $.get("/course/"+courseId, { cache: false }, function(response) {
+               ProtoDiv.reset("PROTO_lectures_head");
+               ProtoDiv.reset("PROTO_lectures_instructor");
+               ProtoDiv.reset("PROTO_lecture");
+               if(typeof response == 'object') {
+                       var course = response.course;
+                       if(course)
+                               ProtoDiv.replicate("PROTO_lectures_head", [course]);
+                       var instructor = response.instructor;
+                       if(instructor)
+                               ProtoDiv.replicate("PROTO_lectures_instructor", [instructor]);
+                       var lectures = response.lectures;
+                       if(lectures)
+                               ProtoDiv.replicate("PROTO_lecture", lectures);
+               }
+               cb("lectures");
+       });
+}
+
+// go to the page that lists the note taking sessions for a specific lecture
+function showNotes(matches, cb) {
+       var lectureId = matches[1];
+       ProtoDiv.reset("PROTO_note");
+       $.get("/lecture/"+lectureId, { cache: false }, function(response) {
+               if(typeof response == 'object') {
+                       var course = response.course;
+                       //if(course)
+                       //      ProtoDiv.replicate("PROTO_lectures_head", [course])
+                       var instructor = response.instructor;
+                       //if(instructor)
+                       //      ProtoDiv.replicate("PROTO_lectures_instructor", [instructor])
+                       var lecture = response.lecture;
+                       //if(lecture)
+                       //      ProtoDiv.replicate("PROTO_lecture", lectures);
+                       var notes = response.notes;
+                       if(notes)
+                               ProtoDiv.replicate("PROTO_note", notes);
+               }
+               cb("notes");
+       });
+}
+
+// go to the page that lists the archived subject names
+function showArchiveSubjects(matches, cb) {
+       ProtoDiv.reset("PROTO_archive_subject");
+       $.get("/archive", { cache: false }, function(response) {
+               var subjects = response.subjects;
+               ProtoDiv.replicate("PROTO_archive_subject", subjects);
+       })
+       cb("archive_subjects");
+}
+
+function showArchiveCourses(matches, cb) {
+       var subjectId = parseInt(matches[1]);
+       ProtoDiv.reset("PROTO_archive_course");
+       $.get("/archive/subject/"+subjectId, { cache: false }, function(response) {
+               var courses = response.courses;
+               ProtoDiv.replicate("PROTO_archive_course", courses);
+       })
+       cb("archive_courses");
+}
+
+function showArchiveNotes(matches, cb) {
+       var courseId = parseInt(matches[1]);
+       ProtoDiv.reset("PROTO_archive_note");
+       $.get("/archive/course/"+courseId, { cache: false }, function(response) {
+               var notes = response.notes;
+               $.each(notes, function(i, note) {
+                       if(!note.topic)
+                               note.topic = note.text.substr(0, 15)+" ...";
+               })
+               ProtoDiv.replicate("PROTO_archive_note", notes);
+       })
+       cb("archive_notes");
+}
+
+
+
+function showArchiveNote(matches, cb) {
+       var noteId = 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" }
+//             note.text = note.text || ""
+               if(!note.topic)
+                       note.topic = note.text.substr(0, 15)+" ...";
+//             if(note.err) {
+//                     note.topic = note.message
+//                     note.err = note.err.stack
+//             }
+//
+               ProtoDiv.replicate("PROTO_archive_note_display", note);
+       })
+       cb("archive_note_display");
+}
+
+// go to the account registration page
+function showRegister(matches, cb) {
+       // xxx clear fields?
+       // xxx change FORM to use AJAX
+       cb("register");
+}
+
+function showLogin(matches, cb) {
+       cb("login");
+}
+
+// go to the press articles page
+function showPress(matches, cb) {
+       cb("press");
+}
+
+// go to the "code of conduct" page
+function showConduct(matches, cb) {
+       cb("conduct");
+}
+
+var pageVectors = [
+       { regex: /^\/(index.html)?$/, func: showHome },
+       { 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: /^\/archive\/?$/, func: showArchiveSubjects },
+       { regex: /^\/archive\/subject\/([0-9]+)/, func: showArchiveCourses },
+       { regex: /^\/archive\/course\/([0-9]+)/, func: showArchiveNotes },
+       { regex: /^\/archive\/note\/([a-f0-9]{24})/, func: showArchiveNote },
+       { regex: /^\/login/, func: showLogin },
+       { regex: /^\/register/, func: showRegister },
+       { regex: /^\/press/, func: showPress },
+       { regex: /^\/conduct/, func: showConduct }
+];
+
+/* Do and show the appropriate thing, based on the pages current URL */
+function showPage(y) {
+       var path = document.location.pathname;
+       $(".page").hide(); //(100);             // hide all pseudo pages
+       for(var i = 0; i < pageVectors.length; i++) {
+               var vector = pageVectors[i];
+               var matches = path.match(vector.regex);
+               if(matches) {
+                       vector.func(matches, function(pageId) {
+                               $("#pg_"+pageId).fadeIn(100);
+                               window.scroll(0, y);
+                       })
+                       break;
+               }
+       }
+       if(i == pageVectors.length) {
+               $("#pg_notfound").fadeIn(100);
+               window.scroll(0, 0);
+       }
+       // scroll to top of page (as if we'd done a real page fetch)
+       /*$('html, body').animate({
+               scrollTop: $("#topofcontent").offset().top
+       }, 100);*/
+}
+
+/* Simulates a page load.
+       'path' is something like "/schools", etc.
+       A page fetch doesn't really happen.
+       Based on what path looks like, an appropriate DIV is shown, and action taken
+*/
+var topQueue = [0];
+function goPage(path) {
+       if(history.pushState !== undefined) {
+               topQueue.push(window.pageYOffset);
+               history.pushState({}, path, path);
+               showPage(0);
+       }
+       else {
+               document.location = path;
+       }
+}
+
+/* Simulates a "back" browser navigation.  */
+var popped = false;
+function goBack(event) {
+       popped = true;
+       showPage( topQueue.pop() );
+}
+
+$(document).ready(function() {
+       // This code executes after the page has been fully loaded
+       $(".proto").css("display", "none");             // make all the prototypes invisible
+       //$("body").get(0).onunload = function() { }    // fires when leaving the page proper
+       ProtoDiv.each = function(e) { $(e).show() };
+       window.onpopstate = goBack;
+       /*setTimeout(function() {
+               if(!popped)
+                       showPage(0)
+       }, 2000);*/
+       // xxx older FF browsers don't fire a page load/reload - deal with it somehow.
+       // showPage( 0 );               // needed for some older browsers, redundant for chrome
+})
+
diff --git a/public/javascripts/main.js b/public/javascripts/main.js
deleted file mode 100644 (file)
index e81bff2..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-This is the core logic for the main page.
-It implements most page transitions by showing and hiding DIV elements
-in the page with javascript+jquery
-*/
-
-/* Convert a JSON string to an object, or null if unparseable */
-function j2o(json) { try { return JSON.parse(json); } catch(e) { return null; } }
-
-/* Convert an object to a JSON string (just easier to type than "JSON.stringify" */
-function o2j(obj) { return JSON.stringify(obj); }
-
-function showHome(matches, cb) {
-       cb("home");
-}
-
-// go to the page that lists the schools
-function showSchools(matches, cb) {
-       ProtoDiv.reset("PROTO_school");
-       $.get("/schools", { cache: false }, function(response) {
-               var schools = [];
-               if(typeof response == 'object') {
-                       schools = response.schools;
-               }
-               ProtoDiv.replicate("PROTO_school", schools);
-               cb("schools");
-       });
-}
-
-// go to the page that lists the courses for a specific school
-function showCourses(matches, cb) {
-       var schoolId = matches[1];
-       ProtoDiv.reset("PROTO_course");
-       $.get("/school/"+schoolId, { cache: false }, function(response) {
-               var courses = [];
-               if(typeof response == 'object') {
-                       var school = response.school;
-                       $("#school_name").html(school.name);
-                       courses = school.courses;
-               }
-               ProtoDiv.replicate("PROTO_course", courses);
-               cb("courses");
-       });
-}
-
-// go to the page that lists the lectures for a specific course
-function showLectures(matches, cb) {
-       var courseId = matches[1];
-       ProtoDiv.reset("PROTO_lecture");
-       $.get("/course/"+courseId, { cache: false }, function(response) {
-               ProtoDiv.reset("PROTO_lectures_head");
-               ProtoDiv.reset("PROTO_lectures_instructor");
-               ProtoDiv.reset("PROTO_lecture");
-               if(typeof response == 'object') {
-                       var course = response.course;
-                       if(course)
-                               ProtoDiv.replicate("PROTO_lectures_head", [course]);
-                       var instructor = response.instructor;
-                       if(instructor)
-                               ProtoDiv.replicate("PROTO_lectures_instructor", [instructor]);
-                       var lectures = response.lectures;
-                       if(lectures)
-                               ProtoDiv.replicate("PROTO_lecture", lectures);
-               }
-               cb("lectures");
-       });
-}
-
-// go to the page that lists the note taking sessions for a specific lecture
-function showNotes(matches, cb) {
-       var lectureId = matches[1];
-       ProtoDiv.reset("PROTO_note");
-       $.get("/lecture/"+lectureId, { cache: false }, function(response) {
-               if(typeof response == 'object') {
-                       var course = response.course;
-                       //if(course)
-                       //      ProtoDiv.replicate("PROTO_lectures_head", [course])
-                       var instructor = response.instructor;
-                       //if(instructor)
-                       //      ProtoDiv.replicate("PROTO_lectures_instructor", [instructor])
-                       var lecture = response.lecture;
-                       //if(lecture)
-                       //      ProtoDiv.replicate("PROTO_lecture", lectures);
-                       var notes = response.notes;
-                       if(notes)
-                               ProtoDiv.replicate("PROTO_note", notes);
-               }
-               cb("notes");
-       });
-}
-
-// go to the page that lists the archived subject names
-function showArchiveSubjects(matches, cb) {
-       ProtoDiv.reset("PROTO_archive_subject");
-       $.get("/archive", { cache: false }, function(response) {
-               var subjects = response.subjects;
-               ProtoDiv.replicate("PROTO_archive_subject", subjects);
-       })
-       cb("archive_subjects");
-}
-
-function showArchiveCourses(matches, cb) {
-       var subjectId = parseInt(matches[1]);
-       ProtoDiv.reset("PROTO_archive_course");
-       $.get("/archive/subject/"+subjectId, { cache: false }, function(response) {
-               var courses = response.courses;
-               ProtoDiv.replicate("PROTO_archive_course", courses);
-       })
-       cb("archive_courses");
-}
-
-function showArchiveNotes(matches, cb) {
-       var courseId = parseInt(matches[1]);
-       ProtoDiv.reset("PROTO_archive_note");
-       $.get("/archive/course/"+courseId, { cache: false }, function(response) {
-               var notes = response.notes;
-               $.each(notes, function(i, note) {
-                       if(!note.topic)
-                               note.topic = note.text.substr(0, 15)+" ...";
-               })
-               ProtoDiv.replicate("PROTO_archive_note", notes);
-       })
-       cb("archive_notes");
-}
-
-
-
-function showArchiveNote(matches, cb) {
-       var noteId = 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" }
-//             note.text = note.text || ""
-               if(!note.topic)
-                       note.topic = note.text.substr(0, 15)+" ...";
-//             if(note.err) {
-//                     note.topic = note.message
-//                     note.err = note.err.stack
-//             }
-//
-               ProtoDiv.replicate("PROTO_archive_note_display", note);
-       })
-       cb("archive_note_display");
-}
-
-// go to the account registration page
-function showRegister(matches, cb) {
-       // xxx clear fields?
-       // xxx change FORM to use AJAX
-       cb("register");
-}
-
-function showLogin(matches, cb) {
-       cb("login");
-}
-
-// go to the press articles page
-function showPress(matches, cb) {
-       cb("press");
-}
-
-// go to the "code of conduct" page
-function showConduct(matches, cb) {
-       cb("conduct");
-}
-
-var pageVectors = [
-       { regex: /^\/(index.html)?$/, func: showHome },
-       { 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: /^\/archive\/?$/, func: showArchiveSubjects },
-       { regex: /^\/archive\/subject\/([0-9]+)/, func: showArchiveCourses },
-       { regex: /^\/archive\/course\/([0-9]+)/, func: showArchiveNotes },
-       { regex: /^\/archive\/note\/([a-f0-9]{24})/, func: showArchiveNote },
-       { regex: /^\/login/, func: showLogin },
-       { regex: /^\/register/, func: showRegister },
-       { regex: /^\/press/, func: showPress },
-       { regex: /^\/conduct/, func: showConduct }
-];
-
-/* Do and show the appropriate thing, based on the pages current URL */
-function showPage(y) {
-       var path = document.location.pathname;
-       $(".page").hide(); //(100);             // hide all pseudo pages
-       for(var i = 0; i < pageVectors.length; i++) {
-               var vector = pageVectors[i];
-               var matches = path.match(vector.regex);
-               if(matches) {
-                       vector.func(matches, function(pageId) {
-                               $("#pg_"+pageId).fadeIn(100);
-                               window.scroll(0, y);
-                       })
-                       break;
-               }
-       }
-       if(i == pageVectors.length) {
-               $("#pg_notfound").fadeIn(100);
-               window.scroll(0, 0);
-       }
-       // scroll to top of page (as if we'd done a real page fetch)
-       /*$('html, body').animate({
-               scrollTop: $("#topofcontent").offset().top
-       }, 100);*/
-}
-
-/* Simulates a page load.
-       'path' is something like "/schools", etc.
-       A page fetch doesn't really happen.
-       Based on what path looks like, an appropriate DIV is shown, and action taken
-*/
-var topQueue = [0];
-function goPage(path) {
-       if(history.pushState !== undefined) {
-               topQueue.push(window.pageYOffset);
-               history.pushState({}, path, path);
-               showPage(0);
-       }
-       else {
-               document.location = path;
-       }
-}
-
-/* Simulates a "back" browser navigation.  */
-var popped = false;
-function goBack(event) {
-       popped = true;
-       showPage( topQueue.pop() );
-}
-
-$(document).ready(function() {
-       // This code executes after the page has been fully loaded
-       $(".proto").css("display", "none");             // make all the prototypes invisible
-       //$("body").get(0).onunload = function() { }    // fires when leaving the page proper
-       ProtoDiv.each = function(e) { $(e).show() };
-       window.onpopstate = goBack;
-       /*setTimeout(function() {
-               if(!popped)
-                       showPage(0)
-       }, 2000);*/
-       // xxx older FF browsers don't fire a page load/reload - deal with it somehow.
-       // showPage( 0 );               // needed for some older browsers, redundant for chrome
-})
-
diff --git a/public/javascripts/main2.js b/public/javascripts/main2.js
deleted file mode 100644 (file)
index 41b9f0f..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-
-/*
-
-This is the core logic for the main page.
-It implements most page transitions by showing and hiding DIV elements
-in the page with javascript+jquery
-
-*/
-
-
-/* Convert a JSON string to an object, or null if unparseable */
-function j2o(json) { try { return JSON.parse(json); } catch(e) { return null; } }
-
-/* Convert an object to a JSON string (just easier to type than "JSON.stringify" */
-function o2j(obj) { return JSON.stringify(obj); }
-
-
-
-function showHome(cb) {
-       cb("home");
-}
-
-
-
-// go to the page that lists the schools
-function showSchools(response, cb) {
-
-  var path = window.location.pathname;
-
-       ProtoDiv.reset("PROTO_school");
-
-
-      var schools = []
-      if(typeof response == 'object') {
-        schools = response.schools
-      }
-
-      ProtoDiv.replicate("PROTO_school", schools);
-
-      cb("schools");
-
-}
-
-
-
-// go to the page that lists the courses for a specific school
-function showCourses(response, cb) {
-
-  var path = window.location.pathname;
-
-
-       ProtoDiv.reset("PROTO_course");
-
-               var courses = []
-               if(typeof response == 'object') {
-                       var school = response.school
-                       $("#school_name").html(school.name);
-                       courses = school.courses
-               }
-
-               ProtoDiv.replicate("PROTO_course", courses);
-
-               cb("courses")
-}
-
-
-
-
-// go to the page that lists the lectures for a specific course
-function showLectures(response, cb) {
-
-  var path = window.location.pathname;
-  
-
-       ProtoDiv.reset("PROTO_lecture");
-       
-               ProtoDiv.reset("PROTO_lectures_head")
-               ProtoDiv.reset("PROTO_lectures_instructor")
-               ProtoDiv.reset("PROTO_lecture")
-
-               if(typeof response == 'object') {
-
-                       var course = response.course
-                       if(course)
-                               ProtoDiv.replicate("PROTO_lectures_head", [course])
-
-                       var instructor = response.instructor
-                       if(instructor)
-                               ProtoDiv.replicate("PROTO_lectures_instructor", [instructor])
-
-                       var lectures = response.lectures
-                       if(lectures)
-                               ProtoDiv.replicate("PROTO_lecture", lectures);
-
-               }
-
-               cb("lectures")
-}
-
-
-
-// go to the page that lists the note taking sessions for a specific lecture
-function showNotes(response, cb) {
-
-  var path = window.location.pathname;
-
-
-       ProtoDiv.reset("PROTO_note");
-       
-               if(typeof response == 'object') {
-
-                       var course = response.course
-                       //if(course)
-                       //      ProtoDiv.replicate("PROTO_lectures_head", [course])
-
-                       var instructor = response.instructor
-                       //if(instructor)
-                       //      ProtoDiv.replicate("PROTO_lectures_instructor", [instructor])
-
-                       var lecture = response.lecture
-                       //if(lecture)
-                       //      ProtoDiv.replicate("PROTO_lecture", lectures);
-
-                       var notes = response.notes
-                       if(notes)
-                               ProtoDiv.replicate("PROTO_note", notes);
-
-               }
-
-               cb("notes")
-}
-
-
-// go to the page that lists the archived subject names
-function showArchiveSubjects(response, cb) {
-
-  var path = window.location.pathname;
-
-       ProtoDiv.reset("PROTO_archive_subject")
-
-               var subjects = response.subjects
-
-               ProtoDiv.replicate("PROTO_archive_subject", subjects)
-
-       cb("archive_subjects")
-}
-
-
-
-function showArchiveCourses(response, cb) {
-
-  var path = window.location.pathname;
-
-
-       ProtoDiv.reset("PROTO_archive_course")
-
-               var courses = response.courses
-
-               ProtoDiv.replicate("PROTO_archive_course", courses)
-
-       cb("archive_courses")
-}
-
-
-
-function showArchiveNotes(response, cb) {
-
-  var path = window.location.pathname;
-
-
-       ProtoDiv.reset("PROTO_archive_note")
-
-               var notes = response.notes
-               $.each(notes, function(i, note) {
-                       if(!note.topic)
-                               note.topic = note._id//note.text.substr(0, 15)+" ..."
-               })
-
-               ProtoDiv.replicate("PROTO_archive_note", notes)
-
-       cb("archive_notes")
-}
-
-
-
-function showArchiveNote(response, cb) {
-
-  var path = window.location.pathname;
-
-
-       ProtoDiv.reset("PROTO_archive_note_display")
-
-               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(response, cb) {
-       // xxx clear fields?
-       // xxx change FORM to use AJAX
-       cb("register");
-}
-
-
-function showLogin(response, cb) {
-       cb("login");
-}
-
-
-
-
-// go to the press articles page
-function showPress(response, cb) {
-       cb("press");
-}
-
-
-// go to the "code of conduct" page
-function showConduct(response, cb) {
-       cb("conduct");
-}
-
-
-
-
-var pageVectors = [
-       { regex: /^\/(index.html)?$/, func: showHome },
-       { 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: /^\/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 },
-       { regex: /^\/conduct/, func: showConduct },
-];
-
-var testVectors = {
-  schools: showSchools,
-  school: showCourses,
-  course: showLectures,
-  lecture: showNotes,
-  archive: showArchiveSubjects,
-  archivesubject: showArchiveCourses,
-  archivecourse: showArchiveNotes,
-  archivenote: showArchiveNote,
-  login: showLogin,
-  press: showPress,
-  conduct: showConduct
-}
-
-/* Do and show the appropriate thing, based on the pages current URL */
-function showPage(y) {
-
-       var path = document.location.pathname
-
-  var mainSlug = path.match(/((?:[a-z][a-z]+))/) ? path.match(/((?:[a-z][a-z]+))/)[1].toLowerCase() : '';
-  if (mainSlug === 'archive') {
-    var archiveSlugs = path.match(/((?:[a-z][a-z]+))\/((?:[a-z][a-z0-9_]*))/);
-    if (archiveSlugs) {
-      mainSlug = mainSlug + archiveSlugs[2];
-    }
-  }
-
-       $(".page").hide(); //(100);             // hide all pseudo pages
-
-  if (testVectors[mainSlug]) {
-    return $.get(path, { cache: false }, function(response) {
-      if (response.status === 'error') {
-        console.log(response.message)
-        $("#pg_notfound").fadeIn(100);
-        window.scroll(0, 0)
-        return;
-      }
-      testVectors[mainSlug](response, function(pageId) {
-        $("#pg_"+pageId).fadeIn(100);
-        window.scroll(0, y)
-      })
-    });
-  } else if (path === '/') {
-    return showHome(function(pageId) {
-      $("#pg_"+pageId).fadeIn(100);
-      window.scroll(0, y)
-    })
-  }
-
-  $("#pg_notfound").fadeIn(100);
-  window.scroll(0, 0)
-  /*
-       for(var i = 0; i < pageVectors.length; i++) {
-               var vector = pageVectors[i]
-               var matches = path.match(vector.regex)
-               if(matches) {
-                       vector.func(function(pageId) {
-
-                               $("#pg_"+pageId).fadeIn(100);
-
-                               window.scroll(0, y)
-
-                       })
-                       break
-               }
-       }
-  
-
-       if(i == pageVectors.length) {
-       }
-       // scroll to top of page (as if we'd done a real page fetch)
-       /*$('html, body').animate({
-               scrollTop: $("#topofcontent").offset().top
-       }, 100);*/
-
-}
-
-
-
-
-/* Simulates a page load.
-       'path' is something like "/schools", etc.
-       A page fetch doesn't really happen.
-       Based on what path looks like, an appropriate DIV is shown, and action taken
-*/
-var topQueue = [0]
-function goPage(path) {
-       var y = 0 + window.pageYOffset
-       topQueue.push(y)
-       history.pushState({}, path, path);
-       showPage(0);
-}
-
-
-/* Simulates a "back" browser navigation.  */
-function goBack(event) {
-       var y = topQueue.pop()
-       showPage( y );
-}
-
-
-       window.onpopstate = goBack
-
-  $('a[href^=/]').live('click', function(e) {
-    var path = e.target.pathname || '/';
-    var checkNote = path.match(/((?:[a-z][a-z]+))/);
-    if (checkNote && checkNote[1] == 'note') {
-      return true;
-    } else {
-      goPage(path)
-      return false;
-    }
-  })
-$(document).ready(function() {
-
-       // This code executes after the page has been fully loaded
-
-
-       // xxx older FF browsers don't fire a page load/reload - deal with it somehow.
-       // showPage( 0 );               // needed for some older browsers, redundant for chrome
-
-})
-
-
-
-
-