zurb-foundation 3.1.1 → 3.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/.rbenv-version +1 -0
  2. data/CHANGELOG.md +51 -0
  3. data/README.md +10 -4
  4. data/index.html +0 -7
  5. data/lib/foundation/generators/USAGE +1 -1
  6. data/lib/foundation/generators/layout_generator.rb +5 -4
  7. data/lib/foundation/version.rb +1 -1
  8. data/marketing/.rbenv-version +1 -0
  9. data/scss/foundation.scss +3 -1
  10. data/scss/foundation/_settings.scss +159 -47
  11. data/scss/foundation/common/_forms.scss +23 -30
  12. data/scss/foundation/common/_globals.scss +4 -8
  13. data/scss/foundation/common/_ratios.scss +17 -17
  14. data/scss/foundation/common/_typography.scss +6 -3
  15. data/scss/foundation/components/_grid.scss +16 -93
  16. data/scss/foundation/components/modules/_all.scss +2 -0
  17. data/scss/foundation/components/modules/_buttons.scss +5 -25
  18. data/scss/foundation/components/modules/_clearing.scss +46 -0
  19. data/scss/foundation/components/modules/_joyride.scss +224 -0
  20. data/scss/foundation/components/modules/_mqueries.scss +451 -0
  21. data/scss/foundation/components/modules/_navbar.scss +1 -37
  22. data/scss/foundation/components/modules/_orbit.scss +57 -198
  23. data/scss/foundation/components/modules/_reveal.scss +3 -24
  24. data/scss/foundation/components/modules/_tabs.scss +15 -40
  25. data/scss/foundation/components/modules/_topbar.scss +12 -113
  26. data/scss/foundation/components/modules/_ui.scss +20 -145
  27. data/templates/project/index.html +4 -10
  28. data/templates/project/scss/_settings.scss +129 -31
  29. data/templates/project/scss/app.scss +1 -1
  30. data/test/buttons.html +0 -6
  31. data/test/clearing.html +74 -0
  32. data/test/config.rb +1 -1
  33. data/test/elements.html +67 -13
  34. data/test/forms.html +0 -6
  35. data/test/grid.html +5 -11
  36. data/test/index.html +18 -20
  37. data/test/joyride.html +126 -0
  38. data/test/magellan.html +112 -0
  39. data/test/navigation.html +27 -19
  40. data/test/orbit.html +11 -12
  41. data/test/reveal.html +0 -6
  42. data/test/scss/_settings.scss +200 -140
  43. data/test/scss/styles.scss +48 -1
  44. data/test/tabs.html +12 -18
  45. data/test/template.html +4 -12
  46. data/test/topbar.html +1 -10
  47. data/test/type.html +8 -14
  48. data/vendor/assets/javascripts/foundation/app.js +17 -13
  49. data/vendor/assets/javascripts/foundation/index.js +3 -0
  50. data/vendor/assets/javascripts/foundation/jquery.event.move.js +580 -0
  51. data/vendor/assets/javascripts/foundation/jquery.event.swipe.js +130 -0
  52. data/vendor/assets/javascripts/foundation/jquery.foundation.accordion.js +24 -7
  53. data/vendor/assets/javascripts/foundation/jquery.foundation.buttons.js +39 -20
  54. data/vendor/assets/javascripts/foundation/jquery.foundation.clearing.js +468 -0
  55. data/vendor/assets/javascripts/foundation/jquery.foundation.forms.js +2 -4
  56. data/vendor/assets/javascripts/foundation/jquery.foundation.joyride.js +635 -0
  57. data/vendor/assets/javascripts/foundation/jquery.foundation.magellan.js +85 -0
  58. data/vendor/assets/javascripts/foundation/jquery.foundation.navigation.js +28 -4
  59. data/vendor/assets/javascripts/foundation/jquery.foundation.orbit.js +84 -28
  60. data/vendor/assets/javascripts/foundation/jquery.foundation.tabs.js +4 -4
  61. data/vendor/assets/javascripts/foundation/jquery.foundation.tooltips.js +18 -14
  62. data/vendor/assets/javascripts/foundation/jquery.foundation.topbar.js +15 -5
  63. data/vendor/assets/javascripts/foundation/modernizr.foundation.js +3 -3
  64. metadata +23 -9
