Browse files

First commit

  • Loading branch information...
0 parents commit e07083afa751bcd1ff4216e74acb4f398d7a99dc @swaroopch committed Dec 4, 2012
Showing with 15,282 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +10 −0 README.md
  3. +8 −0 foundation/humans.txt
  4. BIN foundation/images/foundation/orbit/bullets.jpg
  5. BIN foundation/images/foundation/orbit/left-arrow-small.png
  6. BIN foundation/images/foundation/orbit/left-arrow.png
  7. BIN foundation/images/foundation/orbit/loading.gif
  8. BIN foundation/images/foundation/orbit/mask-black.png
  9. BIN foundation/images/foundation/orbit/pause-black.png
  10. BIN foundation/images/foundation/orbit/right-arrow-small.png
  11. BIN foundation/images/foundation/orbit/right-arrow.png
  12. BIN foundation/images/foundation/orbit/rotator-black.png
  13. BIN foundation/images/foundation/orbit/timer-black.png
  14. +216 −0 foundation/index.html
  15. +38 −0 foundation/javascripts/app.js
  16. +98 −0 foundation/javascripts/foundation.min.js
  17. +39 −0 foundation/javascripts/jquery.foundation.accordion.js
  18. +20 −0 foundation/javascripts/jquery.foundation.alerts.js
  19. +79 −0 foundation/javascripts/jquery.foundation.buttons.js
  20. +480 −0 foundation/javascripts/jquery.foundation.clearing.js
  21. +486 −0 foundation/javascripts/jquery.foundation.forms.js
  22. +639 −0 foundation/javascripts/jquery.foundation.joyride.js
  23. +86 −0 foundation/javascripts/jquery.foundation.magellan.js
  24. +27 −0 foundation/javascripts/jquery.foundation.mediaQueryToggle.js
  25. +55 −0 foundation/javascripts/jquery.foundation.navigation.js
  26. +897 −0 foundation/javascripts/jquery.foundation.orbit.js
  27. +794 −0 foundation/javascripts/jquery.foundation.reveal.js
  28. +56 −0 foundation/javascripts/jquery.foundation.tabs.js
  29. +193 −0 foundation/javascripts/jquery.foundation.tooltips.js
  30. +156 −0 foundation/javascripts/jquery.foundation.topbar.js
  31. +9,440 −0 foundation/javascripts/jquery.js
  32. +157 −0 foundation/javascripts/jquery.placeholder.js
  33. +4 −0 foundation/javascripts/modernizr.foundation.js
  34. +4 −0 foundation/robots.txt
  35. +29 −0 foundation/stylesheets/app.css
  36. +1,215 −0 foundation/stylesheets/foundation.css
  37. +1 −0 foundation/stylesheets/foundation.min.css
  38. +37 −0 index.html
  39. +17 −0 package.json
