Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated for version 3.2 of foundation

  • Loading branch information...
commit d847aebdc6c2db0816bc7c8c53603aff00d58db1 1 parent 7cb0824
ModLearning Team authored
View
29 css/app.css
@@ -0,0 +1,29 @@
+/* Artfully masterminded by ZURB */
+
+/* --------------------------------------------------
+ Table of Contents
+-----------------------------------------------------
+:: Shared Styles
+:: Page Name 1
+:: Page Name 2
+*/
+
+
+/* -----------------------------------------
+ Shared Styles
+----------------------------------------- */
+
+
+
+/* -----------------------------------------
+ Page Name 1
+----------------------------------------- */
+
+
+
+
+/* -----------------------------------------
+ Page Name 2
+----------------------------------------- */
+
+
View
2  css/foundation.min.css
1 addition, 1 deletion not shown
View
6 js/foundation/app.js
@@ -19,15 +19,15 @@
$.fn.foundationTopBar ? $doc.foundationTopBar() : null;
-
+ $.fn.foundationCustomForms ? $doc.foundationCustomForms() : null;
$.fn.foundationMediaQueryViewer ? $doc.foundationMediaQueryViewer() : null;
- $.fn.foundationTabs ? $doc.foundationTabs() : null;
+ $.fn.foundationTabs ? $doc.foundationTabs() : null;
- $("#featured").orbit();
+ $("#featured").orbit();
// UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids
View
59 js/foundation/foundation.min.js
43 additions, 16 deletions not shown
View
31 js/foundation/jquery.foundation.accordion.js
@@ -2,15 +2,32 @@
'use strict';
$.fn.foundationAccordion = function (options) {
+ var $accordion = $('.accordion');
- $('.accordion li', this).on('click.fndtn', function () {
- var p = $(this).parent(); //changed this
- var 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');
+ 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 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');
+ });
});
- });
+ }
};
View
59 js/foundation/jquery.foundation.buttons.js
@@ -1,8 +1,23 @@
;(function ($, window, undefined) {
'use strict';
- $.fn.foundationButtons = function(options) {
- var $doc = $(document);
+ $.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();
@@ -10,28 +25,32 @@
$('.button.dropdown > ul', this).addClass('no-hover');
- $doc.on('click.fndtn', '.button.dropdown, .button.dropdown.split span', function (e) {
- // Stops further propagation of the event up the DOM tree when clicked on the button.
- // Events fired by its descendants are not being blocked.
- $('.button.dropdown').children('ul').removeClass('show-dropdown');
- if (e.target === this) {
- e.stopPropagation();
- }
- });
-
- $doc.on('click.fndtn', '.button.dropdown.split span', function (e) {
+ // 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);
e.preventDefault();
- $('.button.dropdown', this).not($(this).parent()).children('ul').removeClass('show-dropdown');
- $(this).siblings('ul').toggleClass('show-dropdown');
- });
- $doc.on('click.fndtn', '.button.dropdown:not(.split)', function (e) {
- $('.button.dropdown', this).not(this).children('ul').removeClass('show-dropdown');
- $(this).children('ul').toggleClass('show-dropdown');
+ // close other dropdowns
+ closeDropdowns(config.dropdownAsToggle ? dropdown : '');
+ dropdown.toggleClass('show-dropdown');
+
+ if (config.dropdownAsToggle) {
+ resetToggles(button);
+ $el.toggleClass(config.activeClass);
+ }
});
- $doc.on('click.fndtn', 'body, html', function () {
- $('.button.dropdown ul').removeClass('show-dropdown');
+ // close all dropdowns and deactivate all buttons
+ $doc.on('click.fndtn', 'body, html', function (e) {
+ // 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
View
468 js/foundation/jquery.foundation.clearing.js
@@ -0,0 +1,468 @@
+/*
+ * 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>'
+ },
+ 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'));
+
+ 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;
+
+ e.preventDefault();
+
+ // 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', 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');
+ }
+ });
+
+ 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');
+ });
+ },
+
+ assemble : function ($li, target) {
+ 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));
View
6 js/foundation/jquery.foundation.forms.js
@@ -381,9 +381,7 @@
if (false === $input.is(':disabled')) {
$('input:radio[name="' + $input.attr('name') + '"]').next().not($element).removeClass('checked');
- if ($element.hasClass('checked')) {
- // Do Nothing
- } else {
+ if ( !$element.hasClass('checked') ) {
$element.toggleClass('checked');
}
input.checked = $element.hasClass('checked');
@@ -411,7 +409,7 @@
});
$(document).on('click', 'form.custom label', function (event) {
- var $associatedElement = $('#' + $(this).attr('for')),
+ var $associatedElement = $('#' + $(this).attr('for') + '[data-customforms!=disabled]'),
$customCheckbox,
$customRadio;
if ($associatedElement.length !== 0) {
View
639 js/foundation/jquery.foundation.joyride.js
@@ -0,0 +1,639 @@
+/*
+ * jQuery Foundation Joyride Plugin 2.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';
+
+ 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();
+ }
+
+ });
+
+ $('.joyride-close-tip').on('click.joyride', function (e) {
+ e.preventDefault();
+ methods.end();
+ });
+
+ settings.$window.on('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.outerWidth() + w.scrollLeft(),
+ bottom = w.outerWidth() + 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));
View
85 js/foundation/jquery.foundation.magellan.js
@@ -0,0 +1,85 @@
+/*
+ * 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 defaults = {
+ threshold: 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
+ $('[data-magellan-expedition=fixed]').on('magellan.update-position', function(){
+ var $el = $(this);
+ $el.data("magellan-fixed-position","");
+ $el.data("magellan-top-offset", "");
+ });
+
+ $('[data-magellan-expedition=fixed]').trigger('magellan.update-position');
+
+ $(window).on('resize.magellan', function() {
+ $('[data-magellan-expedition=fixed]').trigger('magellan.update-position');
+ });
+
+ $(window).on('scroll.magellan', function() {
+ var windowScrollTop = $(window).scrollTop();
+ $('[data-magellan-expedition=fixed]').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));
View
32 js/foundation/jquery.foundation.navigation.js
@@ -19,10 +19,34 @@
});
$('.nav-bar>li.has-flyout', this).addClass('is-touch');
} else {
- $('.nav-bar>li.has-flyout', this).hover(function () {
- $(this).children('.flyout').show();
- }, function () {
- $(this).children('.flyout').hide();
+ $('.nav-bar>li.has-flyout', this).on('mouseenter mouseleave', function (e) {
+ if (e.type == 'mouseenter') {
+ $('.nav-bar').find('.flyout').hide();
+ $(this).children('.flyout').show();
+ }
+
+ if (e.type == 'mouseleave') {
+ var flyout = $(this).children('.flyout'),
+ inputs = flyout.find('input'),
+ hasFocus = function (inputs) {
+ var focus;
+ if (inputs.length > 0) {
+ inputs.each(function () {
+ if ($(this).is(":focus")) {
+ focus = true;
+ }
+ });
+ return focus;
+ }
+
+ return false;
+ };
+
+ if (!hasFocus(inputs)) {
+ $(this).children('.flyout').hide();
+ }
+ }
+
});
}
View
112 js/foundation/jquery.foundation.orbit.js
@@ -21,27 +21,29 @@
defaults: {
animation: 'horizontal-push', // fade, horizontal-slide, vertical-slide, horizontal-push, vertical-push
- animationSpeed: 600, // how fast animtions are
- timer: true, // true or false to have the timer
- advanceSpeed: 4000, // if timer is enabled, time between transitions
- pauseOnHover: false, // if you hover pauses the slider
- startClockOnMouseOut: false, // if clock should start on MouseOut
+ animationSpeed: 600, // how fast animations are
+ timer: true, // display timer?
+ advanceSpeed: 4000, // if timer is enabled, time between transitions
+ pauseOnHover: false, // if you hover pauses the slider
+ startClockOnMouseOut: false, // if clock should start on MouseOut
startClockOnMouseOutAfter: 1000, // how long after MouseOut should the timer start again
- directionalNav: true, // manual advancing directional navs
+ directionalNav: true, // manual advancing directional navs
directionalNavRightText: 'Right', // text of right directional element for accessibility
- directionalNavLeftText: 'Left', // text of left directional element for accessibility
- captions: true, // do you want captions?
- captionAnimation: 'fade', // fade, slideOpen, none
- captionAnimationSpeed: 600, // if so how quickly should they animate in
- resetTimerOnClick: false, // true resets the timer instead of pausing slideshow progress on manual navigation
- bullets: false, // true or false to activate the bullet navigation
- bulletThumbs: false, // thumbnails for the bullets
- bulletThumbLocation: '', // location from this file where thumbs will be
- afterSlideChange: $.noop, // empty function
- afterLoadComplete: $.noop, //callback to execute after everything has been loaded
+ directionalNavLeftText: 'Left', // text of left directional element for accessibility
+ captions: true, // do you want captions?
+ captionAnimation: 'fade', // fade, slideOpen, none
+ captionAnimationSpeed: 600, // if so how quickly should they animate in
+ resetTimerOnClick: false, // true resets the timer instead of pausing slideshow progress on manual navigation
+ bullets: false, // true or false to activate the bullet navigation
+ bulletThumbs: false, // thumbnails for the bullets
+ bulletThumbLocation: '', // relative path to thumbnails from this file
+ afterSlideChange: $.noop, // callback to execute after slide changes
+ afterLoadComplete: $.noop, // callback to execute after everything has been loaded
fluid: true,
- centerBullets: true, // center bullet nav with js, turn this off if you want to position the bullet nav manually
- singleCycle: false // cycles through orbit slides only once
+ centerBullets: true, // center bullet nav with js, turn this off if you want to position the bullet nav manually
+ singleCycle: false, // cycles through orbit slides only once
+ slideNumber: false, // display slide numbers?
+ stackOnSmall: false // stack slides on small devices (i.e. phones)
},
activeSlide: 0,
@@ -54,8 +56,9 @@
wrapperHTML: '<div class="orbit-wrapper" />',
timerHTML: '<div class="timer"><span class="mask"><span class="rotator"></span></span><span class="pause"></span></div>',
captionHTML: '<div class="orbit-caption"></div>',
- directionalNavHTML: '<div class="slider-nav"><span class="right"></span><span class="left"></span></div>',
+ directionalNavHTML: '<div class="slider-nav hide-for-small"><span class="right"></span><span class="left"></span></div>',
bulletHTML: '<ul class="orbit-bullets"></ul>',
+ slideNumberHTML: '<span class="orbit-slide-counter"></span>',
init: function (element, options) {
var $imageSlides,
@@ -80,11 +83,20 @@
this.$wrapper = this.$element.wrap(this.wrapperHTML).parent();
this.$slides = this.$element.children('img, a, div, figure');
- this.$element.bind('orbit.next', function () {
+ this.$element.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();
+ }
+ });
+
+ this.$element.bind('orbit.next swipeleft', function () {
self.shift('next');
});
- this.$element.bind('orbit.prev', function () {
+ this.$element.bind('orbit.prev swiperight', function () {
self.shift('prev');
});
@@ -119,11 +131,16 @@
.addClass('orbit')
.css({width: '1px', height: '1px'});
+ if (this.options.stackOnSmall) {
+ this.$element.addClass('orbit-stack-on-small');
+ }
+
this.$slides.addClass('orbit-slide');
this.setDimentionsFromLargestSlide();
this.updateOptionsIfOnlyOneSlide();
this.setupFirstSlide();
+ this.notifySlideChange();
if (this.options.timer) {
this.setupTimer();
@@ -151,6 +168,20 @@
return this.$slides.eq(this.activeSlide);
},
+ notifySlideChange: function() {
+ if (this.options.slideNumber) {
+ var txt = (this.activeSlide+1) + ' of ' + this.$slides.length;
+ this.$element.trigger("orbit.change", {slideIndex: this.activeSlide, slideCount: this.$slides.length});
+ if (this.$counter === undefined) {
+ var $counter = $(this.slideNumberHTML).html(txt);
+ this.$counter = $counter;
+ this.$wrapper.append(this.$counter);
+ } else {
+ this.$counter.html(txt);
+ }
+ }
+ },
+
setDimentionsFromLargestSlide: function () {
//Collect all slides and set slider size of largest image
var self = this,
@@ -225,7 +256,7 @@
//Set initial front photo z-index and fades it in
var self = this;
this.$slides.first()
- .css({"z-index" : 3})
+ .css({"z-index" : 3, "opacity" : 1})
.fadeIn(function() {
//brings in all other slides IF css declares a display: none
self.$slides.css({"display":"block"})
@@ -488,6 +519,7 @@
//set to correct bullet
this.setActiveBullet();
+ this.notifySlideChange();
//set previous slide z-index to one below what new activeSlide will be
this.$slides
@@ -500,6 +532,9 @@
.eq(this.activeSlide)
.css({"opacity" : 0, "z-index" : 3})
.animate({"opacity" : 1}, this.options.animationSpeed, this.resetAndUnlock);
+ this.$slides
+ .eq(this.prevActiveSlide)
+ .animate({"opacity":0}, this.options.animationSpeed);
}
//horizontal-slide
@@ -508,14 +543,19 @@
this.$slides
.eq(this.activeSlide)
.css({"left": this.orbitWidth, "z-index" : 3})
+ .css("opacity", 1)
.animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
}
if (slideDirection == "prev") {
this.$slides
.eq(this.activeSlide)
.css({"left": -this.orbitWidth, "z-index" : 3})
+ .css("opacity", 1)
.animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
}
+ this.$slides
+ .eq(this.prevActiveSlide)
+ .css("opacity", 0);
}
//vertical-slide
@@ -524,14 +564,22 @@
this.$slides
.eq(this.activeSlide)
.css({"top": this.orbitHeight, "z-index" : 3})
+ .css("opacity", 1)
.animate({"top" : 0}, this.options.animationSpeed, this.resetAndUnlock);
+ this.$slides
+ .eq(this.prevActiveSlide)
+ .css("opacity", 0);
}
if (slideDirection == "next") {
this.$slides
.eq(this.activeSlide)
.css({"top": -this.orbitHeight, "z-index" : 3})
+ .css("opacity", 1)
.animate({"top" : 0}, this.options.animationSpeed, this.resetAndUnlock);
}
+ this.$slides
+ .eq(this.prevActiveSlide)
+ .css("opacity", 0);
}
//horizontal-push
@@ -540,19 +588,23 @@
this.$slides
.eq(this.activeSlide)
.css({"left": this.orbitWidth, "z-index" : 3})
- .animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
+ .animate({"left" : 0, "opacity" : 1}, this.options.animationSpeed, this.resetAndUnlock);
this.$slides
.eq(this.prevActiveSlide)
- .animate({"left" : -this.orbitWidth}, this.options.animationSpeed);
+ .animate({"left" : -this.orbitWidth}, this.options.animationSpeed, "", function(){
+ $(this).css({"opacity" : 0});
+ });
}
if (slideDirection == "prev") {
this.$slides
.eq(this.activeSlide)
.css({"left": -this.orbitWidth, "z-index" : 3})
- .animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
+ .animate({"left" : 0, "opacity" : 1}, this.options.animationSpeed, this.resetAndUnlock);
this.$slides
.eq(this.prevActiveSlide)
- .animate({"left" : this.orbitWidth}, this.options.animationSpeed);
+ .animate({"left" : this.orbitWidth}, this.options.animationSpeed, "", function(){
+ $(this).css({"opacity" : 0});
+ });
}
}
@@ -562,18 +614,22 @@
this.$slides
.eq(this.activeSlide)
.css({top: -this.orbitHeight, "z-index" : 3})
- .animate({top : 0}, this.options.animationSpeed, this.resetAndUnlock);
+ .css("opacity", 1)
+ .animate({top : 0, "opacity":1}, this.options.animationSpeed, this.resetAndUnlock);
this.$slides
.eq(this.prevActiveSlide)
- .animate({top : this.orbitHeight}, this.options.animationSpeed);
+ .css("opacity", 0)
+ .animate({top : this.orbitHeight}, this.options.animationSpeed, "");
}
if (slideDirection == "prev") {
this.$slides
.eq(this.activeSlide)
.css({top: this.orbitHeight, "z-index" : 3})
+ .css("opacity", 1)
.animate({top : 0}, this.options.animationSpeed, this.resetAndUnlock);
this.$slides
.eq(this.prevActiveSlide)
+ .css("opacity", 0)
.animate({top : -this.orbitHeight}, this.options.animationSpeed);
}
}
View
8 js/foundation/jquery.foundation.tabs.js
@@ -8,7 +8,7 @@
}, options);
var activateTab = function ($tab) {
- var $activeTab = $tab.closest('dl').find('dd.active'),
+ var $activeTab = $tab.closest('dl, ul').find('.active'),
target = $tab.children('a').attr("href"),
hasHash = /^#/.test(target),
contentLocation = '';
@@ -29,12 +29,12 @@
$tab.addClass('active');
};
- $(document).on('click.fndtn', 'dl.tabs dd a', function (event){
- activateTab($(this).parent('dd'));
+ $(document).on('click.fndtn', '.tabs a', function (event){
+ activateTab($(this).parent('dd, li'));
});
if (window.location.hash) {
- activateTab($('a[href="' + window.location.hash + '"]').parent('dd'));
+ activateTab($('a[href="' + window.location.hash + '"]').parent('dd, li'));
settings.callback();
}
View
32 js/foundation/jquery.foundation.tooltips.js
@@ -13,7 +13,7 @@
var settings = {
bodyHeight : 0,
- targetClass : '.has-tip',
+ selector : '.has-tip',
tooltipClass : '.tooltip',
tipTemplate : function (selector, content) {
return '<span data-selector="' + selector + '" class="' + settings.tooltipClass.substring(1) + '">' + content + '<span class="nub"></span></span>';
@@ -23,11 +23,14 @@
init : function (options) {
settings = $.extend(settings, options);
+ // alias the old targetClass option
+ settings.selector = settings.targetClass ? settings.targetClass : settings.selector;
+
return this.each(function () {
var $body = $('body');
if (Modernizr.touch) {
- $body.on('click.tooltip touchstart.tooltip touchend.tooltip', settings.targetClass, function (e) {
+ $body.on('click.tooltip touchstart.tooltip touchend.tooltip', settings.selector, function (e) {
e.preventDefault();
$(settings.tooltipClass).hide();
methods.showOrCreateTip($(this));
@@ -37,7 +40,7 @@
$(this).fadeOut(150);
});
} else {
- $body.on('mouseenter.tooltip mouseleave.tooltip', settings.targetClass, function (e) {
+ $body.on('mouseenter.tooltip mouseleave.tooltip', settings.selector, function (e) {
var $this = $(this);
if (e.type === 'mouseenter') {
@@ -81,7 +84,7 @@
return (id) ? id : dataSelector;
},
create : function ($target) {
- var $tip = $(settings.tipTemplate(methods.selector($target), $('<div>').text($target.attr('title')).html())),
+ var $tip = $(settings.tipTemplate(methods.selector($target), $('<div>').html($target.attr('title')).html())),
classes = methods.inheritable_classes($target);
$tip.addClass(classes).appendTo('body');
@@ -124,15 +127,15 @@
tip.width(column.outerWidth() - 25).css('left', 15).addClass('tip-override');
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
} else {
- if (classes.indexOf('tip-top') > -1) {
+ if (classes && classes.indexOf('tip-top') > -1) {
objPos(tip, (target.offset().top - tip.outerHeight() - nubHeight), 'auto', 'auto', target.offset().left, width)
.removeClass('tip-override');
objPos(nub, 'auto', 'auto', -nubHeight, 'auto');
- } else if (classes.indexOf('tip-left') > -1) {
+ } else if (classes && classes.indexOf('tip-left') > -1) {
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - nubHeight), 'auto', 'auto', (target.offset().left - tip.outerWidth() - 10), width)
.removeClass('tip-override');
objPos(nub, (tip.outerHeight() / 2) - (nubHeight / 2), -nubHeight, 'auto', 'auto');
- } else if (classes.indexOf('tip-right') > -1) {
+ } else if (classes && classes.indexOf('tip-right') > -1) {
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - nubHeight), 'auto', 'auto', (target.offset().left + target.outerWidth() + 10), width)
.removeClass('tip-override');
objPos(nub, (tip.outerHeight() / 2) - (nubHeight / 2), 'auto', 'auto', -nubHeight);
@@ -142,11 +145,12 @@
},
inheritable_classes : function (target) {
var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'],
- filtered = $.map(target.attr('class').split(' '), function (el, i) {
- if ($.inArray(el, inheritables) !== -1) {
- return el;
- }
- }).join(' ');
+ classes = target.attr('class'),
+ filtered = classes ? $.map(classes.split(' '), function (el, i) {
+ if ($.inArray(el, inheritables) !== -1) {
+ return el;
+ }
+ }).join(' ') : '';
return $.trim(filtered);
},
@@ -169,9 +173,9 @@
destroy : function () {
return this.each(function () {
$(window).off('.tooltip');
- $(settings.targetClass).off('.tooltip');
+ $(settings.selector).off('.tooltip');
$(settings.tooltipClass).each(function (i) {
- $($(settings.targetClass).get(i)).attr('title', $(this).text());
+ $($(settings.selector).get(i)).attr('title', $(this).text());
}).remove();
});
}
View
20 js/foundation/jquery.foundation.topbar.js
@@ -35,19 +35,23 @@
methods.largestUL();
}
- $('.top-bar .toggle-topbar').live('click.fndtn', function (e) {
+ if (settings.$topbar.parent().hasClass('fixed')) {
+ $('body').css('padding-top',settings.$topbar.outerHeight())
+ }
+
+ $('.top-bar .toggle-topbar').die('click.fndtn').live('click.fndtn', function (e) {
e.preventDefault();
if (methods.breakpoint()) {
settings.$topbar.toggleClass('expanded');
settings.$topbar.css('min-height', '');
-
}
});
// Show the Dropdown Levels on Click
- $('.top-bar .has-dropdown>a').live('click.fndtn', function (e) {
- e.preventDefault();
+ $('.top-bar .has-dropdown>a').die('click.fndtn').live('click.fndtn', function (e) {
+ if (Modernizr.touch || methods.breakpoint())
+ e.preventDefault();
if (methods.breakpoint()) {
var $this = $(this),
@@ -67,8 +71,14 @@
}
});
+ $(window).on('resize.fndtn.topbar',function() {
+ if (!methods.breakpoint()) {
+ settings.$topbar.css('min-height', '');
+ }
+ });
+
// Go up a level on Click
- $('.top-bar .has-dropdown .back').live('click.fndtn', function (e) {
+ $('.top-bar .has-dropdown .back').die('click.fndtn').live('click.fndtn', function (e) {
e.preventDefault();
var $this = $(this),
View
1,089 js/foundation/jquery.js
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.8.1
+ * jQuery JavaScript Library v1.8.2
* http://jquery.com/
*
* Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license
* http://jquery.org/license
*
- * Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
+ * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
*/
(function( window, undefined ) {
var
@@ -186,7 +186,7 @@ jQuery.fn = jQuery.prototype = {
selector: "",
// The current version of jQuery being used
- jquery: "1.8.1",
+ jquery: "1.8.2",
// The default length of a jQuery object is 0
length: 0,
@@ -573,7 +573,7 @@ jQuery.extend({
},
nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
@@ -630,7 +630,7 @@ jQuery.extend({
function( text ) {
return text == null ?
"" :
- text.toString().replace( rtrim, "" );
+ ( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
@@ -776,7 +776,7 @@ jQuery.extend({
};
// Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
@@ -1143,7 +1143,7 @@ jQuery.extend({
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
- return typeof obj === "object" ? jQuery.extend( obj, promise ) : promise;
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
@@ -1262,7 +1262,7 @@ jQuery.support = (function() {
a.style.cssText = "top:1px;float:left;opacity:.5";
// Can't get basic test support
- if ( !all || !all.length || !a ) {
+ if ( !all || !all.length ) {
return {};
}
@@ -1513,7 +1513,7 @@ jQuery.extend({
deletedIds: [],
- // Please use with caution
+ // Remove at next major release (1.9/2.0)
uuid: 0,
// Unique for each copy of jQuery on the page
@@ -1565,7 +1565,7 @@ jQuery.extend({
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
- elem[ internalKey ] = id = jQuery.deletedIds.pop() || ++jQuery.uuid;
+ elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
@@ -1739,7 +1739,7 @@ jQuery.fn.extend({
for ( l = attr.length; i < l; i++ ) {
name = attr[i].name;
- if ( name.indexOf( "data-" ) === 0 ) {
+ if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.substring(5) );
dataAttr( elem, name, data[ name ] );
@@ -2049,7 +2049,7 @@ jQuery.fn.extend({
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
setClass += classNames[ c ] + " ";
}
}
@@ -2082,7 +2082,7 @@ jQuery.fn.extend({
// loop over each item in the removal list
for ( c = 0, cl = removes.length; c < cl; c++ ) {
// Remove until there is nothing to remove,
- while ( className.indexOf(" " + removes[ c ] + " ") > -1 ) {
+ while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
className = className.replace( " " + removes[ c ] + " " , " " );
}
}
@@ -2136,7 +2136,7 @@ jQuery.fn.extend({
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
@@ -2314,7 +2314,7 @@ jQuery.extend({
return ret;
} else {
- elem.setAttribute( name, "" + value );
+ elem.setAttribute( name, value + "" );
return value;
}
@@ -2578,7 +2578,7 @@ if ( !jQuery.support.style ) {
return elem.style.cssText.toLowerCase() || undefined;
},
set: function( elem, value ) {
- return ( elem.style.cssText = "" + value );
+ return ( elem.style.cssText = value + "" );
}
};
}
@@ -2711,6 +2711,7 @@ jQuery.event = {
handler: handler,
guid: handler.guid,
selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
@@ -2946,7 +2947,7 @@ jQuery.event = {
}
// Note that this is a bare JS function and not a jQuery handler
handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
@@ -2994,7 +2995,7 @@ jQuery.event = {
var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount,
- args = [].slice.call( arguments ),
+ args = core_slice.call( arguments ),
run_all = !event.exclusive && !event.namespace,
special = jQuery.event.special[ event.type ] || {},
handlerQueue = [];
@@ -3023,7 +3024,9 @@ jQuery.event = {
sel = handleObj.selector;
if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = jQuery( sel, this ).index( cur ) >= 0;
+ selMatch[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( selMatch[ sel ] ) {
matches.push( handleObj );
@@ -3593,7 +3596,7 @@ jQuery.fn.extend({
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
- return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
},
trigger: function( type, data ) {
@@ -3664,14 +3667,13 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
});
/*!
* Sizzle CSS Selector Engine
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://sizzlejs.com/
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://sizzlejs.com/
*/
(function( window, undefined ) {
-var dirruns,
- cachedruns,
+var cachedruns,
assertGetIdNotName,
Expr,
getText,
@@ -3680,21 +3682,36 @@ var dirruns,
compile,
sortOrder,
hasDuplicate,
+ outermostContext,
baseHasDuplicate = true,
strundefined = "undefined",
expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
+ Token = String,
document = window.document,
docElem = document.documentElement,
+ dirruns = 0,
done = 0,
- slice = [].slice,
+ pop = [].pop,
push = [].push,
+ slice = [].slice,
+ // Use a stripped-down indexOf if a native one is unavailable
+ indexOf = [].indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
// Augment a function for special use by Sizzle
markFunction = function( fn, value ) {
- fn[ expando ] = value || true;
+ fn[ expando ] = value == null || value;
return fn;
},
@@ -3741,7 +3758,8 @@ var dirruns,
pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
// For matchExpr.POS and matchExpr.needsContext
- pos = ":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",
+ pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
@@ -3769,10 +3787,10 @@ var dirruns,
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|nth|last|first)-child(?:\\(" + whitespace +
+ "POS": new RegExp( pos, "i" ),
+ "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i"