foundation-rails 5.1.1.0 → 5.2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -7
  3. data/bower.json +2 -2
  4. data/lib/foundation/rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/foundation/foundation.abide.js +3 -6
  6. data/vendor/assets/javascripts/foundation/foundation.accordion.js +5 -4
  7. data/vendor/assets/javascripts/foundation/foundation.alert.js +1 -1
  8. data/vendor/assets/javascripts/foundation/foundation.clearing.js +70 -34
  9. data/vendor/assets/javascripts/foundation/foundation.dropdown.js +121 -28
  10. data/vendor/assets/javascripts/foundation/foundation.equalizer.js +6 -6
  11. data/vendor/assets/javascripts/foundation/foundation.interchange.js +34 -25
  12. data/vendor/assets/javascripts/foundation/foundation.joyride.js +4 -8
  13. data/vendor/assets/javascripts/foundation/foundation.js +94 -78
  14. data/vendor/assets/javascripts/foundation/foundation.magellan.js +3 -4
  15. data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +19 -1
  16. data/vendor/assets/javascripts/foundation/foundation.orbit.js +151 -102
  17. data/vendor/assets/javascripts/foundation/foundation.reveal.js +43 -15
  18. data/vendor/assets/javascripts/foundation/foundation.slider.js +187 -0
  19. data/vendor/assets/javascripts/foundation/foundation.tab.js +116 -18
  20. data/vendor/assets/javascripts/foundation/foundation.tooltip.js +112 -60
  21. data/vendor/assets/javascripts/foundation/foundation.topbar.js +47 -14
  22. data/vendor/assets/javascripts/vendor/modernizr.js +3 -3
  23. data/vendor/assets/stylesheets/foundation.scss +7 -0
  24. data/vendor/assets/stylesheets/foundation/_functions.scss +4 -0
  25. data/vendor/assets/stylesheets/foundation/_settings.scss +11 -2
  26. data/vendor/assets/stylesheets/foundation/components/_accordion.scss +5 -1
  27. data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +4 -0
  28. data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +44 -12
  29. data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +4 -0
  30. data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +4 -0
  31. data/vendor/assets/stylesheets/foundation/components/_buttons.scss +7 -5
  32. data/vendor/assets/stylesheets/foundation/components/_clearing.scss +4 -0
  33. data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +4 -0
  34. data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +100 -11
  35. data/vendor/assets/stylesheets/foundation/components/_flex-video.scss +4 -0
  36. data/vendor/assets/stylesheets/foundation/components/_forms.scss +25 -21
  37. data/vendor/assets/stylesheets/foundation/components/_global.scss +79 -44
  38. data/vendor/assets/stylesheets/foundation/components/_grid.scss +6 -2
  39. data/vendor/assets/stylesheets/foundation/components/_inline-lists.scss +4 -0
  40. data/vendor/assets/stylesheets/foundation/components/_joyride.scss +4 -0
  41. data/vendor/assets/stylesheets/foundation/components/_keystrokes.scss +5 -1
  42. data/vendor/assets/stylesheets/foundation/components/_labels.scss +4 -0
  43. data/vendor/assets/stylesheets/foundation/components/_magellan.scss +4 -0
  44. data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +51 -59
  45. data/vendor/assets/stylesheets/foundation/components/_orbit.scss +97 -14
  46. data/vendor/assets/stylesheets/foundation/components/_pagination.scss +7 -2
  47. data/vendor/assets/stylesheets/foundation/components/_panels.scss +5 -1
  48. data/vendor/assets/stylesheets/foundation/components/_pricing-tables.scss +4 -0
  49. data/vendor/assets/stylesheets/foundation/components/_progress-bars.scss +4 -0
  50. data/vendor/assets/stylesheets/foundation/components/_range-slider.scss +148 -0
  51. data/vendor/assets/stylesheets/foundation/components/_reveal.scss +36 -7
  52. data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +8 -3
  53. data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +4 -0
  54. data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +6 -2
  55. data/vendor/assets/stylesheets/foundation/components/_switch.scss +4 -0
  56. data/vendor/assets/stylesheets/foundation/components/_tables.scss +4 -0
  57. data/vendor/assets/stylesheets/foundation/components/_tabs.scss +12 -6
  58. data/vendor/assets/stylesheets/foundation/components/_thumbs.scss +4 -0
  59. data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +9 -0
  60. data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +52 -25
  61. data/vendor/assets/stylesheets/foundation/components/_type.scss +132 -75
  62. data/vendor/assets/stylesheets/foundation/components/_visibility.scss +198 -538
  63. data/vendor/assets/stylesheets/normalize.scss +179 -166
  64. metadata +4 -2
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.equalizer = {
5
5
  name : 'equalizer',
6
6
 
7
- version : '5.1.1',
7
+ version : '5.2.0',
8
8
 
9
9
  settings : {
10
10
  use_tallest: true,
@@ -28,7 +28,7 @@
28
28
  vals = equalizer.find('[' + this.attr_name() + '-watch]'),
29
29
  firstTopOffset = vals.first().offset().top,
30
30
  settings = equalizer.data(this.attr_name(true)+'-init');
31
-
31
+
32
32
  if (vals.length === 0) return;
33
33
  settings.before_height_change();
34
34
  equalizer.trigger('before-height-change');
@@ -40,14 +40,14 @@
40
40
  }
41
41
  });
