Foundationzottiri
Foundationzottiri
while (i--) {
if (head.has('.' + class_array[i]).length === 0) {
head.append('<meta class="' + class_array[i] + '" />');
}
}
};
header_helpers([
'foundation-mq-small',
'foundation-mq-small-only',
'foundation-mq-medium',
'foundation-mq-medium-only',
'foundation-mq-large',
'foundation-mq-large-only',
'foundation-mq-xlarge',
'foundation-mq-xlarge-only',
'foundation-mq-xxlarge',
'foundation-data-attribute-namespace']);
$(function () {
if (typeof FastClick !== 'undefined') {
// Don't attach to body if undefined
if (typeof document.body !== 'undefined') {
FastClick.attach(document.body);
}
}
});
return $(document.querySelectorAll(selector));
}
// Namespace functions.
return arr.join('-');
};
while (i--) {
if (i !== 0) {
arr.push(parts[i]);
} else {
if (this.namespace.length > 0) {
arr.push(this.namespace, parts[i]);
} else {
arr.push(parts[i]);
}
}
}
return arr.reverse().join('-');
};
if (should_bind_events) {
self.events(this);
}
};
if (S(this.scope).is('[' + this.attr_name() +']')) {
bind.call(this.scope);
} else {
S('[' + this.attr_name() +']', this.scope).each(bind);
}
// # Patch to fix #5043 to move this *after* the if/else clause in order for
Backbone and similar frameworks to have improved control over event binding and
data-options updating.
if (typeof method === 'string') {
return this[method].call(this, options);
}
};
function bindLoad () {
this.one('load', loaded);
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
var src = this.attr( 'src' ),
param = src.match( /\?/ ) ? '&' : '?';
if (!image.attr('src')) {
loaded();
return;
}
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors &
copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual
MIT/BSD license */
script.parentNode.insertBefore(style, script);
styleMedia = {
matchMedium: function(media) {
var text = '@media ' + media + '{ #matchmediajs-test { width:
1px; } }';
return function(media) {
return {
matches: styleMedia.matchMedium(media || 'all'),
media: media || 'all'
};
};
}());
/*
* jquery.requestAnimationFrame
* https://github.com/gnarf37/jquery-requestAnimationFrame
* Requires jQuery 1.8+
*
* Copyright (c) 2012 Corey Frang
* Licensed under the MIT license.
*/
(function(jQuery) {
var animating,
lastTime = 0,
vendors = ['webkit', 'moz'],
requestAnimationFrame = window.requestAnimationFrame,
cancelAnimationFrame = window.cancelAnimationFrame,
jqueryFxAvailable = 'undefined' !== typeof jQuery.fx;
function raf() {
if (animating) {
requestAnimationFrame(raf);
if (jqueryFxAvailable) {
jQuery.fx.tick();
}
}
}
if (requestAnimationFrame) {
// use rAF
window.requestAnimationFrame = requestAnimationFrame;
window.cancelAnimationFrame = cancelAnimationFrame;
if (jqueryFxAvailable) {
jQuery.fx.timer = function (timer) {
if (timer() && jQuery.timers.push(timer) && !animating) {
animating = true;
raf();
}
};
jQuery.fx.stop = function () {
animating = false;
};
}
} else {
// polyfill
window.requestAnimationFrame = function (callback) {
var currTime = new Date().getTime(),
timeToCall = Math.max(0, 16 - (currTime - lastTime)),
id = window.setTimeout(function () {
callback(currTime + timeToCall);
}, timeToCall);
lastTime = currTime + timeToCall;
return id;
};
}( $ ));
return string;
}
window.Foundation = {
name : 'Foundation',
version : '5.5.2',
media_queries : {
'small' :
S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+
$/g, ''),
'small-only' :
S('.foundation-mq-small-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|
[\/\\'"]+$/g, ''),
'medium' :
S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]
+$/g, ''),
'medium-only' :
S('.foundation-mq-medium-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|
[\/\\'"]+$/g, ''),
'large' :
S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+
$/g, ''),
'large-only' :
S('.foundation-mq-large-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|
[\/\\'"]+$/g, ''),
'xlarge' :
S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]
+$/g, ''),
'xlarge-only' :
S('.foundation-mq-xlarge-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|
[\/\\'"]+$/g, ''),
'xxlarge' :
S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|
[\/\\'"]+$/g, '')
},
stylesheet : $('<style></style>').appendTo('head')[0].sheet,
global : {
namespace : undefined
},
// check RTL
this.rtl = /rtl/i.test(S('html').attr('dir'));
this.set_namespace();
if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries))
{
if (this.libs.hasOwnProperty(libraries)) {
responses.push(this.init_lib(libraries, args));
}
} else {
for (var lib in this.libs) {
responses.push(this.init_lib(lib, libraries));
}
}
S(window).load(function () {
S(window)
.trigger('resize.fndtn.clearing')
.trigger('resize.fndtn.dropdown')
.trigger('resize.fndtn.equalizer')
.trigger('resize.fndtn.interchange')
.trigger('resize.fndtn.joyride')
.trigger('resize.fndtn.magellan')
.trigger('resize.fndtn.topbar')
.trigger('resize.fndtn.slider');
});
return scope;
},
while (i--) {
if (this.utils.hasOwnProperty(methods_arr[i])) {
scope[methods_arr[i]] = this.utils[methods_arr[i]];
}
}
},
set_namespace : function () {
// Description:
// Don't bother reading the namespace out of the meta tag
// if the namespace has been set globally in javascript
//
// Example:
// Foundation.global.namespace = 'my-namespace';
// or make it an empty string:
// Foundation.global.namespace = '';
//
//
// If the namespace has not been set (is undefined), try to read it out of
the meta element.
// Otherwise use the globally defined namespace, even if it's empty ('')
var namespace = ( this.global.namespace === undefined ) ? $('.foundation-
data-attribute-namespace').css('font-family') : this.global.namespace;
libs : {},
// Description:
// Fast Selector wrapper returns jQuery object. Only use where
getElementById
// is not available.
//
// Arguments:
// Selector (String): CSS selector describing the element(s) to be
// returned as a jQuery object.
//
// Scope (String): CSS selector describing the area to be searched.
Default
// is document.
//
// Returns:
// Element (jQuery Object): jQuery object containing elements matching the
// selector within the scope.
S : S,
// Description:
// Executes a function a max of once every n milliseconds
//
// Arguments:
// Func (Function): Function to be throttled.
//
// Delay (Integer): Function execution threshold in milliseconds.
//
// Returns:
// Lazy_function (Function): Function with throttling applied.
throttle : function (func, delay) {
var timer = null;
return function () {
var context = this, args = arguments;
if (timer == null) {
timer = setTimeout(function () {
func.apply(context, args);
timer = null;
}, delay);
}
};
},
// Description:
// Executes a function when it stops being invoked for n seconds
// Modified version of _.debounce() http://underscorejs.org
//
// Arguments:
// Func (Function): Function to be debounced.
//
// Delay (Integer): Function execution threshold in milliseconds.
//
// Immediate (Bool): Whether the function should be called at the
beginning
// of the delay instead of the end. Default is false.
//
// Returns:
// Lazy_function (Function): Function with debouncing applied.
debounce : function (func, delay, immediate) {
var timeout, result;
return function () {
var context = this, args = arguments;
var later = function () {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, delay);
if (callNow) {
result = func.apply(context, args);
}
return result;
};
},
// Description:
// Parses data-options attribute
//
// Arguments:
// El (jQuery Object): Element to be parsed.
//
// Returns:
// Options (Javascript Object): Contents of the element's data-options
// attribute.
data_options : function (el, data_attr_name) {
data_attr_name = data_attr_name || 'options';
var opts = {}, ii, p, opts_arr,
data_options = function (el) {
var namespace = Foundation.global.namespace;
if (namespace.length > 0) {
return el.data(namespace + '-' + data_attr_name);
}
return el.data(data_attr_name);
};
while (ii--) {
p = opts_arr[ii].split(':');
p = [p[0], p.slice(1).join(':')];
if (/true/i.test(p[1])) {
p[1] = true;
}
if (/false/i.test(p[1])) {
p[1] = false;
}
if (isNumber(p[1])) {
if (p[1].indexOf('.') === -1) {
p[1] = parseInt(p[1], 10);
} else {
p[1] = parseFloat(p[1]);
}
}
return opts;
},
// Description:
// Adds JS-recognizable media queries
//
// Arguments:
// Media (String): Key string for the media query to be stored as in
// Foundation.media_queries
//
// Class (String): Class name for the generated <meta> tag
register_media : function (media, media_class) {
if (Foundation.media_queries[media] === undefined) {
$('head').append('<meta class="' + media_class + '"/>');
Foundation.media_queries[media] = removeQuotes($('.' +
media_class).css('font-family'));
}
},
// Description:
// Add custom CSS within a JS-defined media query
//
// Arguments:
// Rule (String): CSS rule to be appended to the document.
//
// Media (String): Optional media query string for the CSS rule to be
// nested under.
add_custom_rule : function (rule, media) {
if (media === undefined && Foundation.stylesheet) {
Foundation.stylesheet.insertRule(rule,
Foundation.stylesheet.cssRules.length);
} else {
var query = Foundation.media_queries[media];
// Description:
// Performs a callback function when an image is fully loaded
//
// Arguments:
// Image (jQuery Object): Image(s) to check if loaded.
//
// Callback (Function): Function to execute when image is fully loaded.
image_loaded : function (images, callback) {
var self = this,
unloaded = images.length;
function pictures_has_height(images) {
var pictures_number = images.length;
return true;
}
images.each(function () {
single_image_loaded(self.S(this), function () {
unloaded -= 1;
if (unloaded === 0) {
callback(images);
}
});
});
},
// Description:
// Returns a random, alphanumeric string
//
// Arguments:
// Length (Integer): Length of string to be generated. Defaults to random
// integer.
//
// Returns:
// Rand (String): Pseudo-random, alphanumeric string.
random_str : function () {
if (!this.fidx) {
this.fidx = 0;
}
this.prefix = this.prefix || [(this.name || 'F'), (+new
Date).toString(36)].join('-');
// Description:
// Helper for window.matchMedia
//
// Arguments:
// mq (String): Media query
//
// Returns:
// (Boolean): Whether the media query passes or not
match : function (mq) {
return window.matchMedia(mq).matches;
},
// Description:
// Helpers for checking Foundation default media queries with JS
//
// Returns:
// (Boolean): Whether the media query passes or not
is_small_up : function () {
return this.match(Foundation.media_queries.small);
},
is_medium_up : function () {
return this.match(Foundation.media_queries.medium);
},
is_large_up : function () {
return this.match(Foundation.media_queries.large);
},
is_xlarge_up : function () {
return this.match(Foundation.media_queries.xlarge);
},
is_xxlarge_up : function () {
return this.match(Foundation.media_queries.xxlarge);
},
is_small_only : function () {
return !this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up()
&& !this.is_xxlarge_up();
},
is_medium_only : function () {
return this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up()
&& !this.is_xxlarge_up();
},
is_large_only : function () {
return this.is_medium_up() && this.is_large_up() && !this.is_xlarge_up() &&
!this.is_xxlarge_up();
},
is_xlarge_only : function () {
return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up()
&& !this.is_xxlarge_up();
},
is_xxlarge_only : function () {
return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() &&
this.is_xxlarge_up();
}
}
};
$.fn.foundation = function () {
var args = Array.prototype.slice.call(arguments, 0);
return this.each(function () {
Foundation.init.apply(Foundation, [this].concat(args));
return this;
});
};
Foundation.libs.abide = {
name : 'abide',
version : '5.5.2',
settings : {
live_validate : true,
validate_on_blur : true,
// validate_on: 'tab', // tab (when user tabs between fields), change (input
changes), manual (call custom events)
focus_on_invalid : true,
error_labels : true, // labels with a for="inputId" will recieve an `error`
class
error_class : 'error',
timeout : 1000,
patterns : {
alpha : /^[a-zA-Z]+$/,
alpha_numeric : /^[a-zA-Z0-9]+$/,
integer : /^[-+]?\d+$/,
number : /^[-+]?\d*(?:[\.\,]\d+)?$/,
// http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-
the-type-attribute.html#valid-e-mail-address
email : /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]
{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
// http://blogs.lse.ac.uk/lti/2008/04/23/a-regular-expression-to-match-any-
url/
url: /^(https?|ftp|file|ssh):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?
(\d+)?((\/[-\+~%\/\.\w]+)?\??([-\+=&;%@\.\w]+)?#?([\w]+)?)?/,
// abc.de
domain : /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]
{2,8}$/,
datetime : /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-
5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
// YYYY-MM-DD
date : /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:
(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
// HH:MM:SS
time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
dateISO : /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
// MM/DD/YYYY
month_day_year : /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\
d{4}$/,
// DD/MM/YYYY
day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\
d{4}$/,
// #FFF or #FFFFFF
color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
},
validators : {
equalTo : function (el, required, parent) {
var from =
document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
to = el.value,
valid = (from === to);
return valid;
}
}
},
timer : null,
this.invalid_attr = this.add_namespace('data-invalid');
function validate(originalSelf, e) {
clearTimeout(self.timer);
self.timer = setTimeout(function () {
self.validate([originalSelf], e);
}.bind(originalSelf), settings.timeout);
}
form
.off('.abide')
.on('submit.fndtn.abide', function (e) {
var is_ajax = /ajax/i.test(self.S(this).attr(self.attr_name()));
return self.validate(self.S(this).find('input, textarea,
select').not(":hidden, [data-abide-ignore]").get(), e, is_ajax);
})
.on('validate.fndtn.abide', function (e) {
if (settings.validate_on === 'manual') {
self.validate([e.target], e);
}
})
.on('reset', function (e) {
return self.reset($(this), e);
})
.find('input, textarea, select').not(":hidden, [data-abide-ignore]")
.off('.abide')
.on('blur.fndtn.abide change.fndtn.abide', function (e) {
// old settings fallback
// will be deprecated with F6 release
if (settings.validate_on_blur && settings.validate_on_blur === true) {
validate(this, e);
}
// new settings combining validate options into one setting
if (settings.validate_on === 'change') {
validate(this, e);
}
})
.on('keydown.fndtn.abide', function (e) {
// old settings fallback
// will be deprecated with F6 release
if (settings.live_validate && settings.live_validate === true &&
e.which != 9) {
validate(this, e);
}
// new settings combining validate options into one setting
if (settings.validate_on === 'tab' && e.which === 9) {
validate(this, e);
}
else if (settings.validate_on === 'change') {
validate(this, e);
}
})
.on('focus', function (e) {
if (navigator.userAgent.match(/iPad|iPhone|Android|BlackBerry|Windows
Phone|webOS/i)) {
$('html, body').animate({
scrollTop: $(e.target).offset().top
}, 100);
}
});
},
// Has to count up to make sure the focus gets applied to the top error
for (var i = 0; i < validation_count; i++) {
if (!validations[i] && (submit_event || is_ajax)) {
if (this.settings.focus_on_invalid) {
els[i].focus();
}
form.trigger('invalid.fndtn.abide');
this.S(els[i]).closest('form').attr(this.invalid_attr, '');
return false;
}
}
if (submit_event || is_ajax) {
form.trigger('valid.fndtn.abide');
}
form.removeAttr(this.invalid_attr);
if (is_ajax) {
return false;
}
return true;
},
while (i--) {
el_patterns.push(this.pattern(els[i]));
}
return this.check_validation_and_apply_styles(el_patterns);
},
if (this.settings.patterns.hasOwnProperty(type)) {
return [el, this.settings.patterns[type], required];
}
pattern = /.*/;
if (!direct_parent.is('label')) {
parent = direct_parent;
} else {
parent = direct_parent.parent();
}
} else if (validator) {
// Validate using each of the specified (space-delimited) validators.
var validators = validator.split(' ');
var last_valid = true, all_valid = true;
for (var iv = 0; iv < validators.length; iv++) {
valid = this.settings.validators[validators[iv]].apply(this, [el,
required, parent])
el_validations.push(valid);
all_valid = valid && last_valid;
last_valid = valid;
}
if (all_valid) {
this.S(el).removeAttr(this.invalid_attr);
parent.removeClass('error');
if (label.length > 0 && this.settings.error_labels) {
label.removeClass(this.settings.error_class).removeAttr('role');
}
$(el).triggerHandler('valid');
} else {
this.S(el).attr(this.invalid_attr, '');
parent.addClass('error');
if (label.length > 0 && this.settings.error_labels) {
label.addClass(this.settings.error_class).attr('role', 'alert');
}
$(el).triggerHandler('invalid');
}
} else {
// el.setAttribute('aria-describedby', $(el).find('.error')[0].id);
parent.addClass(this.settings.error_class);
if (label.length > 0 && this.settings.error_labels) {
label.addClass(this.settings.error_class).attr('role', 'alert');
}
$(el).triggerHandler('invalid');
}
}
validations = validations.concat(el_validations);
}
return validations;
},
if (valid) {
el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
$(el).triggerHandler('valid');
} else {
el.attr(this.invalid_attr,
'').parent().addClass(this.settings.error_class);
$(el).triggerHandler('invalid');
}
return valid;
},
// Has to count up to make sure the focus gets applied to the top error
for (var i=0; i < count; i++) {
if( group[i].getAttribute('disabled') ){
disabled=true;
valid=true;
} else {
if (group[i].checked){
valid = true;
} else {
if( disabled ){
valid = false;
}
}
}
}
// Has to count up to make sure the focus gets applied to the top error
for (var i = 0; i < count; i++) {
if (valid) {
this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass(this.settings.e
rror_class);
$(group[i]).triggerHandler('valid');
} else {
this.S(group[i]).attr(this.invalid_attr,
'').parent().addClass(this.settings.error_class);
$(group[i]).triggerHandler('invalid');
}
}
return valid;
},
if (valid) {
this.S(el).removeAttr(this.invalid_attr);
parent.removeClass(this.settings.error_class);
if (label.length > 0 && settings.error_labels) {
label.removeClass(this.settings.error_class);
}
} else {
this.S(el).attr(this.invalid_attr, '');
parent.addClass(this.settings.error_class);
if (label.length > 0 && settings.error_labels) {
label.addClass(this.settings.error_class);
}
}
return valid;
},
if (valid) {
el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
} else {
el.attr(this.invalid_attr,
'').parent().addClass(this.settings.error_class);
}
if (!doNotValidateOthers) {
var _this = this;
others.each(function () {
_this.valid_oneof.call(_this, this, null, null, true);
});
}
return valid;
},
Foundation.libs.accordion = {
name : 'accordion',
version : '5.5.2',
settings : {
content_class : 'content',
active_class : 'active',
multi_expand : false,
toggleable : true,
callback : function () {}
},
S(this.scope)
.off('.fndtn.accordion')
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a, [' +
this.attr_name() + '] > li > a', function (e) {
var accordion = S(this).closest('[' + self.attr_name() + ']'),
groupSelector = self.attr_name() + '=' +
accordion.attr(self.attr_name()),
settings = accordion.data(self.attr_name(true) + '-init') ||
self.settings,
target = S('#' + this.href.split('#')[1]),
aunts = $('> dd, > li', accordion),
siblings = aunts.children('.' + settings.content_class),
active_content = siblings.filter('.' + settings.active_class);
e.preventDefault();
if (accordion.attr(self.attr_name())) {
siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' +
settings.content_class + ', [' + groupSelector + '] li > ' + '.' +
settings.content_class);
aunts = aunts.add('[' + groupSelector + '] dd, [' + groupSelector + ']
li');
}
if (!settings.multi_expand) {
siblings.removeClass(settings.active_class);
aunts.removeClass(settings.active_class);
aunts.children('a').attr('aria-expanded','false');
}
target.addClass(settings.active_class).parent().addClass(settings.active_class);
settings.callback(target);
target.triggerHandler('toggled', [accordion]);
accordion.triggerHandler('toggled', [target]);
S(this).attr('aria-expanded','true');
});
},
create: function($instance) {
var self = this,
accordion = $instance,
aunts = $('> .accordion-navigation', accordion),
settings = accordion.data(self.attr_name(true) + '-init') ||
self.settings;
aunts.children('a').attr('aria-expanded','false');
aunts.has('.' + settings.content_class + '.' +
settings.active_class).children('a').attr('aria-expanded','true');
if (settings.multi_expand) {
$instance.attr('aria-multiselectable','true');
}
},
reflow : function () {}
};
}(jQuery, window, window.document));
Foundation.libs.alert = {
name : 'alert',
version : '5.5.2',
settings : {
callback : function () {}
},
events : function () {
var self = this,
S = this.S;
e.preventDefault();
if (Modernizr.csstransitions) {
alertBox.addClass('alert-close');
alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function
(e) {
S(this).trigger('close.fndtn.alert').remove();
settings.callback();
});
} else {
alertBox.fadeOut(300, function () {
S(this).trigger('close.fndtn.alert').remove();
settings.callback();
});
}
});
},
reflow : function () {}
};
}(jQuery, window, window.document));
Foundation.libs.clearing = {
name : 'clearing',
version : '5.5.2',
settings : {
templates : {
viewing : '<a href="#" class="clearing-close">×</a>' +
'<div class="visible-img" style="display: none"><div class="clearing-
touch-label"></div><img
src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />' +
'<p class="clearing-caption"></p><a href="#" class="clearing-main-
prev"><span></span></a>' +
'<a href="#" class="clearing-main-next"><span></span></a></div>' +
'<img class="clearing-preload-next" style="display: none"
src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />' +
'<img class="clearing-preload-prev" style="display: none"
src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />'
},
touch_label : '',
this.bindings(method, options);
if ($scroll_container.length > 0) {
this.scope = $scroll_container;
}
S(this.scope)
.off('.clearing')
.on('click.fndtn.clearing', 'ul[' + this.attr_name() + '] li ' +
this.settings.open_selectors,
function (e, current, target) {
var current = current || S(this),
target = target || current,
next = current.next('li'),
settings = current.closest('[' + self.attr_name() +
']').data(self.attr_name(true) + '-init'),
image = S(e.target);
e.preventDefault();
if (!settings) {
self.init();
settings = current.closest('[' + self.attr_name() +
']').data(self.attr_name(true) + '-init');
}
.on('click.fndtn.clearing', '.clearing-main-next',
function (e) { self.nav(e, 'next') })
.on('click.fndtn.clearing', '.clearing-main-prev',
function (e) { self.nav(e, 'prev') })
.on('click.fndtn.clearing', this.settings.close_selectors,
function (e) { Foundation.libs.clearing.close(e, this) });
$(document).on('keydown.fndtn.clearing',
function (e) { self.keydown(e) });
S(window).off('.clearing').on('resize.fndtn.clearing',
function () { self.resize() });
this.swipe_events(scope);
},
S(this.scope)
.on('touchstart.fndtn.clearing', '.visible-img', function (e) {
if (!e.touches) { e = e.originalEvent; }
var data = {
start_page_x : e.touches[0].pageX,
start_page_y : e.touches[0].pageY,
start_time : (new Date()).getTime(),
delta_x : 0,
is_scrolling : undefined
};
S(this).data('swipe-transition', data);
e.stopPropagation();
})
.on('touchmove.fndtn.clearing', '.visible-img', function (e) {
if (!e.touches) {
e = e.originalEvent;
}
// Ignore pinch/zoom events
if (e.touches.length > 1 || e.scale && e.scale !== 1) {
return;
}
if (Foundation.rtl) {
data.delta_x = -data.delta_x;
}
if ($el.parent().hasClass('carousel')) {
return;
}
$el.after('<div id="foundationClearingHolder"></div>');
if (grid[0] == null) {
return;
} else {
grid_outerHTML = grid[0].outerHTML;
}
if (Modernizr.touch) {
wrapper = $(wrapper).find('.clearing-touch-label').html(touch_label).end();
}
holder.after(wrapper).remove();
},
image.error(function () {
error = true;
});
function startLoad() {
setTimeout(function () {
this.image_loaded(image, function () {
if (image.outerWidth() === 1 && !error) {
startLoad.call(this);
} else {
cb.call(this, image);
}
}.bind(this));
}.bind(this), 100);
}
function cb (image) {
var $image = $(image);
$image.css('visibility', 'visible');
$image.trigger('imageVisible');
// toggle the gallery
body.css('overflow', 'hidden');
root.addClass('clearing-blackout');
container.addClass('clearing-container');
visible_image.show();
this.fix_height(target)
.caption(self.S('.clearing-caption', visible_image), self.S('img',
target))
.center_and_label(image, label)
.shift(current, target, function () {
target.closest('li').siblings().removeClass('visible');
target.closest('li').addClass('visible');
});
visible_image.trigger('opened.fndtn.clearing')
}
if (!this.locked()) {
visible_image.trigger('open.fndtn.clearing');
// set the image to the selected thumbnail
loaded = this.load($image);
if (loaded.interchange) {
image
.attr('data-interchange', loaded.interchange)
.foundation('interchange', 'reflow');
} else {
image
.attr('src', loaded.src)
.attr('data-interchange', '');
}
image.css('visibility', 'hidden');
startLoad.call(this);
}
},
return false;
},
e.preventDefault();
this.go(clearing, direction);
},
resize : function () {
var image = $('img', '.clearing-blackout .visible-img'),
label = $('.clearing-touch-label', '.clearing-blackout');
if (image.length) {
this.center_and_label(image, label);
image.trigger('resized.fndtn.clearing')
}
},
// visual adjustments
fix_height : function (target) {
var lis = target.parent().children(),
self = this;
lis.each(function () {
var li = self.S(this),
image = li.find('img');
return this;
},
if (target.next().length > 0) {
this.S('.clearing-main-next', visible_image).removeClass('disabled');
} else {
this.S('.clearing-main-next', visible_image).addClass('disabled');
}
if (target.prev().length > 0) {
this.S('.clearing-main-prev', visible_image).removeClass('disabled');
} else {
this.S('.clearing-main-prev', visible_image).addClass('disabled');
}
},
this.preload($image);
return {
'src': href ? href : $image.attr('src'),
'interchange': href ? interchange : $image.data('clearing-interchange')
}
},
if (new_a.length) {
src = new_a.attr('href');
interchange = new_a.data('clearing-interchange');
} else {
image = this.S('img', img);
src = image.attr('src');
interchange = image.data('clearing-interchange');
}
if (interchange) {
preload_img.attr('data-interchange', interchange);
} else {
preload_img.attr('src', src);
preload_img.attr('data-interchange', '');
}
}
return this;
},
// image caption
if (caption) {
container
.html(caption)
.show();
} else {
container
.text('')
.hide();
}
return this;
},
// directional methods
if (target.length) {
this.S('img', target)
.trigger('click.fndtn.clearing', [current, target])
.trigger('change.fndtn.clearing');
}
},
callback();
},
this.settings.up_count = up_count;
if (this.adjacent(this.settings.prev_index, target_index)) {
if ((target_index > up_count) && target_index > this.settings.prev_index) {
response = 'right';
} else if ((target_index > up_count - 1) && target_index <=
this.settings.prev_index) {
response = 'left';
} else {
response = false;
}
} else {
response = 'skip';
}
this.settings.prev_index = target_index;
return response;
},
// lock management
lock : function () {
this.settings.locked = true;
},
unlock : function () {
this.settings.locked = false;
},
locked : function () {
return this.settings.locked;
},
off : function () {
this.S(this.scope).off('.fndtn.clearing');
this.S(window).off('.fndtn.clearing');
},
reflow : function () {
this.init();
}
};
Foundation.libs.dropdown = {
name : 'dropdown',
version : '5.5.2',
settings : {
active_class : 'open',
disabled_class : 'disabled',
mega_class : 'mega',
align : 'bottom',
is_hover : false,
hover_timeout : 150,
opened : function () {},
closed : function () {}
},
S(this.scope)
.off('.dropdown')
.on('click.fndtn.dropdown', '[' + this.attr_name() + ']', function (e) {
var settings = S(this).data(self.attr_name(true) + '-init') ||
self.settings;
if (!settings.is_hover || Modernizr.touch) {
e.preventDefault();
if (S(this).parent('[data-reveal-id]').length) {
e.stopPropagation();
}
self.toggle($(this));
}
})
.on('mouseenter.fndtn.dropdown', '[' + this.attr_name() + '], [' +
this.attr_name() + '-content]', function (e) {
var $this = S(this),
dropdown,
target;
clearTimeout(self.timeout);
if ($this.data(self.data_attr())) {
dropdown = S('#' + $this.data(self.data_attr()));
target = $this;
} else {
dropdown = $this;
target = S('[' + self.attr_name() + '="' + dropdown.attr('id') + '"]');
}
if (settings.is_hover) {
self.open.apply(self, [dropdown, target]);
}
})
.on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' +
this.attr_name() + '-content]', function (e) {
var $this = S(this);
var settings;
if ($this.data(self.data_attr())) {
settings = $this.data(self.data_attr(true) + '-init') ||
self.settings;
} else {
var target = S('[' + self.attr_name() + '="' + S(this).attr('id') +
'"]'),
settings = target.data(self.attr_name(true) + '-init') ||
self.settings;
}
self.timeout = setTimeout(function () {
if ($this.data(self.data_attr())) {
if (settings.is_hover) {
self.close.call(self, S('#' + $this.data(self.data_attr())));
}
} else {
if (settings.is_hover) {
self.close.call(self, $this);
}
}
}.bind(this), settings.hover_timeout);
})
.on('click.fndtn.dropdown', function (e) {
var parent = S(e.target).closest('[' + self.attr_name() + '-content]');
var links = parent.find('a');
if (!(S(e.target).data('revealId')) &&
(parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-
content]') ||
$.contains(parent.first()[0], e.target)))) {
e.stopPropagation();
return;
}
S(window)
.off('.dropdown')
.on('resize.fndtn.dropdown', self.throttle(function () {
self.resize.call(self);
}, 50));
this.resize();
},
self.S(this).trigger('closed.fndtn.dropdown', [dropdown]);
}
});
dropdown.removeClass('f-open-' + this.attr_name(true));
},
closeall : function () {
var self = this;
$.each(self.S('.f-open-' + this.attr_name(true)), function () {
self.close.call(self, self.S(this));
});
},
data_attr : function () {
if (this.namespace.length > 0) {
return this.namespace + '-' + this.name;
}
return this.name;
},
if (dropdown.hasClass(this.settings.active_class)) {
this.close.call(this, dropdown);
if (dropdown.data('target') !== target.get(0)) {
this.open.call(this, dropdown, target);
}
} else {
this.open.call(this, dropdown, target);
}
},
resize : function () {
var dropdown = this.S('[' + this.attr_name() + '-content].open');
var target = $(dropdown.data("target"));
this.clear_idx();
if (this.small()) {
var p = this.dirs.bottom.call(dropdown, target, settings);
dropdown.attr('style', '').css({
position : 'absolute',
top : offset
});
return dropdown;
},
dropdown.attr('style', '').css(css);
},
p.top -= o.top;
p.left -= o.left;
if (!this.hasClass('mega')) {
//miss top
if (t.offset().top <= this.outerHeight()) {
p.missTop = true;
actualBoundary = window.innerWidth - actualMarginWidth;
p.leftRightFlag = true;
}
//miss right
if (t.offset().left + this.outerWidth() > t.offset().left +
actualMarginWidth && t.offset().left - actualMarginWidth > this.outerWidth()) {
p.missRight = true;
p.missLeft = false;
}
//miss left
if (t.offset().left - this.outerWidth() <= 0) {
p.missLeft = true;
p.missRight = false;
}
}
return p;
},
this.addClass('drop-top');
if (p.missTop == true) {
p.top = p.top + t.outerHeight() + this.outerHeight();
this.removeClass('drop-top');
}
if (p.missRight == true) {
p.left = p.left - this.outerWidth() + t.outerWidth();
}
if (Foundation.rtl) {
return {left : p.left - this.outerWidth() + t.outerWidth(),
top : p.top - this.outerHeight()};
}
if (p.missRight == true) {
p.left = p.left - this.outerWidth() + t.outerWidth();
}
if (self.rtl) {
return {left : p.left - this.outerWidth() + t.outerWidth(), top : p.top +
t.outerHeight()};
}
this.addClass('drop-left');
if (p.missLeft == true) {
p.left = p.left + this.outerWidth();
p.top = p.top + t.outerHeight();
this.removeClass('drop-left');
}
this.addClass('drop-right');
if (p.missRight == true) {
p.left = p.left - this.outerWidth();
p.top = p.top + t.outerHeight();
this.removeClass('drop-right');
} else {
p.triggeredRight = true;
}
if (dropdown.hasClass(settings.mega_class)) {
pip_offset_base = position.left + (target.outerWidth() / 2) - 8;
} else if (this.small()) {
pip_offset_base += position.left - 8;
}
this.rule_idx = sheet.cssRules.length;
//default
var sel_before = '.f-dropdown.open:before',
sel_after = '.f-dropdown.open:after',
css_before = 'left: ' + pip_offset_base + 'px;',
css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
if (position.missRight == true) {
pip_offset_base = dropdown.outerWidth() - 23;
sel_before = '.f-dropdown.open:before',
sel_after = '.f-dropdown.open:after',
css_before = 'left: ' + pip_offset_base + 'px;',
css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
}
//just a case where right is fired, but its not missing right
if (position.triggeredRight == true) {
sel_before = '.f-dropdown.open:before',
sel_after = '.f-dropdown.open:after',
css_before = 'left:-12px;',
css_after = 'left:-14px;';
}
if (sheet.insertRule) {
sheet.insertRule([sel_before, '{', css_before, '}'].join(' '),
this.rule_idx);
sheet.insertRule([sel_after, '{', css_after, '}'].join(' '), this.rule_idx
+ 1);
} else {
sheet.addRule(sel_before, css_before, this.rule_idx);
sheet.addRule(sel_after, css_after, this.rule_idx + 1);
}
},
small : function () {
return matchMedia(Foundation.media_queries.small).matches &&
!matchMedia(Foundation.media_queries.medium).matches;
},
off : function () {
this.S(this.scope).off('.fndtn.dropdown');
this.S('html, body').off('.fndtn.dropdown');
this.S(window).off('.fndtn.dropdown');
this.S('[data-dropdown-content]').off('.fndtn.dropdown');
},
reflow : function () {}
};
}(jQuery, window, window.document));
Foundation.libs.equalizer = {
name : 'equalizer',
version : '5.5.2',
settings : {
use_tallest : true,
before_height_change : $.noop,
after_height_change : $.noop,
equalize_on_stack : false,
act_on_hidden_el: false
},
events : function () {
this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function (e) {
this.reflow();
}.bind(this));
},
equalize : function (equalizer) {
var isStacked = false,
group = equalizer.data('equalizer'),
settings = equalizer.data(this.attr_name(true)+'-init') || this.settings,
vals,
firstTopOffset;
if (settings.act_on_hidden_el) {
vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]') :
equalizer.find('['+this.attr_name()+'-watch]');
}
else {
vals = group ? equalizer.find('['+this.attr_name()+'-
watch="'+group+'"]:visible') : equalizer.find('['+this.attr_name()+'-
watch]:visible');
}
if (vals.length === 0) {
return;
}
settings.before_height_change();
equalizer.trigger('before-height-change.fndth.equalizer');
vals.height('inherit');
if (settings.use_tallest) {
var max = Math.max.apply(null, heights);
vals.css('height', max);
} else {
var min = Math.min.apply(null, heights);
vals.css('height', min);
}
settings.after_height_change();
equalizer.trigger('after-height-change.fndtn.equalizer');
},
reflow : function () {
var self = this;
if (media_query) {
media_query = 'is_' + media_query.replace(/-/g, '_');
if (Foundation.utils.hasOwnProperty(media_query)) {
ignore_media_query = false;
}
}
Foundation.libs.interchange = {
name : 'interchange',
version : '5.5.2',
cache : {},
images_loaded : false,
nodes_loaded : false,
settings : {
load_attr : 'interchange',
named_queries : {
'default' : 'only screen',
'small' : Foundation.media_queries['small'],
'small-only' : Foundation.media_queries['small-only'],
'medium' : Foundation.media_queries['medium'],
'medium-only' : Foundation.media_queries['medium-only'],
'large' : Foundation.media_queries['large'],
'large-only' : Foundation.media_queries['large-only'],
'xlarge' : Foundation.media_queries['xlarge'],
'xlarge-only' : Foundation.media_queries['xlarge-only'],
'xxlarge' : Foundation.media_queries['xxlarge'],
'landscape' : 'only screen and (orientation: landscape)',
'portrait' : 'only screen and (orientation: portrait)',
'retina' : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
'only screen and (min--moz-device-pixel-ratio: 2),' +
'only screen and (-o-min-device-pixel-ratio: 2/1),' +
'only screen and (min-device-pixel-ratio: 2),' +
'only screen and (min-resolution: 192dpi),' +
'only screen and (min-resolution: 2dppx)'
},
directives : {
replace : function (el, path, trigger) {
// The trigger argument, if called within the directive, fires
// an event named after the directive on the element, passing
// any parameters along to the event that you pass to trigger.
//
// ex. trigger(), trigger([a, b, c]), or trigger(a, b, c)
//
// This allows you to bind a callback like so:
// $('#interchangeContainer').on('replace', function (e, a, b, c) {
// console.log($(this).html(), a, b, c);
// });
el.attr("src", path);
return trigger(el[0].src);
}
var last_path = el.data(this.data_attr + '-last-path'),
self = this;
if (last_path == path) {
return;
}
if (/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i.test(path)) {
$(el).css('background-image', 'url(' + path + ')');
el.data('interchange-last-path', path);
return trigger(path);
}
}
}
},
this.data_attr = this.set_data_attr();
$.extend(true, this.settings, method, options);
this.bindings(method, options);
this.reflow();
},
get_media_hash : function () {
var mediaHash = '';
for (var queryName in this.settings.named_queries ) {
mediaHash +=
matchMedia(this.settings.named_queries[queryName]).matches.toString();
}
return mediaHash;
},
events : function () {
var self = this, prevMediaHash;
$(window)
.off('.interchange')
.on('resize.fndtn.interchange', self.throttle(function () {
var currMediaHash = self.get_media_hash();
if (currMediaHash !== prevMediaHash) {
self.resize();
}
prevMediaHash = currMediaHash;
}, 50));
return this;
},
resize : function () {
var cache = this.cache;
if (!this.images_loaded || !this.nodes_loaded) {
setTimeout($.proxy(this.resize, this), 50);
return;
}
return function() {
passed.el.trigger(passed.scenario[1], args);
}
}(passed)));
}
}
}
},
if (count > 0) {
var el = this.S('[' + this.add_namespace('data-uuid') + '="' + uuid +
'"]');
while (count--) {
var mq, rule = scenarios[count][2];
if (this.settings.named_queries.hasOwnProperty(rule)) {
mq = matchMedia(this.settings.named_queries[rule]);
} else {
mq = matchMedia(rule);
}
if (mq.matches) {
return {el : el, scenario : scenarios[count]};
}
}
}
return false;
},
update_images : function () {
var images = this.S('img[' + this.data_attr + ']'),
count = images.length,
i = count,
loaded_count = 0,
data_attr = this.data_attr;
this.cache = {};
this.cached_images = [];
this.images_loaded = (count === 0);
while (i--) {
loaded_count++;
if (images[i]) {
var str = images[i].getAttribute(data_attr) || '';
if (str.length > 0) {
this.cached_images.push(images[i]);
}
}
return this;
},
update_nodes : function () {
var nodes = this.S('[' + this.data_attr + ']').not('img'),
count = nodes.length,
i = count,
loaded_count = 0,
data_attr = this.data_attr;
this.cached_nodes = [];
this.nodes_loaded = (count === 0);
while (i--) {
loaded_count++;
var str = nodes[i].getAttribute(data_attr) || '';
if (str.length > 0) {
this.cached_nodes.push(nodes[i]);
}
return this;
},
while (i--) {
this.object($(this['cached_' + type][i]));
}
return $(window).trigger('resize.fndtn.interchange');
},
if (trimmed.length > 0) {
return trimmed;
}
return 'replace';
},
} else {
var cached_split = scenario[0].split(/,\s*$/),
path = cached_split[0],
directive = '';
}
if (i > 0) {
while (i--) {
// split array between comma delimited content and mq
// regex: comma, optional space, open parenthesis
var scenario = raw_arr[i].split(/,\s?\(/);
if (scenario.length > 1) {
var params = this.parse_scenario(scenario);
scenarios.push(params);
}
}
}
if (this.cache[current_uuid]) {
return this.cache[current_uuid];
}
el.attr(this.add_namespace('data-uuid'), uuid);
return this.cache[uuid] = scenarios;
},
return str;
},
return this.settings.load_attr;
}
if (this.namespace.length > 0) {
return 'data-' + this.namespace + '-' + this.settings.load_attr;
}
while (i--) {
if (raw[i].replace(/[\W\d]+/, '').length > 4) {
output.push(raw[i]);
}
}
return output;
},
reflow : function () {
this.load('images', true);
this.load('nodes', true);
}
};
Foundation.libs.joyride = {
name : 'joyride',
version : '5.5.2',
defaults : {
expose : false, // turn on or off the expose feature
modal : true, // Whether to cover page with modal
during the tour
keyboard : true, // enable left, right and esc
keystrokes
tip_location : 'bottom', // 'top' or 'bottom' in relation to
parent
nub_position : 'auto', // override on a per tooltip bases
scroll_speed : 1500, // Page scrolling speed in
milliseconds, 0 = no scroll animation
scroll_animation : 'linear', // supports 'swing' and 'linear',
extend with jQuery UI.
timer : 0, // 0 = no timer , all other numbers =
timer in milliseconds
start_timer_on_click : true, // true or false - true requires
clicking the first button start the timer
start_offset : 0, // the index of the tooltip you want to
start on (index of the li)
next_button : true, // true or false to control whether a
next button is used
prev_button : true, // true or false to control whether a
prev button is used
tip_animation : 'fade', // 'pop' or 'fade' in each tip
pause_after : [], // array of indexes where to pause the
tour after
exposed : [], // array of expose elements
tip_animation_fade_speed : 300, // when tipAnimation = 'fade' this is
speed in milliseconds for the transition
cookie_monster : false, // true or false to control whether
cookies are used
cookie_name : 'joyride', // Name the cookie you'll use
cookie_domain : false, // Will this cookie be attached to a
domain, ie. '.notableapp.com'
cookie_expires : 365, // set when you would like the cookie
to expire.
tip_container : 'body', // Where will the tip be attached
abort_on_close : true, // When true, the close event will not
fire any callback
tip_location_patterns : {
top : ['bottom'],
bottom : [], // bottom should not need to be repositioned
left : ['right', 'top', 'bottom'],
right : ['left', 'top', 'bottom']
},
post_ride_callback : function () {}, // A method to call once the tour
closes (canceled or complete)
post_step_callback : function () {}, // A method to call after each
step
pre_step_callback : function () {}, // A method to call before each
step
pre_ride_callback : function () {}, // A method to call before the
tour starts (passed index, tip, and cloned exposed element)
post_expose_callback : function () {}, // A method to call after an
element has been exposed
template : { // HTML segments for tip layout
link : '<a href="#close" class="joyride-close-tip">×</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>',
prev_button : '<a href="#" class="small button joyride-prev-tip"></a>',
modal : '<div class="joyride-modal-bg"></div>',
expose : '<div class="joyride-expose-wrapper"></div>',
expose_cover : '<div class="joyride-expose-cover"></div>'
},
expose_add_class : '' // One or more space-separated class names to be added
to exposed element
},
init : function (scope, method, options) {
Foundation.inherit(this, 'throttle random_str');
this.bindings(method, options)
},
go_next : function () {
if (this.settings.$li.next().length < 1) {
this.end();
} else if (this.settings.timer > 0) {
clearTimeout(this.settings.automate);
this.hide();
this.show();
this.startTimer();
} else {
this.hide();
this.show();
}
},
go_prev : function () {
if (this.settings.$li.prev().length < 1) {
// Do nothing if there are no prev element
} else if (this.settings.timer > 0) {
clearTimeout(this.settings.automate);
this.hide();
this.show(null, true);
this.startTimer();
} else {
this.hide();
this.show(null, true);
}
},
events : function () {
var self = this;
$(this.scope)
.off('.joyride')
.on('click.fndtn.joyride', '.joyride-next-tip, .joyride-modal-bg', function
(e) {
e.preventDefault();
this.go_next()
}.bind(this))
.on('click.fndtn.joyride', '.joyride-prev-tip', function (e) {
e.preventDefault();
this.go_prev();
}.bind(this))
switch (e.which) {
case 39: // right arrow
e.preventDefault();
this.go_next();
break;
case 37: // left arrow
e.preventDefault();
this.go_prev();
break;
case 27: // escape
e.preventDefault();
this.end(this.settings.abort_on_close);
}
}.bind(this));
$(window)
.off('.joyride')
.on('resize.fndtn.joyride', self.throttle(function () {
if ($('[' + self.attr_name() + ']').length > 0 && self.settings.$next_tip
&& self.settings.riding) {
if (self.settings.exposed.length > 0) {
var $els = $(self.settings.exposed);
$els.each(function () {
var $this = $(this);
self.un_expose($this);
self.expose($this);
});
}
if (self.is_phone()) {
self.pos_phone();
} else {
self.pos_default(false);
}
}
}, 100));
},
start : function () {
var self = this,
$this = $('[' + this.attr_name() + ']', this.scope),
integer_settings = ['timer', 'scrollSpeed', 'startOffset',
'tipAnimationFadeSpeed', 'cookieExpires'],
int_settings_count = integer_settings.length;
if (!$this.length > 0) {
return;
}
if (!this.settings.init) {
this.events();
}
this.settings = $this.data(this.attr_name(true) + '-init');
// Make sure that settings parsed from data_options are integers where
necessary
var i = int_settings_count;
while (i--) {
self.settings[integer_settings[i]] =
parseInt(self.settings[integer_settings[i]], 10);
}
self.create({$li : $this, index : index});
});
}
},
resume : function () {
this.set_li();
this.show();
},
$blank = $(this.settings.template.tip).addClass(opts.tip_class);
content = $.trim($(opts.li).html()) +
this.prev_button_text(opts.prev_button_text, opts.index) +
this.button_text(opts.button_text) +
this.settings.template.link +
this.timer_instance(opts.index);
$blank.append($(this.settings.template.wrapper));
$blank.first().attr(this.add_namespace('data-index'), opts.index);
$('.joyride-content-wrapper', $blank).append(content);
return $blank[0];
},
// Add the disabled class to the button if it's the first element
if (idx == 0) {
txt = $
(this.settings.template.prev_button).append(txt).addClass('disabled')[0].outerHTML;
} else {
txt = $(this.settings.template.prev_button).append(txt)[0].outerHTML;
}
} else {
txt = '';
}
return txt;
},
$(this.settings.tip_container).append($tip_content);
},
// are we paused?
if (this.settings.$li === undefined || ($.inArray(this.settings.$li.index(),
this.settings.pause_after) === -1)) {
this.settings.attempts = 0;
this.settings.pre_step_callback(this.settings.$li.index(), this.settings.
$next_tip);
this.settings.tip_settings.tip_location_pattern =
this.settings.tip_location_patterns[this.settings.tip_settings.tip_location];
$timer = this.settings.$next_tip.find('.joyride-timer-indicator');
if (/pop/i.test(this.settings.tip_animation)) {
$timer.width(0);
if (this.settings.timer > 0) {
this.settings.$next_tip.show();
setTimeout(function () {
$timer.animate({
width : $timer.parent().width()
}, this.settings.timer, 'linear');
}.bind(this), this.settings.tip_animation_fade_speed);
} else {
this.settings.$next_tip.show();
} else if (/fade/i.test(this.settings.tip_animation)) {
$timer.width(0);
if (this.settings.timer > 0) {
this.settings.$next_tip
.fadeIn(this.settings.tip_animation_fade_speed)
.show();
setTimeout(function () {
$timer.animate({
width : $timer.parent().width()
}, this.settings.timer, 'linear');
}.bind(this), this.settings.tip_animation_fade_speed);
} else {
this.settings.
$next_tip.fadeIn(this.settings.tip_animation_fade_speed);
}
}
this.settings.$current_tip = this.settings.$next_tip;
this.show(init, is_prev);
} else {
this.end();
}
} else {
this.settings.paused = true;
},
is_phone : function () {
return matchMedia(Foundation.media_queries.small).matches &&
!matchMedia(Foundation.media_queries.medium).matches;
},
hide : function () {
if (this.settings.modal && this.settings.expose) {
this.un_expose();
}
if (!this.settings.modal) {
$('.joyride-modal-bg').hide();
}
this.set_target();
},
set_next_tip : function () {
this.settings.$next_tip = $('.joyride-tip-guide').eq(this.settings.
$li.index());
this.settings.$next_tip.data('closed', '');
},
set_target : function () {
var cl = this.settings.$li.attr(this.add_namespace('data-class')),
id = this.settings.$li.attr(this.add_namespace('data-id')),
$sel = function () {
if (id) {
return $(document.getElementById(id));
} else if (cl) {
return $('.' + cl).first();
} else {
return $('body');
}
};
this.settings.$target = $sel();
},
scroll_to : function () {
var window_half, tipOffset;
window_half = $(window).height() / 2;
tipOffset = Math.ceil(this.settings.$target.offset().top - window_half +
this.settings.$next_tip.outerHeight());
if (tipOffset != 0) {
$('html, body').stop().animate({
scrollTop : tipOffset
}, this.settings.scroll_speed, 'swing');
}
},
paused : function () {
return ($.inArray((this.settings.$li.index() + 1), this.settings.pause_after)
=== -1);
},
restart : function () {
this.hide();
this.settings.$li = undefined;
this.show('init');
},
if (!/body/i.test(this.settings.$target.selector)) {
var topAdjustment = this.settings.tip_settings.tipAdjustmentY ?
parseInt(this.settings.tip_settings.tipAdjustmentY) : 0,
leftAdjustment = this.settings.tip_settings.tipAdjustmentX ?
parseInt(this.settings.tip_settings.tipAdjustmentX) : 0;
if (this.bottom()) {
if (this.rtl) {
this.settings.$next_tip.css({
top : (this.settings.$target.offset().top + nub_height +
this.settings.$target.outerHeight() + topAdjustment),
left : this.settings.$target.offset().left + this.settings.
$target.outerWidth() - this.settings.$next_tip.outerWidth() + leftAdjustment});
} else {
this.settings.$next_tip.css({
top : (this.settings.$target.offset().top + nub_height +
this.settings.$target.outerHeight() + topAdjustment),
left : this.settings.$target.offset().left + leftAdjustment});
}
this.nub_position($nub, this.settings.tip_settings.nub_position,
'top');
} else if (this.top()) {
if (this.rtl) {
this.settings.$next_tip.css({
top : (this.settings.$target.offset().top - this.settings.
$next_tip.outerHeight() - nub_height + topAdjustment),
left : this.settings.$target.offset().left + this.settings.
$target.outerWidth() - this.settings.$next_tip.outerWidth()});
} else {
this.settings.$next_tip.css({
top : (this.settings.$target.offset().top - this.settings.
$next_tip.outerHeight() - nub_height + topAdjustment),
left : this.settings.$target.offset().left + leftAdjustment});
}
this.nub_position($nub, this.settings.tip_settings.nub_position,
'bottom');
} else if (this.right()) {
this.settings.$next_tip.css({
top : this.settings.$target.offset().top + topAdjustment,
left : (this.settings.$target.outerWidth() + this.settings.
$target.offset().left + nub_width + leftAdjustment)});
this.nub_position($nub, this.settings.tip_settings.nub_position,
'left');
} else if (this.left()) {
this.settings.$next_tip.css({
top : this.settings.$target.offset().top + topAdjustment,
left : (this.settings.$target.offset().left - this.settings.
$next_tip.outerWidth() - nub_width + leftAdjustment)});
this.nub_position($nub, this.settings.tip_settings.nub_position,
'right');
if (!this.visible(this.corners(this.settings.$next_tip)) &&
this.settings.attempts < this.settings.tip_settings.tip_location_pattern.length) {
$nub.removeClass('bottom')
.removeClass('top')
.removeClass('right')
.removeClass('left');
this.settings.tip_settings.tip_location =
this.settings.tip_settings.tip_location_pattern[this.settings.attempts];
this.settings.attempts++;
this.pos_default();
} else if (this.settings.$li.length) {
this.pos_modal($nub);
if (toggle) {
this.settings.$next_tip.hide();
this.settings.$next_tip.css('visibility', 'visible');
}
},
$nub.removeClass('bottom')
.removeClass('top')
.removeClass('right')
.removeClass('left');
if (toggle) {
this.settings.$next_tip.css('visibility', 'hidden');
this.settings.$next_tip.show();
}
if (!/body/i.test(this.settings.$target.selector)) {
if (this.top()) {
this.settings.$next_tip.offset({top : this.settings.
$target.offset().top - tip_height - nub_height});
$nub.addClass('bottom');
} else {
this.settings.$next_tip.offset({top : this.settings.$target.offset().top
+ target_height + nub_height});
$nub.addClass('top');
}
} else if (this.settings.$li.length) {
this.pos_modal($nub);
}
if (toggle) {
this.settings.$next_tip.hide();
this.settings.$next_tip.css('visibility', 'visible');
}
},
this.show_modal();
},
show_modal : function () {
if (!this.settings.$next_tip.data('closed')) {
var joyridemodalbg = $('.joyride-modal-bg');
if (joyridemodalbg.length < 1) {
var joyridemodalbg = $(this.settings.template.modal);
joyridemodalbg.appendTo('body');
}
if (/pop/i.test(this.settings.tip_animation)) {
joyridemodalbg.show();
} else {
joyridemodalbg.fadeIn(this.settings.tip_animation_fade_speed);
}
}
},
expose : function () {
var expose,
exposeCover,
el,
origCSS,
origClasses,
randId = 'expose-' + this.random_str(6);
if (el.length < 1) {
if (window.console) {
console.error('element not valid', el);
}
return false;
}
expose = $(this.settings.template.expose);
this.settings.$body.append(expose);
expose.css({
top : el.offset().top,
left : el.offset().left,
width : el.outerWidth(true),
height : el.outerHeight(true)
});
exposeCover = $(this.settings.template.expose_cover);
origCSS = {
zIndex : el.css('z-index'),
position : el.css('position')
};
if (origCSS.position == 'static') {
el.css('position', 'relative');
}
el.data('expose-css', origCSS);
el.data('orig-class', origClasses);
el.attr('class', origClasses + ' ' + this.settings.expose_add_class);
exposeCover.css({
top : el.offset().top,
left : el.offset().left,
width : el.outerWidth(true),
height : el.outerHeight(true)
});
if (this.settings.modal) {
this.show_modal();
}
this.settings.$body.append(exposeCover);
expose.addClass(randId);
exposeCover.addClass(randId);
el.data('expose', randId);
this.settings.post_expose_callback(this.settings.$li.index(), this.settings.
$next_tip, el);
this.add_exposed(el);
},
un_expose : function () {
var exposeId,
el,
expose,
origCSS,
origClasses,
clearAll = false;
if (el.length < 1) {
if (window.console) {
console.error('element not valid', el);
}
return false;
}
exposeId = el.data('expose');
expose = $('.' + exposeId);
if (arguments.length > 1) {
clearAll = arguments[1];
}
origCSS = el.data('expose-css');
if (origCSS.zIndex == 'auto') {
el.css('z-index', '');
} else {
el.css('z-index', origCSS.zIndex);
}
if (origCSS.position != el.css('position')) {
if (origCSS.position == 'static') {// this is default, no need to set it.
el.css('position', '');
} else {
el.css('position', origCSS.position);
}
}
origClasses = el.data('orig-class');
el.attr('class', origClasses);
el.removeData('orig-classes');
el.removeData('expose');
el.removeData('expose-z-index');
this.remove_exposed(el);
},
while (i--) {
if (this.settings.exposed[i] == search) {
this.settings.exposed.splice(i, 1);
return;
}
}
},
center : function () {
var $w = $(window);
this.settings.$next_tip.css({
top : ((($w.height() - this.settings.$next_tip.outerHeight()) / 2) +
$w.scrollTop()),
left : ((($w.width() - this.settings.$next_tip.outerWidth()) / 2) +
$w.scrollLeft())
});
return true;
},
bottom : function () {
return /bottom/i.test(this.settings.tip_settings.tip_location);
},
top : function () {
return /top/i.test(this.settings.tip_settings.tip_location);
},
right : function () {
return /right/i.test(this.settings.tip_settings.tip_location);
},
left : function () {
return /left/i.test(this.settings.tip_settings.tip_location);
},
return [
el.offset().top < top,
right < el.offset().left + el.outerWidth(),
bottom < el.offset().top + el.outerHeight(),
w.scrollLeft() > el.offset().left
];
},
while (i--) {
if (hidden_corners[i]) {
return false;
}
}
return true;
},
startTimer : function () {
if (this.settings.$li.length) {
this.settings.automate = setTimeout(function () {
this.hide();
this.show();
this.startTimer();
}.bind(this), this.settings.timer);
} else {
clearTimeout(this.settings.automate);
}
},
if (this.settings.timer > 0) {
clearTimeout(this.settings.automate);
}
this.settings.$next_tip.data('closed', true);
this.settings.riding = false;
$('.joyride-modal-bg').hide();
this.settings.$current_tip.hide();
$('.joyride-tip-guide').remove();
},
off : function () {
$(this.scope).off('.joyride');
$(window).off('.joyride');
$('.joyride-close-tip, .joyride-next-tip, .joyride-modal-
bg').off('.joyride');
$('.joyride-tip-guide, .joyride-modal-bg').remove();
clearTimeout(this.settings.automate);
this.settings = {};
},
reflow : function () {}
};
}(jQuery, window, window.document));
Foundation.libs['magellan-expedition'] = {
name : 'magellan-expedition',
version : '5.5.2',
settings : {
active_class : 'active',
threshold : 0, // pixels from the top of the expedition for it to become
fixes
destination_threshold : 20, // pixels from the top of destination for it to
be considered active
throttle_delay : 30, // calculation throttling to increase framerate
fixed_top : 0, // top distance in pixels assigend to the fixed element on
scroll
offset_by_height : true, // whether to offset the destination by the
expedition height. Usually you want this to be true, unless your expedition is on
the side.
duration : 700, // animation duration time
easing : 'swing' // animation easing
},
events : function () {
var self = this,
S = self.S,
settings = self.settings;
S(self.scope)
.off('.magellan')
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-
arrival') + '] a[href*=#]', function (e) {
var sameHost = ((this.hostname === location.hostname) || !this.hostname),
samePath = self.filterPathname(location.pathname) ===
self.filterPathname(this.pathname),
testHash = this.hash.replace(/(:|\.|\/)/g, '\\$1'),
anchor = this;
if (target.length === 0) {
target = $('#' + hash);
check_for_arrivals : function () {
var self = this;
self.update_arrivals();
self.update_expedition_positions();
},
set_expedition_position : function () {
var self = this;
$('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) {
var expedition = $(this),
settings = expedition.data('magellan-expedition-init'),
styles = expedition.attr('styles'), // save styles
top_offset, fixed_top;
expedition.attr('style', '');
top_offset = expedition.offset().top + settings.threshold;
expedition.data(self.data_attr('magellan-top-offset'), top_offset);
expedition.attr('style', styles);
});
},
update_expedition_positions : function () {
var self = this,
window_top_offset = $(window).scrollTop();
update_arrivals : function () {
var self = this,
window_top_offset = $(window).scrollTop();
if (!active_item) {
arrivals.removeClass(settings.active_class);
}
});
},
return str;
},
off : function () {
this.S(this.scope).off('.magellan');
this.S(window).off('.magellan');
},
reflow : function () {
var self = this;
// remove placeholder expeditions used for height calculation purposes
$('[' + self.add_namespace('data-magellan-expedition-clone') + ']',
self.scope).remove();
}
};
}(jQuery, window, window.document));
Foundation.libs.offcanvas = {
name : 'offcanvas',
version : '5.5.2',
settings : {
open_method : 'move',
close_on_click : false
},
events : function () {
var self = this,
S = self.S,
move_class = '',
right_postfix = '',
left_postfix = '';
S(this.scope).off('.offcanvas')
.on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
self.click_toggle_class(e, move_class + right_postfix);
if (self.settings.open_method !== 'overlap') {
S('.left-submenu').removeClass(move_class + right_postfix);
}
$('.left-off-canvas-toggle').attr('aria-expanded', 'true');
})
.on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) {
var settings = self.get_settings(e);
var parent = S(this).parent();
if ($off_canvas.length === 0) {
$off_canvas = this.S('.off-canvas-wrap');
}
return $off_canvas;
},
reflow : function () {}
};
}(jQuery, window, window.document));
self.slides = function () {
return slides_container.children(settings.slide_selector);
};
self.slides().first().addClass(settings.active_slide_class);
self.build_markup = function () {
slides_container.wrap('<div class="' + settings.container_class +
'"></div>');
container = slides_container.parent();
slides_container.addClass(settings.slides_container_class);
if (settings.stack_on_small) {
container.addClass(settings.stack_on_small_class);
}
if (settings.navigation_arrows) {
container.append($('<a
href="#"><span></span></a>').addClass(settings.prev_class));
container.append($('<a
href="#"><span></span></a>').addClass(settings.next_class));
}
if (settings.timer) {
timer_container = $('<div>').addClass(settings.timer_container_class);
timer_container.append('<span>');
timer_container.append($('<div>').addClass(settings.timer_progress_class));
timer_container.addClass(settings.timer_paused_class);
container.append(timer_container);
}
if (settings.slide_number) {
number_container = $('<div>').addClass(settings.slide_number_class);
number_container.append('<span></span> ' + settings.slide_number_text + '
<span></span>');
container.append(number_container);
}
if (settings.bullets) {
bullets_container = $('<ol>').addClass(settings.bullets_container_class);
container.append(bullets_container);
bullets_container.wrap('<div class="orbit-bullets-container"></div>');
self.slides().each(function (idx, el) {
var bullet = $('<li>').attr('data-orbit-slide', idx).on('click',
self.link_bullet);;
bullets_container.append(bullet);
});
}
};
current.css('zIndex', 2);
current.removeClass(settings.active_slide_class);
next.css('zIndex', 4).addClass(settings.active_slide_class);
slides_container.trigger('before-slide-change.fndtn.orbit');
settings.before_slide_change();
self.update_active_link(next_idx);
self.timer_callback = function () {
self._goto(idx + 1, true);
}
self.compute_dimensions = function () {
var current = $(self.slides().get(idx));
var h = current.outerHeight();
if (!settings.variable_height) {
self.slides().each(function(){
if ($(this).outerHeight() > h) { h = $(this).outerHeight(); }
});
}
slides_container.height(h);
};
self.create_timer = function () {
var t = new Timer(
container.find('.' + settings.timer_container_class),
settings,
self.timer_callback
);
return t;
};
self.stop_timer = function () {
if (typeof timer === 'object') {
timer.stop();
}
};
self.toggle_timer = function () {
var t = container.find('.' + settings.timer_container_class);
if (t.hasClass(settings.timer_paused_class)) {
if (typeof timer === 'undefined') {timer = self.create_timer();}
timer.start();
} else {
if (typeof timer === 'object') {timer.stop();}
}
};
self.init = function () {
self.build_markup();
if (settings.timer) {
timer = self.create_timer();
Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
}
animate = new FadeAnimation(settings, slides_container);
if (settings.animation === 'slide') {
animate = new SlideAnimation(settings, slides_container);
}
if (settings.next_on_click) {
container.on('click', '.' + settings.slides_container_class + ' [data-
orbit-slide]', self.link_bullet);
}
container.on('click', self.toggle_timer);
if (settings.swipe) {
container.on('touchstart.fndtn.orbit', function (e) {
if (!e.touches) {e = e.originalEvent;}
var data = {
start_page_x : e.touches[0].pageX,
start_page_y : e.touches[0].pageY,
start_time : (new Date()).getTime(),
delta_x : 0,
is_scrolling : undefined
};
container.data('swipe-transition', data);
e.stopPropagation();
})
.on('touchmove.fndtn.orbit', function (e) {
if (!e.touches) {
e = e.originalEvent;
}
// Ignore pinch/zoom events
if (e.touches.length > 1 || e.scale && e.scale !== 1) {
return;
}
self.init();
};
this.restart = function () {
clearTimeout(timeout);
el.addClass(settings.timer_paused_class);
left = -1;
self.update_progress(0);
};
this.start = function () {
if (!el.hasClass(settings.timer_paused_class)) {return true;}
left = (left === -1) ? duration : left;
el.removeClass(settings.timer_paused_class);
start = new Date().getTime();
progress.animate({'width' : '100%'}, left, 'linear');
timeout = setTimeout(function () {
self.restart();
callback();
}, left);
el.trigger('timer-started.fndtn.orbit')
};
this.stop = function () {
if (el.hasClass(settings.timer_paused_class)) {return true;}
clearTimeout(timeout);
el.addClass(settings.timer_paused_class);
var end = new Date().getTime();
left = left - (end - start);
var w = 100 - ((left / duration) * 100);
self.update_progress(w);
el.trigger('timer-stopped.fndtn.orbit');
};
};
Foundation.libs.orbit = {
name : 'orbit',
version : '5.5.2',
settings : {
animation : 'slide',
timer_speed : 10000,
pause_on_hover : true,
resume_on_mouseout : false,
next_on_click : true,
animation_speed : 500,
stack_on_small : false,
navigation_arrows : true,
slide_number : true,
slide_number_text : 'of',
container_class : 'orbit-container',
stack_on_small_class : 'orbit-stack-on-small',
next_class : 'orbit-next',
prev_class : 'orbit-prev',
timer_container_class : 'orbit-timer',
timer_paused_class : 'paused',
timer_progress_class : 'orbit-progress',
slides_container_class : 'orbit-slides-container',
preloader_class : 'preloader',
slide_selector : '*',
bullets_container_class : 'orbit-bullets',
bullets_active_class : 'active',
slide_number_class : 'orbit-slide-number',
caption_class : 'orbit-caption',
active_slide_class : 'active',
orbit_transition_class : 'orbit-transitioning',
bullets : true,
circular : true,
timer : true,
variable_height : false,
swipe : true,
before_slide_change : noop,
after_slide_change : noop
},
reflow : function () {
var self = this;
if (self.S(self.scope).is('[data-orbit]')) {
var $el = self.S(self.scope);
var instance = $el.data(self.name + '-instance');
instance.compute_dimensions();
} else {
self.S('[data-orbit]', self.scope).each(function (idx, el) {
var $el = self.S(el);
var opts = self.data_options($el);
var instance = $el.data(self.name + '-instance');
instance.compute_dimensions();
});
}
}
};
Foundation.libs.reveal = {
name : 'reveal',
version : '5.5.2',
locked : false,
settings : {
animation : 'fadeAndPop',
animation_speed : 250,
close_on_background_click : true,
close_on_esc : true,
dismiss_modal_class : 'close-reveal-modal',
multiple_opened : false,
bg_class : 'reveal-modal-bg',
root_element : 'body',
open : function(){},
opened : function(){},
close : function(){},
closed : function(){},
on_ajax_error: $.noop,
bg : $('.reveal-modal-bg'),
css : {
open : {
'opacity' : 0,
'visibility' : 'visible',
'display' : 'block'
},
close : {
'opacity' : 1,
'visibility' : 'hidden',
'display' : 'none'
}
}
},
S(this.scope)
.off('.reveal')
.on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') +
']:not([disabled])', function (e) {
e.preventDefault();
if (!self.locked) {
var element = S(this),
ajax = element.data(self.data_attr('reveal-ajax')),
replaceContentSel = element.data(self.data_attr('reveal-replace-
content'));
self.locked = true;
S(document)
.on('click.fndtn.reveal', this.close_targets(), function (e) {
e.preventDefault();
if (!self.locked) {
var settings = S('[' + self.attr_name() +
'].open').data(self.attr_name(true) + '-init') || self.settings,
bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];
if (bg_clicked) {
if (settings.close_on_background_click) {
e.stopPropagation();
} else {
return;
}
}
self.locked = true;
self.close.call(self, bg_clicked ? S('[' + self.attr_name() +
'].open:not(.toback)') : S(this).closest('[' + self.attr_name() + ']'));
}
});
return true;
},
// PATCH #3: turning on key up capture only when a reveal window is open
key_up_on : function (scope) {
var self = this;
// PATCH #1: fixing multiple keyup event trigger from single key press
self.S('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function
( event ) {
var open_modal = self.S('[' + self.attr_name() + '].open'),
settings = open_modal.data(self.attr_name(true) + '-init') ||
self.settings ;
// PATCH #2: making sure that the close event can be called only while
unlocked,
// so that multiple keyup.fndtn.reveal events don't prevent clean
closing of the reveal window.
if ( settings && event.which === 27 && settings.close_on_esc && !
self.locked) { // 27 is the keycode for the Escape key
self.close.call(self, open_modal);
}
});
return true;
},
// PATCH #3: turning on key up capture only when a reveal window is open
key_up_off : function (scope) {
this.S('body').off('keyup.fndtn.reveal');
return true;
},
if (target) {
if (typeof target.selector !== 'undefined') {
// Find the named node; only use the first one found, since the rest of
the code assumes there's only one node
modal = self.S('#' + target.data(self.data_attr('reveal-id'))).first();
} else {
modal = self.S(this.scope);
ajax_settings = target;
}
} else {
modal = self.S(this.scope);
}
if (!modal.hasClass('open')) {
var open_modal = self.S('[' + self.attr_name() + '].open');
modal.attr('tabindex','0').attr('aria-hidden','false');
modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal');
if (open_modal.length < 1) {
this.toggle_bg(modal, true);
}
this.show(modal, settings.css.open);
} else {
var old_success = typeof ajax_settings.success !== 'undefined' ?
ajax_settings.success : null;
$.extend(ajax_settings, {
success : function (data, textStatus, jqXHR) {
if ( $.isFunction(old_success) ) {
var result = old_success(data, textStatus, jqXHR);
if (typeof result == 'string') {
data = result;
}
}
self.S(modal).foundation('section', 'reflow');
self.S(modal).children().foundation();
if (open_modal.length > 0) {
if (settings.multiple_opened) {
self.to_back(open_modal);
} else {
self.hide(open_modal, settings.css.close);
}
}
self.show(modal, settings.css.open);
}
});
$.ajax(ajax_settings);
}
}
self.S(window).trigger('resize');
},
if (open_modals.length > 0) {
modal.removeAttr('tabindex','0').attr('aria-hidden','true');
this.locked = true;
this.key_up_off(modal); // PATCH #3: turning on key up capture only when
a reveal window is open
modal.trigger('close.fndtn.reveal');
if (settings.multiple_opened) {
self.hide(modal, settings.css.close, settings);
self.to_front($($.makeArray(open_modals).reverse()[1]));
} else {
self.hide(open_modals, settings.css.close, settings);
}
}
},
close_targets : function () {
var base = '.' + this.settings.dismiss_modal_class;
if (this.settings.close_on_background_click) {
return base + ', .' + this.settings.bg_class;
}
return base;
},
if (el.parent(root_element).length === 0) {
var placeholder = el.wrap('<div style="display: none;" />').parent();
el.on('closed.fndtn.reveal.wrapped', function () {
el.detach().appendTo(placeholder);
el.unwrap().unbind('closed.fndtn.reveal.wrapped');
});
el.detach().appendTo(root_element);
}
return setTimeout(function () {
return el
.css(css)
.animate(end_css, settings.animation_speed, 'linear', function () {
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
.addClass('open');
}, settings.animation_speed / 2);
}
if (animData.fade) {
css.top = $(window).scrollTop() + el.data('css-top') + 'px';
var end_css = {opacity: 1};
return setTimeout(function () {
return el
.css(css)
.animate(end_css, settings.animation_speed, 'linear', function () {
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
.addClass('open');
}, settings.animation_speed / 2);
}
return el.css(css).show().css({opacity :
1}).addClass('open').trigger('opened.fndtn.reveal');
}
this.locked = false;
return el.show();
},
to_back : function(el) {
el.addClass('toback');
},
to_front : function(el) {
el.removeClass('toback');
},
return setTimeout(function () {
return el
.animate(end_css, settings.animation_speed, 'linear', function () {
context.locked = false;
el.css(css).trigger('closed.fndtn.reveal');
})
.removeClass('open');
}, settings.animation_speed / 2);
}
if (animData.fade) {
var end_css = {opacity : 0};
return setTimeout(function () {
return el
.animate(end_css, settings.animation_speed, 'linear', function () {
context.locked = false;
el.css(css).trigger('closed.fndtn.reveal');
})
.removeClass('open');
}, settings.animation_speed / 2);
}
return
el.hide().css(css).removeClass('open').trigger('closed.fndtn.reveal');
}
return el.hide();
},
if (iframe.length > 0) {
iframe.attr('data-src', iframe[0].src);
iframe.attr('src', iframe.attr('src'));
video.hide();
}
},
if (iframe.length > 0) {
var data_src = iframe.attr('data-src');
if (typeof data_src === 'string') {
iframe[0].src = iframe.attr('data-src');
} else {
var src = iframe[0].src;
iframe[0].src = undefined;
iframe[0].src = src;
}
video.show();
}
},
return str;
},
cache_offset : function (modal) {
var offset = modal.show().height() + parseInt(modal.css('top'), 10) +
modal.scrollY;
modal.hide();
return offset;
},
off : function () {
$(this.scope).off('.fndtn.reveal');
},
reflow : function () {}
};
/*
* getAnimationData('popAndFade') // {animate: true, pop: true, fade: true}
* getAnimationData('fade') // {animate: true, pop: false, fade: true}
* getAnimationData('pop') // {animate: true, pop: true, fade: false}
* getAnimationData('foo') // {animate: false, pop: false, fade: false}
* getAnimationData(null) // {animate: false, pop: false, fade: false}
*/
function getAnimationData(str) {
var fade = /fade/i.test(str);
var pop = /pop/i.test(str);
return {
animate : fade || pop,
pop : pop,
fade : fade
};
}
}(jQuery, window, window.document));
Foundation.libs.slider = {
name : 'slider',
version : '5.5.2',
settings : {
start : 0,
end : 100,
step : 1,
precision : null,
initial : null,
display_selector : '',
vertical : false,
trigger_input_change : false,
on_change : function () {}
},
cache : {},
events : function () {
var self = this;
$(this.scope)
.off('.slider')
.on('mousedown.fndtn.slider touchstart.fndtn.slider
pointerdown.fndtn.slider',
'[' + self.attr_name() + ']:not(.disabled, [disabled]) .range-slider-
handle', function (e) {
if (!self.cache.active) {
e.preventDefault();
self.set_active_slider($(e.target));
}
})
.on('mousemove.fndtn.slider touchmove.fndtn.slider
pointermove.fndtn.slider', function (e) {
if (!!self.cache.active) {
e.preventDefault();
if ($.data(self.cache.active[0], 'settings').vertical) {
var scroll_offset = 0;
if (!e.pageY) {
scroll_offset = window.scrollY;
}
self.calculate_position(self.cache.active,
self.get_cursor_position(e, 'y') + scroll_offset);
} else {
self.calculate_position(self.cache.active,
self.get_cursor_position(e, 'x'));
}
}
})
.on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider',
function (e) {
self.remove_active_slider();
})
.on('change.fndtn.slider', function (e) {
self.settings.on_change();
});
self.S(window)
.on('resize.fndtn.slider', self.throttle(function (e) {
self.reflow();
}, 300));
if (settings.display_selector != '') {
$(settings.display_selector).each(function(){
if (this.hasOwnProperty('value')) {
$(this).change(function(){
// is there a better way to do this?
slider.foundation("slider", "set_value", $(this).val());
});
}
});
}
});
},
return position;
},
remove_active_slider : function () {
this.cache.active = null;
},
requestAnimationFrame(function () {
var pct;
self.set_ui($handle, norm);
});
},
if (settings.vertical) {
$handle.siblings('.range-slider-active-segment').css('height',
progress_bar_length + '%');
} else {
$handle.siblings('.range-slider-active-segment').css('width',
progress_bar_length + '%');
}
$handle_parent.attr(this.attr_name(), value).trigger('change.fndtn.slider');
$hidden_inputs.val(value);
if (settings.trigger_input_change) {
$hidden_inputs.trigger('change.fndtn.slider');
}
if (!$handle[0].hasAttribute('aria-valuemin')) {
$handle.attr({
'aria-valuemin' : settings.start,
'aria-valuemax' : settings.end
});
}
$handle.attr('aria-valuenow', value);
if (settings.display_selector != '') {
$(settings.display_selector).each(function () {
if (this.hasAttribute('value')) {
$(this).val(value);
} else {
$(this).text(value);
}
});
}
},
if (settings.vertical) {
$.data(handle, 'bar_o', $(handle).parent().offset().top);
$.data(handle, 'bar_l', $(handle).parent().outerHeight());
$.data(handle, 'handle_o', $(handle).offset().top);
$.data(handle, 'handle_l', $(handle).outerHeight());
} else {
$.data(handle, 'bar_o', $(handle).parent().offset().left);
$.data(handle, 'bar_l', $(handle).parent().outerWidth());
$.data(handle, 'handle_o', $(handle).offset().left);
$.data(handle, 'handle_l', $(handle).outerWidth());
}
reflow : function () {
var self = this;
self.S('[' + this.attr_name() + ']').each(function () {
var handle = $(this).children('.range-slider-handle')[0],
val = $(this).attr(self.attr_name());
self.initialize_settings(handle);
if (val) {
self.set_ui($(handle), parseFloat(val));
} else {
self.set_initial_position($(this));
}
});
}
};
Foundation.libs.tab = {
name : 'tab',
version : '5.5.2',
settings : {
active_class : 'active',
callback : function () {},
deep_linking : false,
scroll_to_content : true,
is_hover : false
},
default_tab_hashes : [],
// store the initial href, which is used to allow correct behaviour of the
// browser back button when deep linking is turned on.
self.entry_location = window.location.href;
this.bindings(method, options);
this.handle_location_hash_change();
},
events : function () {
var self = this,
S = this.S;
S(this.scope)
.off('.tab')
// Key event: focus/tab key
.on('keydown.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e)
{
var el = this;
var keyCode = e.keyCode || e.which;
// if user pressed tab key
if (keyCode == 9) {
e.preventDefault();
// TODO: Change usual_tab_behavior into accessibility function?
usual_tab_behavior(e, el);
}
})
// Click event: tab title
.on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {
var el = this;
usual_tab_behavior(e, el);
})
// Hover event: tab title
.on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function
(e) {
var settings = S(this).closest('[' + self.attr_name() +
']').data(self.attr_name(true) + '-init');
if (settings.is_hover) {
self.toggle_active_tab(S(this).parent());
}
});
// Location hash change event
S(window).on('hashchange.fndtn.tab', function (e) {
e.preventDefault();
self.handle_location_hash_change();
});
},
handle_location_hash_change : function () {
switch (e.keyCode) {
case 37:
$target = $prev;
break;
case 39:
$target = $next;
break;
default:
$target = false
break;
}
if ($target.length) {
$original.attr({
'tabindex' : '-1',
'aria-selected' : null
});
$target.attr({
'tabindex' : '0',
'aria-selected' : true
}).focus();
}
// Hide panels
$('[role="tabpanel"]')
.attr('aria-hidden', 'true');
$('#' + $(document.activeElement).attr('href').substring(1))
.attr('aria-hidden', null);
},
go_to_hash = function(hash) {
// This function allows correct behaviour of the browser's back button
when deep linking is enabled. Without it
// the user would get continually redirected to the default hash.
var is_entry_location = window.location.href === self.entry_location,
default_hash = settings.scroll_to_content ?
self.default_tab_hashes[0] : is_entry_location ? window.location.hash :'fndtn-' +
self.default_tab_hashes[0].replace('#', '')
if (settings.deep_linking) {
if (settings.scroll_to_content) {
tab_link.off('keydown').on('keydown', interpret_keyup_action );
},
reflow : function () {}
};
}(jQuery, window, window.document));
Foundation.libs.tooltip = {
name : 'tooltip',
version : '5.5.2',
settings : {
additional_inheritable_classes : [],
tooltip_class : '.tooltip',
append_to : 'body',
touch_close_text : 'Tap To Close',
disable_for_touch : false,
hover_delay : 200,
show_on : 'all',
tip_template : function (selector, content) {
return '<span data-selector="' + selector + '" id="' + selector + '"
class="'
+ Foundation.libs.tooltip.settings.tooltip_class.substring(1)
+ '" role="tooltip">' + content + '<span class="nub"></span></span>';
}
},
cache : {},
medium : function () {
return matchMedia(Foundation.media_queries['medium']).matches;
},
large : function () {
return matchMedia(Foundation.media_queries['large']).matches;
},
self.create(this.S(instance));
if (immediate) {
elt.timer = null;
self.showTip($this);
} else {
elt.timer = setTimeout(function () {
elt.timer = null;
self.showTip($this);
}.bind(elt), self.settings.hover_delay);
}
}
self.hide($this);
}
$(this.scope)
.off('.tooltip')
.on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip
touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip',
'[' + this.attr_name() + ']', function (e) {
var $this = S(this),
settings = $.extend({}, self.settings, self.data_options($this)),
is_touch = false;
if ($this.hasClass('open')) {
if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
e.preventDefault();
}
self.hide($this);
} else {
if (settings.disable_for_touch && Modernizr.touch && /touchstart|
MSPointerDown/i.test(e.type)) {
return;
} else if (!settings.disable_for_touch && Modernizr.touch &&
/touchstart|MSPointerDown/i.test(e.type)) {
e.preventDefault();
S(settings.tooltip_class + '.open').hide();
is_touch = true;
// close other open tooltips on touch
if ($('.open[' + self.attr_name() + ']').length > 0) {
var prevOpen = S($('.open[' + self.attr_name() + ']')[0]);
self.hide(prevOpen);
}
}
if (/enter|over/i.test(e.type)) {
_startShow(this, $this);
if (selector) {
tip = this.S('span[data-selector="' + selector + '"]' +
settings.tooltip_class);
}
return dataSelector;
},
$tip.addClass(classes).appendTo(settings.append_to);
if (Modernizr.touch) {
$tip.append('<span class="tap-to-close">' + settings.touch_close_text +
'</span>');
$tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function
(e) {
self.hide($target);
});
}
$target.removeAttr('title').attr('title', '');
},
width = target.data('width');
nub = tip.children('.nub');
nubHeight = nub.outerHeight();
nubWidth = nub.outerHeight();
if (this.small()) {
tip.css({'width' : '100%'});
} else {
tip.css({'width' : (width) ? width : 'auto'});
}
if (this.small()) {
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto',
'auto', 12.5, $(this.scope).width());
tip.addClass('tip-override');
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
} else {
var left = target.offset().left;
if (Foundation.rtl) {
nub.addClass('rtl');
left = target.offset().left + target.outerWidth() - tip.outerWidth();
}
tip.removeClass('tip-override');
if (classes && classes.indexOf('tip-top') > -1) {
if (Foundation.rtl) {
nub.addClass('rtl');
}
objPos(tip, (target.offset().top - tip.outerHeight()), 'auto', 'auto',
left)
.removeClass('tip-override');
} else if (classes && classes.indexOf('tip-left') > -1) {
objPos(tip, (target.offset().top + (target.outerHeight() / 2) -
(tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left - tip.outerWidth()
- nubHeight))
.removeClass('tip-override');
nub.removeClass('rtl');
} else if (classes && classes.indexOf('tip-right') > -1) {
objPos(tip, (target.offset().top + (target.outerHeight() / 2) -
(tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left +
target.outerWidth() + nubHeight))
.removeClass('tip-override');
nub.removeClass('rtl');
}
}
tip.css('visibility', 'visible').hide();
},
small : function () {
return matchMedia(Foundation.media_queries.small).matches &&
!matchMedia(Foundation.media_queries.medium).matches;
},
return $.trim(filtered);
},
if ($tip.find('.tap-to-close').length === 0) {
$tip.append('<span class="tap-to-close">' + settings.touch_close_text +
'</span>');
$tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose
MSPointerDown.fndtn.tooltip.tapclose', function (e) {
self.hide($target);
});
}
$target.data('tooltip-open-event-type', 'touch');
},
if ($target.data('tooltip-open-event-type') == 'touch') {
this.convert_to_touch($target);
}
off : function () {
var self = this;
this.S(this.scope).off('.fndtn.tooltip');
this.S(this.settings.tooltip_class).each(function (i) {
$('[' + self.attr_name() + ']').eq(i).attr('title', $(this).text());
}).remove();
},
reflow : function () {}
};
}(jQuery, window, window.document));
Foundation.libs.topbar = {
name : 'topbar',
version : '5.5.2',
settings : {
index : 0,
start_offset : 0,
sticky_class : 'sticky',
custom_back_text : true,
back_text : 'Back',
mobile_show_parent_link : true,
is_hover : true,
scrolltop : true, // jump to top when sticky nav menu toggle is clicked
sticky_on : 'all',
dropdown_autoclose: true
},
self.register_media('topbar', 'foundation-mq-topbar');
this.bindings(method, options);
if (!settings.assembled) {
self.assemble(topbar);
}
if (settings.is_hover) {
self.S('.has-dropdown', topbar).addClass('not-click');
} else {
self.S('.has-dropdown', topbar).removeClass('not-click');
}
if (topbarContainer.hasClass('fixed')) {
self.S('body').addClass('f-topbar-fixed');
}
});
},
return false;
},
if (toggleEl) {
topbar = self.S(toggleEl).closest('[' + this.attr_name() + ']');
} else {
topbar = self.S('[' + this.attr_name() + ']');
}
if (self.breakpoint()) {
if (!self.rtl) {
section.css({left : '0%'});
$('>.name', section).css({left : '100%'});
} else {
section.css({right : '0%'});
$('>.name', section).css({right : '100%'});
}
self.S('li.moved', section).removeClass('moved');
topbar.data('index', 0);
topbar
.toggleClass('expanded')
.css('height', '');
}
if (settings.scrolltop) {
if (!topbar.hasClass('expanded')) {
if (topbar.hasClass('fixed')) {
topbar.parent().addClass('fixed');
topbar.removeClass('fixed');
self.S('body').addClass('f-topbar-fixed');
}
} else if (topbar.parent().hasClass('fixed')) {
if (settings.scrolltop) {
topbar.parent().removeClass('fixed');
topbar.addClass('fixed');
self.S('body').removeClass('f-topbar-fixed');
window.scrollTo(0, 0);
} else {
topbar.parent().removeClass('expanded');
}
}
} else {
if (self.is_sticky(topbar, topbar.parent(), settings)) {
topbar.parent().addClass('fixed');
}
if (topbar.parent().hasClass('fixed')) {
if (!topbar.hasClass('expanded')) {
topbar.removeClass('fixed');
topbar.parent().removeClass('expanded');
self.update_sticky_positioning();
} else {
topbar.addClass('fixed');
topbar.parent().addClass('expanded');
self.S('body').addClass('f-topbar-fixed');
}
}
}
},
timer : null,
S(this.scope)
.off('.topbar')
.on('click.fndtn.topbar', '[' + this.attr_name() + '] .toggle-topbar',
function (e) {
e.preventDefault();
self.toggle(this);
})
.on('click.fndtn.topbar contextmenu.fndtn.topbar', '.top-bar .top-bar-
section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li
a[href^="#"]', function (e) {
var li = $(this).closest('li'),
topbar = li.closest('[' + self.attr_name() + ']'),
settings = topbar.data(self.attr_name(true) + '-init');
})
.on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown',
function (e) {
var li = S(this),
target = S(e.target),
topbar = li.closest('[' + self.attr_name() + ']'),
settings = topbar.data(self.attr_name(true) + '-init');
if (target.data('revealId')) {
self.toggle();
return;
}
if (self.breakpoint()) {
return;
}
e.stopImmediatePropagation();
if (li.hasClass('hover')) {
li
.removeClass('hover')
.find('li')
.removeClass('hover');
li.parents('li.hover')
.removeClass('hover');
} else {
li.addClass('hover');
$(li).siblings().removeClass('hover');
e.preventDefault();
if (!self.rtl) {
section.css({left : -(100 * topbar.data('index')) + '%'});
section.find('>.name').css({left : 100 * topbar.data('index') +
'%'});
} else {
section.css({right : -(100 * topbar.data('index')) + '%'});
section.find('>.name').css({right : 100 * topbar.data('index') +
'%'});
}
topbar.css('height', $this.siblings('ul').outerHeight(true) +
topbar.data('height'));
}
});
S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function ()
{
self.resize.call(self);
}, 50)).trigger('resize.fndtn.topbar').load(function () {
// Ensure that the offset is calculated after all of the pages resources
have loaded
S(this).trigger('resize.fndtn.topbar');
});
if (parent.length > 0) {
return;
}
S('[' + self.attr_name() + '] li.hover').removeClass('hover');
});
// Go up a level on Click
S(this.scope).on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-
dropdown .back', function (e) {
e.preventDefault();
if (!self.rtl) {
section.css({left : -(100 * topbar.data('index')) + '%'});
section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
} else {
section.css({right : -(100 * topbar.data('index')) + '%'});
section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
}
if (topbar.data('index') === 0) {
topbar.css('height', '');
} else {
topbar.css('height', $previousLevelUl.outerHeight(true) +
topbar.data('height'));
}
setTimeout(function () {
$movedLi.removeClass('moved');
}, 300);
});
resize : function () {
var self = this;
self.S('[' + this.attr_name() + ']').each(function () {
var topbar = self.S(this),
settings = topbar.data(self.attr_name(true) + '-init');
if (!self.breakpoint()) {
var doToggle = topbar.hasClass('expanded');
topbar
.css('height', '')
.removeClass('expanded')
.find('li')
.removeClass('hover');
if (doToggle) {
self.toggle(topbar);
}
}
stickyOffset = stickyContainer.offset().top;
if (self.S(document.body).hasClass('f-topbar-fixed')) {
stickyOffset -= topbar.data('height');
}
topbar.data('stickyoffset', stickyOffset);
stickyContainer.addClass('fixed');
} else {
stickyOffset = stickyContainer.offset().top;
topbar.data('stickyoffset', stickyOffset);
}
}
});
},
breakpoint : function () {
return !matchMedia(Foundation.media_queries['topbar']).matches;
},
small : function () {
return matchMedia(Foundation.media_queries['small']).matches;
},
medium : function () {
return matchMedia(Foundation.media_queries['medium']).matches;
},
large : function () {
return matchMedia(Foundation.media_queries['large']).matches;
},
self.S('.has-dropdown>a', section).each(function () {
var $link = self.S(this),
$dropdown = $link.siblings('.dropdown'),
url = $link.attr('href'),
$titleLi;
if (!$dropdown.find('.title.back').length) {
this.assembled(topbar);
},
return total;
},
sticky : function () {
var self = this;
this.S(window).on('scroll', function () {
self.update_sticky_positioning();
});
},
update_sticky_positioning : function () {
var klass = '.' + this.settings.sticky_class,
$window = this.S(window),
self = this;
if (self.settings.sticky_topbar &&
self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(),
this.settings)) {
var distance = this.settings.sticky_topbar.data('stickyoffset') +
this.settings.start_offset;
if (!self.S(klass).hasClass('expanded')) {
if ($window.scrollTop() > (distance)) {
if (!self.S(klass).hasClass('fixed')) {
self.S(klass).addClass('fixed');
self.S('body').addClass('f-topbar-fixed');
}
} else if ($window.scrollTop() <= distance) {
if (self.S(klass).hasClass('fixed')) {
self.S(klass).removeClass('fixed');
self.S('body').removeClass('f-topbar-fixed');
}
}
}
}
},
off : function () {
this.S(this.scope).off('.fndtn.topbar');
this.S(window).off('.fndtn.topbar');
},
reflow : function () {}
};
}(jQuery, window, window.document));