@@ -0,0 +1,130 @@
1
+ // jQuery.event.swipe
2
+ // 0.5
3
+ // Stephen Band
4
+
5
+ // Dependencies
6
+ // jQuery.event.move 1.2
7
+
8
+ // One of swipeleft, swiperight, swipeup or swipedown is triggered on
9
+ // moveend, when the move has covered a threshold ratio of the dimension
10
+ // of the target node, or has gone really fast. Threshold and velocity
11
+ // sensitivity changed with:
12
+ //
13
+ // jQuery.event.special.swipe.settings.threshold
14
+ // jQuery.event.special.swipe.settings.sensitivity
15
+
16
+ (function (module) {
17
+ if (typeof define === 'function' && define.amd) {
18
+ // AMD. Register as an anonymous module.
19
+ define(['jquery'], module);
20
+ } else {
21
+ // Browser globals
22
+ module(jQuery);
23
+ }
24
+ })(function(jQuery, undefined){
25
+ var add = jQuery.event.add,
26
+
27
+ remove = jQuery.event.remove,
28
+
29
+ // Just sugar, so we can have arguments in the same order as
30
+ // add and remove.
31
+ trigger = function(node, type, data) {
32
+ jQuery.event.trigger(type, data, node);
33
+ },
34
+
35
+ settings = {
36
+ // Ratio of distance over target finger must travel to be
37
+ // considered a swipe.
38
+ threshold: 0.4,
39
+ // Faster fingers can travel shorter distances to be considered
40
+ // swipes. 'sensitivity' controls how much. Bigger is shorter.
41
+ sensitivity: 6
42
+ };
43
+
44
+ function moveend(e) {
45
+ var w, h, event;
46
+
47
+ w = e.target.offsetWidth;
48
+ h = e.target.offsetHeight;
49
+
50
+ // Copy over some useful properties from the move event
51
+ event = {
52
+ distX: e.distX,
53
+ distY: e.distY,
54
+ velocityX: e.velocityX,
55
+ velocityY: e.velocityY,
56
+ finger: e.finger
57
+ };
58
+
59
+ // Find out which of the four directions was swiped
60
+ if (e.distX > e.distY) {
61
+ if (e.distX > -e.distY) {
62
+ if (e.distX/w > settings.threshold || e.velocityX * e.distX/w * settings.sensitivity > 1) {
63
+ event.type = 'swiperight';
64
+ trigger(e.currentTarget, event);
65
+ }
66
+ }
67
+ else {
68
+ if (-e.distY/h > settings.threshold || e.velocityY * e.distY/w * settings.sensitivity > 1) {
69
+ event.type = 'swipeup';
70
+ trigger(e.currentTarget, event);
71
+ }
72
+ }
73
+ }
74
+ else {
75
+ if (e.distX > -e.distY) {
76
+ if (e.distY/h > settings.threshold || e.velocityY * e.distY/w * settings.sensitivity > 1) {
77
+ event.type = 'swipedown';
78
+ trigger(e.currentTarget, event);
79
+ }
80
+ }
81
+ else {
82
+ if (-e.distX/w > settings.threshold || e.velocityX * e.distX/w * settings.sensitivity > 1) {
83
+ event.type = 'swipeleft';
84
+ trigger(e.currentTarget, event);
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ function getData(node) {
91
+ var data = jQuery.data(node, 'event_swipe');
92
+
93
+ if (!data) {
94
+ data = { count: 0 };
95
+ jQuery.data(node, 'event_swipe', data);
96
+ }
97
+
98
+ return data;
99
+ }
100
+
101
+ jQuery.event.special.swipe =
102
+ jQuery.event.special.swipeleft =
103
+ jQuery.event.special.swiperight =
104
+ jQuery.event.special.swipeup =
105
+ jQuery.event.special.swipedown = {
106
+ setup: function( data, namespaces, eventHandle ) {
107
+ var data = getData(this);
108
+
109
+ // If another swipe event is already setup, don't setup again.
110
+ if (data.count++ > 0) { return; }
111
+
112
+ add(this, 'moveend', moveend);
113
+
114
+ return true;
115
+ },
116
+
117
+ teardown: function() {
118
+ var data = getData(this);
119
+
120
+ // If another swipe event is still setup, don't teardown.
121
+ if (--data.count > 0) { return; }
122
+
123
+ remove(this, 'moveend', moveend);
124
+
125
+ return true;
126
+ },
127
+
128
+ settings: settings
129
+ };
130
+ });
@@ -2,15 +2,32 @@
2
2
  'use strict';
3
3
 
4
4
  $.fn.foundationAccordion = function (options) {
5
+ var $accordion = $('.accordion');
5
6
 
6
- $('.accordion li', this).on('click.fndtn', function () {
7
- var p = $(this).parent(); //changed this
8
- var flyout = $(this).children('.content').first();
9
- $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
10
- flyout.show(0, function () {
11
- flyout.parent('li').addClass('active');
7
+ if ($accordion.hasClass('hover') && !Modernizr.touch) {
8
+ $('.accordion li', this).on({
9
+ mouseenter : function () {
10
+ console.log('due');
11
+ var p = $(this).parent(),
12
+ flyout = $(this).children('.content').first();
13
+
14
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
15
+ flyout.show(0, function () {
16
+ flyout.parent('li').addClass('active');
17
+ });
18
+ }
19
+ });
20
+ } else {
21
+ $('.accordion li', this).on('click.fndtn', function () {
22
+ var p = $(this).parent(),
23
+ flyout = $(this).children('.content').first();
24
+
25
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
26
+ flyout.show(0, function () {
27
+ flyout.parent('li').addClass('active');
28
+ });
12
29
  });
13
- });
30
+ }
14
31
 
15
32
  };
16
33
 
@@ -1,8 +1,23 @@
1
1
  ;(function ($, window, undefined) {
2
2
  'use strict';
3
3
 
4
- $.fn.foundationButtons = function(options) {
5
- var $doc = $(document);
4
+ $.fn.foundationButtons = function (options) {
5
+ var $doc = $(document),
6
+ config = $.extend({
7
+ dropdownAsToggle:true,
8
+ activeClass:'active'
9
+ }, options),
10
+
11
+ // close all dropdowns except for the dropdown passed
12
+ closeDropdowns = function (dropdown) {
13
+ $('.button.dropdown').find('ul').not(dropdown).removeClass('show-dropdown');
14
+ },
15
+ // reset all toggle states except for the button passed
16
+ resetToggles = function (button) {
17
+ var buttons = $('.button.dropdown').not(button);
18
+ buttons.add($('> span.' + config.activeClass, buttons)).removeClass(config.activeClass);
19
+ };
20
+
6
21
  // Prevent event propagation on disabled buttons
7
22
  $doc.on('click.fndtn', '.button.disabled', function (e) {
8
23
  e.preventDefault();
@@ -10,28 +25,32 @@
10
25
 
11
26
  $('.button.dropdown > ul', this).addClass('no-hover');
12
27
 
13
- $doc.on('click.fndtn', '.button.dropdown, .button.dropdown.split span', function (e) {
14
- // Stops further propagation of the event up the DOM tree when clicked on the button.
15
- // Events fired by its descendants are not being blocked.
16
- $('.button.dropdown').children('ul').removeClass('show-dropdown');
17
- if (e.target === this) {
18
- e.stopPropagation();
19
- }
20
- });
21
-
22
- $doc.on('click.fndtn', '.button.dropdown.split span', function (e) {
28
+ // reset other active states
29
+ $doc.on('click.fndtn', '.button.dropdown:not(.split), .button.dropdown.split span', function (e) {
30
+ var $el = $(this),
31
+ button = $el.closest('.button.dropdown'),
32
+ dropdown = $('> ul', button);
23
33
  e.preventDefault();
24
- $('.button.dropdown', this).not($(this).parent()).children('ul').removeClass('show-dropdown');
25
- $(this).siblings('ul').toggleClass('show-dropdown');
26
- });
27
34
 
28
- $doc.on('click.fndtn', '.button.dropdown:not(.split)', function (e) {
29
- $('.button.dropdown', this).not(this).children('ul').removeClass('show-dropdown');
30
- $(this).children('ul').toggleClass('show-dropdown');
35
+ // close other dropdowns
36
+ closeDropdowns(config.dropdownAsToggle ? dropdown : '');
37
+ dropdown.toggleClass('show-dropdown');
38
+
39
+ if (config.dropdownAsToggle) {
40
+ resetToggles(button);
41
+ $el.toggleClass(config.activeClass);
42
+ }
31
43
  });
32
44
 
33
- $doc.on('click.fndtn', 'body, html', function () {
34
- $('.button.dropdown ul').removeClass('show-dropdown');
45
+ // close all dropdowns and deactivate all buttons
46
+ $doc.on('click.fndtn', 'body, html', function (e) {
47
+ // check original target instead of stopping event propagation to play nice with other events
48
+ if (!$(e.originalEvent.target).is('.button.dropdown:not(.split), .button.dropdown.split span')) {
49
+ closeDropdowns();
50
+ if (config.dropdownAsToggle) {
51
+ resetToggles();
52
+ }
53
+ }
35
54
  });
36
55
 
37
56
  // Positioning the Flyout List
@@ -0,0 +1,468 @@
1
+ /*
2
+ * jQuery Foundation Clearing 1.0
3
+ * http://foundation.zurb.com
4
+ * Copyright 2012, ZURB
5
+ * Free to use under the MIT license.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ */
8
+
9
+ /*jslint unparam: true, browser: true, indent: 2 */
10
+
11
+ ;(function ($, window, undefined) {
12
+ 'use strict';
13
+
14
+ var defaults = {
15
+ templates : {
16
+ viewing : '<a href="#" class="clearing-close">&times;</a>' +
17
+ '<div class="visible-img" style="display: none"><img src="#">' +
18
+ '<p class="clearing-caption"></p><a href="#" class="clearing-main-left"></a>' +
19
+ '<a href="#" class="clearing-main-right"></a></div>'
20
+ },
21
+ locked : false
22
+ },
23
+
24
+ superMethods = {},
25
+
26
+ methods = {
27
+ init : function (options, extendMethods) {
28
+ return this.find('ul[data-clearing]').each(function () {
29
+ var doc = $(document),
30
+ $el = $(this),
31
+ options = options || {},
32
+ extendMethods = extendMethods || {},
33
+ settings = $el.data('fndtn.clearing.settings');
34
+
35
+ if (!settings) {
36
+ options.$parent = $el.parent();
37
+
38
+ $el.data('fndtn.clearing.settings', $.extend({}, defaults, options));
39
+
40
+ // developer goodness experiment
41
+ methods.extend(methods, extendMethods);
42
+
43
+ // if the gallery hasn't been built yet...build it
44
+ methods.assemble($el.find('li'));
45
+
46
+ methods.events();
47
+
48
+ }
49
+ });
50
+ },
51
+
52
+ events : function () {
53
+ var doc = $(document);
54
+
55
+ doc.on('click.fndtn.clearing', 'ul[data-clearing] li', function (e, current, target) {
56
+ var current = current || $(this),
57
+ target = target || current;
58
+
59
+ e.preventDefault();
60
+
61
+ // set current and target to the clicked li if not otherwise defined.
62
+ methods.open($(e.target), current, target);
63
+ methods.update_paddles(target);
64
+ });
65
+
66
+ $(window).on('resize.fndtn.clearing', function () {
67
+ var image = $('.clearing-blackout .visible-img').find('img');
68
+
69
+ if (image.length > 0) {
70
+ methods.center(image);
71
+ }
72
+ });
73
+
74
+ doc.on('click.fndtn.clearing', '.clearing-main-right', function (e) {
75
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
76
+
77
+ e.preventDefault();
78
+ methods.go(clearing, 'next');
79
+ });
80
+
81
+ doc.on('click.fndtn.clearing', '.clearing-main-left', function (e) {
82
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
83
+
84
+ e.preventDefault();
85
+ methods.go(clearing, 'prev');
86
+ });
87
+
88
+ doc.on('click.fndtn.clearing', 'a.clearing-close, div.clearing-blackout', function (e) {
89
+ var root = (function (target) {
90
+ if (/blackout/.test(target.selector)) {
91
+ return target;
92
+ } else {
93
+ return target.closest('.clearing-blackout');
94
+ }
95
+ }($(this))), container, visible_image;
96
+
97
+ if (this === e.target && root) {
98
+ container = root.find('div:first'),
99
+ visible_image = container.find('.visible-img');
100
+
101
+ defaults.prev_index = 0;
102
+
103
+ root.find('ul[data-clearing]').attr('style', '')
104
+ root.removeClass('clearing-blackout');
105
+ container.removeClass('clearing-container');
106
+ visible_image.hide();
107
+ }
108
+
109
+ return false;
110
+ });
111
+
112
+ // should specify a target selector
113
+ doc.on('keydown.fndtn.clearing', function (e) {
114
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
115
+
116
+ // right
117
+ if (e.which === 39) {
118
+ methods.go(clearing, 'next');
119
+ }
120
+
121
+ // left
122
+ if (e.which === 37) {
123
+ methods.go(clearing, 'prev');
124
+ }
125
+ });
126
+
127
+ doc.on('movestart', function(e) {
128
+
129
+ // If the movestart is heading off in an upwards or downwards
130
+ // direction, prevent it so that the browser scrolls normally.
131
+
132
+ if ((e.distX > e.distY && e.distX < -e.distY) ||
133
+ (e.distX < e.distY && e.distX > -e.distY)) {
134
+ e.preventDefault();
135
+ }
136
+ });
137
+
138
+ doc.bind('swipeleft', 'ul[data-clearing] li', function () {
139
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
140
+ methods.go(clearing, 'next');
141
+ });
142
+
143
+ doc.bind('swiperight', 'ul[data-clearing] li', function () {
144
+ var clearing = $('.clearing-blackout').find('ul[data-clearing]');
145
+ methods.go(clearing, 'prev');
146
+ });
147
+ },
148
+
149
+ assemble : function ($li, target) {
150
+ var $el = $li.parent(),
151
+ settings = $el.data('fndtn.clearing.settings'),
152
+ grid = $el.detach(),
153
+ data = {
154
+ grid: '<div class="carousel">' + this.outerHTML(grid[0]) + '</div>',
155
+ viewing: settings.templates.viewing
156
+ },
157
+ wrapper = '<div class="clearing-assembled"><div>' + data.viewing + data.grid + '</div></div>';
158
+
159
+ return settings.$parent.append(wrapper);
160
+ },
161
+
162
+ open : function ($image, current, target) {
163
+ var root = target.closest('.clearing-assembled'),
164
+ container = root.find('div:first'),
165
+ visible_image = container.find('.visible-img'),
166
+ image = visible_image.find('img').not($image);
167
+
168
+ if (!methods.locked()) {
169
+
170
+ // set the image to the selected thumbnail
171
+ image.attr('src', this.load($image));
172
+
173
+ image.is_good(function () {
174
+ // toggle the gallery if not visible
175
+ root.addClass('clearing-blackout');
176
+ container.addClass('clearing-container');
177
+ methods.caption(visible_image.find('.clearing-caption'), $image);
178
+ visible_image.show();
179
+ methods.fix_height(target);
180
+
181
+ methods.center(image);
182
+
183
+ // shift the thumbnails if necessary
184
+ methods.shift(current, target, function () {
185
+ target.siblings().removeClass('visible');
186
+ target.addClass('visible');
187
+ });
188
+ });
189
+ }
190
+ },
191
+
192
+ fix_height : function (target) {
193
+ var lis = target.siblings();
194
+
195
+ lis.each(function () {
196
+ var li = $(this),
197
+ image = li.find('img');
198
+
199
+ if (li.height() > image.height()) {
200
+ li.addClass('fix-height');
201
+ }
202
+ });
203
+ lis.closest('ul').width(lis.length * 100 + '%');
204
+ },
205
+
206
+ update_paddles : function (target) {
207
+ var visible_image = target.closest('.carousel').siblings('.visible-img');
208
+
209
+ if (target.next().length > 0) {
210
+ visible_image.find('.clearing-main-right').removeClass('disabled');
211
+ } else {
212
+ visible_image.find('.clearing-main-right').addClass('disabled');
213
+ }
214
+
215
+ if (target.prev().length > 0) {
216
+ visible_image.find('.clearing-main-left').removeClass('disabled');
217
+ } else {
218
+ visible_image.find('.clearing-main-left').addClass('disabled');
219
+ }
220
+ },
221
+
222
+ load : function ($image) {
223
+ var href = $image.parent().attr('href');
224
+
225
+ // preload next and previous
226
+ this.preload($image);
227
+
228
+ if (href) {
229
+ return href;
230
+ }
231
+
232
+ return $image.attr('src');
233
+ },
234
+
235
+ preload : function ($image) {
236
+ var next = $image.closest('li').next(),
237
+ prev = $image.closest('li').prev(),
238
+ next_a, prev_a,
239
+ next_img, prev_img;
240
+
241
+ if (next.length > 0) {
242
+ next_img = new Image();
243
+ next_a = next.find('a');
244
+ if (next_a.length > 0) {
245
+ next_img.src = next_a.attr('href');
246
+ } else {
247
+ next_img.src = next.find('img').attr('src');
248
+ }
249
+ }
250
+
251
+ if (prev.length > 0) {
252
+ prev_img = new Image();
253
+ prev_a = prev.find('a');
254
+ if (prev_a.length > 0) {
255
+ prev_img.src = prev_a.attr('href');
256
+ } else {
257
+ prev_img.src = prev.find('img').attr('src');
258
+ }
259
+ }
260
+ },
261
+
262
+ caption : function (container, $image) {
263
+ var caption = $image.data('caption');
264
+
265
+ if (caption) {
266
+ container.text(caption).show();
267
+ } else {
268
+ container.text('').hide();
269
+ }
270
+ },
271
+
272
+ go : function ($ul, direction) {
273
+ var current = $ul.find('.visible'),
274
+ target = current[direction]();
275
+
276
+ if (target.length > 0) {
277
+ target.find('img').trigger('click', [current, target]);
278
+ }
279
+ },
280
+
281
+ shift : function (current, target, callback) {
282
+ var clearing = target.parent(),
283
+ container = clearing.closest('.clearing-container'),
284
+ target_offset = target.position().left,
285
+ thumbs_offset = clearing.position().left,
286
+ old_index = defaults.prev_index,
287
+ direction = this.direction(clearing, current, target),
288
+ left = parseInt(clearing.css('left'), 10),
289
+ width = target.outerWidth(),
290
+ skip_shift;
291
+
292
+ // we use jQuery animate instead of CSS transitions because we
293
+ // need a callback to unlock the next animation
294
+
295
+ if (target.index() !== old_index && !/skip/.test(direction)){
296
+ if (/left/.test(direction)) {
297
+ methods.lock();
298
+ clearing.animate({left : left + width}, 300, methods.unlock);
299
+ } else if (/right/.test(direction)) {
300
+ methods.lock();
301
+ clearing.animate({left : left - width}, 300, methods.unlock);
302
+ }
303
+ } else if (/skip/.test(direction)) {
304
+
305
+ // the target image is not adjacent to the current image, so
306
+ // do we scroll right or not
307
+ skip_shift = target.index() - defaults.up_count;
308
+ methods.lock();
309
+
310
+ if (skip_shift > 0) {
311
+ clearing.animate({left : -(skip_shift * width)}, 300, methods.unlock);
312
+ } else {
313
+ clearing.animate({left : 0}, 300, methods.unlock);
314
+ }
315
+ }
316
+
317
+ callback();
318
+ },
319
+
320
+ lock : function () {
321
+ defaults.locked = true;
322
+ },
323
+
324
+ unlock : function () {
325
+ defaults.locked = false;
326
+ },
327
+
328
+ locked : function () {
329
+ return defaults.locked;
330
+ },
331
+
332
+ direction : function ($el, current, target) {
333
+ var lis = $el.find('li'),
334
+ li_width = lis.outerWidth() + (lis.outerWidth() / 4),
335
+ container = $('.clearing-container'),
336
+ up_count = Math.floor(container.outerWidth() / li_width) - 1,
337
+ shift_count = lis.length - up_count,
338
+ target_index = lis.index(target),
339
+ current_index = lis.index(current),
340
+ response;
341
+
342
+ defaults.up_count = up_count;
343
+
344
+ if (this.adjacent(defaults.prev_index, target_index)) {
345
+ if ((target_index > up_count) && target_index > defaults.prev_index) {
346
+ response = 'right';
347
+ } else if ((target_index > up_count - 1) && target_index <= defaults.prev_index) {
348
+ response = 'left';
349
+ } else {
350
+ response = false;
351
+ }
352
+ } else {
353
+ response = 'skip';
354
+ }
355
+
356
+ defaults.prev_index = target_index;
357
+
358
+ return response;
359
+ },
360
+
361
+ adjacent : function (current_index, target_index) {
362
+ if (target_index - 1 === current_index) {
363
+ return true;
364
+ } else if (target_index + 1 === current_index) {
365
+ return true;
366
+ } else if (target_index === current_index) {
367
+ return true;
368
+ }
369
+
370
+ return false;
371
+ },
372
+
373
+ center : function (target) {
374
+ target.css({
375
+ marginLeft : -(target.outerWidth() / 2),
376
+ marginTop : -(target.outerHeight() / 2)
377
+ });
378
+ },
379
+
380
+ outerHTML : function (el) {
381
+ // support FireFox < 11
382
+ return el.outerHTML || new XMLSerializer().serializeToString(el);
383
+ },
384
+
385
+ // experimental functionality for overwriting or extending
386
+ // clearing methods during initialization.
387
+ //
388
+ // ex $doc.foundationClearing({}, {
389
+ // shift : function (current, target, callback) {
390
+ // // modify arguments, etc.
391
+ // this._super('shift', [current, target, callback]);
392
+ // // do something else here.
393
+ // }
394
+ // });
395
+
396
+ extend : function (supers, extendMethods) {
397
+ $.each(supers, function (name, method) {
398
+ if (extendMethods.hasOwnProperty(name)) {
399
+ superMethods[name] = method;
400
+ }
401
+ });
402
+
403
+ $.extend(methods, extendMethods);
404
+ },
405
+
406
+ // you can call this._super('methodName', [args]) to call
407
+ // the original method and wrap it in your own code
408
+
409
+ _super : function (method, args) {
410
+ return superMethods[method].apply(this, args);
411
+ }
412
+ };
413
+
414
+ $.fn.foundationClearing = function (method) {
415
+ if (methods[method]) {
416
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
417
+ } else if (typeof method === 'object' || !method) {
418
+ return methods.init.apply(this, arguments);
419
+ } else {
420
+ $.error('Method ' + method + ' does not exist on jQuery.foundationClearing');
421
+ }
422
+ };
423
+
424
+ // jquery.imageready.js
425
+ // @weblinc, @jsantell, (c) 2012
426
+
427
+ (function( $ ) {
428
+ $.fn.is_good = function ( callback, userSettings ) {
429
+ var
430
+ options = $.extend( {}, $.fn.is_good.defaults, userSettings ),
431
+ $images = this.find( 'img' ).add( this.filter( 'img' ) ),
432
+ unloadedImages = $images.length;
433
+
434
+ function loaded () {
435
+ unloadedImages -= 1;
436
+ !unloadedImages && callback();
437
+ }
438
+
439
+ function bindLoad () {
440
+ this.one( 'load', loaded );
441
+ if ( $.browser.msie ) {
442
+ var
443
+ src = this.attr( 'src' ),
444
+ param = src.match( /\?/ ) ? '&' : '?';
445
+ param += options.cachePrefix + '=' + ( new Date() ).getTime();
446
+ this.attr( 'src', src + param );
447
+ }
448
+ }
449
+
450
+ return $images.each(function () {
451
+ var $this = $( this );
452
+ if ( !$this.attr( 'src' ) ) {
453
+ loaded();
454
+ return;
455
+ }
456
+ this.complete || this.readyState === 4 ?
457
+ loaded() :
458
+ bindLoad.call( $this );
459
+ });
460
+ };
461
+
462
+ $.fn.is_good.defaults = {
463
+ cachePrefix: 'random'
464
+ };
465
+
466
+ }(jQuery));
467
+
468
+ }(jQuery, this));