working on home page design
authorjordan <jordancooperman@gmail.com>
Sat, 14 Jan 2012 21:35:04 +0000 (16:35 -0500)
committerjordan <jordancooperman@gmail.com>
Sat, 14 Jan 2012 21:35:04 +0000 (16:35 -0500)
public/assets/css/screen.css
public/assets/css/scss/partials/_grid.scss
public/assets/css/scss/partials/_modules.scss
public/assets/css/scss/partials/_pages.scss
public/assets/css/scss/partials/_type.scss
public/assets/css/scss/screen.scss
public/assets/img/ajax-loader.gif [new file with mode: 0644]
public/assets/js/init.js
public/index.html
public/javascripts/main.js
public/schools.html

index f6e9670dad5048e3d7f4ae319752f890cb7e731c..adfc4940039604440b944a069b2726285c83bf2f 100755 (executable)
@@ -44,56 +44,64 @@ Please have a look around, I hope you enjoy your stay.
   float: left;
   width: 9.091%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
 .grid-2 {
   float: left;
   width: 21.591%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
 .grid-3 {
   float: left;
   width: 34.091%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
-.grid-4, #g-logo, #nav-main, #intro-text, #intro-schools {
+.grid-4, #g-logo, #nav-main, #intro-text, #intro-video {
   float: left;
   width: 46.591%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
 .grid-5 {
   float: left;
   width: 59.091%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
 .grid-6 {
   float: left;
   width: 71.591%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
 .grid-7 {
   float: left;
   width: 84.091%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
-.grid-8, #nav-user, .subheader, #intro-video {
+.grid-8, #nav-user, .subheader, #g-footer, #intro-schools {
   float: left;
   width: 96.591%;
   padding: 0;
-  margin: 0 1.705%; }
+  margin-left: 1.705%;
+  margin-right: 1.705%; }
 
-.futura, .futura-italic, .futura-light, .subheader h2, .futura-bold, h1, h2, h3, h4, h5, h6, p, #g-masthead {
+.futura, .futura-oblique, .futura-light, .subheader h2, .futura-bold, h1, h2, h3, h4, h5, h6, p, #g-masthead {
   font-family: "futura-pt", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
   font-weight: 500;
   -webkit-font-smoothing: antialiased; }
 
-.futura-italic {
+.futura-oblique {
   font-style: italic; }
 
 .futura-light, .subheader h2 {
@@ -118,7 +126,12 @@ body {
   font-size: 1em;
   line-height: 1.5em; }
 
-.small, #nav-user {
+.tiny, #g-nav-footer li, #g-footer-copyright, #intro-schools li {
+  /* 14px / 18px */
+  font-size: 0.75em;
+  line-height: 1.091em; }
+
+.small, #nav-user, .link-bar a {
   /* 14px / 18px */
   font-size: 0.875em;
   line-height: 1.286em; }
@@ -129,7 +142,7 @@ body {
   line-height: 1.5em;
   /* 24 */ }
 
-.big, p, #nav-main a {
+.big, h4, p, #nav-main a {
   /* 18px / 24px */
   font-size: 1.125em;
   line-height: 1.333em; }
@@ -165,11 +178,17 @@ h1, h2, h3, h4, h5, h6 {
   margin: 0;
   margin-bottom: 0.375em; }
 
+a {
+  color: #e8a200; }
+
 p {
   margin: 0;
   margin-bottom: 0.75em;
   color: #444; }
 
+img {
+  max-width: 100%; }
+
 ::-moz-selection {
   background: #44a1dd;
   color: #fff;
@@ -278,12 +297,16 @@ body {
   margin: 0; }
 
 body {
-  background-color: #262626;
   background-position: 20% 0;
   border-top: 3px solid #1f1e1c; }
 
 /* a.`header
 -------------------------- */
+#g-masthead {
+  background-color: #262626; }
+  #g-masthead .wrapper {
+    background-color: #262626; }
+
 #g-logo a {
   display: block; }
 
@@ -334,7 +357,8 @@ body {
 -------------------------- */
 #g-page {
   border-top: 1px solid #333;
-  background-color: #fff; }
+  background-color: #fff;
+  margin-bottom: 3em; }
 
 .page {
   color: #333; }
@@ -352,6 +376,20 @@ body {
 
 /* c.`footer
 -------------------------- */
+#g-footer {
+  text-align: center; }
+
+#g-nav-footer {
+  text-align: center; }
+  #g-nav-footer li {
+    display: inline;
+    text-align: center; }
+  #g-nav-footer a {
+    padding: 0 0.75em; }
+
+#g-footer-copyright img {
+  margin: 0 auto; }
+
 .footer {
   color: #444;
   padding-top: 24px; }
@@ -543,28 +581,42 @@ body {
  1.Layout
 
 ----------------------------------------------------------------*/
-.section-home h3 {
-  padding-bottom: 0.375em;
-  margin-bottom: 0.375em; }
-
+.page {
+  display: none;
+  -webkit-transition: all 0.25s ease-in-out;
+  -moz-transition: all 0.25s ease-in-out;
+  -o-transition: all 0.25s ease-in-out;
+  -ms-transition: all 0.25s ease-in-out;
+  transition: all 0.25s ease-in-out; }
+
+.section-home {
+  margin-bottom: 1.5em; }
+
+#intro-schools h4 {
+  padding-bottom: 0.75em;
+  border-bottom: 1px solid #e5e5e5; }
 #intro-schools li {
-  float: left;
-  width: 33.333%;
-  min-height: 50px;
-  margin: 0.75em 0; }
-  #intro-schools li .sprite {
-    margin: 0 auto; }
+  display: inline;
+  padding: 0.5em; }
 
