You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by sp...@apache.org on 2016/12/13 16:12:21 UTC
[3/9] incubator-quickstep-site git commit: install jekyll,
an automated blogging framework
http://git-wip-us.apache.org/repos/asf/incubator-quickstep-site/blob/3e7c96b9/js/vendor/foundation.js
----------------------------------------------------------------------
diff --git a/js/vendor/foundation.js b/js/vendor/foundation.js
deleted file mode 100644
index 6ae658a..0000000
--- a/js/vendor/foundation.js
+++ /dev/null
@@ -1,1884 +0,0 @@
-!function ($) {
-
- "use strict";
-
- var FOUNDATION_VERSION = '6.2.2';
-
- // Global Foundation object
- // This is attached to the window, or used as a module for AMD/Browserify
- var Foundation = {
- version: FOUNDATION_VERSION,
-
- /**
- * Stores initialized plugins.
- */
- _plugins: {},
-
- /**
- * Stores generated unique ids for plugin instances
- */
- _uuids: [],
-
- /**
- * Returns a boolean for RTL support
- */
- rtl: function () {
- return $('html').attr('dir') === 'rtl';
- },
- /**
- * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.
- * @param {Object} plugin - The constructor of the plugin.
- */
- plugin: function (plugin, name) {
- // Object key to use when adding to global Foundation object
- // Examples: Foundation.Reveal, Foundation.OffCanvas
- var className = name || functionName(plugin);
- // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin
- // Examples: data-reveal, data-off-canvas
- var attrName = hyphenate(className);
-
- // Add to the Foundation object and the plugins list (for reflowing)
- this._plugins[attrName] = this[className] = plugin;
- },
- /**
- * @function
- * Populates the _uuids array with pointers to each individual plugin instance.
- * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.
- * Also fires the initialization event for each plugin, consolidating repetitive code.
- * @param {Object} plugin - an instance of a plugin, usually `this` in context.
- * @param {String} name - the name of the plugin, passed as a camelCased string.
- * @fires Plugin#init
- */
- registerPlugin: function (plugin, name) {
- var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();
- plugin.uuid = this.GetYoDigits(6, pluginName);
-
- if (!plugin.$element.attr('data-' + pluginName)) {
- plugin.$element.attr('data-' + pluginName, plugin.uuid);
- }
- if (!plugin.$element.data('zfPlugin')) {
- plugin.$element.data('zfPlugin', plugin);
- }
- /**
- * Fires when the plugin has initialized.
- * @event Plugin#init
- */
- plugin.$element.trigger('init.zf.' + pluginName);
-
- this._uuids.push(plugin.uuid);
-
- return;
- },
- /**
- * @function
- * Removes the plugins uuid from the _uuids array.
- * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.
- * Also fires the destroyed event for the plugin, consolidating repetitive code.
- * @param {Object} plugin - an instance of a plugin, usually `this` in context.
- * @fires Plugin#destroyed
- */
- unregisterPlugin: function (plugin) {
- var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));
-
- this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);
- plugin.$element.removeAttr('data-' + pluginName).removeData('zfPlugin')
- /**
- * Fires when the plugin has been destroyed.
- * @event Plugin#destroyed
- */
- .trigger('destroyed.zf.' + pluginName);
- for (var prop in plugin) {
- plugin[prop] = null; //clean up script to prep for garbage collection.
- }
- return;
- },
-
- /**
- * @function
- * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.
- * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'`
- * @default If no argument is passed, reflow all currently active plugins.
- */
- reInit: function (plugins) {
- var isJQ = plugins instanceof $;
- try {
- if (isJQ) {
- plugins.each(function () {
- $(this).data('zfPlugin')._init();
- });
- } else {
- var type = typeof plugins,
- _this = this,
- fns = {
- 'object': function (plgs) {
- plgs.forEach(function (p) {
- p = hyphenate(p);
- $('[data-' + p + ']').foundation('_init');
- });
- },
- 'string': function () {
- plugins = hyphenate(plugins);
- $('[data-' + plugins + ']').foundation('_init');
- },
- 'undefined': function () {
- this['object'](Object.keys(_this._plugins));
- }
- };
- fns[type](plugins);
- }
- } catch (err) {
- console.error(err);
- } finally {
- return plugins;
- }
- },
-
- /**
- * returns a random base-36 uid with namespacing
- * @function
- * @param {Number} length - number of random base-36 digits desired. Increase for more random strings.
- * @param {String} namespace - name of plugin to be incorporated in uid, optional.
- * @default {String} '' - if no plugin name is provided, nothing is appended to the uid.
- * @returns {String} - unique id
- */
- GetYoDigits: function (length, namespace) {
- length = length || 6;
- return Math.round(Math.pow(36, length + 1) - Math.random() * Math.pow(36, length)).toString(36).slice(1) + (namespace ? '-' + namespace : '');
- },
- /**
- * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.
- * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.
- * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.
- */
- reflow: function (elem, plugins) {
-
- // If plugins is undefined, just grab everything
- if (typeof plugins === 'undefined') {
- plugins = Object.keys(this._plugins);
- }
- // If plugins is a string, convert it to an array with one item
- else if (typeof plugins === 'string') {
- plugins = [plugins];
- }
-
- var _this = this;
-
- // Iterate through each plugin
- $.each(plugins, function (i, name) {
- // Get the current plugin
- var plugin = _this._plugins[name];
-
- // Localize the search to all elements inside elem, as well as elem itself, unless elem === document
- var $elem = $(elem).find('[data-' + name + ']').addBack('[data-' + name + ']');
-
- // For each plugin found, initialize it
- $elem.each(function () {
- var $el = $(this),
- opts = {};
- // Don't double-dip on plugins
- if ($el.data('zfPlugin')) {
- console.warn("Tried to initialize " + name + " on an element that already has a Foundation plugin.");
- return;
- }
-
- if ($el.attr('data-options')) {
- var thing = $el.attr('data-options').split(';').forEach(function (e, i) {
- var opt = e.split(':').map(function (el) {
- return el.trim();
- });
- if (opt[0]) opts[opt[0]] = parseValue(opt[1]);
- });
- }
- try {
- $el.data('zfPlugin', new plugin($(this), opts));
- } catch (er) {
- console.error(er);
- } finally {
- return;
- }
- });
- });
- },
- getFnName: functionName,
- transitionend: function ($elem) {
- var transitions = {
- 'transition': 'transitionend',
- 'WebkitTransition': 'webkitTransitionEnd',
- 'MozTransition': 'transitionend',
- 'OTransition': 'otransitionend'
- };
- var elem = document.createElement('div'),
- end;
-
- for (var t in transitions) {
- if (typeof elem.style[t] !== 'undefined') {
- end = transitions[t];
- }
- }
- if (end) {
- return end;
- } else {
- end = setTimeout(function () {
- $elem.triggerHandler('transitionend', [$elem]);
- }, 1);
- return 'transitionend';
- }
- }
- };
-
- Foundation.util = {
- /**
- * Function for applying a debounce effect to a function call.
- * @function
- * @param {Function} func - Function to be called at end of timeout.
- * @param {Number} delay - Time in ms to delay the call of `func`.
- * @returns function
- */
- 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);
- }
- };
- }
- };
-
- // TODO: consider not making this a jQuery function
- // TODO: need way to reflow vs. re-initialize
- /**
- * The Foundation jQuery method.
- * @param {String|Array} method - An action to perform on the current jQuery object.
- */
- var foundation = function (method) {
- var type = typeof method,
- $meta = $('meta.foundation-mq'),
- $noJS = $('.no-js');
-
- if (!$meta.length) {
- $('<meta class="foundation-mq">').appendTo(document.head);
- }
- if ($noJS.length) {
- $noJS.removeClass('no-js');
- }
-
- if (type === 'undefined') {
- //needs to initialize the Foundation object, or an individual plugin.
- Foundation.MediaQuery._init();
- Foundation.reflow(this);
- } else if (type === 'string') {
- //an individual method to invoke on a plugin or group of plugins
- var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary
- var plugClass = this.data('zfPlugin'); //determine the class of plugin
-
- if (plugClass !== undefined && plugClass[method] !== undefined) {
- //make sure both the class and method exist
- if (this.length === 1) {
- //if there's only one, call it directly.
- plugClass[method].apply(plugClass, args);
- } else {
- this.each(function (i, el) {
- //otherwise loop through the jQuery collection and invoke the method on each
- plugClass[method].apply($(el).data('zfPlugin'), args);
- });
- }
- } else {
- //error for no class or no method
- throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.');
- }
- } else {
- //error for invalid argument type
- throw new TypeError('We\'re sorry, ' + type + ' is not a valid parameter. You must use a string representing the method you wish to invoke.');
- }
- return this;
- };
-
- window.Foundation = Foundation;
- $.fn.foundation = foundation;
-
- // Polyfill for requestAnimationFrame
- (function () {
- if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () {
- return new Date().getTime();
- };
-
- var vendors = ['webkit', 'moz'];
- for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
- var vp = vendors[i];
- window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
- window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame'];
- }
- if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
- var lastTime = 0;
- window.requestAnimationFrame = function (callback) {
- var now = Date.now();
- var nextTime = Math.max(lastTime + 16, now);
- return setTimeout(function () {
- callback(lastTime = nextTime);
- }, nextTime - now);
- };
- window.cancelAnimationFrame = clearTimeout;
- }
- /**
- * Polyfill for performance.now, required by rAF
- */
- if (!window.performance || !window.performance.now) {
- window.performance = {
- start: Date.now(),
- now: function () {
- return Date.now() - this.start;
- }
- };
- }
- })();
- if (!Function.prototype.bind) {
- Function.prototype.bind = function (oThis) {
- if (typeof this !== 'function') {
- // closest thing possible to the ECMAScript 5
- // internal IsCallable function
- throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
- }
-
- var aArgs = Array.prototype.slice.call(arguments, 1),
- fToBind = this,
- fNOP = function () {},
- fBound = function () {
- return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
- };
-
- if (this.prototype) {
- // native functions don't have a prototype
- fNOP.prototype = this.prototype;
- }
- fBound.prototype = new fNOP();
-
- return fBound;
- };
- }
- // Polyfill to get the name of a function in IE9
- function functionName(fn) {
- if (Function.prototype.name === undefined) {
- var funcNameRegex = /function\s([^(]{1,})\(/;
- var results = funcNameRegex.exec(fn.toString());
- return results && results.length > 1 ? results[1].trim() : "";
- } else if (fn.prototype === undefined) {
- return fn.constructor.name;
- } else {
- return fn.prototype.constructor.name;
- }
- }
- function parseValue(str) {
- if (/true/.test(str)) return true;else if (/false/.test(str)) return false;else if (!isNaN(str * 1)) return parseFloat(str);
- return str;
- }
- // Convert PascalCase to kebab-case
- // Thank you: http://stackoverflow.com/a/8955580
- function hyphenate(str) {
- return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
- }
-}(jQuery);
-'use strict';
-
-!function ($) {
-
- // Default set of media queries
- var defaultQueries = {
- 'default': 'only screen',
- 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)'
- };
-
- var MediaQuery = {
- queries: [],
-
- current: '',
-
- /**
- * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.
- * @function
- * @private
- */
- _init: function () {
- var self = this;
- var extractedStyles = $('.foundation-mq').css('font-family');
- var namedQueries;
-
- namedQueries = parseStyleToObject(extractedStyles);
-
- for (var key in namedQueries) {
- if (namedQueries.hasOwnProperty(key)) {
- self.queries.push({
- name: key,
- value: 'only screen and (min-width: ' + namedQueries[key] + ')'
- });
- }
- }
-
- this.current = this._getCurrentSize();
-
- this._watcher();
- },
-
-
- /**
- * Checks if the screen is at least as wide as a breakpoint.
- * @function
- * @param {String} size - Name of the breakpoint to check.
- * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.
- */
- atLeast: function (size) {
- var query = this.get(size);
-
- if (query) {
- return window.matchMedia(query).matches;
- }
-
- return false;
- },
-
-
- /**
- * Gets the media query of a breakpoint.
- * @function
- * @param {String} size - Name of the breakpoint to get.
- * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.
- */
- get: function (size) {
- for (var i in this.queries) {
- if (this.queries.hasOwnProperty(i)) {
- var query = this.queries[i];
- if (size === query.name) return query.value;
- }
- }
-
- return null;
- },
-
-
- /**
- * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).
- * @function
- * @private
- * @returns {String} Name of the current breakpoint.
- */
- _getCurrentSize: function () {
- var matched;
-
- for (var i = 0; i < this.queries.length; i++) {
- var query = this.queries[i];
-
- if (window.matchMedia(query.value).matches) {
- matched = query;
- }
- }
-
- if (typeof matched === 'object') {
- return matched.name;
- } else {
- return matched;
- }
- },
-
-
- /**
- * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.
- * @function
- * @private
- */
- _watcher: function () {
- var _this = this;
-
- $(window).on('resize.zf.mediaquery', function () {
- var newSize = _this._getCurrentSize(),
- currentSize = _this.current;
-
- if (newSize !== currentSize) {
- // Change the current media query
- _this.current = newSize;
-
- // Broadcast the media query change on the window
- $(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);
- }
- });
- }
- };
-
- Foundation.MediaQuery = MediaQuery;
-
- // 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
- window.matchMedia || (window.matchMedia = function () {
- 'use strict';
-
- // For browsers that support matchMedium api such as IE 9 and webkit
-
- var styleMedia = window.styleMedia || window.media;
-
- // For those that don't support matchMedium
- if (!styleMedia) {
- var style = document.createElement('style'),
- script = document.getElementsByTagName('script')[0],
- info = null;
-
- style.type = 'text/css';
- style.id = 'matchmediajs-test';
-
- script.parentNode.insertBefore(style, script);
-
- // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
- info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle;
-
- styleMedia = {
- matchMedium: function (media) {
- var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
-
- // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
- if (style.styleSheet) {
- style.styleSheet.cssText = text;
- } else {
- style.textContent = text;
- }
-
- // Test if media query is true or false
- return info.width === '1px';
- }
- };
- }
-
- return function (media) {
- return {
- matches: styleMedia.matchMedium(media || 'all'),
- media: media || 'all'
- };
- };
- }());
-
- // Thank you: https://github.com/sindresorhus/query-string
- function parseStyleToObject(str) {
- var styleObject = {};
-
- if (typeof str !== 'string') {
- return styleObject;
- }
-
- str = str.trim().slice(1, -1); // browsers re-quote string style values
-
- if (!str) {
- return styleObject;
- }
-
- styleObject = str.split('&').reduce(function (ret, param) {
- var parts = param.replace(/\+/g, ' ').split('=');
- var key = parts[0];
- var val = parts[1];
- key = decodeURIComponent(key);
-
- // missing `=` should be `null`:
- // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
- val = val === undefined ? null : decodeURIComponent(val);
-
- if (!ret.hasOwnProperty(key)) {
- ret[key] = val;
- } else if (Array.isArray(ret[key])) {
- ret[key].push(val);
- } else {
- ret[key] = [ret[key], val];
- }
- return ret;
- }, {});
-
- return styleObject;
- }
-
- Foundation.MediaQuery = MediaQuery;
-}(jQuery);
-'use strict';
-
-!function ($) {
-
- Foundation.Box = {
- ImNotTouchingYou: ImNotTouchingYou,
- GetDimensions: GetDimensions,
- GetOffsets: GetOffsets
- };
-
- /**
- * Compares the dimensions of an element to a container and determines collision events with container.
- * @function
- * @param {jQuery} element - jQuery object to test for collisions.
- * @param {jQuery} parent - jQuery object to use as bounding container.
- * @param {Boolean} lrOnly - set to true to check left and right values only.
- * @param {Boolean} tbOnly - set to true to check top and bottom values only.
- * @default if no parent object passed, detects collisions with `window`.
- * @returns {Boolean} - true if collision free, false if a collision in any direction.
- */
- function ImNotTouchingYou(element, parent, lrOnly, tbOnly) {
- var eleDims = GetDimensions(element),
- top,
- bottom,
- left,
- right;
-
- if (parent) {
- var parDims = GetDimensions(parent);
-
- bottom = eleDims.offset.top + eleDims.height <= parDims.height + parDims.offset.top;
- top = eleDims.offset.top >= parDims.offset.top;
- left = eleDims.offset.left >= parDims.offset.left;
- right = eleDims.offset.left + eleDims.width <= parDims.width + parDims.offset.left;
- } else {
- bottom = eleDims.offset.top + eleDims.height <= eleDims.windowDims.height + eleDims.windowDims.offset.top;
- top = eleDims.offset.top >= eleDims.windowDims.offset.top;
- left = eleDims.offset.left >= eleDims.windowDims.offset.left;
- right = eleDims.offset.left + eleDims.width <= eleDims.windowDims.width;
- }
-
- var allDirs = [bottom, top, left, right];
-
- if (lrOnly) {
- return left === right === true;
- }
-
- if (tbOnly) {
- return top === bottom === true;
- }
-
- return allDirs.indexOf(false) === -1;
- };
-
- /**
- * Uses native methods to return an object of dimension values.
- * @function
- * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.
- * @returns {Object} - nested object of integer pixel values
- * TODO - if element is window, return only those values.
- */
- function GetDimensions(elem, test) {
- elem = elem.length ? elem[0] : elem;
-
- if (elem === window || elem === document) {
- throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");
- }
-
- var rect = elem.getBoundingClientRect(),
- parRect = elem.parentNode.getBoundingClientRect(),
- winRect = document.body.getBoundingClientRect(),
- winY = window.pageYOffset,
- winX = window.pageXOffset;
-
- return {
- width: rect.width,
- height: rect.height,
- offset: {
- top: rect.top + winY,
- left: rect.left + winX
- },
- parentDims: {
- width: parRect.width,
- height: parRect.height,
- offset: {
- top: parRect.top + winY,
- left: parRect.left + winX
- }
- },
- windowDims: {
- width: winRect.width,
- height: winRect.height,
- offset: {
- top: winY,
- left: winX
- }
- }
- };
- }
-
- /**
- * Returns an object of top and left integer pixel values for dynamically rendered elements,
- * such as: Tooltip, Reveal, and Dropdown
- * @function
- * @param {jQuery} element - jQuery object for the element being positioned.
- * @param {jQuery} anchor - jQuery object for the element's anchor point.
- * @param {String} position - a string relating to the desired position of the element, relative to it's anchor
- * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.
- * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.
- * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.
- * TODO alter/rewrite to work with `em` values as well/instead of pixels
- */
- function GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) {
- var $eleDims = GetDimensions(element),
- $anchorDims = anchor ? GetDimensions(anchor) : null;
-
- switch (position) {
- case 'top':
- return {
- left: Foundation.rtl() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width : $anchorDims.offset.left,
- top: $anchorDims.offset.top - ($eleDims.height + vOffset)
- };
- break;
- case 'left':
- return {
- left: $anchorDims.offset.left - ($eleDims.width + hOffset),
- top: $anchorDims.offset.top
- };
- break;
- case 'right':
- return {
- left: $anchorDims.offset.left + $anchorDims.width + hOffset,
- top: $anchorDims.offset.top
- };
- break;
- case 'center top':
- return {
- left: $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2,
- top: $anchorDims.offset.top - ($eleDims.height + vOffset)
- };
- break;
- case 'center bottom':
- return {
- left: isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2,
- top: $anchorDims.offset.top + $anchorDims.height + vOffset
- };
- break;
- case 'center left':
- return {
- left: $anchorDims.offset.left - ($eleDims.width + hOffset),
- top: $anchorDims.offset.top + $anchorDims.height / 2 - $eleDims.height / 2
- };
- break;
- case 'center right':
- return {
- left: $anchorDims.offset.left + $anchorDims.width + hOffset + 1,
- top: $anchorDims.offset.top + $anchorDims.height / 2 - $eleDims.height / 2
- };
- break;
- case 'center':
- return {
- left: $eleDims.windowDims.offset.left + $eleDims.windowDims.width / 2 - $eleDims.width / 2,
- top: $eleDims.windowDims.offset.top + $eleDims.windowDims.height / 2 - $eleDims.height / 2
- };
- break;
- case 'reveal':
- return {
- left: ($eleDims.windowDims.width - $eleDims.width) / 2,
- top: $eleDims.windowDims.offset.top + vOffset
- };
- case 'reveal full':
- return {
- left: $eleDims.windowDims.offset.left,
- top: $eleDims.windowDims.offset.top
- };
- break;
- case 'left bottom':
- return {
- left: $anchorDims.offset.left - ($eleDims.width + hOffset),
- top: $anchorDims.offset.top + $anchorDims.height
- };
- break;
- case 'right bottom':
- return {
- left: $anchorDims.offset.left + $anchorDims.width + hOffset - $eleDims.width,
- top: $anchorDims.offset.top + $anchorDims.height
- };
- break;
- default:
- return {
- left: Foundation.rtl() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width : $anchorDims.offset.left,
- top: $anchorDims.offset.top + $anchorDims.height + vOffset
- };
- }
- }
-}(jQuery);
-'use strict';
-
-!function ($) {
-
- /**
- * Motion module.
- * @module foundation.motion
- */
-
- var initClasses = ['mui-enter', 'mui-leave'];
- var activeClasses = ['mui-enter-active', 'mui-leave-active'];
-
- var Motion = {
- animateIn: function (element, animation, cb) {
- animate(true, element, animation, cb);
- },
-
- animateOut: function (element, animation, cb) {
- animate(false, element, animation, cb);
- }
- };
-
- function Move(duration, elem, fn) {
- var anim,
- prog,
- start = null;
- // console.log('called');
-
- function move(ts) {
- if (!start) start = window.performance.now();
- // console.log(start, ts);
- prog = ts - start;
- fn.apply(elem);
-
- if (prog < duration) {
- anim = window.requestAnimationFrame(move, elem);
- } else {
- window.cancelAnimationFrame(anim);
- elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
- }
- }
- anim = window.requestAnimationFrame(move);
- }
-
- /**
- * Animates an element in or out using a CSS transition class.
- * @function
- * @private
- * @param {Boolean} isIn - Defines if the animation is in or out.
- * @param {Object} element - jQuery or HTML object to animate.
- * @param {String} animation - CSS class to use.
- * @param {Function} cb - Callback to run when animation is finished.
- */
- function animate(isIn, element, animation, cb) {
- element = $(element).eq(0);
-
- if (!element.length) return;
-
- var initClass = isIn ? initClasses[0] : initClasses[1];
- var activeClass = isIn ? activeClasses[0] : activeClasses[1];
-
- // Set up the animation
- reset();
-
- element.addClass(animation).css('transition', 'none');
-
- requestAnimationFrame(function () {
- element.addClass(initClass);
- if (isIn) element.show();
- });
-
- // Start the animation
- requestAnimationFrame(function () {
- element[0].offsetWidth;
- element.css('transition', '').addClass(activeClass);
- });
-
- // Clean up the animation when it finishes
- element.one(Foundation.transitionend(element), finish);
-
- // Hides the element (for out animations), resets the element, and runs a callback
- function finish() {
- if (!isIn) element.hide();
- reset();
- if (cb) cb.apply(element);
- }
-
- // Resets transitions and removes motion-specific classes
- function reset() {
- element[0].style.transitionDuration = 0;
- element.removeClass(initClass + ' ' + activeClass + ' ' + animation);
- }
- }
-
- Foundation.Move = Move;
- Foundation.Motion = Motion;
-}(jQuery);
-'use strict';
-
-!function ($) {
-
- var MutationObserver = function () {
- var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
- for (var i = 0; i < prefixes.length; i++) {
- if (prefixes[i] + 'MutationObserver' in window) {
- return window[prefixes[i] + 'MutationObserver'];
- }
- }
- return false;
- }();
-
- var triggers = function (el, type) {
- el.data(type).split(' ').forEach(function (id) {
- $('#' + id)[type === 'close' ? 'trigger' : 'triggerHandler'](type + '.zf.trigger', [el]);
- });
- };
- // Elements with [data-open] will reveal a plugin that supports it when clicked.
- $(document).on('click.zf.trigger', '[data-open]', function () {
- triggers($(this), 'open');
- });
-
- // Elements with [data-close] will close a plugin that supports it when clicked.
- // If used without a value on [data-close], the event will bubble, allowing it to close a parent component.
- $(document).on('click.zf.trigger', '[data-close]', function () {
- var id = $(this).data('close');
- if (id) {
- triggers($(this), 'close');
- } else {
- $(this).trigger('close.zf.trigger');
- }
- });
-
- // Elements with [data-toggle] will toggle a plugin that supports it when clicked.
- $(document).on('click.zf.trigger', '[data-toggle]', function () {
- triggers($(this), 'toggle');
- });
-
- // Elements with [data-closable] will respond to close.zf.trigger events.
- $(document).on('close.zf.trigger', '[data-closable]', function (e) {
- e.stopPropagation();
- var animation = $(this).data('closable');
-
- if (animation !== '') {
- Foundation.Motion.animateOut($(this), animation, function () {
- $(this).trigger('closed.zf');
- });
- } else {
- $(this).fadeOut().trigger('closed.zf');
- }
- });
-
- $(document).on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', function () {
- var id = $(this).data('toggle-focus');
- $('#' + id).triggerHandler('toggle.zf.trigger', [$(this)]);
- });
-
- /**
- * Fires once after all other scripts have loaded
- * @function
- * @private
- */
- $(window).load(function () {
- checkListeners();
- });
-
- function checkListeners() {
- eventsListener();
- resizeListener();
- scrollListener();
- closemeListener();
- }
-
- //******** only fires this function once on load, if there's something to watch ********
- function closemeListener(pluginName) {
- var yetiBoxes = $('[data-yeti-box]'),
- plugNames = ['dropdown', 'tooltip', 'reveal'];
-
- if (pluginName) {
- if (typeof pluginName === 'string') {
- plugNames.push(pluginName);
- } else if (typeof pluginName === 'object' && typeof pluginName[0] === 'string') {
- plugNames.concat(pluginName);
- } else {
- console.error('Plugin names must be strings');
- }
- }
- if (yetiBoxes.length) {
- var listeners = plugNames.map(function (name) {
- return 'closeme.zf.' + name;
- }).join(' ');
-
- $(window).off(listeners).on(listeners, function (e, pluginId) {
- var plugin = e.namespace.split('.')[0];
- var plugins = $('[data-' + plugin + ']').not('[data-yeti-box="' + pluginId + '"]');
-
- plugins.each(function () {
- var _this = $(this);
-
- _this.triggerHandler('close.zf.trigger', [_this]);
- });
- });
- }
- }
-
- function resizeListener(debounce) {
- var timer = void 0,
- $nodes = $('[data-resize]');
- if ($nodes.length) {
- $(window).off('resize.zf.trigger').on('resize.zf.trigger', function (e) {
- if (timer) {
- clearTimeout(timer);
- }
-
- timer = setTimeout(function () {
-
- if (!MutationObserver) {
- //fallback for IE 9
- $nodes.each(function () {
- $(this).triggerHandler('resizeme.zf.trigger');
- });
- }
- //trigger all listening elements and signal a resize event
- $nodes.attr('data-events', "resize");
- }, debounce || 10); //default time to emit resize event
- });
- }
- }
-
- function scrollListener(debounce) {
- var timer = void 0,
- $nodes = $('[data-scroll]');
- if ($nodes.length) {
- $(window).off('scroll.zf.trigger').on('scroll.zf.trigger', function (e) {
- if (timer) {
- clearTimeout(timer);
- }
-
- timer = setTimeout(function () {
-
- if (!MutationObserver) {
- //fallback for IE 9
- $nodes.each(function () {
- $(this).triggerHandler('scrollme.zf.trigger');
- });
- }
- //trigger all listening elements and signal a scroll event
- $nodes.attr('data-events', "scroll");
- }, debounce || 10); //default time to emit scroll event
- });
- }
- }
-
- function eventsListener() {
- if (!MutationObserver) {
- return false;
- }
- var nodes = document.querySelectorAll('[data-resize], [data-scroll], [data-mutate]');
-
- //element callback
- var listeningElementsMutation = function (mutationRecordsList) {
- var $target = $(mutationRecordsList[0].target);
- //trigger the event handler for the element depending on type
- switch ($target.attr("data-events")) {
-
- case "resize":
- $target.triggerHandler('resizeme.zf.trigger', [$target]);
- break;
-
- case "scroll":
- $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);
- break;
-
- // case "mutate" :
- // console.log('mutate', $target);
- // $target.triggerHandler('mutate.zf.trigger');
- //
- // //make sure we don't get stuck in an infinite loop from sloppy codeing
- // if ($target.index('[data-mutate]') == $("[data-mutate]").length-1) {
- // domMutationObserver();
- // }
- // break;
-
- default:
- return false;
- //nothing
- }
- };
-
- if (nodes.length) {
- //for each element that needs to listen for resizing, scrolling, (or coming soon mutation) add a single observer
- for (var i = 0; i <= nodes.length - 1; i++) {
- var elementObserver = new MutationObserver(listeningElementsMutation);
- elementObserver.observe(nodes[i], { attributes: true, childList: false, characterData: false, subtree: false, attributeFilter: ["data-events"] });
- }
- }
- }
-
- // ------------------------------------
-
- // [PH]
- // Foundation.CheckWatchers = checkWatchers;
- Foundation.IHearYou = checkListeners;
- // Foundation.ISeeYou = scrollListener;
- // Foundation.IFeelYou = closemeListener;
-}(jQuery);
-
-// function domMutationObserver(debounce) {
-// // !!! This is coming soon and needs more work; not active !!! //
-// var timer,
-// nodes = document.querySelectorAll('[data-mutate]');
-// //
-// if (nodes.length) {
-// // var MutationObserver = (function () {
-// // var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
-// // for (var i=0; i < prefixes.length; i++) {
-// // if (prefixes[i] + 'MutationObserver' in window) {
-// // return window[prefixes[i] + 'MutationObserver'];
-// // }
-// // }
-// // return false;
-// // }());
-//
-//
-// //for the body, we need to listen for all changes effecting the style and class attributes
-// var bodyObserver = new MutationObserver(bodyMutation);
-// bodyObserver.observe(document.body, { attributes: true, childList: true, characterData: false, subtree:true, attributeFilter:["style", "class"]});
-//
-//
-// //body callback
-// function bodyMutation(mutate) {
-// //trigger all listening elements and signal a mutation event
-// if (timer) { clearTimeout(timer); }
-//
-// timer = setTimeout(function() {
-// bodyObserver.disconnect();
-// $('[data-mutate]').attr('data-events',"mutate");
-// }, debounce || 150);
-// }
-// }
-// }
-/*******************************************
- * *
- * This util was created by Marius Olbertz *
- * Please thank Marius on GitHub /owlbertz *
- * or the web http://www.mariusolbertz.de/ *
- * *
- ******************************************/
-
-'use strict';
-
-!function ($) {
-
- var keyCodes = {
- 9: 'TAB',
- 13: 'ENTER',
- 27: 'ESCAPE',
- 32: 'SPACE',
- 37: 'ARROW_LEFT',
- 38: 'ARROW_UP',
- 39: 'ARROW_RIGHT',
- 40: 'ARROW_DOWN'
- };
-
- var commands = {};
-
- var Keyboard = {
- keys: getKeyCodes(keyCodes),
-
- /**
- * Parses the (keyboard) event and returns a String that represents its key
- * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
- * @param {Event} event - the event generated by the event handler
- * @return String key - String that represents the key pressed
- */
- parseKey: function (event) {
- var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase();
- if (event.shiftKey) key = 'SHIFT_' + key;
- if (event.ctrlKey) key = 'CTRL_' + key;
- if (event.altKey) key = 'ALT_' + key;
- return key;
- },
-
-
- /**
- * Handles the given (keyboard) event
- * @param {Event} event - the event generated by the event handler
- * @param {String} component - Foundation component's name, e.g. Slider or Reveal
- * @param {Objects} functions - collection of functions that are to be executed
- */
- handleKey: function (event, component, functions) {
- var commandList = commands[component],
- keyCode = this.parseKey(event),
- cmds,
- command,
- fn;
-
- if (!commandList) return console.warn('Component not defined!');
-
- if (typeof commandList.ltr === 'undefined') {
- // this component does not differentiate between ltr and rtl
- cmds = commandList; // use plain list
- } else {
- // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa
- if (Foundation.rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);else cmds = $.extend({}, commandList.rtl, commandList.ltr);
- }
- command = cmds[keyCode];
-
- fn = functions[command];
- if (fn && typeof fn === 'function') {
- // execute function if exists
- var returnValue = fn.apply();
- if (functions.handled || typeof functions.handled === 'function') {
- // execute function when event was handled
- functions.handled(returnValue);
- }
- } else {
- if (functions.unhandled || typeof functions.unhandled === 'function') {
- // execute function when event was not handled
- functions.unhandled();
- }
- }
- },
-
-
- /**
- * Finds all focusable elements within the given `$element`
- * @param {jQuery} $element - jQuery object to search within
- * @return {jQuery} $focusable - all focusable elements within `$element`
- */
- findFocusable: function ($element) {
- return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {
- if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) {
- return false;
- } //only have visible elements and those that have a tabindex greater or equal 0
- return true;
- });
- },
-
-
- /**
- * Returns the component name name
- * @param {Object} component - Foundation component, e.g. Slider or Reveal
- * @return String componentName
- */
-
- register: function (componentName, cmds) {
- commands[componentName] = cmds;
- }
- };
-
- /*
- * Constants for easier comparing.
- * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
- */
- function getKeyCodes(kcs) {
- var k = {};
- for (var kc in kcs) {
- k[kcs[kc]] = kcs[kc];
- }return k;
- }
-
- Foundation.Keyboard = Keyboard;
-}(jQuery);
-'use strict';
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-!function ($) {
-
- /**
- * Reveal module.
- * @module foundation.reveal
- * @requires foundation.util.keyboard
- * @requires foundation.util.box
- * @requires foundation.util.triggers
- * @requires foundation.util.mediaQuery
- * @requires foundation.util.motion if using animations
- */
-
- var Reveal = function () {
- /**
- * Creates a new instance of Reveal.
- * @class
- * @param {jQuery} element - jQuery object to use for the modal.
- * @param {Object} options - optional parameters.
- */
-
- function Reveal(element, options) {
- _classCallCheck(this, Reveal);
-
- this.$element = element;
- this.options = $.extend({}, Reveal.defaults, this.$element.data(), options);
- this._init();
-
- Foundation.registerPlugin(this, 'Reveal');
- Foundation.Keyboard.register('Reveal', {
- 'ENTER': 'open',
- 'SPACE': 'open',
- 'ESCAPE': 'close',
- 'TAB': 'tab_forward',
- 'SHIFT_TAB': 'tab_backward'
- });
- }
-
- /**
- * Initializes the modal by adding the overlay and close buttons, (if selected).
- * @private
- */
-
-
- _createClass(Reveal, [{
- key: '_init',
- value: function _init() {
- this.id = this.$element.attr('id');
- this.isActive = false;
- this.cached = { mq: Foundation.MediaQuery.current };
- this.isMobile = mobileSniff();
-
- this.$anchor = $('[data-open="' + this.id + '"]').length ? $('[data-open="' + this.id + '"]') : $('[data-toggle="' + this.id + '"]');
- this.$anchor.attr({
- 'aria-controls': this.id,
- 'aria-haspopup': true,
- 'tabindex': 0
- });
-
- if (this.options.fullScreen || this.$element.hasClass('full')) {
- this.options.fullScreen = true;
- this.options.overlay = false;
- }
- if (this.options.overlay && !this.$overlay) {
- this.$overlay = this._makeOverlay(this.id);
- }
-
- this.$element.attr({
- 'role': 'dialog',
- 'aria-hidden': true,
- 'data-yeti-box': this.id,
- 'data-resize': this.id
- });
-
- if (this.$overlay) {
- this.$element.detach().appendTo(this.$overlay);
- } else {
- this.$element.detach().appendTo($('body'));
- this.$element.addClass('without-overlay');
- }
- this._events();
- if (this.options.deepLink && window.location.hash === '#' + this.id) {
- $(window).one('load.zf.reveal', this.open.bind(this));
- }
- }
-
- /**
- * Creates an overlay div to display behind the modal.
- * @private
- */
-
- }, {
- key: '_makeOverlay',
- value: function _makeOverlay(id) {
- var $overlay = $('<div></div>').addClass('reveal-overlay').appendTo('body');
- return $overlay;
- }
-
- /**
- * Updates position of modal
- * TODO: Figure out if we actually need to cache these values or if it doesn't matter
- * @private
- */
-
- }, {
- key: '_updatePosition',
- value: function _updatePosition() {
- var width = this.$element.outerWidth();
- var outerWidth = $(window).width();
- var height = this.$element.outerHeight();
- var outerHeight = $(window).height();
- var left, top;
- if (this.options.hOffset === 'auto') {
- left = parseInt((outerWidth - width) / 2, 10);
- } else {
- left = parseInt(this.options.hOffset, 10);
- }
- if (this.options.vOffset === 'auto') {
- if (height > outerHeight) {
- top = parseInt(Math.min(100, outerHeight / 10), 10);
- } else {
- top = parseInt((outerHeight - height) / 4, 10);
- }
- } else {
- top = parseInt(this.options.vOffset, 10);
- }
- this.$element.css({ top: top + 'px' });
- // only worry about left if we don't have an overlay or we havea horizontal offset,
- // otherwise we're perfectly in the middle
- if (!this.$overlay || this.options.hOffset !== 'auto') {
- this.$element.css({ left: left + 'px' });
- this.$element.css({ margin: '0px' });
- }
- }
-
- /**
- * Adds event handlers for the modal.
- * @private
- */
-
- }, {
- key: '_events',
- value: function _events() {
- var _this2 = this;
-
- var _this = this;
-
- this.$element.on({
- 'open.zf.trigger': this.open.bind(this),
- 'close.zf.trigger': function (event, $element) {
- if (event.target === _this.$element[0] || $(event.target).parents('[data-closable]')[0] === $element) {
- // only close reveal when it's explicitly called
- return _this2.close.apply(_this2);
- }
- },
- 'toggle.zf.trigger': this.toggle.bind(this),
- 'resizeme.zf.trigger': function () {
- _this._updatePosition();
- }
- });
-
- if (this.$anchor.length) {
- this.$anchor.on('keydown.zf.reveal', function (e) {
- if (e.which === 13 || e.which === 32) {
- e.stopPropagation();
- e.preventDefault();
- _this.open();
- }
- });
- }
-
- if (this.options.closeOnClick && this.options.overlay) {
- this.$overlay.off('.zf.reveal').on('click.zf.reveal', function (e) {
- if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) {
- return;
- }
- _this.close();
- });
- }
- if (this.options.deepLink) {
- $(window).on('popstate.zf.reveal:' + this.id, this._handleState.bind(this));
- }
- }
-
- /**
- * Handles modal methods on back/forward button clicks or any other event that triggers popstate.
- * @private
- */
-
- }, {
- key: '_handleState',
- value: function _handleState(e) {
- if (window.location.hash === '#' + this.id && !this.isActive) {
- this.open();
- } else {
- this.close();
- }
- }
-
- /**
- * Opens the modal controlled by `this.$anchor`, and closes all others by default.
- * @function
- * @fires Reveal#closeme
- * @fires Reveal#open
- */
-
- }, {
- key: 'open',
- value: function open() {
- var _this3 = this;
-
- if (this.options.deepLink) {
- var hash = '#' + this.id;
-
- if (window.history.pushState) {
- window.history.pushState(null, null, hash);
- } else {
- window.location.hash = hash;
- }
- }
-
- this.isActive = true;
-
- // Make elements invisible, but remove display: none so we can get size and positioning
- this.$element.css({ 'visibility': 'hidden' }).show().scrollTop(0);
- if (this.options.overlay) {
- this.$overlay.css({ 'visibility': 'hidden' }).show();
- }
-
- this._updatePosition();
-
- this.$element.hide().css({ 'visibility': '' });
-
- if (this.$overlay) {
- this.$overlay.css({ 'visibility': '' }).hide();
- if (this.$element.hasClass('fast')) {
- this.$overlay.addClass('fast');
- } else if (this.$element.hasClass('slow')) {
- this.$overlay.addClass('slow');
- }
- }
-
- if (!this.options.multipleOpened) {
- /**
- * Fires immediately before the modal opens.
- * Closes any other modals that are currently open
- * @event Reveal#closeme
- */
- this.$element.trigger('closeme.zf.reveal', this.id);
- }
- // Motion UI method of reveal
- if (this.options.animationIn) {
- var _this;
-
- (function () {
- var afterAnimationFocus = function () {
- _this.$element.attr({
- 'aria-hidden': false,
- 'tabindex': -1
- }).focus();
- console.log('focus');
- };
-
- _this = _this3;
-
- if (_this3.options.overlay) {
- Foundation.Motion.animateIn(_this3.$overlay, 'fade-in');
- }
- Foundation.Motion.animateIn(_this3.$element, _this3.options.animationIn, function () {
- _this3.focusableElements = Foundation.Keyboard.findFocusable(_this3.$element);
- afterAnimationFocus();
- });
- })();
- }
- // jQuery method of reveal
- else {
- if (this.options.overlay) {
- this.$overlay.show(0);
- }
- this.$element.show(this.options.showDelay);
- }
-
- // handle accessibility
- this.$element.attr({
- 'aria-hidden': false,
- 'tabindex': -1
- }).focus();
-
- /**
- * Fires when the modal has successfully opened.
- * @event Reveal#open
- */
- this.$element.trigger('open.zf.reveal');
-
- if (this.isMobile) {
- this.originalScrollPos = window.pageYOffset;
- $('html, body').addClass('is-reveal-open');
- } else {
- $('body').addClass('is-reveal-open');
- }
-
- setTimeout(function () {
- _this3._extraHandlers();
- }, 0);
- }
-
- /**
- * Adds extra event handlers for the body and window if necessary.
- * @private
- */
-
- }, {
- key: '_extraHandlers',
- value: function _extraHandlers() {
- var _this = this;
- this.focusableElements = Foundation.Keyboard.findFocusable(this.$element);
-
- if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) {
- $('body').on('click.zf.reveal', function (e) {
- if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) {
- return;
- }
- _this.close();
- });
- }
-
- if (this.options.closeOnEsc) {
- $(window).on('keydown.zf.reveal', function (e) {
- Foundation.Keyboard.handleKey(e, 'Reveal', {
- close: function () {
- if (_this.options.closeOnEsc) {
- _this.close();
- _this.$anchor.focus();
- }
- }
- });
- });
- }
-
- // lock focus within modal while tabbing
- this.$element.on('keydown.zf.reveal', function (e) {
- var $target = $(this);
- // handle keyboard event with keyboard util
- Foundation.Keyboard.handleKey(e, 'Reveal', {
- tab_forward: function () {
- if (_this.$element.find(':focus').is(_this.focusableElements.eq(-1))) {
- // left modal downwards, setting focus to first element
- _this.focusableElements.eq(0).focus();
- return true;
- }
- if (_this.focusableElements.length === 0) {
- // no focusable elements inside the modal at all, prevent tabbing in general
- return true;
- }
- },
- tab_backward: function () {
- if (_this.$element.find(':focus').is(_this.focusableElements.eq(0)) || _this.$element.is(':focus')) {
- // left modal upwards, setting focus to last element
- _this.focusableElements.eq(-1).focus();
- return true;
- }
- if (_this.focusableElements.length === 0) {
- // no focusable elements inside the modal at all, prevent tabbing in general
- return true;
- }
- },
- open: function () {
- if (_this.$element.find(':focus').is(_this.$element.find('[data-close]'))) {
- setTimeout(function () {
- // set focus back to anchor if close button has been activated
- _this.$anchor.focus();
- }, 1);
- } else if ($target.is(_this.focusableElements)) {
- // dont't trigger if acual element has focus (i.e. inputs, links, ...)
- _this.open();
- }
- },
- close: function () {
- if (_this.options.closeOnEsc) {
- _this.close();
- _this.$anchor.focus();
- }
- },
- handled: function (preventDefault) {
- if (preventDefault) {
- e.preventDefault();
- }
- }
- });
- });
- }
-
- /**
- * Closes the modal.
- * @function
- * @fires Reveal#closed
- */
-
- }, {
- key: 'close',
- value: function close() {
- if (!this.isActive || !this.$element.is(':visible')) {
- return false;
- }
- var _this = this;
-
- // Motion UI method of hiding
- if (this.options.animationOut) {
- if (this.options.overlay) {
- Foundation.Motion.animateOut(this.$overlay, 'fade-out', finishUp);
- } else {
- finishUp();
- }
-
- Foundation.Motion.animateOut(this.$element, this.options.animationOut);
- }
- // jQuery method of hiding
- else {
- if (this.options.overlay) {
- this.$overlay.hide(0, finishUp);
- } else {
- finishUp();
- }
-
- this.$element.hide(this.options.hideDelay);
- }
-
- // Conditionals to remove extra event listeners added on open
- if (this.options.closeOnEsc) {
- $(window).off('keydown.zf.reveal');
- }
-
- if (!this.options.overlay && this.options.closeOnClick) {
- $('body').off('click.zf.reveal');
- }
-
- this.$element.off('keydown.zf.reveal');
-
- function finishUp() {
- if (_this.isMobile) {
- $('html, body').removeClass('is-reveal-open');
- if (_this.originalScrollPos) {
- $('body').scrollTop(_this.originalScrollPos);
- _this.originalScrollPos = null;
- }
- } else {
- $('body').removeClass('is-reveal-open');
- }
-
- _this.$element.attr('aria-hidden', true);
-
- /**
- * Fires when the modal is done closing.
- * @event Reveal#closed
- */
- _this.$element.trigger('closed.zf.reveal');
- }
-
- /**
- * Resets the modal content
- * This prevents a running video to keep going in the background
- */
- if (this.options.resetOnClose) {
- this.$element.html(this.$element.html());
- }
-
- this.isActive = false;
- if (_this.options.deepLink) {
- if (window.history.replaceState) {
- window.history.replaceState("", document.title, window.location.pathname);
- } else {
- window.location.hash = '';
- }
- }
- }
-
- /**
- * Toggles the open/closed state of a modal.
- * @function
- */
-
- }, {
- key: 'toggle',
- value: function toggle() {
- if (this.isActive) {
- this.close();
- } else {
- this.open();
- }
- }
- }, {
- key: 'destroy',
-
-
- /**
- * Destroys an instance of a modal.
- * @function
- */
- value: function destroy() {
- if (this.options.overlay) {
- this.$element.appendTo($('body')); // move $element outside of $overlay to prevent error unregisterPlugin()
- this.$overlay.hide().off().remove();
- }
- this.$element.hide().off();
- this.$anchor.off('.zf');
- $(window).off('.zf.reveal:' + this.id);
-
- Foundation.unregisterPlugin(this);
- }
- }]);
-
- return Reveal;
- }();
-
- Reveal.defaults = {
- /**
- * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.
- * @option
- * @example 'slide-in-left'
- */
- animationIn: '',
- /**
- * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.
- * @option
- * @example 'slide-out-right'
- */
- animationOut: '',
- /**
- * Time, in ms, to delay the opening of a modal after a click if no animation used.
- * @option
- * @example 10
- */
- showDelay: 0,
- /**
- * Time, in ms, to delay the closing of a modal after a click if no animation used.
- * @option
- * @example 10
- */
- hideDelay: 0,
- /**
- * Allows a click on the body/overlay to close the modal.
- * @option
- * @example true
- */
- closeOnClick: true,
- /**
- * Allows the modal to close if the user presses the `ESCAPE` key.
- * @option
- * @example true
- */
- closeOnEsc: true,
- /**
- * If true, allows multiple modals to be displayed at once.
- * @option
- * @example false
- */
- multipleOpened: false,
- /**
- * Distance, in pixels, the modal should push down from the top of the screen.
- * @option
- * @example auto
- */
- vOffset: 'auto',
- /**
- * Distance, in pixels, the modal should push in from the side of the screen.
- * @option
- * @example auto
- */
- hOffset: 'auto',
- /**
- * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well.
- * @option
- * @example false
- */
- fullScreen: false,
- /**
- * Percentage of screen height the modal should push up from the bottom of the view.
- * @option
- * @example 10
- */
- btmOffsetPct: 10,
- /**
- * Allows the modal to generate an overlay div, which will cover the view when modal opens.
- * @option
- * @example true
- */
- overlay: true,
- /**
- * Allows the modal to remove and reinject markup on close. Should be true if using video elements w/o using provider's api, otherwise, videos will continue to play in the background.
- * @option
- * @example false
- */
- resetOnClose: false,
- /**
- * Allows the modal to alter the url on open/close, and allows the use of the `back` button to close modals. ALSO, allows a modal to auto-maniacally open on page load IF the hash === the modal's user-set id.
- * @option
- * @example false
- */
- deepLink: false
- };
-
- // Window exports
- Foundation.plugin(Reveal, 'Reveal');
-
- function iPhoneSniff() {
- return (/iP(ad|hone|od).*OS/.test(window.navigator.userAgent)
- );
- }
-
- function androidSniff() {
- return (/Android/.test(window.navigator.userAgent)
- );
- }
-
- function mobileSniff() {
- return iPhoneSniff() || androidSniff();
- }
-}(jQuery);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-quickstep-site/blob/3e7c96b9/js/vendor/foundation.min.js
----------------------------------------------------------------------
diff --git a/js/vendor/foundation.min.js b/js/vendor/foundation.min.js
deleted file mode 100644
index 8668f8e..0000000
--- a/js/vendor/foundation.min.js
+++ /dev/null
@@ -1 +0,0 @@
-function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}!function(t){"use strict";function e(t){if(void 0===Function.prototype.name){var e=/function\s([^(]{1,})\(/,n=e.exec(t.toString());return n&&n.length>1?n[1].trim():""}return void 0===t.prototype?t.constructor.name:t.prototype.constructor.name}function n(t){return/true/.test(t)?!0:/false/.test(t)?!1:isNaN(1*t)?t:parseFloat(t)}function i(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var o="6.2.2",a={version:o,_plugins:{},_uuids:[],rtl:function(){return"rtl"===t("html").attr("dir")},plugin:function(t,n){var o=n||e(t),a=i(o);this._plugins[a]=this[o]=t},registerPlugin:function(t,n){var o=n?i(n):e(t.constructor).toLowerCase();t.uuid=this.GetYoDigits(6,o),t.$element.attr("data-"+o)||t.$element.attr("data-"+o,t.uuid),t.$element.data("zfPlugin")||t.$element.data("zfPlugin",t),t.$element.trigger("init.zf."+o),this._uuids.push(t.uuid)},unregisterPlugin:function(t){var n=i(
e(t.$element.data("zfPlugin").constructor));this._uuids.splice(this._uuids.indexOf(t.uuid),1),t.$element.removeAttr("data-"+n).removeData("zfPlugin").trigger("destroyed.zf."+n);for(var o in t)t[o]=null},reInit:function(e){var n=e instanceof t;try{if(n)e.each(function(){t(this).data("zfPlugin")._init()});else{var o=typeof e,a=this,r={object:function(e){e.forEach(function(e){e=i(e),t("[data-"+e+"]").foundation("_init")})},string:function(){e=i(e),t("[data-"+e+"]").foundation("_init")},undefined:function(){this.object(Object.keys(a._plugins))}};r[o](e)}}catch(s){console.error(s)}finally{return e}},GetYoDigits:function(t,e){return t=t||6,Math.round(Math.pow(36,t+1)-Math.random()*Math.pow(36,t)).toString(36).slice(1)+(e?"-"+e:"")},reflow:function(e,i){"undefined"==typeof i?i=Object.keys(this._plugins):"string"==typeof i&&(i=[i]);var o=this;t.each(i,function(i,a){var r=o._plugins[a],s=t(e).find("[data-"+a+"]").addBack("[data-"+a+"]");s.each(function(){var e=t(this),i={};if(e.data("zfPlugi
n"))return void console.warn("Tried to initialize "+a+" on an element that already has a Foundation plugin.");if(e.attr("data-options")){e.attr("data-options").split(";").forEach(function(t,e){var o=t.split(":").map(function(t){return t.trim()});o[0]&&(i[o[0]]=n(o[1]))})}try{e.data("zfPlugin",new r(t(this),i))}catch(o){console.error(o)}finally{return}})})},getFnName:e,transitionend:function(t){var e,n={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend"},i=document.createElement("div");for(var o in n)"undefined"!=typeof i.style[o]&&(e=n[o]);return e?e:(e=setTimeout(function(){t.triggerHandler("transitionend",[t])},1),"transitionend")}};a.util={throttle:function(t,e){var n=null;return function(){var i=this,o=arguments;null===n&&(n=setTimeout(function(){t.apply(i,o),n=null},e))}}};var r=function(n){var i=typeof n,o=t("meta.foundation-mq"),r=t(".no-js");if(o.length||t('<meta class="foundation-mq">').appendTo(docum
ent.head),r.length&&r.removeClass("no-js"),"undefined"===i)a.MediaQuery._init(),a.reflow(this);else{if("string"!==i)throw new TypeError("We're sorry, "+i+" is not a valid parameter. You must use a string representing the method you wish to invoke.");var s=Array.prototype.slice.call(arguments,1),l=this.data("zfPlugin");if(void 0===l||void 0===l[n])throw new ReferenceError("We're sorry, '"+n+"' is not an available method for "+(l?e(l):"this element")+".");1===this.length?l[n].apply(l,s):this.each(function(e,i){l[n].apply(t(i).data("zfPlugin"),s)})}return this};window.Foundation=a,t.fn.foundation=r,function(){Date.now&&window.Date.now||(window.Date.now=Date.now=function(){return(new Date).getTime()});for(var t=["webkit","moz"],e=0;e<t.length&&!window.requestAnimationFrame;++e){var n=t[e];window.requestAnimationFrame=window[n+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS 6/.test(windo
w.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var i=0;window.requestAnimationFrame=function(t){var e=Date.now(),n=Math.max(i+16,e);return setTimeout(function(){t(i=n)},n-e)},window.cancelAnimationFrame=clearTimeout}window.performance&&window.performance.now||(window.performance={start:Date.now(),now:function(){return Date.now()-this.start}})}(),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,i=function(){},o=function(){return n.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),o.prototype=new i,o})}(jQuery),!function(t){function e(t){var e={};return"string"!=typeof t?e:(t=t.trim().slice(1,-1))?e=t.split("&").reduce(function(t,e){var n=e.replace(/\+/g," ").split("="),i=n[0],o=n[1];
return i=decodeURIComponent(i),o=void 0===o?null:decodeURIComponent(o),t.hasOwnProperty(i)?Array.isArray(t[i])?t[i].push(o):t[i]=[t[i],o]:t[i]=o,t},{}):e}var n={queries:[],current:"",_init:function(){var n,i=this,o=t(".foundation-mq").css("font-family");n=e(o);for(var a in n)n.hasOwnProperty(a)&&i.queries.push({name:a,value:"only screen and (min-width: "+n[a]+")"});this.current=this._getCurrentSize(),this._watcher()},atLeast:function(t){var e=this.get(t);return e?window.matchMedia(e).matches:!1},get:function(t){for(var e in this.queries)if(this.queries.hasOwnProperty(e)){var n=this.queries[e];if(t===n.name)return n.value}return null},_getCurrentSize:function(){for(var t,e=0;e<this.queries.length;e++){var n=this.queries[e];window.matchMedia(n.value).matches&&(t=n)}return"object"==typeof t?t.name:t},_watcher:function(){var e=this;t(window).on("resize.zf.mediaquery",function(){var n=e._getCurrentSize(),i=e.current;n!==i&&(e.current=n,t(window).trigger("changed.zf.mediaquery",[n,i]))})}
};Foundation.MediaQuery=n,window.matchMedia||(window.matchMedia=function(){"use strict";var t=window.styleMedia||window.media;if(!t){var e=document.createElement("style"),n=document.getElementsByTagName("script")[0],i=null;e.type="text/css",e.id="matchmediajs-test",n.parentNode.insertBefore(e,n),i="getComputedStyle"in window&&window.getComputedStyle(e,null)||e.currentStyle,t={matchMedium:function(t){var n="@media "+t+"{ #matchmediajs-test { width: 1px; } }";return e.styleSheet?e.styleSheet.cssText=n:e.textContent=n,"1px"===i.width}}}return function(e){return{matches:t.matchMedium(e||"all"),media:e||"all"}}}()),Foundation.MediaQuery=n}(jQuery),!function(t){function e(t,e,i,o){var a,r,s,l,f=n(t);if(e){var u=n(e);r=f.offset.top+f.height<=u.height+u.offset.top,a=f.offset.top>=u.offset.top,s=f.offset.left>=u.offset.left,l=f.offset.left+f.width<=u.width+u.offset.left}else r=f.offset.top+f.height<=f.windowDims.height+f.windowDims.offset.top,a=f.offset.top>=f.windowDims.offset.top,s=f.offse
t.left>=f.windowDims.offset.left,l=f.offset.left+f.width<=f.windowDims.width;var d=[r,a,s,l];return i?s===l==!0:o?a===r==!0:-1===d.indexOf(!1)}function n(t,e){if(t=t.length?t[0]:t,t===window||t===document)throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");var n=t.getBoundingClientRect(),i=t.parentNode.getBoundingClientRect(),o=document.body.getBoundingClientRect(),a=window.pageYOffset,r=window.pageXOffset;return{width:n.width,height:n.height,offset:{top:n.top+a,left:n.left+r},parentDims:{width:i.width,height:i.height,offset:{top:i.top+a,left:i.left+r}},windowDims:{width:o.width,height:o.height,offset:{top:a,left:r}}}}function i(t,e,i,o,a,r){var s=n(t),l=e?n(e):null;switch(i){case"top":return{left:Foundation.rtl()?l.offset.left-s.width+l.width:l.offset.left,top:l.offset.top-(s.height+o)};case"left":return{left:l.offset.left-(s.width+a),top:l.offset.top};case"right":return{left:l.offset.left+l.width+a,top:l.offset.top};case"center top":return{left:l.offset.left+l.width/2-
s.width/2,top:l.offset.top-(s.height+o)};case"center bottom":return{left:r?a:l.offset.left+l.width/2-s.width/2,top:l.offset.top+l.height+o};case"center left":return{left:l.offset.left-(s.width+a),top:l.offset.top+l.height/2-s.height/2};case"center right":return{left:l.offset.left+l.width+a+1,top:l.offset.top+l.height/2-s.height/2};case"center":return{left:s.windowDims.offset.left+s.windowDims.width/2-s.width/2,top:s.windowDims.offset.top+s.windowDims.height/2-s.height/2};case"reveal":return{left:(s.windowDims.width-s.width)/2,top:s.windowDims.offset.top+o};case"reveal full":return{left:s.windowDims.offset.left,top:s.windowDims.offset.top};case"left bottom":return{left:l.offset.left-(s.width+a),top:l.offset.top+l.height};case"right bottom":return{left:l.offset.left+l.width+a-s.width,top:l.offset.top+l.height};default:return{left:Foundation.rtl()?l.offset.left-s.width+l.width:l.offset.left,top:l.offset.top+l.height+o}}}Foundation.Box={ImNotTouchingYou:e,GetDimensions:n,GetOffsets:i}}(
jQuery),!function(t){function e(t,e,n){function i(s){r||(r=window.performance.now()),a=s-r,n.apply(e),t>a?o=window.requestAnimationFrame(i,e):(window.cancelAnimationFrame(o),e.trigger("finished.zf.animate",[e]).triggerHandler("finished.zf.animate",[e]))}var o,a,r=null;o=window.requestAnimationFrame(i)}function n(e,n,a,r){function s(){e||n.hide(),l(),r&&r.apply(n)}function l(){n[0].style.transitionDuration=0,n.removeClass(f+" "+u+" "+a)}if(n=t(n).eq(0),n.length){var f=e?i[0]:i[1],u=e?o[0]:o[1];l(),n.addClass(a).css("transition","none"),requestAnimationFrame(function(){n.addClass(f),e&&n.show()}),requestAnimationFrame(function(){n[0].offsetWidth,n.css("transition","").addClass(u)}),n.one(Foundation.transitionend(n),s)}}var i=["mui-enter","mui-leave"],o=["mui-enter-active","mui-leave-active"],a={animateIn:function(t,e,i){n(!0,t,e,i)},animateOut:function(t,e,i){n(!1,t,e,i)}};Foundation.Move=e,Foundation.Motion=a}(jQuery),!function(t){function e(){a(),i(),o(),n()}function n(e){var n=t("[
data-yeti-box]"),i=["dropdown","tooltip","reveal"];if(e&&("string"==typeof e?i.push(e):"object"==typeof e&&"string"==typeof e[0]?i.concat(e):console.error("Plugin names must be strings")),n.length){var o=i.map(function(t){return"closeme.zf."+t}).join(" ");t(window).off(o).on(o,function(e,n){var i=e.namespace.split(".")[0],o=t("[data-"+i+"]").not('[data-yeti-box="'+n+'"]');o.each(function(){var e=t(this);e.triggerHandler("close.zf.trigger",[e])})})}}function i(e){var n=void 0,i=t("[data-resize]");i.length&&t(window).off("resize.zf.trigger").on("resize.zf.trigger",function(o){n&&clearTimeout(n),n=setTimeout(function(){r||i.each(function(){t(this).triggerHandler("resizeme.zf.trigger")}),i.attr("data-events","resize")},e||10)})}function o(e){var n=void 0,i=t("[data-scroll]");i.length&&t(window).off("scroll.zf.trigger").on("scroll.zf.trigger",function(o){n&&clearTimeout(n),n=setTimeout(function(){r||i.each(function(){t(this).triggerHandler("scrollme.zf.trigger")}),i.attr("data-events","s
croll")},e||10)})}function a(){if(!r)return!1;var e=document.querySelectorAll("[data-resize], [data-scroll], [data-mutate]"),n=function(e){var n=t(e[0].target);switch(n.attr("data-events")){case"resize":n.triggerHandler("resizeme.zf.trigger",[n]);break;case"scroll":n.triggerHandler("scrollme.zf.trigger",[n,window.pageYOffset]);break;default:return!1}};if(e.length)for(var i=0;i<=e.length-1;i++){var o=new r(n);o.observe(e[i],{attributes:!0,childList:!1,characterData:!1,subtree:!1,attributeFilter:["data-events"]})}}var r=function(){for(var t=["WebKit","Moz","O","Ms",""],e=0;e<t.length;e++)if(t[e]+"MutationObserver"in window)return window[t[e]+"MutationObserver"];return!1}(),s=function(e,n){e.data(n).split(" ").forEach(function(i){t("#"+i)["close"===n?"trigger":"triggerHandler"](n+".zf.trigger",[e])})};t(document).on("click.zf.trigger","[data-open]",function(){s(t(this),"open")}),t(document).on("click.zf.trigger","[data-close]",function(){var e=t(this).data("close");e?s(t(this),"close")
:t(this).trigger("close.zf.trigger")}),t(document).on("click.zf.trigger","[data-toggle]",function(){s(t(this),"toggle")}),t(document).on("close.zf.trigger","[data-closable]",function(e){e.stopPropagation();var n=t(this).data("closable");""!==n?Foundation.Motion.animateOut(t(this),n,function(){t(this).trigger("closed.zf")}):t(this).fadeOut().trigger("closed.zf")}),t(document).on("focus.zf.trigger blur.zf.trigger","[data-toggle-focus]",function(){var e=t(this).data("toggle-focus");t("#"+e).triggerHandler("toggle.zf.trigger",[t(this)])}),t(window).load(function(){e()}),Foundation.IHearYou=e}(jQuery),!function(t){function e(t){var e={};for(var n in t)e[t[n]]=t[n];return e}var n={9:"TAB",13:"ENTER",27:"ESCAPE",32:"SPACE",37:"ARROW_LEFT",38:"ARROW_UP",39:"ARROW_RIGHT",40:"ARROW_DOWN"},i={},o={keys:e(n),parseKey:function(t){var e=n[t.which||t.keyCode]||String.fromCharCode(t.which).toUpperCase();return t.shiftKey&&(e="SHIFT_"+e),t.ctrlKey&&(e="CTRL_"+e),t.altKey&&(e="ALT_"+e),e},handleKey:f
unction(e,n,o){var a,r,s,l=i[n],f=this.parseKey(e);if(!l)return console.warn("Component not defined!");if(a="undefined"==typeof l.ltr?l:Foundation.rtl()?t.extend({},l.ltr,l.rtl):t.extend({},l.rtl,l.ltr),r=a[f],s=o[r],s&&"function"==typeof s){var u=s.apply();(o.handled||"function"==typeof o.handled)&&o.handled(u)}else(o.unhandled||"function"==typeof o.unhandled)&&o.unhandled()},findFocusable:function(e){return e.find("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]").filter(function(){return t(this).is(":visible")&&!(t(this).attr("tabindex")<0)})},register:function(t,e){i[t]=e}};Foundation.Keyboard=o}(jQuery);var _createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}
}();!function(t){function e(){return/iP(ad|hone|od).*OS/.test(window.navigator.userAgent)}function n(){return/Android/.test(window.navigator.userAgent)}function i(){return e()||n()}var o=function(){function e(n,i){_classCallCheck(this,e),this.$element=n,this.options=t.extend({},e.defaults,this.$element.data(),i),this._init(),Foundation.registerPlugin(this,"Reveal"),Foundation.Keyboard.register("Reveal",{ENTER:"open",SPACE:"open",ESCAPE:"close",TAB:"tab_forward",SHIFT_TAB:"tab_backward"})}return _createClass(e,[{key:"_init",value:function(){this.id=this.$element.attr("id"),this.isActive=!1,this.cached={mq:Foundation.MediaQuery.current},this.isMobile=i(),this.$anchor=t(t('[data-open="'+this.id+'"]').length?'[data-open="'+this.id+'"]':'[data-toggle="'+this.id+'"]'),this.$anchor.attr({"aria-controls":this.id,"aria-haspopup":!0,tabindex:0}),(this.options.fullScreen||this.$element.hasClass("full"))&&(this.options.fullScreen=!0,this.options.overlay=!1),this.options.overlay&&!this.$overlay&
&(this.$overlay=this._makeOverlay(this.id)),this.$element.attr({role:"dialog","aria-hidden":!0,"data-yeti-box":this.id,"data-resize":this.id}),this.$overlay?this.$element.detach().appendTo(this.$overlay):(this.$element.detach().appendTo(t("body")),this.$element.addClass("without-overlay")),this._events(),this.options.deepLink&&window.location.hash==="#"+this.id&&t(window).one("load.zf.reveal",this.open.bind(this))}},{key:"_makeOverlay",value:function(e){var n=t("<div></div>").addClass("reveal-overlay").appendTo("body");return n}},{key:"_updatePosition",value:function(){var e,n,i=this.$element.outerWidth(),o=t(window).width(),a=this.$element.outerHeight(),r=t(window).height();e="auto"===this.options.hOffset?parseInt((o-i)/2,10):parseInt(this.options.hOffset,10),n="auto"===this.options.vOffset?a>r?parseInt(Math.min(100,r/10),10):parseInt((r-a)/4,10):parseInt(this.options.vOffset,10),this.$element.css({top:n+"px"}),this.$overlay&&"auto"===this.options.hOffset||(this.$element.css({left:
e+"px"}),this.$element.css({margin:"0px"}))}},{key:"_events",value:function(){var e=this,n=this;this.$element.on({"open.zf.trigger":this.open.bind(this),"close.zf.trigger":function(i,o){return i.target===n.$element[0]||t(i.target).parents("[data-closable]")[0]===o?e.close.apply(e):void 0},"toggle.zf.trigger":this.toggle.bind(this),"resizeme.zf.trigger":function(){n._updatePosition()}}),this.$anchor.length&&this.$anchor.on("keydown.zf.reveal",function(t){13!==t.which&&32!==t.which||(t.stopPropagation(),t.preventDefault(),n.open())}),this.options.closeOnClick&&this.options.overlay&&this.$overlay.off(".zf.reveal").on("click.zf.reveal",function(e){e.target===n.$element[0]||t.contains(n.$element[0],e.target)||n.close()}),this.options.deepLink&&t(window).on("popstate.zf.reveal:"+this.id,this._handleState.bind(this))}},{key:"_handleState",value:function(t){window.location.hash!=="#"+this.id||this.isActive?this.close():this.open()}},{key:"open",value:function(){var e=this;if(this.options.de
epLink){var n="#"+this.id;window.history.pushState?window.history.pushState(null,null,n):window.location.hash=n}if(this.isActive=!0,this.$element.css({visibility:"hidden"}).show().scrollTop(0),this.options.overlay&&this.$overlay.css({visibility:"hidden"}).show(),this._updatePosition(),this.$element.hide().css({visibility:""}),this.$overlay&&(this.$overlay.css({visibility:""}).hide(),this.$element.hasClass("fast")?this.$overlay.addClass("fast"):this.$element.hasClass("slow")&&this.$overlay.addClass("slow")),this.options.multipleOpened||this.$element.trigger("closeme.zf.reveal",this.id),this.options.animationIn){var i;!function(){var t=function(){i.$element.attr({"aria-hidden":!1,tabindex:-1}).focus(),console.log("focus")};i=e,e.options.overlay&&Foundation.Motion.animateIn(e.$overlay,"fade-in"),Foundation.Motion.animateIn(e.$element,e.options.animationIn,function(){e.focusableElements=Foundation.Keyboard.findFocusable(e.$element),t()})}()}else this.options.overlay&&this.$overlay.show(
0),this.$element.show(this.options.showDelay);this.$element.attr({"aria-hidden":!1,tabindex:-1}).focus(),this.$element.trigger("open.zf.reveal"),this.isMobile?(this.originalScrollPos=window.pageYOffset,t("html, body").addClass("is-reveal-open")):t("body").addClass("is-reveal-open"),setTimeout(function(){e._extraHandlers()},0)}},{key:"_extraHandlers",value:function(){var e=this;this.focusableElements=Foundation.Keyboard.findFocusable(this.$element),this.options.overlay||!this.options.closeOnClick||this.options.fullScreen||t("body").on("click.zf.reveal",function(n){n.target===e.$element[0]||t.contains(e.$element[0],n.target)||e.close()}),this.options.closeOnEsc&&t(window).on("keydown.zf.reveal",function(t){Foundation.Keyboard.handleKey(t,"Reveal",{close:function(){e.options.closeOnEsc&&(e.close(),e.$anchor.focus())}})}),this.$element.on("keydown.zf.reveal",function(n){var i=t(this);Foundation.Keyboard.handleKey(n,"Reveal",{tab_forward:function(){return e.$element.find(":focus").is(e.f
ocusableElements.eq(-1))?(e.focusableElements.eq(0).focus(),!0):0===e.focusableElements.length?!0:void 0},tab_backward:function(){return e.$element.find(":focus").is(e.focusableElements.eq(0))||e.$element.is(":focus")?(e.focusableElements.eq(-1).focus(),!0):0===e.focusableElements.length?!0:void 0},open:function(){e.$element.find(":focus").is(e.$element.find("[data-close]"))?setTimeout(function(){e.$anchor.focus()},1):i.is(e.focusableElements)&&e.open()},close:function(){e.options.closeOnEsc&&(e.close(),e.$anchor.focus())},handled:function(t){t&&n.preventDefault()}})})}},{key:"close",value:function(){function e(){n.isMobile?(t("html, body").removeClass("is-reveal-open"),n.originalScrollPos&&(t("body").scrollTop(n.originalScrollPos),n.originalScrollPos=null)):t("body").removeClass("is-reveal-open"),n.$element.attr("aria-hidden",!0),n.$element.trigger("closed.zf.reveal")}if(!this.isActive||!this.$element.is(":visible"))return!1;var n=this;this.options.animationOut?(this.options.overla
y?Foundation.Motion.animateOut(this.$overlay,"fade-out",e):e(),Foundation.Motion.animateOut(this.$element,this.options.animationOut)):(this.options.overlay?this.$overlay.hide(0,e):e(),this.$element.hide(this.options.hideDelay)),this.options.closeOnEsc&&t(window).off("keydown.zf.reveal"),!this.options.overlay&&this.options.closeOnClick&&t("body").off("click.zf.reveal"),this.$element.off("keydown.zf.reveal"),this.options.resetOnClose&&this.$element.html(this.$element.html()),this.isActive=!1,n.options.deepLink&&(window.history.replaceState?window.history.replaceState("",document.title,window.location.pathname):window.location.hash="")}},{key:"toggle",value:function(){this.isActive?this.close():this.open()}},{key:"destroy",value:function(){this.options.overlay&&(this.$element.appendTo(t("body")),this.$overlay.hide().off().remove()),this.$element.hide().off(),this.$anchor.off(".zf"),t(window).off(".zf.reveal:"+this.id),Foundation.unregisterPlugin(this)}}]),e}();o.defaults={animationIn:"
",animationOut:"",showDelay:0,hideDelay:0,closeOnClick:!0,closeOnEsc:!0,multipleOpened:!1,vOffset:"auto",hOffset:"auto",fullScreen:!1,btmOffsetPct:10,overlay:!0,resetOnClose:!1,deepLink:!1},Foundation.plugin(o,"Reveal")}(jQuery);
\ No newline at end of file