{I" class:ETI"BundledAsset; FI"logical_path; TI"foundation/index.js; FI" pathname; TI"m/home/meddle/.rbenv/versions/2.0.0-p353/gemsets/yatoto/gems/zurb-foundation-4.0.9/js/foundation/index.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+€ƒœRI"length; TiÄI"digest; TI"%51b7235a7f5b78c58a39d40cb201c8bd; FI"source; TI"Ä/* * Foundation Responsive Library * http://foundation.zurb.com * Copyright 2013, ZURB * Free to use under the MIT license. * http://www.opensource.org/licenses/mit-license.php */ /*jslint unparam: true, browser: true, indent: 2 */ // Accommodate running jQuery or Zepto in noConflict() mode by // using an anonymous function to redefine the $ shorthand name. // See http://docs.jquery.com/Using_jQuery_with_Other_Libraries // and http://zeptojs.com/ var libFuncName = null; if (typeof jQuery === "undefined" && typeof Zepto === "undefined" && typeof $ === "function") { libFuncName = $; } else if (typeof jQuery === "function") { libFuncName = jQuery; } else if (typeof Zepto === "function") { libFuncName = Zepto; } else { throw new TypeError(); } (function ($) { (function () { // add dusty browser stuff if (!Array.prototype.filter) { Array.prototype.filter = function(fun /*, thisp */) { "use strict"; if (this == null) { throw new TypeError(); } var t = Object(this), len = t.length >>> 0; if (typeof fun != "function") { try { throw new TypeError(); } catch (e) { return; } } var res = [], thisp = arguments[1]; for (var i = 0; i < len; i++) { if (i in t) { var val = t[i]; // in case fun mutates this if (fun && fun.call(thisp, val, i, t)) { res.push(val); } } } return res; }; 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 && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); }; fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); return fBound; }; } } // fake stop() for zepto. $.fn.stop = $.fn.stop || function() { return this; }; }()); ;(function (window, document, undefined) { 'use strict'; window.Foundation = { name : 'Foundation', version : '4.0.8', // global Foundation cache object cache : {}, init : function (scope, libraries, method, options, response, /* internal */ nc) { var library_arr, args = [scope, method, options, response], responses = [], nc = nc || false; // disable library error catching, // used for development only if (nc) this.nc = nc; // set foundation global scope this.scope = scope || this.scope; if (libraries && typeof libraries === 'string') { if (/off/i.test(libraries)) return this.off(); library_arr = libraries.split(' '); if (library_arr.length > 0) { for (var i = library_arr.length - 1; i >= 0; i--) { responses.push(this.init_lib(library_arr[i], args)); } } } else { for (var lib in this.libs) { responses.push(this.init_lib(lib, args)); } } // if first argument is callback, add to args if (typeof libraries === 'function') { args.unshift(libraries); } return this.response_obj(responses, args); }, response_obj : function (response_arr, args) { for (var callback in args) { if (typeof args[callback] === 'function') { return args[callback]({ errors: response_arr.filter(function (s) { if (typeof s === 'string') return s; }) }); } } return response_arr; }, init_lib : function (lib, args) { return this.trap(function () { if (this.libs.hasOwnProperty(lib)) { this.patch(this.libs[lib]); return this.libs[lib].init.apply(this.libs[lib], args); } }.bind(this), lib); }, trap : function (fun, lib) { if (!this.nc) { try { return fun(); } catch (e) { return this.error({name: lib, message: 'could not be initialized', more: e.name + ' ' + e.message}); } } return fun(); }, patch : function (lib) { this.fix_outer(lib); }, inherit : function (scope, methods) { var methods_arr = methods.split(' '); for (var i = methods_arr.length - 1; i >= 0; i--) { if (this.lib_methods.hasOwnProperty(methods_arr[i])) { this.libs[scope.name][methods_arr[i]] = this.lib_methods[methods_arr[i]]; } } }, random_str : function (length) { var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split(''); if (!length) { length = Math.floor(Math.random() * chars.length); } var str = ''; for (var i = 0; i < length; i++) { str += chars[Math.floor(Math.random() * chars.length)]; } return str; }, libs : {}, // methods that can be inherited in libraries lib_methods : { set_data : function (node, data) { // this.name references the name of the library calling this method var id = [this.name,+new Date(),Foundation.random_str(5)].join('-'); Foundation.cache[id] = data; node.attr('data-' + this.name + '-id', id); return data; }, get_data : function (node) { return Foundation.cache[node.attr('data-' + this.name + '-id')]; }, remove_data : function (node) { if (node) { delete Foundation.cache[node.attr('data-' + this.name + '-id')]; node.attr('data-' + this.name + '-id', ''); } else { $('[data-' + this.name + '-id]').each(function () { delete Foundation.cache[$(this).attr('data-' + this.name + '-id')]; $(this).attr('data-' + this.name + '-id', ''); }); } }, throttle : function(fun, delay) { var timer = null; return function () { var context = this, args = arguments; clearTimeout(timer); timer = setTimeout(function () { fun.apply(context, args); }, delay); }; }, // parses data-options attribute on nodes and turns // them into an object data_options : function (el) { var opts = {}, ii, p, opts_arr = (el.attr('data-options') || ':').split(';'), opts_len = opts_arr.length; function isNumber (o) { return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true; } function trim(str) { if (typeof str === 'string') return $.trim(str); return str; } // parse options for (ii = opts_len - 1; ii >= 0; ii--) { p = opts_arr[ii].split(':'); if (/true/i.test(p[1])) p[1] = true; if (/false/i.test(p[1])) p[1] = false; if (isNumber(p[1])) p[1] = parseInt(p[1], 10); if (p.length === 2 && p[0].length > 0) { opts[trim(p[0])] = trim(p[1]); } } return opts; }, delay : function (fun, delay) { return setTimeout(fun, delay); }, // animated scrolling scrollTo : function (el, to, duration) { if (duration < 0) return; var difference = to - $(window).scrollTop(); var perTick = difference / duration * 10; this.scrollToTimerCache = setTimeout(function() { if (!isNaN(parseInt(perTick, 10))) { window.scrollTo(0, $(window).scrollTop() + perTick); this.scrollTo(el, to, duration - 10); } }.bind(this), 10); }, // not supported in core Zepto scrollLeft : function (el) { if (!el.length) return; return ('scrollLeft' in el[0]) ? el[0].scrollLeft : el[0].pageXOffset; }, // test for empty object or array empty : function (obj) { if (obj.length && obj.length > 0) return false; if (obj.length && obj.length === 0) return true; for (var key in obj) { if (hasOwnProperty.call(obj, key)) return false; } return true; } }, fix_outer : function (lib) { lib.outerHeight = function (el, bool) { if (typeof Zepto === 'function') { return el.height(); } if (typeof bool !== 'undefined') { return el.outerHeight(bool); } return el.outerHeight(); }; lib.outerWidth = function (el) { if (typeof Zepto === 'function') { return el.width(); } if (typeof bool !== 'undefined') { return el.outerWidth(bool); } return el.outerWidth(); }; }, error : function (error) { return error.name + ' ' + error.message + '; ' + error.more; }, // remove all foundation events. off: function () { $(this.scope).off('.fndtn'); $(window).off('.fndtn'); return true; }, zj : function () { try { return Zepto; } catch (e) { return jQuery; } }() }, $.fn.foundation = function () { var args = Array.prototype.slice.call(arguments, 0); return this.each(function () { Foundation.init.apply(Foundation, [this].concat(args)); return this; }); }; }(this, this.document)); })(libFuncName); /*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.alerts = { name : 'alerts', version : '4.0.0', settings : { speed: 300, // fade out speed callback: function (){} }, init : function (scope, method, options) { this.scope = scope || this.scope; if (typeof method === 'object') { $.extend(true, this.settings, method); } if (typeof method != 'string') { if (!this.settings.init) this.events(); return this.settings.init; } else { return this[method].call(this, options); } }, events : function () { var self = this; $(this.scope).on('click.fndtn.alerts', '[data-alert] a.close', function (e) { e.preventDefault(); $(this).closest("[data-alert]").fadeOut(self.speed, function () { $(this).remove(); self.settings.callback(); }); }); this.settings.init = true; }, off : function () { $(this.scope).off('.fndtn.alerts'); } }; }(Foundation.zj, this, this.document)); /*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.clearing = { name : 'clearing', version : '4.0.0', settings : { templates : { viewing : '×' + '
' }, // comma delimited list of selectors that, on click, will close clearing, // add 'div.clearing-blackout, div.visible-img' to close on background click close_selectors : '.clearing-close', // event initializers and locks init : false, locked : false }, init : function (scope, method, options) { this.scope = this.scope || scope; Foundation.inherit(this, 'set_data get_data remove_data throttle'); if (typeof method === 'object') { options = $.extend(true, this.settings, method); } if (typeof method != 'string') { $(this.scope).find('ul[data-clearing]').each(function () { var self = Foundation.libs.clearing, $el = $(this), options = options || {}, settings = self.get_data($el); if (!settings) { options.$parent = $el.parent(); self.set_data($el, $.extend(true, self.settings, options)); self.assemble($el.find('li')); if (!self.settings.init) { self.events().swipe_events(); } } }); return this.settings.init; } else { // fire method return this[method].call(this, options); } }, // event binding and initial setup events : function () { var self = this; $(this.scope) .on('click.fndtn.clearing', 'ul[data-clearing] li', function (e, current, target) { var current = current || $(this), target = target || current, settings = self.get_data(current.parent()); e.preventDefault(); if (!settings) self.init(); // set current and target to the clicked li if not otherwise defined. self.open($(e.target), current, target); self.update_paddles(target); }) .on('click.fndtn.clearing', '.clearing-main-right', function (e) { this.nav(e, 'next') }.bind(this)) .on('click.fndtn.clearing', '.clearing-main-left', function (e) { this.nav(e, 'prev') }.bind(this)) .on('click.fndtn.clearing', this.settings.close_selectors, function (e) { Foundation.libs.clearing.close(e, this) }) .on('keydown.fndtn.clearing', function (e) { this.keydown(e) }.bind(this)); $(window).on('resize.fndtn.clearing', function (e) { this.resize() }.bind(this)); this.settings.init = true; return this; }, swipe_events : function () { var self = this; $(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 }; $(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; var data = $(this).data('swipe-transition'); if (typeof data === 'undefined') { data = {}; } data.delta_x = e.touches[0].pageX - data.start_page_x; if ( typeof data.is_scrolling === 'undefined') { data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) ); } if (!data.is_scrolling && !data.active) { e.preventDefault(); var direction = (data.delta_x < 0) ? 'next' : 'prev'; data.active = true; self.nav(e, direction); } }) .on('touchend.fndtn.clearing', '.visible-img', function(e) { $(this).data('swipe-transition', {}); e.stopPropagation(); }); }, assemble : function ($li) { var $el = $li.parent(), settings = this.get_data($el), grid = $el.detach(), data = { grid: '