Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Overhaul ( still depless )

  • Loading branch information...
commit 6a46ae2aa55279292e45ce11bc47d4fa1f9bdefd 1 parent cad78db
Jamie authored October 12, 2012

Showing 39 changed files with 14,305 additions and 29 deletions. Show diff stats Hide diff stats

  1. 2  README.md
  2. 23  app.js
  3. 8  humans.txt
  4. BIN  images/foundation/orbit/bullets.jpg
  5. BIN  images/foundation/orbit/left-arrow-small.png
  6. BIN  images/foundation/orbit/left-arrow.png
  7. BIN  images/foundation/orbit/loading.gif
  8. BIN  images/foundation/orbit/mask-black.png
  9. BIN  images/foundation/orbit/pause-black.png
  10. BIN  images/foundation/orbit/right-arrow-small.png
  11. BIN  images/foundation/orbit/right-arrow.png
  12. BIN  images/foundation/orbit/rotator-black.png
  13. BIN  images/foundation/orbit/timer-black.png
  14. 195  index.html
  15. 54  javascripts/app.js
  16. 71  javascripts/foundation.min.js
  17. 17  javascripts/jquery.foundation.accordion.js
  18. 20  javascripts/jquery.foundation.alerts.js
  19. 55  javascripts/jquery.foundation.buttons.js
  20. 488  javascripts/jquery.foundation.forms.js
  21. 27  javascripts/jquery.foundation.mediaQueryToggle.js
  22. 31  javascripts/jquery.foundation.navigation.js
  23. 841  javascripts/jquery.foundation.orbit.js
  24. 794  javascripts/jquery.foundation.reveal.js
  25. 43  javascripts/jquery.foundation.tabs.js
  26. 189  javascripts/jquery.foundation.tooltips.js
  27. 142  javascripts/jquery.foundation.topbar.js
  28. 9,301  javascripts/jquery.js
  29. 157  javascripts/jquery.placeholder.js
  30. 4  javascripts/modernizr.foundation.js
  31. 36  lib/keyprocessor.js
  32. 622  lib/mustache.js
  33. 35  lib/sysinfo.js
  34. 4  robots.txt
  35. 66  server.js
  36. 6  stackato.yml
  37. 29  stylesheets/app.css
  38. 1,073  stylesheets/foundation.css
  39. 1  stylesheets/foundation.min.css
2  README.md
Source Rendered
@@ -4,7 +4,7 @@ A simple demo that prints the server's environment variables.
4 4
 
5 5
 ## Local development
6 6
 
7  
-    node app.js
  7
+    node server.js
8 8
 
9 9
 ## Deploying to Stackato
10 10
 
23  app.js
... ...
@@ -1,23 +0,0 @@
1  
-var http = require('http');
2  
-
3  
-var host = process.env.VCAP_APP_HOST || "127.0.0.1";
4  
-var port = process.env.VCAP_APP_PORT || 1337;
5  
-
6  
-http.createServer(function (req, res) {
7  
-  res.writeHead(200, {'Content-Type': 'text/html'});
8  
-  res.write('<title>Stackato environment variables</title>');
9  
-  res.write('<h1>Stackato environment variables</h1><hr/>');
10  
-  res.write('<table>');
11  
-  for (var env in process.env){
12  
-    res.write('<tr><td style="border-style: solid;\
13  
-                              border-color: #034569;background-color: #9FB6C3;\
14  
-                              text-align: right; vertical-align: top; padding: 4px 1em; "><b>'
15  
-              + env + '</b></td>');
16  
-    res.write('<td><tt style="padding-left: 4px">'
17  
-              + process.env[env] + '</tt></td></tr>');
18  
-  }
19  
-  res.write('</table>');
20  
-  res.end();
21  
-}).listen(port, host);
22  
-
23  
-console.log('Server running at ' + host + ":" + port);
8  humans.txt
... ...
@@ -0,0 +1,8 @@
  1
+/* Foundation was made by ZURB, an interaction design and design strategy firm in Campbell, CA */
  2
+/* zurb.com */
  3
+/* humanstxt.org */
  4
+
  5
+/* SITE */
  6
+  Standards: HTML5, CSS3
  7
+  Components: jQuery, Orbit, Reveal
  8
+  Software: Coda, Textmate, Git
BIN  images/foundation/orbit/bullets.jpg
BIN  images/foundation/orbit/left-arrow-small.png
BIN  images/foundation/orbit/left-arrow.png
BIN  images/foundation/orbit/loading.gif
BIN  images/foundation/orbit/mask-black.png
BIN  images/foundation/orbit/pause-black.png
BIN  images/foundation/orbit/right-arrow-small.png
BIN  images/foundation/orbit/right-arrow.png
BIN  images/foundation/orbit/rotator-black.png
BIN  images/foundation/orbit/timer-black.png
195  index.html
... ...
@@ -0,0 +1,195 @@
  1
+<!DOCTYPE html>
  2
+
  3
+<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
  4
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
  5
+<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
  6
+<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
  7
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
  8
+<head>
  9
+  <meta charset="utf-8" />
  10
+
  11
+  <!-- Set the viewport width to device width for mobile -->
  12
+  <meta name="viewport" content="width=device-width" />
  13
+
  14
+  <title>Stackato Environment Variables</title>
  15
+  
  16
+  <!-- Included CSS Files (Uncompressed) -->
  17
+  <!--
  18
+  <link rel="stylesheet" href="stylesheets/foundation.css">
  19
+  -->
  20
+  
  21
+  <!-- Included CSS Files (Compressed) -->
  22
+  <link rel="stylesheet" href="stylesheets/foundation.min.css">
  23
+  <link rel="stylesheet" href="stylesheets/app.css">
  24
+
  25
+  <script src="javascripts/modernizr.foundation.js"></script>
  26
+
  27
+  <!-- IE Fix for HTML5 Tags -->
  28