1 .gitignore
@@ -0,0 +1 @@
+.*.sw*
10 README.md
@@ -0,0 +1,10 @@
+
+# What is Kalam
+
+I needed a live preview of Pandoc text while writing, something like [Mou.app](http://mouapp.com) but for Pandoc (and not plain Markdown) so that it is easy to [work on my books](http://www.swaroopch.com/blog/byte-of-python-pandoc/), so I hacked this up.
+
+# How to run
+
+1. Install [node-webkit](https://github.com/rogerwang/node-webkit) command
+2. Fetch this repository, perhaps using the "Zip Download" button
+3. Run the node-webkit command with this app folder: `nw kalam`
8 foundation/humans.txt
@@ -0,0 +1,8 @@
+/* Foundation was made by ZURB, an interaction design and design strategy firm in Campbell, CA */
+/* zurb.com */
+/* humanstxt.org */
+
+/* SITE */
+ Standards: HTML5, CSS3
+ Components: jQuery, Orbit, Reveal
+ Software: Coda, Textmate, Git
BIN foundation/images/foundation/orbit/bullets.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/left-arrow-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/left-arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/mask-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/pause-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/right-arrow-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/right-arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/rotator-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN foundation/images/foundation/orbit/timer-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
216 foundation/index.html
@@ -0,0 +1,216 @@
+<!DOCTYPE html>
+
+<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
+<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
+<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
+<head>
+ <meta charset="utf-8" />
+
+ <!-- Set the viewport width to device width for mobile -->
+ <meta name="viewport" content="width=device-width" />
+
+ <title>Welcome to Foundation</title>
+
+ <!-- Included CSS Files (Uncompressed) -->
+ <!--
+ <link rel="stylesheet" href="stylesheets/foundation.css">
+ -->
+
+ <!-- Included CSS Files (Compressed) -->
+ <link rel="stylesheet" href="stylesheets/foundation.min.css">
+ <link rel="stylesheet" href="stylesheets/app.css">
+
+ <script src="javascripts/modernizr.foundation.js"></script>
+
+ <!-- IE Fix for HTML5 Tags -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+</head>
+<body>
+
+ <div class="row">
+ <div class="twelve columns">
+ <h2>Welcome to Foundation</h2>
+ <p>This is version <strong>3.2.2</strong> generated on November 10, 2012.</p>
+ <hr />
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="eight columns">
+ <h3>The Grid</h3>
+
+ <!-- Grid Example -->
+ <div class="row">
+ <div class="twelve columns">
+ <div class="panel">
+ <p>This is a twelve column section in a row. Each of these includes a div.panel element so you can see where the columns are - it's not required at all for the grid.</p>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="six columns">
+ <div class="panel">
+ <p>Six columns</p>
+ </div>
+ </div>
+ <div class="six columns">
+ <div class="panel">
+ <p>Six columns</p>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="four columns">
+ <div class="panel">
+ <p>Four columns</p>
+ </div>
+ </div>
+ <div class="four columns">
+ <div class="panel">
+ <p>Four columns</p>
+ </div>
+ </div>
+ <div class="four columns">
+ <div class="panel">
+ <p>Four columns</p>
+ </div>
+ </div>
+ </div>
+
+
+ <h3>Tabs</h3>
+ <dl class="tabs">
+ <dd class="active"><a href="#simple1">Simple Tab 1</a></dd>
+ <dd><a href="#simple2">Simple Tab 2</a></dd>
+ <dd><a href="#simple3">Simple Tab 3</a></dd>
+ </dl>
+
+ <ul class="tabs-content">
+ <li class="active" id="simple1Tab">This is simple tab 1's content. Pretty neat, huh?</li>
+ <li id="simple2Tab">This is simple tab 2's content. Now you see it!</li>
+ <li id="simple3Tab">This is simple tab 3's content. It's, you know...okay.</li>
+ </ul>
+
+
+
+ <h3>Buttons</h3>
+
+ <div class="row">
+ <div class="six columns">
+ <p><a href="#" class="small button">Small Button</a></p>
+ <p><a href="#" class="button">Medium Button</a></p>
+ <p><a href="#" class="large button">Large Button</a></p>
+ </div>
+ <div class="six columns">
+ <p><a href="#" class="small alert button">Small Alert Button</a></p>
+ <p><a href="#" class="success button">Medium Success Button</a></p>
+ <p><a href="#" class="large secondary button">Large Secondary Button</a></p>
+ </div>
+ </div>
+
+ </div>
+
+ <div class="four columns">
+ <h4>Getting Started</h4>
+ <p>We're stoked you want to try Foundation! To get going, this file (index.html) includes some basic styles you can modify, play around with, or totally destroy to get going.</p>
+
+ <h4>Other Resources</h4>
+ <p>Once you've exhausted the fun in this document, you should check out:</p>
+ <ul class="disc">
+ <li><a href="http://foundation.zurb.com/docs">Foundation Documentation</a><br />Everything you need to know about using the framework.</li>
+ <li><a href="http://github.com/zurb/foundation">Foundation on Github</a><br />Latest code, issue reports, feature requests and more.</li>
+ <li><a href="http://twitter.com/foundationzurb">@foundationzurb</a><br />Ping us on Twitter if you have questions. If you build something with this we'd love to see it (and send you a totally boss sticker).</li>
+ </ul>
+ </div>
+ </div>
+
+
+ <div class="row">
+ <div class="twelve columns">
+ <h3>Orbit</h3>
+ <div id="featured">
+ <img src="holder.js/1200x250/text:Slide_1" alt="slide image">
+ <img src="holder.js/1200x250/text:Slide_2" alt="slide image">
+ <img src="holder.js/1200x250/text:Slide_3" alt="slide image">
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="row">
+ <div class="twelve columns">
+ <h3>Reveal</h3>
+ <p><a href="#" data-reveal-id="exampleModal" class="button">Example modal</a></p>
+ </div>
+ </div>
+
+ <div id="exampleModal" class="reveal-modal">
+ <h2>This is a modal.</h2>
+ <p>
+ Reveal makes these very easy to summon and dismiss. The close button is simple an anchor with a unicode
+ character icon and a class of <code>close-reveal-modal</code>. Clicking anywhere outside the modal will
+ also dismiss it.
+ </p>
+ <a class="close-reveal-modal">×</a>
+ </div>
+
+
+ <!-- Included JS Files (Uncompressed) -->
+ <!--
+
+ <script src="javascripts/jquery.js"></script>
+
+ <script src="javascripts/jquery.foundation.mediaQueryToggle.js"></script>
+
+ <script src="javascripts/jquery.foundation.forms.js"></script>
+
+ <script src="javascripts/jquery.foundation.reveal.js"></script>
+
+ <script src="javascripts/jquery.foundation.orbit.js"></script>
+
+ <script src="javascripts/jquery.foundation.navigation.js"></script>
+
+ <script src="javascripts/jquery.foundation.buttons.js"></script>
+
+ <script src="javascripts/jquery.foundation.tabs.js"></script>
+
+ <script src="javascripts/jquery.foundation.tooltips.js"></script>
+
+ <script src="javascripts/jquery.foundation.accordion.js"></script>
+
+ <script src="javascripts/jquery.placeholder.js"></script>
+
+ <script src="javascripts/jquery.foundation.alerts.js"></script>
+
+ <script src="javascripts/jquery.foundation.topbar.js"></script>
+
+ <script src="javascripts/jquery.foundation.joyride.js"></script>
+
+ <script src="javascripts/jquery.foundation.clearing.js"></script>
+
+ <script src="javascripts/jquery.foundation.magellan.js"></script>
+
+ -->
+
+ <!-- Included JS Files (Compressed) -->
+ <script src="javascripts/jquery.js"></script>
+ <script src="javascripts/foundation.min.js"></script>
+
+ <!-- Initialize JS Plugins -->
+ <script src="javascripts/app.js"></script>
+
+
+ <script>
+ $(window).load(function(){
+ $("#featured").orbit();
+ });
+ </script>
+
+</body>
+</html>
38 foundation/javascripts/app.js
@@ -0,0 +1,38 @@
+;(function ($, window, undefined) {
+ 'use strict';
+
+ var $doc = $(document),
+ Modernizr = window.Modernizr;
+
+ $(document).ready(function() {
+ $.fn.foundationAlerts ? $doc.foundationAlerts() : null;
+ $.fn.foundationButtons ? $doc.foundationButtons() : null;
+ $.fn.foundationAccordion ? $doc.foundationAccordion() : null;
+ $.fn.foundationNavigation ? $doc.foundationNavigation() : null;
+ $.fn.foundationTopBar ? $doc.foundationTopBar() : null;
+ $.fn.foundationCustomForms ? $doc.foundationCustomForms() : null;
+ $.fn.foundationMediaQueryViewer ? $doc.foundationMediaQueryViewer() : null;
+ $.fn.foundationTabs ? $doc.foundationTabs({callback : $.foundation.customForms.appendCustomMarkup}) : null;
+ $.fn.foundationTooltips ? $doc.foundationTooltips() : null;
+ $.fn.foundationMagellan ? $doc.foundationMagellan() : null;
+ $.fn.foundationClearing ? $doc.foundationClearing() : null;
+
+ $.fn.placeholder ? $('input, textarea').placeholder() : null;
+ });
+
+ // UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids
+ // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'});
+ // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'both'});
+ // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'both'});
+ // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'both'});
+
+ // Hide address bar on mobile devices (except if #hash present, so we don't mess up deep linking).
+ if (Modernizr.touch && !window.location.hash) {
+ $(window).load(function () {
+ setTimeout(function () {
+ window.scrollTo(0, 1);
+ }, 0);
+ });
+ }
+
+})(jQuery, this);
98 foundation/javascripts/foundation.min.js
98 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
39 foundation/javascripts/jquery.foundation.accordion.js
@@ -0,0 +1,39 @@
+;(function ($, window, undefined){
+ 'use strict';
+
+ $.fn.foundationAccordion = function (options) {
+ var $accordion = $('.accordion');
+
+ if ($accordion.hasClass('hover') && !Modernizr.touch) {
+ $('.accordion li', this).on({
+ mouseenter : function () {
+ console.log('due');
+ var p = $(this).parent(),
+ flyout = $(this).children('.content').first();
+
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
+ flyout.show(0, function () {
+ flyout.parent('li').addClass('active');
+ });
+ }
+ });
+ } else {
+ $('.accordion li', this).on('click.fndtn', function () {
+ var li = $(this),
+ p = $(this).parent(),
+ flyout = $(this).children('.content').first();
+
+ if (li.hasClass('active')) {
+ p.find('li').removeClass('active').end().find('.content').hide();
+ } else {
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
+ flyout.show(0, function () {
+ flyout.parent('li').addClass('active');
+ });
+ }
+ });
+ }
+
+ };
+
+})( jQuery, this );
20 foundation/javascripts/jquery.foundation.alerts.js
@@ -0,0 +1,20 @@
+;(function ($, window, undefined) {
+ 'use strict';
+
+ $.fn.foundationAlerts = function (options) {
+ var settings = $.extend({
+ callback: $.noop
+ }, options);
+
+ $(document).on("click", ".alert-box a.close", function (e) {
+ e.preventDefault();
+ $(this).closest(".alert-box").fadeOut(function () {
+ $(this).remove();
+ // Do something else after the alert closes
+ settings.callback();
+ });
+ });
+
+ };
+
+})(jQuery, this);
79 foundation/javascripts/jquery.foundation.buttons.js
@@ -0,0 +1,79 @@
+;(function ($, window, undefined) {
+ 'use strict';
+
+ $.fn.foundationButtons = function (options) {
+ var $doc = $(document),
+ config = $.extend({
+ dropdownAsToggle:true,
+ activeClass:'active'
+ }, options),
+
+ // close all dropdowns except for the dropdown passed
+ closeDropdowns = function (dropdown) {
+ $('.button.dropdown').find('ul').not(dropdown).removeClass('show-dropdown');
+ },
+ // reset all toggle states except for the button passed
+ resetToggles = function (button) {
+ var buttons = $('.button.dropdown').not(button);
+ buttons.add($('> span.' + config.activeClass, buttons)).removeClass(config.activeClass);
+ };
+
+ // Prevent event propagation on disabled buttons
+ $doc.on('click.fndtn', '.button.disabled', function (e) {
+ e.preventDefault();
+ });
+
+ $('.button.dropdown > ul', this).addClass('no-hover');
+
+ // reset other active states
+ $doc.on('click.fndtn', '.button.dropdown:not(.split), .button.dropdown.split span', function (e) {
+ var $el = $(this),
+ button = $el.closest('.button.dropdown'),
+ dropdown = $('> ul', button);
+
+ // If the click is registered on an actual link then do not preventDefault which stops the browser from following the link
+ if (e.target.nodeName !== "A"){
+ e.preventDefault();
+ }
+
+ // close other dropdowns
+ closeDropdowns(config.dropdownAsToggle ? dropdown : '');
+ dropdown.toggleClass('show-dropdown');
+
+ if (config.dropdownAsToggle) {
+ resetToggles(button);
+ $el.toggleClass(config.activeClass);
+ }
+ });
+
+ // close all dropdowns and deactivate all buttons
+ $doc.on('click.fndtn', 'body, html', function (e) {
+ if (undefined == e.originalEvent) { return; }
+ // check original target instead of stopping event propagation to play nice with other events
+ if (!$(e.originalEvent.target).is('.button.dropdown:not(.split), .button.dropdown.split span')) {
+ closeDropdowns();
+ if (config.dropdownAsToggle) {
+ resetToggles();
+ }
+ }
+ });
+
+ // Positioning the Flyout List
+ var normalButtonHeight = $('.button.dropdown:not(.large):not(.small):not(.tiny)', this).outerHeight() - 1,
+ largeButtonHeight = $('.button.large.dropdown', this).outerHeight() - 1,
+ smallButtonHeight = $('.button.small.dropdown', this).outerHeight() - 1,
+ tinyButtonHeight = $('.button.tiny.dropdown', this).outerHeight() - 1;
+
+ $('.button.dropdown:not(.large):not(.small):not(.tiny) > ul', this).css('top', normalButtonHeight);
+ $('.button.dropdown.large > ul', this).css('top', largeButtonHeight);
+ $('.button.dropdown.small > ul', this).css('top', smallButtonHeight);
+ $('.button.dropdown.tiny > ul', this).css('top', tinyButtonHeight);
+
+ $('.button.dropdown.up:not(.large):not(.small):not(.tiny) > ul', this).css('top', 'auto').css('bottom', normalButtonHeight - 2);
+ $('.button.dropdown.up.large > ul', this).css('top', 'auto').css('bottom', largeButtonHeight - 2);
+ $('.button.dropdown.up.small > ul', this).css('top', 'auto').css('bottom', smallButtonHeight - 2);
+ $('.button.dropdown.up.tiny > ul', this).css('top', 'auto').css('bottom', tinyButtonHeight - 2);
+
+ };
+
+})( jQuery, this );
480 foundation/javascripts/jquery.foundation.clearing.js
@@ -0,0 +1,480 @@
+/*
+ * jQuery Foundation Clearing 1.0
+ * http://foundation.zurb.com
+ * Copyright 2012, ZURB
+ * Free to use under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+*/
+
+/*jslint unparam: true, browser: true, indent: 2 */
+
+;(function ($, window, undefined) {
+ 'use strict';
+
+ var defaults = {
+ templates : {
+ viewing : '<a href="#" class="clearing-close">&times;</a>' +
+ '<div class="visible-img" style="display: none"><img src="#">' +
+ '<p class="clearing-caption"></p><a href="#" class="clearing-main-left"></a>' +
+ '<a href="#" class="clearing-main-right"></a></div>'
+ },
+ initialized : false,
+ locked : false
+ },
+
+ superMethods = {},
+
+ methods = {
+ init : function (options, extendMethods) {
+ return this.find('ul[data-clearing]').each(function () {
+ var doc = $(document),
+ $el = $(this),
+ options = options || {},
+ extendMethods = extendMethods || {},
+ settings = $el.data('fndtn.clearing.settings');
+
+ if (!settings) {
+ options.$parent = $el.parent();
+
+ $el.data('fndtn.clearing.settings', $.extend({}, defaults, options));
+
+ // developer goodness experiment
+ methods.extend(methods, extendMethods);
+
+ // if the gallery hasn't been built yet...build it
+ methods.assemble($el.find('li'));
+
+ if (!defaults.initialized) methods.events();
+
+ }
+ });
+ },
+
+ events : function () {
+ var doc = $(document);
+
+ doc.on('click.fndtn.clearing', 'ul[data-clearing] li', function (e, current, target) {
+ var current = current || $(this),
+ target = target || current,
+ settings = current.parent().data('fndtn.clearing.settings');
+
+ e.preventDefault();
+
+ if (!settings) {
+ current.parent().foundationClearing();
+ }
+
+ // set current and target to the clicked li if not otherwise defined.
+ methods.open($(e.target), current, target);
+ methods.update_paddles(target);
+ });
+
+ $(window).on('resize.fndtn.clearing', function () {
+ var image = $('.clearing-blackout .visible-img').find('img');
+
+ if (image.length > 0) {
+ methods.center(image);
+ }
+ });
+
+ doc.on('click.fndtn.clearing', '.clearing-main-right', function (e) {
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
+
+ e.preventDefault();
+ methods.go(clearing, 'next');
+ });
+
+ doc.on('click.fndtn.clearing', '.clearing-main-left', function (e) {
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
+
+ e.preventDefault();
+ methods.go(clearing, 'prev');
+ });
+
+ doc.on('click.fndtn.clearing', 'a.clearing-close, div.clearing-blackout, div.visible-img', function (e) {
+ var root = (function (target) {
+ if (/blackout/.test(target.selector)) {
+ return target;
+ } else {
+ return target.closest('.clearing-blackout');
+ }
+ }($(this))), container, visible_image;
+
+ if (this === e.target && root) {
+ container = root.find('div:first'),
+ visible_image = container.find('.visible-img');
+
+ defaults.prev_index = 0;
+
+ root.find('ul[data-clearing]').attr('style', '')
+ root.removeClass('clearing-blackout');
+ container.removeClass('clearing-container');
+ visible_image.hide();
+ }
+
+ return false;
+ });
+
+ // should specify a target selector
+ doc.on('keydown.fndtn.clearing', function (e) {
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
+
+ // right
+ if (e.which === 39) {
+ methods.go(clearing, 'next');
+ }
+
+ // left
+ if (e.which === 37) {
+ methods.go(clearing, 'prev');
+ }
+
+ if (e.which === 27) {
+ $('a.clearing-close').trigger('click');
+ }
+ });
+
+ doc.on('movestart', function(e) {
+
+ // If the movestart is heading off in an upwards or downwards
+ // direction, prevent it so that the browser scrolls normally.
+
+ if ((e.distX > e.distY && e.distX < -e.distY) ||
+ (e.distX < e.distY && e.distX > -e.distY)) {
+ e.preventDefault();
+ }
+ });
+
+ doc.bind('swipeleft', 'ul[data-clearing] li', function () {
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
+ methods.go(clearing, 'next');
+ });
+
+ doc.bind('swiperight', 'ul[data-clearing] li', function () {
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
+ methods.go(clearing, 'prev');
+ });
+
+ defaults.initialized = true;
+ },
+
+ assemble : function ($li) {
+ var $el = $li.parent(),
+ settings = $el.data('fndtn.clearing.settings'),
+ grid = $el.detach(),
+ data = {
+ grid: '<div class="carousel">' + this.outerHTML(grid[0]) + '</div>',
+ viewing: settings.templates.viewing
+ },
+ wrapper = '<div class="clearing-assembled"><div>' + data.viewing + data.grid + '</div></div>';
+
+ return settings.$parent.append(wrapper);
+ },
+
+ open : function ($image, current, target) {
+ var root = target.closest('.clearing-assembled'),
+ container = root.find('div:first'),
+ visible_image = container.find('.visible-img'),
+ image = visible_image.find('img').not($image);
+
+ if (!methods.locked()) {
+
+ // set the image to the selected thumbnail
+ image.attr('src', this.load($image));
+
+ image.is_good(function () {
+ // toggle the gallery if not visible
+ root.addClass('clearing-blackout');
+ container.addClass('clearing-container');
+ methods.caption(visible_image.find('.clearing-caption'), $image);
+ visible_image.show();
+ methods.fix_height(target);
+
+ methods.center(image);
+
+ // shift the thumbnails if necessary
+ methods.shift(current, target, function () {
+ target.siblings().removeClass('visible');
+ target.addClass('visible');
+ });
+ });
+ }
+ },
+
+ fix_height : function (target) {
+ var lis = target.siblings();
+
+ lis.each(function () {
+ var li = $(this),
+ image = li.find('img');
+
+ if (li.height() > image.outerHeight()) {
+ li.addClass('fix-height');
+ }
+ });
+ lis.closest('ul').width(lis.length * 100 + '%');
+ },
+
+ update_paddles : function (target) {
+ var visible_image = target.closest('.carousel').siblings('.visible-img');
+
+ if (target.next().length > 0) {
+ visible_image.find('.clearing-main-right').removeClass('disabled');
+ } else {
+ visible_image.find('.clearing-main-right').addClass('disabled');
+ }
+
+ if (target.prev().length > 0) {
+ visible_image.find('.clearing-main-left').removeClass('disabled');
+ } else {
+ visible_image.find('.clearing-main-left').addClass('disabled');
+ }
+ },
+
+ load : function ($image) {
+ var href = $image.parent().attr('href');
+
+ // preload next and previous
+ this.preload($image);
+
+ if (href) {
+ return href;
+ }
+
+ return $image.attr('src');
+ },
+
+ preload : function ($image) {
+ var next = $image.closest('li').next(),
+ prev = $image.closest('li').prev(),
+ next_a, prev_a,
+ next_img, prev_img;
+
+ if (next.length > 0) {
+ next_img = new Image();
+ next_a = next.find('a');
+ if (next_a.length > 0) {
+ next_img.src = next_a.attr('href');
+ } else {
+ next_img.src = next.find('img').attr('src');
+ }
+ }
+
+ if (prev.length > 0) {
+ prev_img = new Image();
+ prev_a = prev.find('a');
+ if (prev_a.length > 0) {
+ prev_img.src = prev_a.attr('href');
+ } else {
+ prev_img.src = prev.find('img').attr('src');
+ }
+ }
+ },
+
+ caption : function (container, $image) {
+ var caption = $image.data('caption');
+
+ if (caption) {
+ container.text(caption).show();
+ } else {
+ container.text('').hide();
+ }
+ },
+
+ go : function ($ul, direction) {
+ var current = $ul.find('.visible'),
+ target = current[direction]();
+
+ if (target.length > 0) {
+ target.find('img').trigger('click', [current, target]);
+ }
+ },
+
+ shift : function (current, target, callback) {
+ var clearing = target.parent(),
+ container = clearing.closest('.clearing-container'),
+ target_offset = target.position().left,
+ thumbs_offset = clearing.position().left,
+ old_index = defaults.prev_index,
+ direction = this.direction(clearing, current, target),
+ left = parseInt(clearing.css('left'), 10),
+ width = target.outerWidth(),
+ skip_shift;
+
+ // we use jQuery animate instead of CSS transitions because we
+ // need a callback to unlock the next animation
+
+ if (target.index() !== old_index && !/skip/.test(direction)){
+ if (/left/.test(direction)) {
+ methods.lock();
+ clearing.animate({left : left + width}, 300, methods.unlock);
+ } else if (/right/.test(direction)) {
+ methods.lock();
+ clearing.animate({left : left - width}, 300, methods.unlock);
+ }
+ } else if (/skip/.test(direction)) {
+
+ // the target image is not adjacent to the current image, so
+ // do we scroll right or not
+ skip_shift = target.index() - defaults.up_count;
+ methods.lock();
+
+ if (skip_shift > 0) {
+ clearing.animate({left : -(skip_shift * width)}, 300, methods.unlock);
+ } else {
+ clearing.animate({left : 0}, 300, methods.unlock);
+ }
+ }
+
+ callback();
+ },
+
+ lock : function () {
+ defaults.locked = true;
+ },
+
+ unlock : function () {
+ defaults.locked = false;
+ },
+
+ locked : function () {
+ return defaults.locked;
+ },
+
+ direction : function ($el, current, target) {
+ var lis = $el.find('li'),
+ li_width = lis.outerWidth() + (lis.outerWidth() / 4),
+ container = $('.clearing-container'),
+ up_count = Math.floor(container.outerWidth() / li_width) - 1,
+ shift_count = lis.length - up_count,
+ target_index = lis.index(target),
+ current_index = lis.index(current),
+ response;
+
+ defaults.up_count = up_count;
+
+ if (this.adjacent(defaults.prev_index, target_index)) {
+ if ((target_index > up_count) && target_index > defaults.prev_index) {
+ response = 'right';
+ } else if ((target_index > up_count - 1) && target_index <= defaults.prev_index) {
+ response = 'left';
+ } else {
+ response = false;
+ }
+ } else {
+ response = 'skip';
+ }
+
+ defaults.prev_index = target_index;
+
+ return response;
+ },
+
+ adjacent : function (current_index, target_index) {
+ if (target_index - 1 === current_index) {
+ return true;
+ } else if (target_index + 1 === current_index) {
+ return true;
+ } else if (target_index === current_index) {
+ return true;
+ }
+
+ return false;
+ },
+
+ center : function (target) {
+ target.css({
+ marginLeft : -(target.outerWidth() / 2),
+ marginTop : -(target.outerHeight() / 2)
+ });
+ },
+
+ outerHTML : function (el) {
+ // support FireFox < 11
+ return el.outerHTML || new XMLSerializer().serializeToString(el);
+ },
+
+ // experimental functionality for overwriting or extending
+ // clearing methods during initialization.
+ //
+ // ex $doc.foundationClearing({}, {
+ // shift : function (current, target, callback) {
+ // // modify arguments, etc.
+ // this._super('shift', [current, target, callback]);
+ // // do something else here.
+ // }
+ // });
+
+ extend : function (supers, extendMethods) {
+ $.each(supers, function (name, method) {
+ if (extendMethods.hasOwnProperty(name)) {
+ superMethods[name] = method;
+ }
+ });
+
+ $.extend(methods, extendMethods);
+ },
+
+ // you can call this._super('methodName', [args]) to call
+ // the original method and wrap it in your own code
+
+ _super : function (method, args) {
+ return superMethods[method].apply(this, args);
+ }
+ };
+
+ $.fn.foundationClearing = function (method) {
+ if (methods[method]) {
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+ } else if (typeof method === 'object' || !method) {
+ return methods.init.apply(this, arguments);
+ } else {
+ $.error('Method ' + method + ' does not exist on jQuery.foundationClearing');
+ }
+ };
+
+ // jquery.imageready.js
+ // @weblinc, @jsantell, (c) 2012
+
+ (function( $ ) {
+ $.fn.is_good = function ( callback, userSettings ) {
+ var
+ options = $.extend( {}, $.fn.is_good.defaults, userSettings ),
+ $images = this.find( 'img' ).add( this.filter( 'img' ) ),
+ unloadedImages = $images.length;
+
+ function loaded () {
+ unloadedImages -= 1;
+ !unloadedImages && callback();
+ }
+
+ function bindLoad () {
+ this.one( 'load', loaded );
+ if ( $.browser.msie ) {
+ var
+ src = this.attr( 'src' ),
+ param = src.match( /\?/ ) ? '&' : '?';
+ param += options.cachePrefix + '=' + ( new Date() ).getTime();
+ this.attr( 'src', src + param );
+ }
+ }
+
+ return $images.each(function () {
+ var $this = $( this );
+ if ( !$this.attr( 'src' ) ) {
+ loaded();
+ return;
+ }
+ this.complete || this.readyState === 4 ?
+ loaded() :
+ bindLoad.call( $this );
+ });
+ };
+
+ $.fn.is_good.defaults = {
+ cachePrefix: 'random'
+ };
+
+ }(jQuery));
+
+}(jQuery, this));
486 foundation/javascripts/jquery.foundation.forms.js
@@ -0,0 +1,486 @@
+/*
+ * jQuery Custom Forms Plugin 1.0
+ * www.ZURB.com
+ * Copyright 2010, ZURB
+ * Free to use under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+*/
+
+(function( $ ){
+
+ /**
+ * Helper object used to quickly adjust all hidden parent element's, display and visibility properties.
+ * This is currently used for the custom drop downs. When the dropdowns are contained within a reveal modal
+ * we cannot accurately determine the list-item elements width property, since the modal's display property is set
+ * to 'none'.
+ *
+ * This object will help us work around that problem.
+ *
+ * NOTE: This could also be plugin.
+ *
+ * @function hiddenFix
+ */
+ var hiddenFix = function() {
+
+ return {
+ /**
+ * Sets all hidden parent elements and self to visibile.
+ *
+ * @method adjust
+ * @param {jQuery Object} $child
+ */
+
+ // We'll use this to temporarily store style properties.
+ tmp : [],
+
+ // We'll use this to set hidden parent elements.
+ hidden : null,
+
+ adjust : function( $child ) {
+ // Internal reference.
+ var _self = this;
+
+ // Set all hidden parent elements, including this element.
+ _self.hidden = $child.parents().andSelf().filter( ":hidden" );
+
+ // Loop through all hidden elements.
+ _self.hidden.each( function() {
+
+ // Cache the element.
+ var $elem = $( this );
+
+ // Store the style attribute.
+ // Undefined if element doesn't have a style attribute.
+ _self.tmp.push( $elem.attr( 'style' ) );
+
+ // Set the element's display property to block,
+ // but ensure it's visibility is hidden.
+ $elem.css( { 'visibility' : 'hidden', 'display' : 'block' } );
+ });
+
+ }, // end adjust
+
+ /**
+ * Resets the elements previous state.
+ *
+ * @method reset
+ */
+ reset : function() {
+ // Internal reference.
+ var _self = this;
+ // Loop through our hidden element collection.
+ _self.hidden.each( function( i ) {
+ // Cache this element.
+ var $elem = $( this ),
+ _tmp = _self.tmp[ i ]; // Get the stored 'style' value for this element.
+
+ // If the stored value is undefined.
+ if( _tmp === undefined )
+ // Remove the style attribute.
+ $elem.removeAttr( 'style' );
+ else
+ // Otherwise, reset the element style attribute.
+ $elem.attr( 'style', _tmp );
+
+ });
+ // Reset the tmp array.
+ _self.tmp = [];
+ // Reset the hidden elements variable.
+ _self.hidden = null;
+
+ } // end reset
+
+ }; // end return
+
+ };
+
+ jQuery.foundation = jQuery.foundation || {};
+ jQuery.foundation.customForms = jQuery.foundation.customForms || {};
+
+ $.foundation.customForms.appendCustomMarkup = function ( options ) {
+
+ var defaults = {
+ disable_class: "js-disable-custom"
+ };
+
+ options = $.extend( defaults, options );
+
+ function appendCustomMarkup(idx, sel) {
+ var $this = $(sel).hide(),
+ type = $this.attr('type'),
+ $span = $this.next('span.custom.' + type);
+
+ if ($span.length === 0) {
+ $span = $('<span class="custom ' + type + '"></span>').insertAfter($this);
+ }
+
+ $span.toggleClass('checked', $this.is(':checked'));
+ $span.toggleClass('disabled', $this.is(':disabled'));
+ }
+
+ function appendCustomSelect(idx, sel) {
+ var hiddenFixObj = hiddenFix();
+ //
+ // jQueryify the <select> element and cache it.
+ //
+ var $this = $( sel ),
+ //
+ // Find the custom drop down element.
+ //
+ $customSelect = $this.next( 'div.custom.dropdown' ),
+ //
+ // Find the custom select element within the custom drop down.
+ //
+ $customList = $customSelect.find( 'ul' ),
+ //
+ // Find the custom a.current element.
+ //
+ $selectCurrent = $customSelect.find( ".current" ),
+ //
+ // Find the custom a.selector element (the drop-down icon).
+ //
+ $selector = $customSelect.find( ".selector" ),
+ //
+ // Get the <options> from the <select> element.
+ //
+ $options = $this.find( 'option' ),
+ //
+ // Filter down the selected options
+ //
+ $selectedOption = $options.filter( ':selected' ),
+ //
+ // Initial max width.
+ //
+ maxWidth = 0,
+ //
+ // We'll use this variable to create the <li> elements for our custom select.
+ //
+ liHtml = '',
+ //
+ // We'll use this to cache the created <li> elements within our custom select.
+ //
+ $listItems
+ ;
+ var $currentSelect = false;
+ //
+ // Should we not create a custom list?
+ //
+ if ( $this.hasClass( 'no-custom' ) ) return;
+
+ //
+ // Did we not create a custom select element yet?
+ //
+ if ( $customSelect.length === 0 ) {
+ //
+ // Let's create our custom select element!
+ //
+
+ //
+ // Determine what select size to use.
+ //
+ var customSelectSize = $this.hasClass( 'small' ) ? 'small' :
+ $this.hasClass( 'medium' ) ? 'medium' :
+ $this.hasClass( 'large' ) ? 'large' :
+ $this.hasClass( 'expand' ) ? 'expand' : ''
+ ;
+ //
+ // Build our custom list.
+ //
+ $customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>"');
+ //
+ // Grab the selector element
+ //
+ $selector = $customSelect.find( ".selector" );
+ //
+ // Grab the unordered list element from the custom list.
+ //
+ $customList = $customSelect.find( "ul" );
+ //
+ // Build our <li> elements.
+ //
+ liHtml = $options.map( function() { return "<li>" + $( this ).html() + "</li>"; } ).get().join( '' );
+ //
+ // Append our <li> elements to the custom list (<ul>).
+ //
+ $customList.append( liHtml );
+ //
+ // Insert the the currently selected list item before all other elements.
+ // Then, find the element and assign it to $currentSelect.
+ //
+
+ $currentSelect = $customSelect.prepend( '<a href="#" class="current">' + $selectedOption.html() + '</a>' ).find( ".current" );
+ //
+ // Add the custom select element after the <select> element.
+ //
+ $this.after( $customSelect )
+ //
+ //then hide the <select> element.
+ //
+ .hide();
+
+ } else {
+ //
+ // Create our list item <li> elements.
+ //
+ liHtml = $options.map( function() { return "<li>" + $( this ).html() + "</li>"; } ).get().join( '' );
+ //
+ // Refresh the ul with options from the select in case the supplied markup doesn't match.
+ // Clear what's currently in the <ul> element.
+ //
+ $customList.html( '' )
+ //
+ // Populate the list item <li> elements.
+ //
+ .append( liHtml );
+
+ } // endif $customSelect.length === 0
+
+ //
+ // Determine whether or not the custom select element should be disabled.
+ //
+ $customSelect.toggleClass( 'disabled', $this.is( ':disabled' ) );
+ //
+ // Cache our List item elements.
+ //
+ $listItems = $customList.find( 'li' );
+
+ //
+ // Determine which elements to select in our custom list.
+ //
+ $options.each( function ( index ) {
+
+ if ( this.selected ) {
+ //
+ // Add the selected class to the current li element
+ //
+ $listItems.eq( index ).addClass( 'selected' );
+ //
+ // Update the current element with the option value.
+ //
+ if ($currentSelect) {
+ $currentSelect.html( $( this ).html() );
+ }
+
+ }
+
+ });
+
+ //
+ // Update the custom <ul> list width property.
+ //
+ $customList.css( 'width', 'inherit' );
+ //
+ // Set the custom select width property.
+ //
+ $customSelect.css( 'width', 'inherit' );
+
+ //
+ // If we're not specifying a predetermined form size.
+ //
+ if ( !$customSelect.is( '.small, .medium, .large, .expand' ) ) {
+
+ // ------------------------------------------------------------------------------------
+ // This is a work-around for when elements are contained within hidden parents.
+ // For example, when custom-form elements are inside of a hidden reveal modal.
+ //
+ // We need to display the current custom list element as well as hidden parent elements
+ // in order to properly calculate the list item element's width property.
+ // -------------------------------------------------------------------------------------
+
+ //
+ // Show the drop down.
+ // This should ensure that the list item's width values are properly calculated.
+ //
+ $customSelect.addClass( 'open' );
+ //
+ // Quickly, display all parent elements.
+ // This should help us calcualate the width of the list item's within the drop down.
+ //
+ hiddenFixObj.adjust( $customList );
+ //
+ // Grab the largest list item width.
+ //
+ maxWidth = ( $listItems.outerWidth() > maxWidth ) ? $listItems.outerWidth() : maxWidth;
+ //
+ // Okay, now reset the parent elements.
+ // This will hide them again.
+ //
+ hiddenFixObj.reset();
+ //
+ // Finally, hide the drop down.
+ //
+ $customSelect.removeClass( 'open' );
+ //
+ // Set the custom list width.
+ //
+ $customSelect.width( maxWidth + 18);
+ //
+ // Set the custom list element (<ul />) width.
+ //
+ $customList.width( maxWidth + 16 );
+
+ } // endif
+
+ }
+
+ $('form.custom input:radio[data-customforms!=disabled]').each(appendCustomMarkup);
+ $('form.custom input:checkbox[data-customforms!=disabled]').each(appendCustomMarkup);
+ $('form.custom select[data-customforms!=disabled]').each(appendCustomSelect);
+ };
+
+ var refreshCustomSelect = function($select) {
+ var maxWidth = 0,
+ $customSelect = $select.next();
+ $options = $select.find('option');
+ $customSelect.find('ul').html('');
+
+ $options.each(function () {
+ $li = $('<li>' + $(this).html() + '</li>');
+ $customSelect.find('ul').append($li);
+ });
+
+ // re-populate
+ $options.each(function (index) {
+ if (this.selected) {
+ $customSelect.find('li').eq(index).addClass('selected');
+ $customSelect.find('.current').html($(this).html());
+ }
+ });
+
+ // fix width
+ $customSelect.removeAttr('style')
+ .find('ul').removeAttr('style');
+ $customSelect.find('li').each(function () {
+ $customSelect.addClass('open');
+ if ($(this).outerWidth() > maxWidth) {
+ maxWidth = $(this).outerWidth();
+ }
+ $customSelect.removeClass('open');
+ });
+ $customSelect.css('width', maxWidth + 18 + 'px');
+ $customSelect.find('ul').css('width', maxWidth + 16 + 'px');
+
+ };
+
+ var toggleCheckbox = function($element) {
+ var $input = $element.prev(),
+ input = $input[0];
+
+ if (false === $input.is(':disabled')) {
+ input.checked = ((input.checked) ? false : true);
+ $element.toggleClass('checked');
+
+ $input.trigger('change');
+ }
+ };
+
+ var toggleRadio = function($element) {
+ var $input = $element.prev(),
+ $form = $input.closest('form.custom'),
+ input = $input[0];
+
+ if (false === $input.is(':disabled')) {
+ $form.find('input:radio[name="' + $input.attr('name') + '"]').next().not($element).removeClass('checked');
+ if ( !$element.hasClass('checked') ) {
+ $element.toggleClass('checked');
+ }
+ input.checked = $element.hasClass('checked');
+
+ $input.trigger('change');
+ }
+ };
+
+ $(document).on('click', 'form.custom span.custom.checkbox', function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ toggleCheckbox($(this));
+ });
+
+ $(document).on('click', 'form.custom span.custom.radio', function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ toggleRadio($(this));
+ });
+
+ $(document).on('change', 'form.custom select[data-customforms!=disabled]', function (event) {
+ refreshCustomSelect($(this));
+ });
+
+ $(document).on('click', 'form.custom label', function (event) {
+ var $associatedElement = $('#' + $(this).attr('for') + '[data-customforms!=disabled]'),
+ $customCheckbox,
+ $customRadio;
+ if ($associatedElement.length !== 0) {
+ if ($associatedElement.attr('type') === 'checkbox') {
+ event.preventDefault();
+ $customCheckbox = $(this).find('span.custom.checkbox');
+ toggleCheckbox($customCheckbox);
+ } else if ($associatedElement.attr('type') === 'radio') {
+ event.preventDefault();
+ $customRadio = $(this).find('span.custom.radio');
+ toggleRadio($customRadio);
+ }
+ }
+ });
+
+ $(document).on('click', 'form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector', function (event) {
+ var $this = $(this),
+ $dropdown = $this.closest('div.custom.dropdown'),
+ $select = $dropdown.prev();
+
+ event.preventDefault();
+ $('div.dropdown').removeClass('open');
+
+ if (false === $select.is(':disabled')) {
+ $dropdown.toggleClass('open');
+
+ if ($dropdown.hasClass('open')) {
+ $(document).bind('click.customdropdown', function (event) {
+ $dropdown.removeClass('open');
+ $(document).unbind('.customdropdown');
+ });
+ } else {
+ $(document).unbind('.customdropdown');
+ }
+ return false;
+ }
+ });
+
+ $(document).on('click', 'form.custom div.custom.dropdown li', function (event) {
+ var $this = $(this),
+ $customDropdown = $this.closest('div.custom.dropdown'),
+ $select = $customDropdown.prev(),
+ selectedIndex = 0;
+
+ event.preventDefault();
+ event.stopPropagation();
+ $('div.dropdown').removeClass('open');
+
+ $this
+ .closest('ul')
+ .find('li')
+ .removeClass('selected');
+ $this.addClass('selected');
+
+ $customDropdown
+ .removeClass('open')
+ .find('a.current')
+ .html($this.html());
+
+ $this.closest('ul').find('li').each(function (index) {
+ if ($this[0] == this) {
+ selectedIndex = index;
+ }
+
+ });
+ $select[0].selectedIndex = selectedIndex;
+
+ $select.trigger('change');
+ });
+
+
+ $.fn.foundationCustomForms = $.foundation.customForms.appendCustomMarkup;
+
+})( jQuery );
639 foundation/javascripts/jquery.foundation.joyride.js
@@ -0,0 +1,639 @@
+/*
+ * jQuery Foundation Joyride Plugin 2.0.2
+ * http://foundation.zurb.com
+ * Copyright 2012, ZURB
+ * Free to use under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+*/
+
+/*jslint unparam: true, browser: true, indent: 2 */
+
+;(function ($, window, undefined) {
+ 'use strict';
+
+ var defaults = {
+ 'version' : '2.0.1',
+ 'tipLocation' : 'bottom', // 'top' or 'bottom' in relation to parent
+ 'nubPosition' : 'auto', // override on a per tooltip bases
+ 'scrollSpeed' : 300, // Page scrolling speed in milliseconds
+ 'timer' : 0, // 0 = no timer , all other numbers = timer in milliseconds
+ 'startTimerOnClick' : true, // true or false - true requires clicking the first button start the timer
+ 'startOffset' : 0, // the index of the tooltip you want to start on (index of the li)
+ 'nextButton' : true, // true or false to control whether a next button is used
+ 'tipAnimation' : 'fade', // 'pop' or 'fade' in each tip
+ 'pauseAfter' : [], // array of indexes where to pause the tour after
+ 'tipAnimationFadeSpeed': 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
+ 'cookieMonster' : false, // true or false to control whether cookies are used
+ 'cookieName' : 'joyride', // Name the cookie you'll use
+ 'cookieDomain' : false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
+ 'tipContainer' : 'body', // Where will the tip be attached
+ 'postRideCallback' : $.noop, // A method to call once the tour closes (canceled or complete)
+ 'postStepCallback' : $.noop, // A method to call after each step
+ 'template' : { // HTML segments for tip layout
+ 'link' : '<a href="#close" class="joyride-close-tip">X</a>',
+ 'timer' : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
+ 'tip' : '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',
+ 'wrapper' : '<div class="joyride-content-wrapper"></div>',
+ 'button' : '<a href="#" class="small button joyride-next-tip"></a>'
+ }
+ },
+
+ Modernizr = Modernizr || false,
+
+ settings = {},
+
+ methods = {
+
+ init : function (opts) {
+ return this.each(function () {
+
+ if ($.isEmptyObject(settings)) {
+ settings = $.extend(defaults, opts);
+
+ // non configureable settings
+ settings.document = window.document;
+ settings.$document = $(settings.document);
+ settings.$window = $(window);
+ settings.$content_el = $(this);
+ settings.body_offset = $(settings.tipContainer).position();
+ settings.$tip_content = $('> li', settings.$content_el);
+ settings.paused = false;
+ settings.attempts = 0;
+
+ settings.tipLocationPatterns = {
+ top: ['bottom'],
+ bottom: [], // bottom should not need to be repositioned
+ left: ['right', 'top', 'bottom'],
+ right: ['left', 'top', 'bottom']
+ };
+
+ // are we using jQuery 1.7+
+ methods.jquery_check();
+
+ // can we create cookies?
+ if (!$.isFunction($.cookie)) {
+ settings.cookieMonster = false;
+ }
+
+ // generate the tips and insert into dom.
+ if (!settings.cookieMonster || !$.cookie(settings.cookieName)) {
+
+ settings.$tip_content.each(function (index) {
+ methods.create({$li : $(this), index : index});
+ });
+
+ // show first tip
+ if (!settings.startTimerOnClick && settings.timer > 0) {
+ methods.show('init');
+ methods.startTimer();
+ } else {
+ methods.show('init');
+ }
+
+ }
+
+ settings.$document.on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
+ e.preventDefault();
+
+ if (settings.$li.next().length < 1) {
+ methods.end();
+ } else if (settings.timer > 0) {
+ clearTimeout(settings.automate);
+ methods.hide();
+ methods.show();
+ methods.startTimer();
+ } else {
+ methods.hide();
+ methods.show();
+ }
+
+ });
+
+ settings.$document.on('click.joyride', '.joyride-close-tip', function (e) {
+ e.preventDefault();
+ methods.end();
+ });
+
+ settings.$window.bind('resize.joyride', function (e) {
+ if (methods.is_phone()) {
+ methods.pos_phone();
+ } else {
+ methods.pos_default();
+ }
+ });
+ } else {
+ methods.restart();
+ }
+
+ });
+ },
+
+ // call this method when you want to resume the tour
+ resume : function () {
+ methods.set_li();
+ methods.show();
+ },
+
+ tip_template : function (opts) {
+ var $blank, content;
+
+ opts.tip_class = opts.tip_class || '';
+
+ $blank = $(settings.template.tip).addClass(opts.tip_class);
+ content = $.trim($(opts.li).html()) +
+ methods.button_text(opts.button_text) +
+ settings.template.link +
+ methods.timer_instance(opts.index);
+
+ $blank.append($(settings.template.wrapper));
+ $blank.first().attr('data-index', opts.index);
+ $('.joyride-content-wrapper', $blank).append(content);
+
+ return $blank[0];
+ },
+
+ timer_instance : function (index) {
+ var txt;
+
+ if ((index === 0 && settings.startTimerOnClick && settings.timer > 0) || settings.timer === 0) {
+ txt = '';
+ } else {
+ txt = methods.outerHTML($(settings.template.timer)[0]);
+ }
+ return txt;
+ },
+
+ button_text : function (txt) {
+ if (settings.nextButton) {
+ txt = $.trim(txt) || 'Next';
+ txt = methods.outerHTML($(settings.template.button).append(txt)[0]);
+ } else {
+ txt = '';
+ }
+ return txt;
+ },
+
+ create : function (opts) {
+ // backwards compatability with data-text attribute
+ var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
+ tipClass = opts.$li.attr('class'),
+ $tip_content = $(methods.tip_template({
+ tip_class : tipClass,
+ index : opts.index,
+ button_text : buttonText,
+ li : opts.$li
+ }));
+
+ $(settings.tipContainer).append($tip_content);
+ },
+
+ show : function (init) {
+ var opts = {}, ii, opts_arr = [], opts_len = 0, p,
+ $timer = null;
+
+ // are we paused?
+ if (settings.$li === undefined || ($.inArray(settings.$li.index(), settings.pauseAfter) === -1)) {
+
+ // don't go to the next li if the tour was paused
+ if (settings.paused) {
+ settings.paused = false;
+ } else {
+ methods.set_li(init);
+ }
+
+ settings.attempts = 0;
+
+ if (settings.$li.length && settings.$target.length > 0) {
+ opts_arr = (settings.$li.data('options') || ':').split(';');
+ opts_len = opts_arr.length;
+
+ // parse options
+ for (ii = opts_len - 1; ii >= 0; ii--) {
+ p = opts_arr[ii].split(':');
+
+ if (p.length === 2) {
+ opts[$.trim(p[0])] = $.trim(p[1]);
+ }
+ }
+
+ settings.tipSettings = $.extend({}, settings, opts);
+
+ settings.tipSettings.tipLocationPattern = settings.tipLocationPatterns[settings.tipSettings.tipLocation];
+
+ // scroll if not modal
+ if (!/body/i.test(settings.$target.selector)) {
+ methods.scroll_to();
+ }
+
+ if (methods.is_phone()) {
+ methods.pos_phone(true);
+ } else {
+ methods.pos_default(true);
+ }
+
+ $timer = $('.joyride-timer-indicator', settings.$next_tip);
+
+ if (/pop/i.test(settings.tipAnimation)) {
+
+ $timer.outerWidth(0);
+
+ if (settings.timer > 0) {
+
+ settings.$next_tip.show();
+ $timer.animate({
+ width: $('.joyride-timer-indicator-wrap', settings.$next_tip).outerWidth()
+ }, settings.timer);
+
+ } else {
+
+ settings.$next_tip.show();
+
+ }
+
+
+ } else if (/fade/i.test(settings.tipAnimation)) {
+
+ $timer.outerWidth(0);
+
+ if (settings.timer > 0) {
+
+ settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
+
+ settings.$next_tip.show();
+ $timer.animate({
+ width: $('.joyride-timer-indicator-wrap', settings.$next_tip).outerWidth()
+ }, settings.timer);
+
+ } else {
+
+ settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
+
+ }
+ }
+
+ settings.$current_tip = settings.$next_tip;
+
+ // skip non-existant targets
+ } else if (settings.$li && settings.$target.length < 1) {
+
+ methods.show();
+
+ } else {
+
+ methods.end();
+
+ }
+ } else {
+
+ settings.paused = true;
+
+ }
+
+ },
+
+ // detect phones with media queries if supported.
+ is_phone : function () {
+ if (Modernizr) {
+ return Modernizr.mq('only screen and (max-width: 767px)');
+ }
+
+ return (settings.$window.width() < 767) ? true : false;
+ },
+
+ hide : function () {
+ settings.postStepCallback(settings.$li.index(), settings.$current_tip);
+ $('.joyride-modal-bg').hide();
+ settings.$current_tip.hide();
+ },
+
+ set_li : function (init) {
+ if (init) {
+ settings.$li = settings.$tip_content.eq(settings.startOffset);
+ methods.set_next_tip();
+ settings.$current_tip = settings.$next_tip;
+ } else {
+ settings.$li = settings.$li.next();
+ methods.set_next_tip();
+ }
+
+ methods.set_target();
+ },
+
+ set_next_tip : function () {
+ settings.$next_tip = $('.joyride-tip-guide[data-index=' + settings.$li.index() + ']');
+ },
+
+ set_target : function () {
+ var cl = settings.$li.attr('data-class'),
+ id = settings.$li.attr('data-id'),
+ $sel = function () {
+ if (id) {
+ return $(settings.document.getElementById(id));
+ } else if (cl) {
+ return $('.' + cl).first();
+ } else {
+ return $('body');
+ }
+ };
+
+ settings.$target = $sel();
+ },
+
+ scroll_to : function () {
+ var window_half, tipOffset;
+
+ window_half = settings.$window.height() / 2;
+ tipOffset = Math.ceil(settings.$target.offset().top - window_half + settings.$next_tip.outerHeight());
+
+ $("html, body").stop().animate({
+ scrollTop: tipOffset
+ }, settings.scrollSpeed);
+ },
+
+ paused : function () {
+ if (($.inArray((settings.$li.index() + 1), settings.pauseAfter) === -1)) {
+ return true;
+ }
+
+ return false;
+ },
+
+ destroy : function () {
+ settings.$document.off('.joyride');
+ $(window).off('.joyride');
+ $('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
+ $('.joyride-tip-guide, .joyride-modal-bg').remove();
+ clearTimeout(settings.automate);
+ settings = {};
+ },
+
+ restart : function () {
+ methods.hide();
+ settings.$li = undefined;
+ methods.show('init');
+ },
+
+ pos_default : function (init) {
+ var half_fold = Math.ceil(settings.$window.height() / 2),
+ tip_position = settings.$next_tip.offset(),
+ $nub = $('.joyride-nub', settings.$next_tip),
+ nub_height = Math.ceil($nub.outerHeight() / 2),
+ toggle = init || false;
+
+ // tip must not be "display: none" to calculate position
+ if (toggle) {
+ settings.$next_tip.css('visibility', 'hidden');
+ settings.$next_tip.show();
+ }
+
+ if (!/body/i.test(settings.$target.selector)) {
+
+ if (methods.bottom()) {
+ settings.$next_tip.css({
+ top: (settings.$target.offset().top + nub_height + settings.$target.outerHeight()),
+ left: settings.$target.offset().left});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'top');
+
+ } else if (methods.top()) {
+
+ settings.$next_tip.css({
+ top: (settings.$target.offset().top - settings.$next_tip.outerHeight() - nub_height),
+ left: settings.$target.offset().left});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'bottom');
+
+ } else if (methods.right()) {
+
+ settings.$next_tip.css({
+ top: settings.$target.offset().top,
+ left: (settings.$target.outerWidth() + settings.$target.offset().left)});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'left');
+
+ } else if (methods.left()) {
+
+ settings.$next_tip.css({
+ top: settings.$target.offset().top,
+ left: (settings.$target.offset().left - settings.$next_tip.outerWidth() - nub_height)});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'right');
+
+ }
+
+ if (!methods.visible(methods.corners(settings.$next_tip)) && settings.attempts < settings.tipSettings.tipLocationPattern.length) {
+
+ $nub.removeClass('bottom')
+ .removeClass('top')
+ .removeClass('right')
+ .removeClass('left');
+
+ settings.tipSettings.tipLocation = settings.tipSettings.tipLocationPattern[settings.attempts];
+
+ settings.attempts++;
+
+ methods.pos_default(true);
+
+ }
+
+ } else if (settings.$li.length) {
+
+ methods.pos_modal($nub);
+
+ }
+
+ if (toggle) {
+ settings.$next_tip.hide();
+ settings.$next_tip.css('visibility', 'visible');
+ }
+
+ },
+
+ pos_phone : function (init) {
+ var tip_height = settings.$next_tip.outerHeight(),
+ tip_offset = settings.$next_tip.offset(),
+ target_height = settings.$target.outerHeight(),
+ $nub = $('.joyride-nub', settings.$next_tip),
+ nub_height = Math.ceil($nub.outerHeight() / 2),
+ toggle = init || false;
+
+ $nub.removeClass('bottom')
+ .removeClass('top')
+ .removeClass('right')
+ .removeClass('left');
+
+ if (toggle) {
+ settings.$next_tip.css('visibility', 'hidden');
+ settings.$next_tip.show();
+ }
+
+ if (!/body/i.test(settings.$target.selector)) {
+
+ if (methods.top()) {
+
+ settings.$next_tip.offset({top: settings.$target.offset().top - tip_height - nub_height});
+ $nub.addClass('bottom');
+
+ } else {
+
+ settings.$next_tip.offset({top: settings.$target.offset().top + target_height + nub_height});
+ $nub.addClass('top');
+
+ }
+
+ } else if (settings.$li.length) {
+
+ methods.pos_modal($nub);
+
+ }
+
+ if (toggle) {
+ settings.$next_tip.hide();
+ settings.$next_tip.css('visibility', 'visible');
+ }
+ },
+
+ pos_modal : function ($nub) {
+ methods.center();
+ $nub.hide();
+
+ if ($('.joyride-modal-bg').length < 1) {
+ $('body').append('<div class="joyride-modal-bg">').show();
+ }
+
+ if (/pop/i.test(settings.tipAnimation)) {
+ $('.joyride-modal-bg').show();
+ } else {
+ $('.joyride-modal-bg').fadeIn(settings.tipAnimationFadeSpeed);
+ }
+ },
+
+ center : function () {
+ var $w = settings.$window;
+
+ settings.$next_tip.css({
+ top : ((($w.height() - settings.$next_tip.outerHeight()) / 2) + $w.scrollTop()),
+ left : ((($w.width() - settings.$next_tip.outerWidth()) / 2) + $w.scrollLeft())
+ });
+
+ return true;
+ },
+
+ bottom : function () {
+ return /bottom/i.test(settings.tipSettings.tipLocation);
+ },
+
+ top : function () {
+ return /top/i.test(settings.tipSettings.tipLocation);
+ },
+
+ right : function () {
+ return /right/i.test(settings.tipSettings.tipLocation);
+ },
+
+ left : function () {
+ return /left/i.test(settings.tipSettings.tipLocation);
+ },
+
+ corners : function (el) {
+ var w = settings.$window,
+ right = w.width() + w.scrollLeft(),
+ bottom = w.width() + w.scrollTop();
+
+ return [
+ el.offset().top <= w.scrollTop(),
+ right <= el.offset().left + el.outerWidth(),
+ bottom <= el.offset().top + el.outerHeight(),
+ w.scrollLeft() >= el.offset().left
+ ];
+ },
+
+ visible : function (hidden_corners) {
+ var i = hidden_corners.length;
+
+ while (i--) {
+ if (hidden_corners[i]) return false;
+ }
+
+ return true;
+ },
+
+ nub_position : function (nub, pos, def) {
+ if (pos === 'auto') {
+ nub.addClass(def);
+ } else {
+ nub.addClass(pos);
+ }
+ },
+
+ startTimer : function () {
+ if (settings.$li.length) {
+ settings.automate = setTimeout(function () {
+ methods.hide();
+ methods.show();
+ methods.startTimer();
+ }, settings.timer);
+ } else {
+ clearTimeout(settings.automate);
+ }
+ },
+
+ end : function () {
+ if (settings.cookieMonster) {
+ $.cookie(settings.cookieName, 'ridden', { expires: 365, domain: settings.cookieDomain });
+ }
+
+ if (settings.timer > 0) {
+ clearTimeout(settings.automate);
+ }
+
+ $('.joyride-modal-bg').hide();
+ settings.$current_tip.hide();
+ settings.postStepCallback(settings.$li.index(), settings.$current_tip);
+ settings.postRideCallback(settings.$li.index(), settings.$current_tip);
+ },
+
+ jquery_check : function () {
+ // define on() and off() for older jQuery
+ if (!$.isFunction($.fn.on)) {
+
+ $.fn.on = function (types, sel, fn) {
+
+ return this.delegate(sel, types, fn);
+
+ };
+
+ $.fn.off = function (types, sel, fn) {
+
+ return this.undelegate(sel, types, fn);
+
+ };
+
+ return false;
+ }
+
+ return true;
+ },
+
+ outerHTML : function (el) {
+ // support FireFox < 11
+ return el.outerHTML || new XMLSerializer().serializeToString(el);
+ },
+
+ version : function () {
+ return settings.version;
+ }
+
+ };
+
+ $.fn.joyride = function (method) {
+ if (methods[method]) {
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+ } else if (typeof method === 'object' || !method) {
+ return methods.init.apply(this, arguments);
+ } else {
+ $.error('Method ' + method + ' does not exist on jQuery.joyride');
+ }
+ };
+
+}(jQuery, this));
86 foundation/javascripts/jquery.foundation.magellan.js
@@ -0,0 +1,86 @@
+/*
+ * jQuery Foundation Magellan 0.0.1
+ * http://foundation.zurb.com
+ * Copyright 2012, ZURB
+ * Free to use under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+*/
+
+/*jslint unparam: true, browser: true, indent: 2 */
+
+;(function ($, window, undefined) {
+ 'use strict';
+
+ $.fn.foundationMagellan = function(options) {
+ var $fixedMagellan = $('[data-magellan-expedition=fixed]'),
+ defaults = {
+ threshold: ($fixedMagellan.length) ? $fixedMagellan.outerHeight(true) : 25,
+ activeClass: 'active'
+ },
+
+ options = $.extend({}, defaults, options);
+
+ // Indicate we have arrived at a destination
+ $(document).on('magellan.arrival', '[data-magellan-arrival]', function(e) {
+ var $expedition = $(this).closest('[data-magellan-expedition]'),
+ activeClass = $expedition.attr('data-magellan-active-class') || options.activeClass;
+ $(this)
+ .closest('[data-magellan-expedition]')
+ .find('[data-magellan-arrival]')
+ .not(this)
+ .removeClass(activeClass);
+ $(this).addClass(activeClass);
+ });
+
+ // Set starting point as the current destination
+ var $expedition = $('[data-magellan-expedition]');
+ $expedition.find('[data-magellan-arrival]:first')
+ .addClass($expedition.attr('data-magellan-active-class') || options.activeClass);
+
+ // Update fixed position
+ $fixedMagellan.on('magellan.update-position', function(){
+ var $el = $(this);
+ $el.data("magellan-fixed-position","");
+ $el.data("magellan-top-offset", "");
+ });
+
+ $fixedMagellan.trigger('magellan.update-position');
+
+ $(window).on('resize.magellan', function() {
+ $fixedMagellan.trigger('magellan.update-position');
+ });
+
+ $(window).on('scroll.magellan', function() {
+ var windowScrollTop = $(window).scrollTop();
+ $fixedMagellan.each(function() {
+ var $expedition = $(this);
+ if ($expedition.data("magellan-top-offset") === "") {
+ $expedition.data("magellan-top-offset", $expedition.offset().top);
+ }
+ var fixed_position = (windowScrollTop + options.threshold) > $expedition.data("magellan-top-offset");
+ if ($expedition.data("magellan-fixed-position") != fixed_position) {
+ $expedition.data("magellan-fixed-position", fixed_position);
+ if (fixed_position) {
+ $expedition.css({position:"fixed", top:0});
+ } else {
+ $expedition.css({position:"", top:""});
+ }
+ }
+ });
+ });
+
+ // Determine when a destination has been reached, ah0y!
+ $(window).on('scroll.magellan', function(e){
+ var windowScrollTop = $(window).scrollTop();
+ $('[data-magellan-destination]').each(function(){
+ var $destination = $(this),
+ destination_name = $destination.attr('data-magellan-destination'),
+ topOffset = $destination.offset().top - windowScrollTop;
+ if (topOffset <= options.threshold) {
+ $('[data-magellan-arrival=' + destination_name + ']')
+ .trigger('magellan.arrival');
+ }
+ });
+ });
+ };
+}(jQuery, this));
27 foundation/javascripts/jquery.foundation.mediaQueryToggle.js
@@ -0,0 +1,27 @@
+;(function ($, window, undefined) {
+ 'use strict';
+
+ $.fn.foundationMediaQueryViewer = function (options) {
+ var settings = $.extend(options,{toggleKey:77}), // Press 'M'
+ $doc = $(document);
+
+ $doc.on("keyup.mediaQueryViewer", ":input", function (e){
+ if (e.which === settings.toggleKey) {
+ e.stopPropagation();
+ }
+ });
+ $doc.on("keyup.mediaQueryViewer", function (e) {
+ var $mqViewer = $('#fqv');
+
+ if (e.which === settings.toggleKey) {
+ if ($mqViewer.length > 0) {
+ $mqViewer.remove();
+ } else {
+ $('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>');
+ }
+ }
+ });
+
+ };
+
+})(jQuery, this);
55 foundation/javascripts/jquery.foundation.navigation.js
@@ -0,0 +1,55 @@
+;(function ($, window, undefined) {
+ 'use strict';
+
+ $.fn