42
42
  if (isStacked) return;
43
-
44
- var heights = vals.map(function(){ return $(this).outerHeight() });
43
+
44
+ var heights = vals.map(function(){ return $(this).outerHeight() }).get();
45
45
  if (settings.use_tallest) {
46
46
  var max = Math.max.apply(null, heights);
47
- vals.height(max);
47
+ vals.css('height', max);
48
48
  } else {
49
49
  var min = Math.min.apply(null, heights);
50
- vals.height(min);
50
+ vals.css('height', min);
51
51
  }
52
52
  settings.after_height_change();
53
53
  equalizer.trigger('after-height-change');
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.interchange = {
5
5
  name : 'interchange',
6
6
 
7
- version : '5.1.1',
7
+ version : '5.2.0',
8
8
 
9
9
  cache : {},
10
10
 
@@ -15,7 +15,7 @@
15
15
  load_attr : 'interchange',
16
16
 
17
17
  named_queries : {
18
- 'default' : 'only screen',
18
+ 'default' : Foundation.media_queries.small,
19
19
  small : Foundation.media_queries.small,
20
20
  medium : Foundation.media_queries.medium,
21
21
  large : Foundation.media_queries.large,
@@ -23,11 +23,11 @@
23
23
  xxlarge: Foundation.media_queries.xxlarge,
24
24
  landscape : 'only screen and (orientation: landscape)',
25
25
  portrait : 'only screen and (orientation: portrait)',
26
- retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
27
- 'only screen and (min--moz-device-pixel-ratio: 2),' +
28
- 'only screen and (-o-min-device-pixel-ratio: 2/1),' +
29
- 'only screen and (min-device-pixel-ratio: 2),' +
30
- 'only screen and (min-resolution: 192dpi),' +
26
+ retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
27
+ 'only screen and (min--moz-device-pixel-ratio: 2),' +
28
+ 'only screen and (-o-min-device-pixel-ratio: 2/1),' +
29
+ 'only screen and (min-device-pixel-ratio: 2),' +
30
+ 'only screen and (min-resolution: 192dpi),' +
31
31
  'only screen and (min-resolution: 2dppx)'
32
32
  },
33
33
 
@@ -57,6 +57,16 @@
57
57
 
58
58
  if (last_path == path) return;
59
59
 
60
+
61
+ var regex = "/^.(\.jpg|\.jpeg|\.png|\.gif|\.tiff|\.bmp)\??|#?./";
62
+
63
+ if (new RegExp(regex,'i').test(path)){
64
+
65
+ $(el).css('background-image', 'url('+path+')');
66
+ el.data('interchange-last-path', path);
67
+ return trigger(path);
68
+ }
69
+
60
70
  return $.get(path, function (response) {
61
71
  el.html(response);
62
72
  el.data(this.data_attr + '-last-path', path);
@@ -72,19 +82,30 @@
72
82
 
73
83
  this.data_attr = this.set_data_attr();
74
84
  $.extend(true, this.settings, method, options);
75
-
76
85
  this.bindings(method, options);
77
86
  this.load('images');
78
87
  this.load('nodes');
79
88
  },
80
89
 
90
+ get_media_hash : function() {
91
+ var mediaHash='';
92
+ for (var queryName in this.settings.named_queries ) {
93
+ mediaHash += matchMedia(this.settings.named_queries[queryName]).matches.toString();
94
+ }
95
+ return mediaHash;
96
+ },
97
+
81
98
  events : function () {
82
- var self = this;
99
+ var self = this, prevMediaHash;
83
100
 
84
101
  $(window)
85
102
  .off('.interchange')
86
103
  .on('resize.fndtn.interchange', self.throttle(function () {
87
- self.resize();
104
+ var currMediaHash = self.get_media_hash();
105
+ if (currMediaHash !== prevMediaHash) {
106
+ self.resize();
107
+ }
108
+ prevMediaHash = currMediaHash;
88
109
  }, 50));
89
110
 
90
111
  return this;
@@ -187,8 +208,6 @@
187
208
  data_attr = this.data_attr;
188
209
 
189
210
  this.cached_nodes = [];
190
- // Set nodes_loaded to true if there are no nodes
191
- // this.nodes_loaded = false;
192
211
  this.nodes_loaded = (count === 0);
193
212
 
194
213
 
@@ -224,6 +243,7 @@
224
243
  },
225
244
 
226
245
  convert_directive : function (directive) {
246
+
227
247
  var trimmed = this.trim(directive);
228
248
 
229
249
  if (trimmed.length > 0) {
@@ -255,20 +275,8 @@
255
275
  return this.store(el, scenarios);
256
276
  },
257
277
 
258
- uuid : function (separator) {
259
- var delim = separator || "-",
260
- self = this;
261
-
262
- function S4() {
263
- return self.random_str(6);
264
- }
265
-
266
- return (S4() + S4() + delim + S4() + delim + S4()
267
- + delim + S4() + delim + S4() + S4() + S4());
268
- },
269
-
270
278
  store : function (el, scenarios) {
271
- var uuid = this.uuid(),
279
+ var uuid = this.random_str(),
272
280
  current_uuid = el.data(this.add_namespace('uuid', true));
273
281
 
274
282
  if (this.cache[current_uuid]) return this.cache[current_uuid];
@@ -279,6 +287,7 @@
279
287
  },
280
288
 
281
289
  trim : function(str) {
290
+
282
291
  if (typeof str === 'string') {
283
292
  return $.trim(str);
284
293
  }
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.joyride = {
7
7
  name : 'joyride',
8
8
 
9
- version : '5.1.1',
9
+ version : '5.2.0',
10
10
 
11
11
  defaults : {
12
12
  expose : false, // turn on or off the expose feature
@@ -55,7 +55,7 @@
55
55
  init : function (scope, method, options) {
56
56
  Foundation.inherit(this, 'throttle random_str');
57
57
 
58
- this.settings = this.defaults;
58
+ this.settings = this.settings || $.extend({}, this.defaults, (options || method));
59
59
 
60
60
  this.bindings(method, options)
61
61
  },
@@ -205,7 +205,6 @@
205
205
  },
206
206
 
207
207
  create : function (opts) {
208
- console.log(opts.$li)
209
208
  var buttonText = opts.$li.attr(this.add_namespace('data-button'))
210
209
  || opts.$li.attr(this.add_namespace('data-text')),
211
210
  tipClass = opts.$li.attr('class'),
@@ -372,7 +371,6 @@
372
371
  },
373
372
 
374
373
  set_target : function () {
375
- console.log(this.add_namespace('data-class'))
376
374
  var cl = this.settings.$li.attr(this.add_namespace('data-class')),
377
375
  id = this.settings.$li.attr(this.add_namespace('data-id')),
378
376
  $sel = function () {
@@ -385,8 +383,6 @@
385
383
  }
386
384
  };
387
385
 
388
- console.log(cl, id)
389
-
390
386
  this.settings.$target = $sel();
391
387
  },
392
388
 
@@ -462,7 +458,7 @@
462
458
 
463
459
  this.settings.$next_tip.css({
464
460
  top: this.settings.$target.offset().top,
465
- left: (this.outerWidth(this.settings.$target) + this.settings.$target.offset().left + nub_width)});
461
+ left: (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width)});
466
462
 
467
463
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'left');
468
464
 
@@ -470,7 +466,7 @@
470
466
 
471
467
  this.settings.$next_tip.css({
472
468
  top: this.settings.$target.offset().top,
473
- left: (this.settings.$target.offset().left - this.outerWidth(this.settings.$next_tip) - nub_width)});
469
+ left: (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width)});
474
470
 