-.button {
-  background-color: #e5e5e5;
-  color: #0ca6ff; }
+.link-bar {
+  margin-left: -0.375em; }
+  .link-bar li {
+    display: inline; }
+    .link-bar li.last a {
+      border: 0; }
+  .link-bar a {
+    padding: 0 0.375em;
+    border-right: 1px solid #ffcd58;
+    color: #e8a200; }
 
 .video-wrapper {
   -moz-border-radius: 5px;
   border-radius: 5px;
   padding: 5px;
   background-color: #f5f5f5;
-  text-align: center; }
+  text-align: center;
+  line-height: 0; }
 
 .schools li {
   float: left;
index 8dd2af229a00a81f06436726ddd4ceab771a20df..f6bf1591999ca5f901fadcaf41702eccf245fc60 100755 (executable)
@@ -21,7 +21,8 @@ $percent-margin: $margin / $layout-margin-width;
         float: left;
         width: ( ($col_width * $i / $layout-margin-width) - 2 * $percent-margin) * 100%;
         padding: 0;
-        margin: 0 $percent-margin * 100%;
+        margin-left: $percent-margin * 100%;
+        margin-right: $percent-margin * 100%;
     }
 }
 
index 36cedd6bce16f04fd636f175430f914301d44373..93347fa6a86de07c70c4b36be6948465b7e07bab 100644 (file)
@@ -1,6 +1,23 @@
-.button {
-    background-color: #e5e5e5;
-    color: $blue;
+.link-bar {
+    margin-left: $base/-4;
+
+    li {
+        display: inline;
+
+        &.last {
+            a {
+                border: 0;
+
+            }
+        }
+    }
+
+    a {
+        padding: 0 $base/4;
+        border-right: 1px solid $gold;
+        color: $mustard;
+        @extend .small;
+    }
 }
 
 .video-wrapper {
@@ -8,6 +25,7 @@
   padding: 5px;
   background-color: #f5f5f5;
   text-align: center;
+  line-height: 0;
 }
 
 .schools {
index 03fd32a26a58c01077950c02327cea5c8909d801..78f2c4be3df34913c679e371e84c199a7d8f5a99 100644 (file)
@@ -7,33 +7,34 @@
 
 ----------------------------------------------------------------*/
 
-.section-home {
-
-    h3 { 
-        padding-bottom: $base/4;
-        margin-bottom: $base/4;
-    }
+.page {
+    display: none;
+    @include transition( all );
+}
 
+.section-home {
+    margin-bottom: $base;
 }
+
 #intro-text {
     @extend .grid-4;
 }
 
-#intro-schools {
+#intro-video {
     @extend .grid-4;
-
-    li {
-        float: left;
-        width: 100/3*1%;
-        min-height: 50px;
-        margin: $base/2 0;
-
-        .sprite {
-            margin: 0 auto;
-        }
-    }
 }
 
-#intro-video {
+#intro-schools {
     @extend .grid-8;
+
+    h4 {
+        padding-bottom: $base/2;
+        border-bottom: 1px solid #e5e5e5;
+    }
+
+    li {
+        display: inline;
+        padding: $base/3;
+        @extend .tiny;
+    }
 }