+  <!--[if lt IE 9]>
  29
+    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  30
+  <![endif]-->
  31
+
  32
+  <style>
  33
+    p { word-break: break-all; }
  34
+    .keyheader { border-bottom: 4px solid #238bde;}
  35
+    body{
  36
+
  37
+    }
  38
+
  39
+  </style>
  40
+
  41
+</head>
  42
+<body>
  43
+
  44
+<!-- Header and Nav -->
  45
+
  46
+  <nav class="top-bar">
  47
+    <ul>
  48
+      <!-- Title Area -->
  49
+      <li class="name">
  50
+        <h1>
  51
+          <a href="#" >
  52
+            <span style="color: #c5e5ef">[ Stackato ]</span> Environment variables
  53
+          </a>
  54
+        </h1>
  55
+      </li>
  56
+      <li class="toggle-nav"><a href="#system-info">System Information</a></li>
  57
+    </ul>
  58
+
  59
+  </nav>
  60
+
  61
+
  62
+  <!-- End Header and Nav -->
  63
+
  64
+  <!-- Main Grid Section -->
  65
+
  66
+
  67
+  <div class="row display">
  68
+    <div class="three columns keyheader panel"><h5>Key</h5></div>
  69
+    <div class="eight columns offset-by-one keyheader panel"><h5>Value </h5></div>
  70
+  </div>
  71
+
  72
+  <br/>
  73
+
  74
+  {{#env}}
  75
+  <div class="row display">
  76
+    <div class="three columns" > <p><b>{{key}}</b></p></div>
  77
+    <div class="eight columns offset-by-one" style="border-left: 2px solid #ccc"><p class="values"> {{{value}}} </p></div>
  78
+  </div>
  79
+  <br/>
  80
+  {{/env}}
  81
+
  82
+  <div class="row display"><a name="system-info"></a>
  83
+    <div class="ten columns" > <h4>System Information</h4></div>
  84
+    <div class="two columns" > <a href="#top"> back to top </a></div>
  85
+  </div>
  86
+
  87
+  {{#sys}}
  88
+  <div class="row display">
  89
+    <div class="three columns" > <p><b>{{0}}</b></p></div>
  90
+    <div class="eight columns offset-by-one" style="border-left: 2px solid #ccc"><p class="values"> {{{1}}} </p></div>
  91
+
  92
+  </div>
  93
+  {{/sys}}
  94
+
  95
+  <!-- End Grid Section -->
  96
+
  97
+  <!-- Footer -->
  98
+
  99
+  <footer class="row">
  100
+    <div class="twelve columns">
  101
+      <hr />
  102
+      <div class="row">
  103
+        <div class="six columns">
  104
+          <p>ActiveState Software Inc.</p>
  105
+        </div>
  106
+        <div class="six columns">
  107
+          <ul class="link-list right">
  108
+            <li><a href="http://stackato.com">Stackato</a></li>
  109
+            <li><a href="https://github.com/Stackato-Apps/node-env">Github</a></li>
  110
+          </ul>
  111
+        </div>
  112
+      </div>
  113
+    </div>
  114
+  </footer>
  115
+  
  116
+  <!-- Included JS Files (Uncompressed) -->
  117
+  <!--
  118
+  
  119
+  <script src="javascripts/jquery.js"></script>
  120
+  
  121
+  <script src="javascripts/jquery.foundation.mediaQueryToggle.js"></script>
  122
+  
  123
+  <script src="javascripts/jquery.foundation.forms.js"></script>
  124
+  
  125
+  <script src="javascripts/jquery.foundation.reveal.js"></script>
  126
+  
  127
+  <script src="javascripts/jquery.foundation.orbit.js"></script>
  128
+  
  129
+  <script src="javascripts/jquery.foundation.navigation.js"></script>
  130
+  
  131
+  <script src="javascripts/jquery.foundation.buttons.js"></script>
  132
+  
  133
+  <script src="javascripts/jquery.foundation.tabs.js"></script>
  134
+  
  135
+  <script src="javascripts/jquery.foundation.tooltips.js"></script>
  136
+  
  137
+  <script src="javascripts/jquery.foundation.accordion.js"></script>
  138
+  
  139
+  <script src="javascripts/jquery.placeholder.js"></script>
  140
+  
  141
+  <script src="javascripts/jquery.foundation.alerts.js"></script>
  142
+  
  143
+  <script src="javascripts/jquery.foundation.topbar.js"></script>
  144
+  
  145
+  -->
  146
+  
  147
+  <!-- Included JS Files (Compressed) -->
  148
+  <script src="javascripts/jquery.js"></script>
  149
+ 
  150
+  <script src="javascripts/foundation.min.js"></script>
  151
+  
  152
+  <!-- Initialize JS Plugins -->
  153
+  <script src="javascripts/app.js"></script>
  154
+
  155
+  <script>
  156
+
  157
+// http://www.binpress.com/app/anchorscroll/228
  158
+(function($){
  159
+    $.fn.anchorscroll = function(param) {
  160
+        // Params
  161
+        var defaults = {
  162
+            speed: 1500,
  163
+            easing: 'swing',
  164
+            before: 10
  165
+        };
  166
+        var param = $.extend(defaults, param);
  167
+        
  168
+         
  169
+        // Engine
  170
+        return this.each(function() {
  171
+            $(this).click(function() {
  172
+                if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
  173
+                    && location.hostname == this.hostname) {
  174
+                    var $target = $(this.hash);
  175
+                    $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
  176
+                    if ($target.length) {
  177
+                        var targetOffset = $target.offset().top;
  178
+                        $('html,body').animate({
  179
+                            scrollTop: targetOffset - param.before
  180
+                        }, param.speed, param.easing);
  181
+                        return false;
  182
+                    }
  183
+                }
  184
+            });        
  185
+        });        
  186
+    };
  187
+})(jQuery);
  188
+
  189
+$(function(){  
  190
+    $("a[href*=#]").anchorscroll() //this is basic setup  
  191
+});
  192
+  </script>
  193
+
  194
+</body>
  195
+</html>
54  javascripts/app.js
... ...
@@ -0,0 +1,54 @@
  1
+;(function ($, window, undefined) {
  2
+  'use strict';
  3
+
  4
+  var $doc = $(document),
  5
+      Modernizr = window.Modernizr;
  6
+
  7
+  
  8
+  $.fn.foundationAlerts           ? $doc.foundationAlerts() : null;
  9
+  $.fn.foundationAccordion        ? $doc.foundationAccordion() : null;
  10
+  $.fn.foundationTooltips         ? $doc.foundationTooltips() : null;
  11
+  $('input, textarea').placeholder();
  12
+  
  13
+  
  14
+  $.fn.foundationButtons          ? $doc.foundationButtons() : null;
  15
+  
  16
+  
  17
+  $.fn.foundationNavigation       ? $doc.foundationNavigation() : null;
  18
+  
  19
+  
  20
+  $.fn.foundationTopBar           ? $doc.foundationTopBar() : null;
  21
+  
  22
+  $.fn.foundationCustomForms      ? $doc.foundationCustomForms() : null;
  23
+  $.fn.foundationMediaQueryViewer ? $doc.foundationMediaQueryViewer() : null;
  24
+  
  25
+    
  26
+  $.fn.foundationTabs             ? $doc.foundationTabs() : null;
  27
+    
  28
+  
  29
+  
  30
+  $("#featured").orbit();
  31
+
  32
+
  33
+
  34
+
  35
+  
  36
+
  37
+  // UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids
  38
+  // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'});
  39
+  // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'both'});
  40
+  // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'both'});
  41
+  // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'both'});
  42
+
  43
+  // Hide address bar on mobile devices
  44
+  if (Modernizr.touch) {
  45
+    $(window).load(function () {
  46
+      setTimeout(function () {
  47
+        window.scrollTo(0, 1);
  48
+      }, 0);
  49
+    });
  50
+  }
  51
+
  52
+})(jQuery, this);
  53
+
  54
+
71  javascripts/foundation.min.js
71 additions, 0 deletions not shown
17  javascripts/jquery.foundation.accordion.js
... ...
@@ -0,0 +1,17 @@
  1
+;(function ($, window, undefined){
  2
+  'use strict';
  3
+
  4
+  $.fn.foundationAccordion = function (options) {
  5
+
  6
+    $('.accordion li', this).on('click.fndtn', function () {
  7
+    var p = $(this).parent(); //changed this
  8
+      var flyout = $(this).children('.content').first();
  9
+      $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
  10
+      flyout.show(0, function () {
  11
+        flyout.parent('li').addClass('active');
  12
+      });
  13
+    });
  14
+
  15
+  };
  16
+
  17
+})( jQuery, this );
20  javascripts/jquery.foundation.alerts.js
... ...
@@ -0,0 +1,20 @@
  1
+;(function ($, window, undefined) {
  2
+  'use strict';
  3
+  
  4
+  $.fn.foundationAlerts = function (options) {
  5
+    var settings = $.extend({
  6
+      callback: $.noop
  7
+    }, options);
  8
+    
  9
+    $(document).on("click", ".alert-box a.close", function (e) {
  10
+      e.preventDefault();
  11
+      $(this).closest(".alert-box").fadeOut(function () {
  12
+        $(this).remove();
  13
+        // Do something else after the alert closes
  14
+        settings.callback();
  15
+      });
  16
+    });
  17
+    
  18
+  };
  19
+
  20
+})(jQuery, this);
55  javascripts/jquery.foundation.buttons.js
... ...
@@ -0,0 +1,55 @@
  1
+;(function ($, window, undefined) {
  2
+  'use strict';
  3
+
  4
+  $.fn.foundationButtons = function(options) {
  5
+    var $doc = $(document);
  6
+    // Prevent event propagation on disabled buttons
  7
+    $doc.on('click.fndtn', '.button.disabled', function (e) {
  8
+      e.preventDefault();
  9
+    });
  10
+
  11
+    $('.button.dropdown > ul', this).addClass('no-hover');
  12
+
  13
+    $doc.on('click.fndtn', '.button.dropdown, .button.dropdown.split span', function (e) {
  14
+      // Stops further propagation of the event up the DOM tree when clicked on the button.
  15
+      // Events fired by its descendants are not being blocked.
  16
+      $('.button.dropdown').children('ul').removeClass('show-dropdown');
  17
+      if (e.target === this) {
  18
+        e.stopPropagation();
  19
+      }
  20
+    });
  21
+
  22
+    $doc.on('click.fndtn', '.button.dropdown.split span', function (e) {
  23
+      e.preventDefault();
  24
+      $('.button.dropdown', this).not($(this).parent()).children('ul').removeClass('show-dropdown');
  25
+      $(this).siblings('ul').toggleClass('show-dropdown');
  26
+    });
  27
+
  28
+    $doc.on('click.fndtn', '.button.dropdown:not(.split)', function (e) {
  29
+      $('.button.dropdown', this).not(this).children('ul').removeClass('show-dropdown');
  30
+      $(this).children('ul').toggleClass('show-dropdown');
  31
+    });
  32
+
  33
+    $doc.on('click.fndtn', 'body, html', function () {
  34
+      $('.button.dropdown ul').removeClass('show-dropdown');
  35
+    });
  36
+
  37
+    // Positioning the Flyout List
  38
+    var normalButtonHeight  = $('.button.dropdown:not(.large):not(.small):not(.tiny)', this).outerHeight() - 1,
  39
+        largeButtonHeight   = $('.button.large.dropdown', this).outerHeight() - 1,
  40
+        smallButtonHeight   = $('.button.small.dropdown', this).outerHeight() - 1,
  41
+        tinyButtonHeight    = $('.button.tiny.dropdown', this).outerHeight() - 1;
  42
+
  43
+    $('.button.dropdown:not(.large):not(.small):not(.tiny) > ul', this).css('top', normalButtonHeight);
  44
+    $('.button.dropdown.large > ul', this).css('top', largeButtonHeight);
  45
+    $('.button.dropdown.small > ul', this).css('top', smallButtonHeight);
  46
+    $('.button.dropdown.tiny > ul', this).css('top', tinyButtonHeight);
  47
+
  48
+    $('.button.dropdown.up:not(.large):not(.small):not(.tiny) > ul', this).css('top', 'auto').css('bottom', normalButtonHeight - 2);
  49
+    $('.button.dropdown.up.large > ul', this).css('top', 'auto').css('bottom', largeButtonHeight - 2);
  50
+    $('.button.dropdown.up.small > ul', this).css('top', 'auto').css('bottom', smallButtonHeight - 2);
  51
+    $('.button.dropdown.up.tiny > ul', this).css('top', 'auto').css('bottom', tinyButtonHeight - 2);
  52
+
  53
+  };
  54
+
  55
+})( jQuery, this );
488  javascripts/jquery.foundation.forms.js
... ...
@@ -0,0 +1,488 @@
  1
+/*
  2
+ * jQuery Custom Forms Plugin 1.0
  3
+ * www.ZURB.com
  4
+ * Copyright 2010, ZURB
  5
+ * Free to use under the MIT license.
  6
+ * http://www.opensource.org/licenses/mit-license.php
  7
+*/
  8
+
  9
+(function( $ ){
  10
+
  11
+  /**
  12
+   * Helper object used to quickly adjust all hidden parent element's, display and visibility properties.
  13
+   * This is currently used for the custom drop downs. When the dropdowns are contained within a reveal modal
  14
+   * we cannot accurately determine the list-item elements width property, since the modal's display property is set
  15
+   * to 'none'.
  16
+   *
  17
+   * This object will help us work around that problem.
  18
+   *
  19
+   * NOTE: This could also be plugin.
  20
+   *
  21
+   * @function hiddenFix
  22
+   */
  23
+  var hiddenFix = function() {
  24
+
  25
+    return {
  26
+      /**
  27
+       * Sets all hidden parent elements and self to visibile.
  28
+       *
  29
+       * @method adjust
  30
+       * @param {jQuery Object} $child
  31
+       */
  32
+
  33
+      // We'll use this to temporarily store style properties.
  34
+      tmp : [],
  35
+
  36
+      // We'll use this to set hidden parent elements.
  37
+      hidden : null,
  38
+
  39
+      adjust : function( $child ) {
  40
+        // Internal reference.
  41
+        var _self = this;
  42
+
  43
+        // Set all hidden parent elements, including this element.
  44
+        _self.hidden = $child.parents().andSelf().filter( ":hidden" );
  45
+
  46
+        // Loop through all hidden elements.
  47
+        _self.hidden.each( function() {
  48
+
  49
+          // Cache the element.
  50
+          var $elem = $( this );
  51
+
  52
+          // Store the style attribute.
  53
+          // Undefined if element doesn't have a style attribute.
  54
+          _self.tmp.push( $elem.attr( 'style' ) );
  55
+
  56
+          // Set the element's display property to block,
  57
+          // but ensure it's visibility is hidden.
  58
+          $elem.css( { 'visibility' : 'hidden', 'display' : 'block' } );
  59
+        });
  60
+
  61
+      }, // end adjust
  62
+
  63
+      /**
  64
+       * Resets the elements previous state.
  65
+       *
  66
+       * @method reset
  67
+       */
  68
+      reset : function() {
  69
+        // Internal reference.
  70
+        var _self = this;
  71
+        // Loop through our hidden element collection.
  72
+        _self.hidden.each( function( i ) {
  73
+          // Cache this element.
  74
+          var $elem = $( this ),
  75
+              _tmp = _self.tmp[ i ]; // Get the stored 'style' value for this element.
  76
+
  77
+          // If the stored value is undefined.
  78
+          if( _tmp === undefined )
  79
+            // Remove the style attribute.
  80
+            $elem.removeAttr( 'style' );
  81
+          else
  82
+            // Otherwise, reset the element style attribute.
  83
+            $elem.attr( 'style', _tmp );
  84
+
  85
+        });
  86
+        // Reset the tmp array.
  87
+        _self.tmp = [];
  88
+        // Reset the hidden elements variable.
  89
+        _self.hidden = null;
  90
+
  91
+      } // end reset
  92
+
  93
+    }; // end return
  94
+
  95
+  };
  96
+
  97
+  jQuery.foundation = jQuery.foundation || {};
  98
+  jQuery.foundation.customForms = jQuery.foundation.customForms || {};
  99
+
  100
+  $.foundation.customForms.appendCustomMarkup = function ( options ) {
  101
+
  102
+    var defaults = {
  103
+      disable_class: "js-disable-custom"
  104
+    };
  105
+
  106
+    options = $.extend( defaults, options );
  107
+
  108
+    function appendCustomMarkup(idx, sel) {
  109
+      var $this = $(sel).hide(),
  110
+          type  = $this.attr('type'),
  111
+          $span = $this.next('span.custom.' + type);
  112
+
  113
+      if ($span.length === 0) {
  114
+        $span = $('<span class="custom ' + type + '"></span>').insertAfter($this);
  115
+      }
  116
+
  117
+      $span.toggleClass('checked', $this.is(':checked'));
  118
+      $span.toggleClass('disabled', $this.is(':disabled'));
  119
+    }
  120
+
  121
+    function appendCustomSelect(idx, sel) {
  122
+      var hiddenFixObj = hiddenFix();
  123
+          //
  124
+          // jQueryify the <select> element and cache it.
  125
+          //
  126
+      var $this = $( sel ),
  127
+          //
  128
+          // Find the custom drop down element.
  129
+          //
  130
+          $customSelect = $this.next( 'div.custom.dropdown' ),
  131
+          //
  132
+          // Find the custom select element within the custom drop down.
  133
+          //
  134
+          $customList = $customSelect.find( 'ul' ),
  135
+          //
  136
+          // Find the custom a.current element.
  137
+          //
  138
+          $selectCurrent = $customSelect.find( ".current" ),
  139
+          //
  140
+          // Find the custom a.selector element (the drop-down icon).
  141
+          //
  142
+          $selector = $customSelect.find( ".selector" ),
  143
+          //
  144
+          // Get the <options> from the <select> element.
  145
+          //
  146
+          $options = $this.find( 'option' ),
  147
+          //
  148
+          // Filter down the selected options
  149
+          //
  150
+          $selectedOption = $options.filter( ':selected' ),
  151
+          //
  152
+          // Initial max width.
  153
+          //
  154
+          maxWidth = 0,
  155
+          //
  156
+          // We'll use this variable to create the <li> elements for our custom select.
  157
+          //
  158
+          liHtml = '',
  159
+          //
  160
+          // We'll use this to cache the created <li> elements within our custom select.
  161
+          //
  162
+          $listItems
  163
+      ;
  164
+      var $currentSelect = false;
  165
+      //
  166
+      // Should we not create a custom list?
  167
+      //
  168
+      if ( $this.hasClass( 'no-custom' ) ) return;
  169
+
  170
+      //
  171
+      // Did we not create a custom select element yet?
  172
+      //
  173
+      if ( $customSelect.length === 0 ) {
  174
+        //
  175
+        // Let's create our custom select element!
  176
+        //
  177
+
  178
+            //
  179
+            // Determine what select size to use.
  180
+            //
  181
+        var customSelectSize = $this.hasClass( 'small' )   ? 'small'   :
  182
+                               $this.hasClass( 'medium' )  ? 'medium'  :
  183
+                               $this.hasClass( 'large' )   ? 'large'   :
  184
+                               $this.hasClass( 'expand' )  ? 'expand'  : ''
  185
+        ;
  186
+        //
  187
+        // Build our custom list.
  188
+        //
  189
+        $customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>"');
  190
+        //
  191
+        // Grab the selector element
  192
+        //
  193
+        $selector = $customSelect.find( ".selector" );
  194
+        //
  195
+        // Grab the unordered list element from the custom list.
  196
+        //
  197
+        $customList = $customSelect.find( "ul" );
  198
+        //
  199
+        // Build our <li> elements.
  200
+        //
  201
+        liHtml = $options.map( function() { return "<li>" + $( this ).html() + "</li>"; } ).get().join( '' );
  202
+        //
  203
+        // Append our <li> elements to the custom list (<ul>).
  204
+        //
  205
+        $customList.append( liHtml );
  206
+        //
  207
+        // Insert the the currently selected list item before all other elements.
  208
+        // Then, find the element and assign it to $currentSelect.
  209
+        //
  210
+
  211
+        $currentSelect = $customSelect.prepend( '<a href="#" class="current">' + $selectedOption.html() + '</a>' ).find( ".current" );
  212
+        //
  213
+        // Add the custom select element after the <select> element.
  214
+        //
  215
+        $this.after( $customSelect )
  216
+        //
  217
+        //then hide the <select> element.
  218
+        //
  219
+        .hide();
  220
+
  221
+      } else {
  222
+        //
  223
+        // Create our list item <li> elements.
  224
+        //
  225
+        liHtml = $options.map( function() { return "<li>" + $( this ).html() + "</li>"; } ).get().join( '' );
  226
+        //
  227
+        // Refresh the ul with options from the select in case the supplied markup doesn't match.
  228
+        // Clear what's currently in the <ul> element.
  229
+        //
  230
+        $customList.html( '' )
  231
+        //
  232
+        // Populate the list item <li> elements.
  233
+        //
  234
+        .append( liHtml );
  235
+
  236
+      } // endif $customSelect.length === 0
  237
+
  238
+      //
  239
+      // Determine whether or not the custom select element should be disabled.
  240
+      //
  241
+      $customSelect.toggleClass( 'disabled', $this.is( ':disabled' ) );
  242
+      //
  243
+      // Cache our List item elements.
  244
+      //
  245
+      $listItems = $customList.find( 'li' );
  246
+
  247
+      //
  248
+      // Determine which elements to select in our custom list.
  249
+      //
  250
+      $options.each( function ( index ) {
  251
+
  252
+        if ( this.selected ) {
  253
+          //
  254
+          // Add the selected class to the current li element
  255
+          //
  256
+          $listItems.eq( index ).addClass( 'selected' );
  257
+          //
  258
+          // Update the current element with the option value.
  259
+          //
  260
+          if ($currentSelect) {
  261
+            $currentSelect.html( $( this ).html() );
  262
+          }
  263
+
  264
+        }
  265
+
  266
+      });
  267
+
  268
+      //
  269
+      // Update the custom <ul> list width property.
  270
+      //
  271
+      $customList.css( 'width', 'inherit' );
  272
+      //
  273
+      // Set the custom select width property.
  274
+      //
  275
+      $customSelect.css( 'width', 'inherit' );
  276
+
  277
+      //
  278
+      // If we're not specifying a predetermined form size.
  279
+      //
  280
+      if ( !$customSelect.is( '.small, .medium, .large, .expand' ) ) {
  281
+
  282
+        // ------------------------------------------------------------------------------------
  283
+        // This is a work-around for when elements are contained within hidden parents.
  284
+        // For example, when custom-form elements are inside of a hidden reveal modal.
  285
+        //
  286
+        // We need to display the current custom list element as well as hidden parent elements
  287
+        // in order to properly calculate the list item element's width property.
  288
+        // -------------------------------------------------------------------------------------
  289
+
  290
+        //
  291
+        // Show the drop down.
  292
+        // This should ensure that the list item's width values are properly calculated.
  293
+        //
  294
+        $customSelect.addClass( 'open' );
  295
+        //
  296
+        // Quickly, display all parent elements.
  297
+        // This should help us calcualate the width of the list item's within the drop down.
  298
+        //
  299
+        hiddenFixObj.adjust( $customList );
  300
+        //
  301
+        // Grab the largest list item width.
  302
+        //
  303
+        maxWidth = ( $listItems.outerWidth() > maxWidth ) ? $listItems.outerWidth() : maxWidth;
  304
+        //
  305
+        // Okay, now reset the parent elements.
  306
+        // This will hide them again.
  307
+        //
  308
+        hiddenFixObj.reset();
  309
+        //
  310
+        // Finally, hide the drop down.
  311
+        //
  312
+        $customSelect.removeClass( 'open' );
  313
+        //
  314
+        // Set the custom list width.
  315
+        //
  316
+        $customSelect.width( maxWidth + 18);
  317
+        //
  318
+        // Set the custom list element (<ul />) width.
  319
+        //
  320
+        $customList.width(  maxWidth + 16 );
  321
+
  322
+      } // endif
  323
+
  324
+    }
  325
+
  326
+    $('form.custom input:radio[data-customforms!=disabled]').each(appendCustomMarkup);
  327
+    $('form.custom input:checkbox[data-customforms!=disabled]').each(appendCustomMarkup);
  328
+    $('form.custom select[data-customforms!=disabled]').each(appendCustomSelect);
  329
+  };
  330
+
  331
+  var refreshCustomSelect = function($select) {
  332
+    var maxWidth = 0,
  333
+        $customSelect = $select.next();
  334
+    $options = $select.find('option');
  335
+    $customSelect.find('ul').html('');
  336
+
  337
+    $options.each(function () {
  338
+      $li = $('<li>' + $(this).html() + '</li>');
  339
+      $customSelect.find('ul').append($li);
  340
+    });
  341
+
  342
+    // re-populate
  343
+    $options.each(function (index) {
  344
+      if (this.selected) {
  345
+        $customSelect.find('li').eq(index).addClass('selected');
  346
+        $customSelect.find('.current').html($(this).html());
  347
+      }
  348
+    });
  349
+
  350
+    // fix width
  351
+    $customSelect.removeAttr('style')
  352
+      .find('ul').removeAttr('style');
  353
+    $customSelect.find('li').each(function () {
  354
+      $customSelect.addClass('open');
  355
+      if ($(this).outerWidth() > maxWidth) {
  356
+        maxWidth = $(this).outerWidth();
  357
+      }
  358
+      $customSelect.removeClass('open');
  359
+    });
  360
+    $customSelect.css('width', maxWidth + 18 + 'px');
  361
+    $customSelect.find('ul').css('width', maxWidth + 16 + 'px');
  362
+
  363
+  };
  364
+
  365
+  var toggleCheckbox = function($element) {
  366
+    var $input = $element.prev(),
  367
+        input = $input[0];
  368
+
  369
+    if (false === $input.is(':disabled')) {
  370
+        input.checked = ((input.checked) ? false : true);
  371
+        $element.toggleClass('checked');
  372
+
  373
+        $input.trigger('change');
  374
+    }
  375
+  };
  376
+
  377
+  var toggleRadio = function($element) {
  378
+    var $input = $element.prev(),
  379
+        input = $input[0];
  380
+
  381
+    if (false === $input.is(':disabled')) {
  382
+
  383
+      $('input:radio[name="' + $input.attr('name') + '"]').next().not($element).removeClass('checked');
  384
+      if ($element.hasClass('checked')) {
  385
+        // Do Nothing
  386
+      } else {
  387
+        $element.toggleClass('checked');
  388
+      }
  389
+      input.checked = $element.hasClass('checked');
  390
+
  391
+      $input.trigger('change');
  392
+    }
  393
+  };
  394
+
  395
+  $(document).on('click', 'form.custom span.custom.checkbox', function (event) {
  396
+    event.preventDefault();
  397
+    event.stopPropagation();
  398
+
  399
+    toggleCheckbox($(this));
  400
+  });
  401
+
  402
+  $(document).on('click', 'form.custom span.custom.radio', function (event) {
  403
+    event.preventDefault();
  404
+    event.stopPropagation();
  405
+
  406
+    toggleRadio($(this));
  407
+  });
  408
+
  409
+  $(document).on('change', 'form.custom select[data-customforms!=disabled]', function (event) {
  410
+    refreshCustomSelect($(this));
  411
+  });
  412
+
  413
+  $(document).on('click', 'form.custom label', function (event) {
  414
+    var $associatedElement = $('#' + $(this).attr('for')),
  415
+        $customCheckbox,
  416
+        $customRadio;
  417
+    if ($associatedElement.length !== 0) {
  418
+      if ($associatedElement.attr('type') === 'checkbox') {
  419
+        event.preventDefault();
  420
+        $customCheckbox = $(this).find('span.custom.checkbox');
  421
+        toggleCheckbox($customCheckbox);
  422
+      } else if ($associatedElement.attr('type') === 'radio') {
  423
+        event.preventDefault();
  424
+        $customRadio = $(this).find('span.custom.radio');
  425
+        toggleRadio($customRadio);
  426
+      }
  427
+    }
  428
+  });
  429
+
  430
+  $(document).on('click', 'form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector', function (event) {
  431
+    var $this = $(this),
  432
+        $dropdown = $this.closest('div.custom.dropdown'),
  433
+        $select = $dropdown.prev();
  434
+
  435
+    event.preventDefault();
  436
+    $('div.dropdown').removeClass('open');
  437
+
  438
+    if (false === $select.is(':disabled')) {
  439
+        $dropdown.toggleClass('open');
  440
+
  441
+        if ($dropdown.hasClass('open')) {
  442
+          $(document).bind('click.customdropdown', function (event) {
  443
+            $dropdown.removeClass('open');
  444
+            $(document).unbind('.customdropdown');
  445
+          });
  446
+        } else {
  447
+          $(document).unbind('.customdropdown');
  448
+        }
  449
+        return false;
  450
+    }
  451
+  });
  452
+
  453
+  $(document).on('click', 'form.custom div.custom.dropdown li', function (event) {
  454
+    var $this = $(this),
  455
+        $customDropdown = $this.closest('div.custom.dropdown'),
  456
+        $select = $customDropdown.prev(),
  457
+        selectedIndex = 0;
  458
+
  459
+    event.preventDefault();
  460
+    event.stopPropagation();
  461
+    $('div.dropdown').removeClass('open');
  462
+
  463
+    $this
  464
+      .closest('ul')
  465
+      .find('li')
  466
+      .removeClass('selected');
  467
+    $this.addClass('selected');
  468
+
  469
+    $customDropdown
  470
+      .removeClass('open')
  471
+      .find('a.current')
  472
+      .html($this.html());
  473
+
  474
+    $this.closest('ul').find('li').each(function (index) {
  475
+      if ($this[0] == this) {
  476
+        selectedIndex = index;
  477
+      }
  478
+
  479
+    });
  480
+    $select[0].selectedIndex = selectedIndex;
  481
+
  482
+    $select.trigger('change');
  483
+  });
  484
+
  485
+
  486
+  $.fn.foundationCustomForms = $.foundation.customForms.appendCustomMarkup;
  487
+
  488
+})( jQuery );
27  javascripts/jquery.foundation.mediaQueryToggle.js
... ...
@@ -0,0 +1,27 @@
  1
+;(function ($, window, undefined) {
  2
+  'use strict';
  3
+  
  4
+  $.fn.foundationMediaQueryViewer = function (options) {
  5
+    var settings = $.extend(options,{toggleKey:77}), // Press 'M'
  6
+        $doc = $(document);
  7
+
  8
+    $doc.on("keyup.mediaQueryViewer", ":input", function (e){
  9
+      if (e.which === settings.toggleKey) {
  10
+        e.stopPropagation();
  11
+      }
  12
+    });
  13
+    $doc.on("keyup.mediaQueryViewer", function (e) {
  14
+      var $mqViewer = $('#fqv');
  15
+
  16
+      if (e.which === settings.toggleKey) { 
  17
+        if ($mqViewer.length > 0) {
  18
+          $mqViewer.remove();
  19
+        } else {
  20
+          $('body').prepend('<div id="fqv" style="position:fixed;top:4px;left:4px;z-index:999;color:#fff;"><p style="font-size:12px;background:rgba(0,0,0,0.75);padding:5px;margin-bottom:1px;line-height:1.2;"><span class="left">Media:</span> <span style="font-weight:bold;" class="show-for-xlarge">Extra Large</span><span style="font-weight:bold;" class="show-for-large">Large</span><span style="font-weight:bold;" class="show-for-medium">Medium</span><span style="font-weight:bold;" class="show-for-small">Small</span><span style="font-weight:bold;" class="show-for-landscape">Landscape</span><span style="font-weight:bold;" class="show-for-portrait">Portrait</span><span style="font-weight:bold;" class="show-for-touch">Touch</span></p></div>');
  21
+        }
  22
+      }
  23
+    });
  24
+
  25
+  };
  26
+
  27
+})(jQuery, this);
31  javascripts/jquery.foundation.navigation.js
... ...
@@ -0,0 +1,31 @@
  1
+;(function ($, window, undefined) {
  2
+  'use strict';
  3
+
  4
+  $.fn.foundationNavigation = function (options) {
  5
+
  6
+    var lockNavBar = false;
  7
+    // Windows Phone, sadly, does not register touch events :(
  8
+    if (Modernizr.touch || navigator.userAgent.match(/Windows Phone/i)) {
  9
+      $(document).on('click.fndtn touchstart.fndtn', '.nav-bar a.flyout-toggle', function (e) {
  10
+        e.preventDefault();
  11
+        var flyout = $(this).siblings('.flyout').first();
  12
+        if (lockNavBar === false) {
  13
+          $('.nav-bar .flyout').not(flyout).slideUp(500);
  14
+          flyout.slideToggle(500, function () {
  15
+            lockNavBar = false;
  16
+          });
  17
+        }
  18
+        lockNavBar = true;
  19
+      });
  20
+      $('.nav-bar>li.has-flyout', this).addClass('is-touch');
  21
+    } else {
  22
+      $('.nav-bar>li.has-flyout', this).hover(function () {
  23
+        $(this).children('.flyout').show();
  24
+      }, function () {
  25
+        $(this).children('.flyout').hide();
  26
+      });
  27
+    }
  28
+
  29
+  };
  30
+
  31
+})( jQuery, this );
841  javascripts/jquery.foundation.orbit.js
... ...
@@ -0,0 +1,841 @@
  1
+/*
  2
+ * jQuery Orbit Plugin 1.4.0
  3
+ * www.ZURB.com/playground
  4
+ * Copyright 2010, ZURB
  5
+ * Free to use under the MIT license.
  6
+ * http://www.opensource.org/licenses/mit-license.php
  7
+*/
  8
+
  9
+
  10
+(function ($) {
  11
+  'use strict';
  12
+
  13
+  $.fn.findFirstImage = function () {
  14
+    return this.first()
  15
+            .find('img')
  16
+            .andSelf().filter('img')
  17
+            .first();
  18
+  };
  19
+
  20
+  var ORBIT = {
  21
+
  22
+    defaults: {
  23
+      animation: 'horizontal-push',     // fade, horizontal-slide, vertical-slide, horizontal-push, vertical-push
  24
+      animationSpeed: 600,        // how fast animtions are
  25
+      timer: true,            // true or false to have the timer
  26
+      advanceSpeed: 4000,         // if timer is enabled, time between transitions
  27
+      pauseOnHover: false,        // if you hover pauses the slider
  28
+      startClockOnMouseOut: false,    // if clock should start on MouseOut
  29
+      startClockOnMouseOutAfter: 1000,  // how long after MouseOut should the timer start again
  30
+      directionalNav: true,         // manual advancing directional navs
  31
+      directionalNavRightText: 'Right', // text of right directional element for accessibility
  32
+      directionalNavLeftText: 'Left', // text of left directional element for accessibility
  33
+      captions: true,           // do you want captions?
  34
+      captionAnimation: 'fade',       // fade, slideOpen, none
  35
+      captionAnimationSpeed: 600,     // if so how quickly should they animate in
  36
+      resetTimerOnClick: false,      // true resets the timer instead of pausing slideshow progress on manual navigation
  37
+      bullets: false,           // true or false to activate the bullet navigation
  38
+      bulletThumbs: false,        // thumbnails for the bullets
  39
+      bulletThumbLocation: '',      // location from this file where thumbs will be
  40
+      afterSlideChange: $.noop,   // empty function
  41
+      afterLoadComplete: $.noop, //callback to execute after everything has been loaded
  42
+      fluid: true,
  43
+      centerBullets: true,   // center bullet nav with js, turn this off if you want to position the bullet nav manually
  44
+      singleCycle: false     // cycles through orbit slides only once
  45
+    },
  46
+
  47
+    activeSlide: 0,
  48
+    numberSlides: 0,
  49
+    orbitWidth: null,
  50
+    orbitHeight: null,
  51
+    locked: null,
  52
+    timerRunning: null,
  53
+    degrees: 0,
  54
+    wrapperHTML: '<div class="orbit-wrapper" />',
  55
+    timerHTML: '<div class="timer"><span class="mask"><span class="rotator"></span></span><span class="pause"></span></div>',
  56
+    captionHTML: '<div class="orbit-caption"></div>',
  57
+    directionalNavHTML: '<div class="slider-nav"><span class="right"></span><span class="left"></span></div>',
  58
+    bulletHTML: '<ul class="orbit-bullets"></ul>',
  59
+
  60
+    init: function (element, options) {
  61
+      var $imageSlides,
  62
+          imagesLoadedCount = 0,
  63
+          self = this;
  64
+
  65
+      // Bind functions to correct context
  66
+      this.clickTimer = $.proxy(this.clickTimer, this);
  67
+      this.addBullet = $.proxy(this.addBullet, this);
  68
+      this.resetAndUnlock = $.proxy(this.resetAndUnlock, this);
  69
+      this.stopClock = $.proxy(this.stopClock, this);
  70
+      this.startTimerAfterMouseLeave = $.proxy(this.startTimerAfterMouseLeave, this);
  71
+      this.clearClockMouseLeaveTimer = $.proxy(this.clearClockMouseLeaveTimer, this);
  72
+      this.rotateTimer = $.proxy(this.rotateTimer, this);
  73
+
  74
+      this.options = $.extend({}, this.defaults, options);
  75
+      if (this.options.timer === 'false') this.options.timer = false;
  76
+      if (this.options.captions === 'false') this.options.captions = false;
  77
+      if (this.options.directionalNav === 'false') this.options.directionalNav = false;
  78
+
  79
+      this.$element = $(element);
  80
+      this.$wrapper = this.$element.wrap(this.wrapperHTML).parent();
  81
+      this.$slides = this.$element.children('img, a, div, figure');
  82
+
  83
+      this.$element.bind('orbit.next', function () {
  84
+        self.shift('next');
  85
+      });
  86
+
  87
+      this.$element.bind('orbit.prev', function () {
  88
+        self.shift('prev');
  89
+      });
  90
+
  91
+      this.$element.bind('orbit.goto', function (event, index) {
  92
+        self.shift(index);
  93
+      });
  94
+
  95
+      this.$element.bind('orbit.start', function (event, index) {
  96
+        self.startClock();
  97
+      });
  98
+
  99
+      this.$element.bind('orbit.stop', function (event, index) {
  100
+        self.stopClock();
  101
+      });
  102
+
  103
+      $imageSlides = this.$slides.filter('img');
  104
+
  105
+      if ($imageSlides.length === 0) {
  106
+        this.loaded();
  107
+      } else {
  108
+        $imageSlides.bind('imageready', function () {
  109
+          imagesLoadedCount += 1;
  110
+          if (imagesLoadedCount === $imageSlides.length) {
  111
+            self.loaded();
  112
+          }
  113
+        });
  114
+      }
  115
+    },
  116
+
  117
+    loaded: function () {
  118
+      this.$element
  119
+        .addClass('orbit')
  120
+        .css({width: '1px', height: '1px'});
  121
+
  122
+      this.$slides.addClass('orbit-slide');
  123
+
  124
+      this.setDimentionsFromLargestSlide();
  125
+      this.updateOptionsIfOnlyOneSlide();
  126
+      this.setupFirstSlide();
  127
+
  128
+      if (this.options.timer) {
  129
+        this.setupTimer();
  130
+        this.startClock();
  131
+      }
  132
+
  133
+      if (this.options.captions) {
  134
+        this.setupCaptions();
  135
+      }
  136
+
  137
+      if (this.options.directionalNav) {
  138
+        this.setupDirectionalNav();
  139
+      }
  140
+
  141
+      if (this.options.bullets) {
  142
+        this.setupBulletNav();
  143
+        this.setActiveBullet();
  144
+      }
  145
+
  146
+      this.options.afterLoadComplete.call(this);
  147
+      Holder.run();
  148
+    },
  149
+
  150
+    currentSlide: function () {
  151
+      return this.$slides.eq(this.activeSlide);