475
471
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'right');
476
472
 
@@ -11,26 +11,27 @@
11
11
 
12
12
  var header_helpers = function (class_array) {
13
13
  var i = class_array.length;
14
+ var head = $('head');
14
15
 
15
16
  while (i--) {
16
17
  if($('head').has('.' + class_array[i]).length === 0) {
17
- $('head').append('<meta class="' + class_array[i] + '">');
18
+ $('head').append('<meta class="' + class_array[i] + '" />');
18
19
  }
19
20
  }
20
21
  };
21
22
 
22
23
  header_helpers([
23
- 'foundation-mq-small',
24
- 'foundation-mq-medium',
25
- 'foundation-mq-large',
26
- 'foundation-mq-xlarge',
27
- 'foundation-mq-xxlarge',
24
+ 'foundation-mq-small',
25
+ 'foundation-mq-medium',
26
+ 'foundation-mq-large',
27
+ 'foundation-mq-xlarge',
28
+ 'foundation-mq-xxlarge',
28
29
  'foundation-data-attribute-namespace']);
29
30
 
30
31
  // Enable FastClick if present
31
32
 
32
33
  $(function() {
33
- if(typeof FastClick !== 'undefined') {
34
+ if (typeof FastClick !== 'undefined') {
34
35
  // Don't attach to body if undefined
35
36
  if (typeof document.body !== 'undefined') {
36
37
  FastClick.attach(document.body);
@@ -43,10 +44,11 @@
43
44
  // getElementById is not available.
44
45
  var S = function (selector, context) {
45
46
  if (typeof selector === 'string') {
46
- if (context) {
47
+ if (context) {
47
48
  var cont;
48
49
  if (context.jquery) {
49
50
  cont = context[0];
51
+ if (!cont) return context;
50
52
  } else {
51
53
  cont = context;
52
54
  }
@@ -70,22 +72,12 @@
70
72
  return arr.join('-');
71
73
  };
72
74
 
73
- var header_helpers = function (class_array) {
74
- var i = class_array.length;
75
-
76
- while (i--) {
77
- if($('head').has('.' + class_array[i]).length === 0) {
78
- $('head').append('<meta class="' + class_array[i] + '">');
79
- }
80
- }
81
- };
82
-
83
75
  var add_namespace = function (str) {
84
76
  var parts = str.split('-'),
85
77
  i = parts.length,
86
78
  arr = [];
87
79
 
88
- while(i--) {
80
+ while (i--) {
89
81
  if (i !== 0) {
90
82
  arr.push(parts[i]);
91
83
  } else {
@@ -120,7 +112,6 @@
120
112
  } else {
121
113
  S('[' + this.attr_name() +']', this.scope).each(function () {
122
114
  var should_bind_events = !S(this).data(self.attr_name(true) + '-init');
123
-
124
115
  S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this))));
125
116
 
126
117
  if (should_bind_events) {
@@ -157,8 +148,8 @@
157
148
  } else {
158
149
  bindLoad.call(image);
159
150
  }
160
- }
161
-
151
+ };
152
+
162
153
  /*
163
154
  https://github.com/paulirish/matchMedia.js
164
155
  */
@@ -179,7 +170,7 @@
179
170
  fakeBody.style.background = "none";
180
171
  fakeBody.appendChild(div);
181
172
 
182
- return function(q){
173
+ return function (q) {
183
174
 
184
175
  div.innerHTML = "&shy;<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>";
185
176
 
@@ -205,21 +196,21 @@
205
196
  * Licensed under the MIT license.
206
197
  */
207
198
 
208
- (function( $ ) {
199
+ (function($) {
209
200
 
210
201
  // requestAnimationFrame polyfill adapted from Erik Möller
211
202
  // fixes from Paul Irish and Tino Zijdel
212
203
  // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
213
204
  // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
214
205
 
215
-
216
206
  var animating,
217
- lastTime = 0,
218
- vendors = ['webkit', 'moz'],
219
- requestAnimationFrame = window.requestAnimationFrame,
220
- cancelAnimationFrame = window.cancelAnimationFrame;
207
+ lastTime = 0,
208
+ vendors = ['webkit', 'moz'],
209
+ requestAnimationFrame = window.requestAnimationFrame,
210
+ cancelAnimationFrame = window.cancelAnimationFrame,
211
+ jqueryFxAvailable = 'undefined' !== typeof jQuery.fx;
221
212
 
222
- for(; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
213
+ for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
223
214
  requestAnimationFrame = window[ vendors[lastTime] + "RequestAnimationFrame" ];
224
215
  cancelAnimationFrame = cancelAnimationFrame ||
225
216
  window[ vendors[lastTime] + "CancelAnimationFrame" ] ||
@@ -227,42 +218,48 @@
227
218
  }
228
219
 
229
220
  function raf() {
230
- if ( animating ) {
231
- requestAnimationFrame( raf );
232
- jQuery.fx.tick();
221
+ if (animating) {
222
+ requestAnimationFrame(raf);
223
+
224
+ if (jqueryFxAvailable) {
225
+ jQuery.fx.tick();
226
+ }
233
227
  }
234
228
  }
235
229
 
236
- if ( requestAnimationFrame ) {
230
+ if (requestAnimationFrame) {
237
231
  // use rAF
238
232
  window.requestAnimationFrame = requestAnimationFrame;
239
233
  window.cancelAnimationFrame = cancelAnimationFrame;
240
- jQuery.fx.timer = function( timer ) {
241
- if ( timer() && jQuery.timers.push( timer ) && !animating ) {
242
- animating = true;
243
- raf();
244
- }
245
- };
234
+
235
+ if (jqueryFxAvailable) {
236
+ jQuery.fx.timer = function (timer) {
237
+ if (timer() && jQuery.timers.push(timer) && !animating) {
238
+ animating = true;
239
+ raf();
240
+ }
241
+ };
246
242
 
247
- jQuery.fx.stop = function() {
248
- animating = false;
249
- };
243
+ jQuery.fx.stop = function () {
244
+ animating = false;
245
+ };
246
+ }
250
247
  } else {
251
248
  // polyfill
252
- window.requestAnimationFrame = function( callback, element ) {
249
+ window.requestAnimationFrame = function (callback, element) {
253
250
  var currTime = new Date().getTime(),
254
- timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) ),
255
- id = window.setTimeout( function() {
256
- callback( currTime + timeToCall );
257
- }, timeToCall );
251
+ timeToCall = Math.max(0, 16 - (currTime - lastTime)),
252
+ id = window.setTimeout(function () {
253
+ callback(currTime + timeToCall);
254
+ }, timeToCall);
258
255
  lastTime = currTime + timeToCall;
259
256
  return id;
260
257
  };
261
258
 
262
- window.cancelAnimationFrame = function(id) {
259
+ window.cancelAnimationFrame = function (id) {
263
260
  clearTimeout(id);
264
261
  };
265
-
262
+
266
263
  }
267
264
 
268
265
  }( jQuery ));
@@ -279,7 +276,7 @@
279
276
  window.Foundation = {
280
277
  name : 'Foundation',
281
278
 
282
- version : '5.1.1',
279
+ version : '5.2.0',
283
280
 
284
281
  media_queries : {
285
282
  small : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
@@ -326,6 +323,12 @@
326
323
  this.patch(this.libs[lib]);
327
324
 
328
325
  if (args && args.hasOwnProperty(lib)) {
326
+ if (typeof this.libs[lib].settings !== 'undefined') {
327
+ $.extend(true, this.libs[lib].settings, args[lib]);
328
+ }
329
+ else if (typeof this.libs[lib].defaults !== 'undefined') {
330
+ $.extend(true, this.libs[lib].defaults, args[lib]);
331
+ }
329
332
  return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
330
333
  }
331
334
 
@@ -359,10 +362,19 @@
359
362
  },
360
363
 
361
364
  set_namespace: function () {
362
- var namespace = $('.foundation-data-attribute-namespace').css('font-family');
363
365
 
364
- if (/false/i.test(namespace)) return;
366
+ // Don't bother reading the namespace out of the meta tag
367
+ // if the namespace has been set globally in javascript
368
+ //
369
+ // Example: something like Foundation.global.namespace = 'my-namespace';
370
+ //
371
+ // Otherwise, if the namespace hasn't been set globally,
372
+ // read it out of the meta tag
373
+ //
374
+ var namespace = this.global.namespace || $('.foundation-data-attribute-namespace').css('font-family');
365
375
 
376
+ if (/false/i.test(namespace)) return;
377
+
366
378
  this.global.namespace = namespace;
367
379
  },
368
380
 
@@ -397,7 +409,7 @@
397
409
  //
398
410
  // Returns:
399
411
  // Lazy_function (Function): Function with throttling applied.
400
- throttle : function(func, delay) {
412
+ throttle : function (func, delay) {
401
413
  var timer = null;
402
414
 
403
415
  return function () {
@@ -424,11 +436,11 @@
424
436
  //
425
437
  // Returns:
426
438
  // Lazy_function (Function): Function with debouncing applied.
427
- debounce : function(func, delay, immediate) {
439
+ debounce : function (func, delay, immediate) {
428
440
  var timeout, result;
429
- return function() {
441
+ return function () {
430
442
  var context = this, args = arguments;
431
- var later = function() {
443
+ var later = function () {
432
444
  timeout = null;
433
445
  if (!immediate) result = func.apply(context, args);
434
446
  };
@@ -474,7 +486,7 @@
474
486
  return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true;
475
487
  }
476
488
 
477
- function trim(str) {
489
+ function trim (str) {
478
490
  if (typeof str === 'string') return $.trim(str);
479
491
  return str;
480
492
  }
@@ -484,7 +496,13 @@
484
496
 
485
497
  if (/true/i.test(p[1])) p[1] = true;
486
498
  if (/false/i.test(p[1])) p[1] = false;
487
- if (isNumber(p[1])) p[1] = parseInt(p[1], 10);
499
+ if (isNumber(p[1])) {
500
+ if (p[1].indexOf('.') === -1) {
501
+ p[1] = parseInt(p[1], 10);
502
+ } else {
503
+ p[1] = parseFloat(p[1], 10);
504
+ }
505
+ }
488
506
 
489
507
  if (p.length === 2 && p[0].length > 0) {
490
508
  opts[trim(p[0])] = trim(p[1]);
@@ -502,7 +520,7 @@
502
520
  // Foundation.media_queries
503
521
  //
504
522
  // Class (String): Class name for the generated <meta> tag
505
- register_media : function(media, media_class) {
523
+ register_media : function (media, media_class) {
506
524
  if(Foundation.media_queries[media] === undefined) {
507
525
  $('head').append('<meta class="' + media_class + '">');
508
526
  Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
@@ -517,12 +535,13 @@
517
535
  //
518
536
  // Media (String): Optional media query string for the CSS rule to be
519
537
  // nested under.
520
- add_custom_rule : function(rule, media) {
521
- if(media === undefined) {
538
+ add_custom_rule : function (rule, media) {
539
+ if (media === undefined) {
522
540
  Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length);
523
541
  } else {
524
542
  var query = Foundation.media_queries[media];
525
- if(query !== undefined) {
543
+
544
+ if (query !== undefined) {
526
545
  Foundation.stylesheet.insertRule('@media ' +
527
546
  Foundation.media_queries[media] + '{ ' + rule + ' }');
528
547
  }
@@ -540,10 +559,14 @@
540
559
  var self = this,
541
560
  unloaded = images.length;
542
561
 
543
- images.each(function(){
544
- single_image_loaded(self.S(this),function(){
545
- unloaded -= 1;
546
- if(unloaded == 0){
562
+ if (unloaded === 0) {
563
+ callback(images);
564
+ }
565
+
566
+ images.each(function () {
567
+ single_image_loaded(self.S(this), function () {
568
+ unloaded -= 1;
569
+ if (unloaded === 0) {
547
570
  callback(images);
548
571
  }
549
572
  });
@@ -559,18 +582,11 @@
559
582
  //
560
583
  // Returns:
561
584
  // Rand (String): Pseudo-random, alphanumeric string.
562
- random_str : function (length) {
563
- var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
585
+ random_str : function () {
586
+ if (!this.fidx) this.fidx = 0;
587
+ this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-');
564
588
 
565
- if (!length) {
566
- length = Math.floor(Math.random() * chars.length);
567
- }
568
-
569
- var str = '';
570
- while (length--) {
571
- str += chars[Math.floor(Math.random() * chars.length)];
572
- }
573
- return str;
589
+ return this.prefix + (this.fidx++).toString(36);
574
590
  }
575
591
  }
576
592
  };