index 0591ef20ad33944cdee7f82966e39594f40d48ef..f41ac2cecbde8d040cac46bbadc94c844015be51 100755 (executable)
@@ -4,7 +4,7 @@
     -webkit-font-smoothing: antialiased;
 }
 
-.futura-italic {
+.futura-oblique {
     @extend .futura;
     font-style: italic;
 }
@@ -46,6 +46,12 @@ body {
     line-height: #{$line / $em}em;
 }
 
+.tiny {
+    /* 14px / 18px */
+    font-size: #{($font-size*0.75) / $em}em;
+    line-height: ($line*0.5) / ($font-size*0.6875) * 1em;
+}
+
 .small {
     /* 14px / 18px */
     font-size: #{($font-size*0.875) / $em}em;
index d446f8a2dee1ba1ea2e0b7a4519d852aba7e2da3..14b5e67db5ab960a3bacf7fea795b4541a7a02ab 100755 (executable)
@@ -40,6 +40,7 @@ Please have a look around, I hope you enjoy your stay.
 $blue: #0ca6ff;
 $dark: #1f1e1c;
 $gold: #ffcd58;
+$mustard: #e8a200;
 
 @import "partials/mixins";
 @import "partials/grid";
@@ -67,6 +68,14 @@ h3 {
     @extend .large;
 }
 
+h4 {
+    @extend .big;
+}
+
+a {
+    color: $mustard;
+}
+
 p {
     @extend .futura;
     @extend .big;
@@ -75,6 +84,10 @@ p {
     color: #444;
 }
 
+img {
+    max-width: 100%;
+}
+
 ::-moz-selection { background: #44a1dd; color: #fff; text-shadow: none; }
 ::selection { background: #44a1dd; color: #fff; text-shadow: none; }
 
@@ -105,7 +118,7 @@ body {
 }
 
 body {
-    background-color: #262626;
+    // background-color: #262626;
     background-position: 20% 0;
     border-top: 3px solid $dark;
 }
@@ -117,6 +130,11 @@ body {
 
 #g-masthead {
     @extend .futura;
+    background-color: #262626;
+
+    .wrapper {
+        background-color: #262626;
+    }
 }
 
 #g-logo {
@@ -223,6 +241,7 @@ body {
 #g-page {
     border-top: 1px solid #333;
     background-color: #fff;
+    margin-bottom: $base*2;
 }
 
 .page {
@@ -255,6 +274,34 @@ body {
 /* c.`footer
 -------------------------- */
 
+
+#g-footer {
+    @extend .grid-8;
+    text-align: center;
+}
+
+#g-nav-footer {
+    text-align: center;
+
+    li {
+        display: inline;
+        text-align: center;
+        @extend .tiny;
+    }
+
+    a {
+        padding: 0 $base/2;
+    }
+}
+
+#g-footer-copyright {
+    @extend .tiny;
+
+    img {
+        margin: 0 auto;
+    }
+
+}
 .footer {
   color: #444;
   padding-top: 24px;
diff --git a/public/assets/img/ajax-loader.gif b/public/assets/img/ajax-loader.gif
new file mode 100644 (file)
index 0000000..53dd589
Binary files /dev/null and b/public/assets/img/ajax-loader.gif differ
index 2ff1ce3a028c27dbfdaf85c6ce8528192fe5e992..5b6f35b779ca2d8dfc3caa323bdc591a7aeb7f50 100755 (executable)
@@ -1,9 +1,5 @@
 $(function() {
 
-    // Remember to minimize JavaScripts before going into production
+    $loader = $('.loader');
 
-    function include(file) {
-
-    }
-
-});
\ No newline at end of file
+});
index 2e438299230b346a0ed23bce6557dfb48f4ce47a..765e9de68cb926d2c14b81cc4c7b31453b7e8186 100644 (file)
@@ -5,41 +5,45 @@
         <link rel="stylesheet" href="/assets/css/include.css" type="text/css" media="screen" />
         <script type="text/javascript" src="/assets/js/modernizr.custom.js"></script>
 
-        <!-- <script type="text/javascript" src="http://use.typekit.com/cbx6gxx.js"></script>-->
-        <!-- <script type="text/javascript">try{Typekit.load();}catch(e){}</script>-->
         <script type='text/javascript' src='/javascripts/jquery.min.js'></script>
         <script type='text/javascript' src='/javascripts/jquery.tmpl.js'></script>
-        <!--<script type='text/javascript' src='/javascripts/jquery.min.js'></script> -->
-        <!--<script type="text/javascript" src="/assets/js/load.js"></script>-->
+        <script type="text/javascript" src="/assets/js/init.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">
-          TypekitConfig = {
-            kitId: 'cbx6gxx',
-            scriptTimeout: 3000
-          };
-          (function() {
-            var h = document.getElementsByTagName('html')[0];
-            h.className += ' wf-loading';
-            var t = setTimeout(function() {
-              h.className = h.className.replace(/(\s|^)wf-loading(\s|$)/g, '');
-              h.className += ' wf-inactive';
-            }, TypekitConfig.scriptTimeout);
-            var tk = document.createElement('script');
-            tk.src = '//use.typekit.com/' + TypekitConfig.kitId + '.js';
-            tk.type = 'text/javascript';
-            tk.async = 'true';
-            tk.onload = tk.onreadystatechange = function() {
-              var rs = this.readyState;
-              if (rs && rs != 'complete' && rs != 'loaded') return;
-              clearTimeout(t);
-              try { Typekit.load(TypekitConfig); } catch (e) {}
+        <script type='text/javascript'>
+            TypekitConfig = {
+                kitId: 'cbx6gxx',
+                scriptTimeout: 3000
             };
-            var s = document.getElementsByTagName('script')[0];
-            s.parentNode.insertBefore(tk, s);
-          })();
+
+            (function() {
+                var h = document.getElementsByTagName('html')[0];
+                h.className += ' wf-loading';
+
+                var t = setTimeout(function() {
+                    h.className = h.className.replace(/(\s|^)wf-loading(\s|$)/g, '');
+                    h.className += ' wf-inactive';
+                }, TypekitConfig.scriptTimeout);
+
+                var tk = document.createElement('script');
+                tk.src = '//use.typekit.com/' + TypekitConfig.kitId + '.js';
+                tk.type = 'text/javascript';
+                tk.async = 'true';
+
+                tk.onload = tk.onreadystatechange = function() {
+                    var rs = this.readyState;
+
+                    if (rs && rs != 'complete' && rs != 'loaded') return;
+                    clearTimeout(t);
+                    try { Typekit.load(TypekitConfig); } catch (e) {}
+                };
+
+                var s = document.getElementsByTagName('script')[0];
+                s.parentNode.insertBefore(tk, s);
+            })();
         </script>
+
     </head>
   <!--================================================================= -->
     <body>
                 </div>
                 <div class="wrapper">
                     <div id="intro">
+
+                        <section class="section-home" id="intro-video">
+                            <h3 class="heading">Our Screencasts</h3>
+                            <div class="video-wrapper">
+                                <!-- video loaded in main.js -->
+                            </div>
+                        </section>
+
                         <section class="section-home" id="intro-text">
                             <h3>Our Mission</h3>
                             <p>
-                                To provide tools that help college students collaborate on during and after class, with peers and with instructers.  and lecture, and to ask questions to their professors, when they have them.
-                            </p>
+                                To provide tools that make it dead simple for college students to collaborate during and after class, with peers and with instructers.  You can begin taking lecture notes online, and allow anyone to contribute.</p> 
                             <p>
-                            A single user can begin lecture notes on FinalsClub, but the best results occur when everyone contributes to common knowledge. Working together we can transform higher education, one classroom at a time.
+                                You can also post questions that will be seen by the entire class, and get a response from your peers or instructor immediately. Sign up, or just have a look around. Let us know what you think. We need your feedback to make Finals Club the best that it can be.
                             </p>
-                            <a href="#" class="button" id="signup">Sign Up</a>
-                            <a href="#" class="button" id="learnsomething">Learn Something</a>
+                            <nav class="link-bar">
+                                <ul>
+                                    <li><a href="#">Sign Up</a></li>
+                                    <li class="last"><a href="#">Learn Something</a></li>
+                                </ul>
+                            </nav>
                         </section>
 
+
+
                         <section class="section-home" id="intro-schools">
-                            <h3>Who we support</h3>
+                            <h4>Schools we support</h4>
                             <ul>
-                                <li><div class="sprite logo-brown">Brown Logo</div></li>
-                                <li><div class="sprite logo-columbia">Columbia Logo</div></li>
-                                <li><div class="sprite logo-cornell">Cornell Logo</div></li>
-                                <li><div class="sprite logo-dartmouth">Dartmouth Logo</div></li>
-                                <li><div class="sprite logo-shield">School Logo</div></li>
-                                <li><div class="sprite logo-mit">MIT Logo</div></li>
-                                <li><div class="sprite logo-lock_haven">Lock Haven Logo</div></li>
-                                <li><div class="sprite logo-california">Cal Tech Logo</div></li>
-                                <li><div class="sprite logo-texas">University of Texas Logo</div></li>
-                                <li><div class="sprite logo-yale">Yale Logo</div></li>
-                                <li><div class="sprite logo-penn">Penn Logo</div></li>
-                                <li><div class="sprite logo-harvard">Harvad Logo</div></li>
+                                <li><span class="school-name">Brown</span></li>
+                                <li><span class="school-name">Columbia</span></li>
+                                <li><span class="school-name">Cornell</span></li>
+                                <li><span class="school-name">Dartmouth</span></li>
+                                <li><span class="school-name">Harvard</span></li>
+                                <li><span class="school-name">Lock Haven</span></li>
+                                <li><span class="school-name">MIT</span></li>
+                                <li><span class="school-name">University of California</span></li>
+                                <li><span class="school-name">University of Pennsylvania</span></li>
+                                <li><span class="school-name">University of Texas</span></li>
+                                <li><span class="school-name">Yale</span></li>
                             </ul>
                         </section>
-
-                        <section class="section-home" id="intro-video">
-                            <h3 class="heading">Check out our Screencasts</h3>
-                            <div class="video-wrapper">
-                                <iframe src="http://player.vimeo.com/video/30647271?title=0&amp;byline=0&amp;portrait=0&amp;color=367da9" width="460" height="259" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>             
-                            </div>
-                        </section>
                     </div>
                 </div>
             </div>
       <!--================================================================= -->
+
             <div class="page" id="pg_schools">
                 <h1>Universities</h1>
             </div>
             <script id="course" type="text/x-jquery-tmpl">
                 <li>${dept}: ${name} (${number})</li>
             </script>
+
       <!--================================================================= -->
             <div class=page id=pg_courses>
                 <h1>Courses for <span id=school_name></span></h1>
             </div>
         </div>
 
-        <div id="g-footer">
-            <div class="wrapper">
-                <nav id="nav-footer">
+        <div class="wrapper">
+            <div id="g-footer">
+                <nav id="g-nav-footer">
                     <ul>
                         <li><a href="/conduct">Conduct</a></li>
                         <li><a href="https://github.com/finalsclubdev/FinalsClub/">Code</a></li>
                         <li><a href="http://blog.finalsclub.org/team.html">Team</a></li>
                     </ul>
                 </nav>
-            </div>
-
-            <p>Finals Club is a 501\(c\)(3) non-profit organization.</p>
-            <div class="creative_commons">
-                <div class="section">
+                <div id="g-footer-copyright">
+                    <p>Finals Club is a 501c3 non-profit organization.</p>
                     <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">
                         <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" />
                     </a>
-                    <br />
-                </div>
-                <div class="section">
                     This site is licensed under a
                     <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
                 </div>
index 73995c0a56b4d8c4aebc708f756bbabd72cd916a..7fac64e3dc5932cdb29cf8bbb8014a8b9aa16e24 100644 (file)
@@ -14,35 +14,49 @@ 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); }
 
-var user = {};
-
-var router = {
-  routes: {},
-  add: function(name, useAjax, cb) {
-    if (typeof useAjax === 'function') {
-      cb = useAjax;
-      useAjax = true;
-    }
-    this.routes[name] = {
-      fn: cb,
-      useAjax: useAjax
-    }
-  },
-  run: function(name, path) {
-    $('.nav').removeClass('active');
-    checkUser(function() {
-      if (router.routes[name].useAjax) {
-        $.get(path, {cache: false}, function(data) {
-          if (data.status === 'not_found' || (typeof data === 'string')) {
-            return router.run('404');
-          }
-          router.routes[name].fn(data, render);
+var
+user = {},
+
+router = {
+
+    routes: {},
+
+    add: function(name, useAjax, cb) {
+        if (typeof useAjax === 'function') {
+            cb = useAjax;
+            useAjax = true;
+        }
+
+        this.routes[name] = {
+            fn: cb,
+            useAjax: useAjax
+        }
+    },
+
+    run: function(name, path) {
+
+        $('.nav').removeClass('active');
+
+        checkUser( function() {
+
+            if (router.routes[name].useAjax) {
+
+                $.get(
+                    path,
+                    {cache: false},
+                    function(data) {
+
+                        if (data.status === 'not_found' || (typeof data === 'string')) {
+                            return router.run('404');
+                        }
+                        router.routes[name].fn(data, render);
+                    }
+                );
+            } else {
+                router.routes[name].fn(render);
+            }
         });
-      } else {
-        router.routes[name].fn(render);
-      }
-    });
-  }
+    }
 }
 
 function render(pageId, response) {
@@ -114,27 +128,26 @@ router.add('home', false, function(cb) {
     })
   });
   if ($('#vimeo-screencast').length === 0) {
-    $('.video-wrapper').html('<iframe id="vimeo-screencast" src="http://player.vimeo.com/video/30647271?title=0&amp;byline=0&amp;portrait=0&amp;color=367da9" width="460" height="259" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>');
+    $('.video-wrapper').html('<iframe id="vimeo-screencast" src="http://player.vimeo.com/video/30647271?title=0&amp;byline=0&amp;portrait=0&amp;color=367da9" width="400" height="225" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>');
   }
 });
 
 
-
 // go to the page that lists the schools
 router.add('schools', function(data, cb) {
-  console.log(data);
+
   $('#school_link').addClass('active');
+
   var response = {
     id: 'school',
     data: data.schools
   }
-  //$('#pg_schools').html('');
+
   $('#pg_schools').css('display', 'block');
   $('#schoolTmpl').tmpl( data.schools ).appendTo("#pg_schools");
 });
 
 
-
 // go to the page that lists the courses for a specific school
 router.add('school', function(data, cb) {
   $('#school_link').addClass('active');
@@ -495,29 +508,28 @@ router.add('conduct', false, function(cb) {
 /* Do and show the appropriate thing, based on the pages current URL */
 function showPage(y) {
 
-       $(".page").hide(); //(100);             // hide all pseudo pages
-
-       var path = document.location.pathname
-  var routes = router.routes;
+    $('.page').hide(); //(100);// hide all pseudo pages
 
-  var slugs = path.split('/');
+    var
+    path = document.location.pathname,
+    routes = router.routes,
+    slugs = path.split('/');
 
-  slugs.shift();
+    slugs.shift();
 
-  mainSlug = slugs[0].toLowerCase() || 'home';
+    var mainSlug = slugs[0].toLowerCase() || 'home';
 
-  if (mainSlug === 'archive') {
-    if (slugs[1]) {
-      mainSlug = mainSlug + slugs[1];
+    if (mainSlug === 'archive') {
+        if (slugs[1]) {
+            mainSlug = mainSlug + slugs[1];
+        }
     }
-  }
-
-  if (routes[mainSlug]) {
-    router.run(mainSlug, path)
-  } else {
-    router.run('404')
-  }
 
+    if (routes[mainSlug]) {
+        router.run(mainSlug, path)
+    } else {
+        router.run('404')
+    }
 }
 
 
@@ -539,7 +551,6 @@ function goPage(path) {
   }
 }
 
-
 /* Simulates a "back" browser navigation.  */
 var popped = false;
 function goBack(event) {
@@ -569,13 +580,14 @@ $(document).ready(function() {
     }
   })
 
-       // xxx older FF browsers don't fire a page load/reload - deal with it somehow.
+    // xxx older FF browsers don't fire a page load/reload - deal with it somehow.
+    // I've increased the timeout, we need to avoid calling showPage twice. It causes page flicker.
   setTimeout(function() {
     console.timeEnd('no-pop')
     if (!popped) {
-      showPage( 0 );           // needed for some older browsers, redundant for chrome
+      showPage( 0 ); // needed for some older browsers, redundant for chrome
     }
-  }, 200)
+  }, 1200)
 
 })
 
index 97e4f403c5f0bb20386a70c1a7b4cd45acc40d89..299652c95cc5586f94209173fd7573d3c35e9cf5 100644 (file)
@@ -54,7 +54,6 @@
 
                 <h1>Universities</h1>
 
-                
                 <div class="school" id=PROTO_school>
                     <div class=name>
                         <a href="courses.html?school=__name__">__name__</a>
 
             <script>
 
-            var schools = []
+                var schools = []
 
-            // this is what will really happen when we're done
-            $.get("/schools", {}, function(r) {
+                // this is what will really happen when we're done
+                $.get("/schools", {}, function(r) {
 
-                //XXX schools = JSON.parse(r)
-                schools = [
-                    { name: "Berkeley", numCourses: 2 },
-                    { name: "Brown", numCourses: 5 },
-                    { name: "Columbia", numCourses: 0 },
-                ];
-
-                ProtoDiv.replicate("PROTO_school", schools);
-            });
+                    //XXX schools = JSON.parse(r)
+                    schools = [
+                        { name: "Berkeley", numCourses: 2 },
+                        { name: "Brown", numCourses: 5 },
+                        { name: "Columbia", numCourses: 0 },
+                    ];
 
+                    ProtoDiv.replicate("PROTO_school", schools);
+                });
 
             </script>
         </div>