catscope 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/assets/bower.json +1 -0
  3. data/assets/bower_components/foundation/LICENSE +22 -0
  4. data/assets/bower_components/foundation/README.md +46 -0
  5. data/assets/bower_components/foundation/bower.json +2 -4
  6. data/assets/bower_components/foundation/css/foundation.css +1695 -1230
  7. data/assets/bower_components/foundation/css/foundation.css.map +1 -1
  8. data/assets/bower_components/foundation/css/foundation.min.css +1 -0
  9. data/assets/bower_components/foundation/css/normalize.css +9 -12
  10. data/assets/bower_components/foundation/css/normalize.css.map +1 -1
  11. data/assets/bower_components/foundation/css/normalize.min.css +1 -0
  12. data/assets/bower_components/foundation/js/foundation/foundation.abide.js +171 -75
  13. data/assets/bower_components/foundation/js/foundation/foundation.accordion.js +70 -12
  14. data/assets/bower_components/foundation/js/foundation/foundation.alert.js +5 -5
  15. data/assets/bower_components/foundation/js/foundation/foundation.clearing.js +84 -40
  16. data/assets/bower_components/foundation/js/foundation/foundation.dropdown.js +104 -79
  17. data/assets/bower_components/foundation/js/foundation/foundation.equalizer.js +57 -26
  18. data/assets/bower_components/foundation/js/foundation/foundation.interchange.js +50 -38
  19. data/assets/bower_components/foundation/js/foundation/foundation.joyride.js +121 -110
  20. data/assets/bower_components/foundation/js/foundation/foundation.js +121 -79
  21. data/assets/bower_components/foundation/js/foundation/foundation.magellan.js +75 -59
  22. data/assets/bower_components/foundation/js/foundation/foundation.offcanvas.js +95 -22
  23. data/assets/bower_components/foundation/js/foundation/foundation.orbit.js +127 -123
  24. data/assets/bower_components/foundation/js/foundation/foundation.reveal.js +147 -69
  25. data/assets/bower_components/foundation/js/foundation/foundation.slider.js +101 -72
  26. data/assets/bower_components/foundation/js/foundation/foundation.tab.js +52 -39
  27. data/assets/bower_components/foundation/js/foundation/foundation.tooltip.js +97 -49
  28. data/assets/bower_components/foundation/js/foundation/foundation.topbar.js +70 -57
  29. data/assets/bower_components/foundation/js/foundation.js +1544 -951
  30. data/assets/bower_components/foundation/js/foundation.min.js +5 -4
  31. data/assets/bower_components/foundation/js/vendor/fastclick.js +8 -9
  32. data/assets/bower_components/foundation/js/vendor/jquery.js +6 -6
  33. data/assets/bower_components/foundation/js/vendor/modernizr.js +1 -1
  34. data/assets/bower_components/foundation/package.json +57 -0
  35. data/assets/bower_components/foundation/scss/foundation/_functions.scss +53 -43
  36. data/assets/bower_components/foundation/scss/foundation/_settings.scss +59 -37
  37. data/assets/bower_components/foundation/scss/foundation/components/_accordion.scss +12 -8
  38. data/assets/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +12 -12
  39. data/assets/bower_components/foundation/scss/foundation/components/_block-grid.scss +14 -13
  40. data/assets/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +19 -19
  41. data/assets/bower_components/foundation/scss/foundation/components/_button-groups.scss +33 -25
  42. data/assets/bower_components/foundation/scss/foundation/components/_buttons.scss +30 -28
  43. data/assets/bower_components/foundation/scss/foundation/components/_clearing.scss +51 -47
  44. data/assets/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +10 -11
  45. data/assets/bower_components/foundation/scss/foundation/components/_dropdown.scss +45 -38
  46. data/assets/bower_components/foundation/scss/foundation/components/_flex-video.scss +7 -7
  47. data/assets/bower_components/foundation/scss/foundation/components/_forms.scss +99 -62
  48. data/assets/bower_components/foundation/scss/foundation/components/_global.scss +152 -67
  49. data/assets/bower_components/foundation/scss/foundation/components/_grid.scss +39 -36
  50. data/assets/bower_components/foundation/scss/foundation/components/_icon-bar.scss +337 -235
  51. data/assets/bower_components/foundation/scss/foundation/components/_inline-lists.scss +9 -8
  52. data/assets/bower_components/foundation/scss/foundation/components/_joyride.scss +40 -42
  53. data/assets/bower_components/foundation/scss/foundation/components/_keystrokes.scss +2 -3
  54. data/assets/bower_components/foundation/scss/foundation/components/_labels.scss +6 -6
  55. data/assets/bower_components/foundation/scss/foundation/components/_magellan.scss +2 -2
  56. data/assets/bower_components/foundation/scss/foundation/components/_offcanvas.scss +259 -168
  57. data/assets/bower_components/foundation/scss/foundation/components/_orbit.scss +82 -62
  58. data/assets/bower_components/foundation/scss/foundation/components/_pagination.scss +16 -15
  59. data/assets/bower_components/foundation/scss/foundation/components/_panels.scss +21 -15
  60. data/assets/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +16 -16
  61. data/assets/bower_components/foundation/scss/foundation/components/_progress-bars.scss +10 -4
  62. data/assets/bower_components/foundation/scss/foundation/components/_range-slider.scss +28 -20
  63. data/assets/bower_components/foundation/scss/foundation/components/_reveal.scss +38 -28
  64. data/assets/bower_components/foundation/scss/foundation/components/_side-nav.scss +15 -11
  65. data/assets/bower_components/foundation/scss/foundation/components/_split-buttons.scss +22 -18
  66. data/assets/bower_components/foundation/scss/foundation/components/_sub-nav.scss +14 -12
  67. data/assets/bower_components/foundation/scss/foundation/components/_switches.scss +22 -19
  68. data/assets/bower_components/foundation/scss/foundation/components/_tables.scss +8 -8
  69. data/assets/bower_components/foundation/scss/foundation/components/_tabs.scss +50 -31
  70. data/assets/bower_components/foundation/scss/foundation/components/_thumbs.scss +8 -8
  71. data/assets/bower_components/foundation/scss/foundation/components/_tooltips.scss +25 -25
  72. data/assets/bower_components/foundation/scss/foundation/components/_top-bar.scss +176 -122
  73. data/assets/bower_components/foundation/scss/foundation/components/_type.scss +38 -38
  74. data/assets/bower_components/foundation/scss/foundation/components/_visibility.scss +33 -16
  75. data/assets/bower_components/foundation/scss/foundation.scss +37 -40
  76. data/assets/bower_components/foundation/scss/normalize.scss +8 -11
  77. data/assets/bower_components/jquery/bower.json +2 -1
  78. data/assets/bower_components/jquery/dist/jquery.js +9 -4
  79. data/assets/bower_components/jquery/dist/jquery.min.js +4 -4
  80. data/assets/bower_components/jquery/dist/jquery.min.map +1 -1
  81. data/assets/bower_components/jquery/src/core.js +6 -1
  82. data/assets/scss/_settings.scss +2 -0
  83. data/assets/stylesheets/app.css +3066 -2429
  84. data/lib/catscope/version.rb +1 -1
  85. data/lib/catscope/views/layout.erb +6 -2
  86. metadata +8 -4
  87. data/assets/bower_components/foundation/scss/foundation/components/_toolbar.scss +0 -70
@@ -1,36 +1,40 @@
1
1
  ;(function ($, window, document, undefined) {
2
2
  'use strict';
3
3
 
4
+ var openModals = [];
5
+
4
6
  Foundation.libs.reveal = {
5
7
  name : 'reveal',
6
8
 
7
- version : '5.5.0',
9
+ version : '5.5.3',
8
10
 
9
11
  locked : false,
10
12
 
11
13
  settings : {
12
- animation: 'fadeAndPop',
13
- animation_speed: 250,
14
- close_on_background_click: true,
15
- close_on_esc: true,
16
- dismiss_modal_class: 'close-reveal-modal',
17
- bg_class: 'reveal-modal-bg',
18
- root_element: 'body',
19
- open: function(){},
20
- opened: function(){},
21
- close: function(){},
22
- closed: function(){},
14
+ animation : 'fadeAndPop',
15
+ animation_speed : 250,
16
+ close_on_background_click : true,
17
+ close_on_esc : true,
18
+ dismiss_modal_class : 'close-reveal-modal',
19
+ multiple_opened : false,
20
+ bg_class : 'reveal-modal-bg',
21
+ root_element : 'body',
22
+ open : function(){},
23
+ opened : function(){},
24
+ close : function(){},
25
+ closed : function(){},
26
+ on_ajax_error: $.noop,
23
27
  bg : $('.reveal-modal-bg'),
24
28
  css : {
25
29
  open : {
26
- 'opacity': 0,
27
- 'visibility': 'visible',
30
+ 'opacity' : 0,
31
+ 'visibility' : 'visible',
28
32
  'display' : 'block'
29
33
  },
30
34
  close : {
31
- 'opacity': 1,
32
- 'visibility': 'hidden',
33
- 'display': 'none'
35
+ 'opacity' : 1,
36
+ 'visibility' : 'hidden',
37
+ 'display' : 'none'
34
38
  }
35
39
  }
36
40
  },
@@ -51,7 +55,8 @@
51
55
 
52
56
  if (!self.locked) {
53
57
  var element = S(this),
54
- ajax = element.data(self.data_attr('reveal-ajax'));
58
+ ajax = element.data(self.data_attr('reveal-ajax')),
59
+ replaceContentSel = element.data(self.data_attr('reveal-replace-content'));
55
60
 
56
61
  self.locked = true;
57
62
 
@@ -59,8 +64,7 @@
59
64
  self.open.call(self, element);
60
65
  } else {
61
66
  var url = ajax === true ? element.attr('href') : ajax;
62
-
63
- self.open.call(self, element, {url: url});
67
+ self.open.call(self, element, {url : url}, { replaceContentSel : replaceContentSel });
64
68
  }
65
69
  }
66
70
  });
@@ -81,11 +85,11 @@
81
85
  }
82
86
 
83
87
  self.locked = true;
84
- self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open') : S(this).closest('[' + self.attr_name() + ']'));
88
+ self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open:not(.toback)') : S(this).closest('[' + self.attr_name() + ']'));
85
89
  }
86
90
  });
87
91
 
88
- if(S('[' + self.attr_name() + ']', this.scope).length > 0) {
92
+ if (S('[' + self.attr_name() + ']', this.scope).length > 0) {
89
93
  S(this.scope)
90
94
  // .off('.reveal')
91
95
  .on('open.fndtn.reveal', this.settings.open)
@@ -132,7 +136,6 @@
132
136
  return true;
133
137
  },
134
138
 
135
-
136
139
  open : function (target, ajax_settings) {
137
140
  var self = this,
138
141
  modal;
@@ -154,7 +157,7 @@
154
157
  settings = settings || this.settings;
155
158
 
156
159
 
157
- if (modal.hasClass('open') && target.attr('data-reveal-id') == modal.attr('id')) {
160
+ if (modal.hasClass('open') && target !== undefined && target.attr('data-reveal-id') == modal.attr('id')) {
158
161
  return self.close(modal);
159
162
  }
160
163
 
@@ -166,8 +169,15 @@
166
169
  .data('offset', this.cache_offset(modal));
167
170
  }
168
171
 
172
+ modal.attr('tabindex','0').attr('aria-hidden','false');
173
+
169
174
  this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
170
175
 
176
+ // Prevent namespace event from triggering twice
177
+ modal.on('open.fndtn.reveal', function(e) {
178
+ if (e.namespace !== 'fndtn.reveal') return;
179
+ });
180
+
171
181
  modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal');
172
182
 
173
183
  if (open_modal.length < 1) {
@@ -176,37 +186,60 @@
176
186
 
177
187
  if (typeof ajax_settings === 'string') {
178
188
  ajax_settings = {
179
- url: ajax_settings
189
+ url : ajax_settings
180
190
  };
181
191
  }
182
192
 
183
- if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
184
- if (open_modal.length > 0) {
185
- this.hide(open_modal, settings.css.close);
193
+ var openModal = function() {
194
+ if(open_modal.length > 0) {
195
+ if(settings.multiple_opened) {
196
+ self.to_back(open_modal);
197
+ } else {
198
+ self.hide(open_modal, settings.css.close);
199
+ }
186
200
  }
187
201
 
188
- this.show(modal, settings.css.open);
202
+ // bl: add the open_modal that isn't already in the background to the openModals array
203
+ if(settings.multiple_opened) {
204
+ openModals.push(modal);
205
+ }
206
+
207
+ self.show(modal, settings.css.open);
208
+ };
209
+
210
+ if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
211
+ openModal();
189
212
  } else {
190
213
  var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
191
-
192
214
  $.extend(ajax_settings, {
193
- success: function (data, textStatus, jqXHR) {
215
+ success : function (data, textStatus, jqXHR) {
194
216
  if ( $.isFunction(old_success) ) {
195
217
  var result = old_success(data, textStatus, jqXHR);
196
- if (typeof result == 'string') data = result;
218
+ if (typeof result == 'string') {
219
+ data = result;
220
+ }
221
+ }
222
+
223
+ if (typeof options !== 'undefined' && typeof options.replaceContentSel !== 'undefined') {
224
+ modal.find(options.replaceContentSel).html(data);
225
+ } else {
226
+ modal.html(data);
197
227
  }
198
228
 
199
- modal.html(data);
200
229
  self.S(modal).foundation('section', 'reflow');
201
230
  self.S(modal).children().foundation();
202
231
 
203
- if (open_modal.length > 0) {
204
- self.hide(open_modal, settings.css.close);
205
- }
206
- self.show(modal, settings.css.open);
232
+ openModal();
207
233
  }
208
234
  });
209
235
 
236
+ // check for if user initalized with error callback
237
+ if (settings.on_ajax_error !== $.noop) {
238
+ $.extend(ajax_settings, {
239
+ error : settings.on_ajax_error
240
+ });
241
+ }
242
+
210
243
  $.ajax(ajax_settings);
211
244
  }
212
245
  }
@@ -216,14 +249,48 @@
216
249
  close : function (modal) {
217
250
  var modal = modal && modal.length ? modal : this.S(this.scope),
218
251
  open_modals = this.S('[' + this.attr_name() + '].open'),
219
- settings = modal.data(this.attr_name(true) + '-init') || this.settings;
252
+ settings = modal.data(this.attr_name(true) + '-init') || this.settings,
253
+ self = this;
220
254
 
221
255
  if (open_modals.length > 0) {
256
+
257
+ modal.removeAttr('tabindex','0').attr('aria-hidden','true');
258
+
222
259
  this.locked = true;
223
260
  this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open
224
- modal.trigger('close').trigger('close.fndtn.reveal');
225
- this.toggle_bg(modal, false);
226
- this.hide(open_modals, settings.css.close, settings);
261
+
262
+ modal.trigger('close.fndtn.reveal');
263
+
264
+ if ((settings.multiple_opened && open_modals.length === 1) || !settings.multiple_opened || modal.length > 1) {
265
+ self.toggle_bg(modal, false);
266
+ self.to_front(modal);
267
+ }
268
+
269
+ if (settings.multiple_opened) {
270
+ var isCurrent = modal.is(':not(.toback)');
271
+ self.hide(modal, settings.css.close, settings);
272
+ if(isCurrent) {
273
+ // remove the last modal since it is now closed
274
+ openModals.pop();
275
+ } else {
276
+ // if this isn't the current modal, then find it in the array and remove it
277
+ openModals = $.grep(openModals, function(elt) {
278
+ var isThis = elt[0]===modal[0];
279
+ if(isThis) {
280
+ // since it's not currently in the front, put it in the front now that it is hidden
281
+ // so that if it's re-opened, it won't be .toback
282
+ self.to_front(modal);
283
+ }
284
+ return !isThis;
285
+ });
286
+ }
287
+ // finally, show the next modal in the stack, if there is one
288
+ if(openModals.length>0) {
289
+ self.to_front(openModals[openModals.length - 1]);
290
+ }
291
+ } else {
292
+ self.hide(open_modals, settings.css.close, settings);
293
+ }
227
294
  }
228
295
  },
229
296
 
@@ -257,12 +324,13 @@
257
324
  // is modal
258
325
  if (css) {
259
326
  var settings = el.data(this.attr_name(true) + '-init') || this.settings,
260
- root_element = settings.root_element;
327
+ root_element = settings.root_element,
328
+ context = this;
261
329
 
262
330
  if (el.parent(root_element).length === 0) {
263
331
  var placeholder = el.wrap('<div style="display: none;" />').parent();
264
332
 
265
- el.on('closed.fndtn.reveal.wrapped', function() {
333
+ el.on('closed.fndtn.reveal.wrapped', function () {
266
334
  el.detach().appendTo(placeholder);
267
335
  el.unwrap().unbind('closed.fndtn.reveal.wrapped');
268
336
  });
@@ -285,29 +353,30 @@
285
353
  return el
286
354
  .css(css)
287
355
  .animate(end_css, settings.animation_speed, 'linear', function () {
288
- this.locked = false;
289
- el.trigger('opened').trigger('opened.fndtn.reveal');
290
- }.bind(this))
356
+ context.locked = false;
357
+ el.trigger('opened.fndtn.reveal');
358
+ })
291
359
  .addClass('open');
292
- }.bind(this), settings.animation_speed / 2);
360
+ }, settings.animation_speed / 2);
293
361
  }
294
362
 
363
+ css.top = $(window).scrollTop() + el.data('css-top') + 'px';
364
+
295
365
  if (animData.fade) {
296
- css.top = $(window).scrollTop() + el.data('css-top') + 'px';
297
366
  var end_css = {opacity: 1};
298
367
 
299
368
  return setTimeout(function () {
300
369
  return el
301
370
  .css(css)
302
371
  .animate(end_css, settings.animation_speed, 'linear', function () {
303
- this.locked = false;
304
- el.trigger('opened').trigger('opened.fndtn.reveal');
305
- }.bind(this))
372
+ context.locked = false;
373
+ el.trigger('opened.fndtn.reveal');
374
+ })
306
375
  .addClass('open');
307
- }.bind(this), settings.animation_speed / 2);
376
+ }, settings.animation_speed / 2);
308
377
  }
309
378
 
310
- return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened').trigger('opened.fndtn.reveal');
379
+ return el.css(css).show().css({opacity : 1}).addClass('open').trigger('opened.fndtn.reveal');
311
380
  }
312
381
 
313
382
  var settings = this.settings;
@@ -322,10 +391,19 @@
322
391
  return el.show();
323
392
  },
324
393
 
394
+ to_back : function(el) {
395
+ el.addClass('toback');
396
+ },
397
+
398
+ to_front : function(el) {
399
+ el.removeClass('toback');
400
+ },
401
+
325
402
  hide : function (el, css) {
326
403
  // is modal
327
404
  if (css) {
328
- var settings = el.data(this.attr_name(true) + '-init');
405
+ var settings = el.data(this.attr_name(true) + '-init'),
406
+ context = this;
329
407
  settings = settings || this.settings;
330
408
 
331
409
  var animData = getAnimationData(settings.animation);
@@ -341,27 +419,27 @@
341
419
  return setTimeout(function () {
342
420
  return el
343
421
  .animate(end_css, settings.animation_speed, 'linear', function () {
344
- this.locked = false;
345
- el.css(css).trigger('closed').trigger('closed.fndtn.reveal');
346
- }.bind(this))
422
+ context.locked = false;
423
+ el.css(css).trigger('closed.fndtn.reveal');
424
+ })
347
425
  .removeClass('open');
348
- }.bind(this), settings.animation_speed / 2);
426
+ }, settings.animation_speed / 2);
349
427
  }
350
428
 
351
429
  if (animData.fade) {
352
- var end_css = {opacity: 0};
430
+ var end_css = {opacity : 0};
353
431
 
354
432
  return setTimeout(function () {
355
433
  return el
356
434
  .animate(end_css, settings.animation_speed, 'linear', function () {
357
- this.locked = false;
358
- el.css(css).trigger('closed').trigger('closed.fndtn.reveal');
359
- }.bind(this))
435
+ context.locked = false;
436
+ el.css(css).trigger('closed.fndtn.reveal');
437
+ })
360
438
  .removeClass('open');
361
- }.bind(this), settings.animation_speed / 2);
439
+ }, settings.animation_speed / 2);
362
440
  }
363
441
 
364
- return el.hide().css(css).removeClass('open').trigger('closed').trigger('closed.fndtn.reveal');
442
+ return el.hide().css(css).removeClass('open').trigger('closed.fndtn.reveal');
365
443
  }
366
444
 
367
445
  var settings = this.settings;
@@ -402,7 +480,7 @@
402
480
  }
403
481
  },
404
482
 
405
- data_attr: function (str) {
483
+ data_attr : function (str) {
406
484
  if (this.namespace.length > 0) {
407
485
  return this.namespace + '-' + str;
408
486
  }
@@ -411,7 +489,7 @@
411
489
  },
412
490
 
413
491
  cache_offset : function (modal) {
414
- var offset = modal.show().height() + parseInt(modal.css('top'), 10);
492
+ var offset = modal.show().height() + parseInt(modal.css('top'), 10) + modal.scrollY;
415
493
 
416
494
  modal.hide();
417
495
 
@@ -436,9 +514,9 @@
436
514
  var fade = /fade/i.test(str);
437
515
  var pop = /pop/i.test(str);
438
516
  return {
439
- animate: fade || pop,
440
- pop: pop,
441
- fade: fade
517
+ animate : fade || pop,
518
+ pop : pop,
519
+ fade : fade
442
520
  };
443
521
  }
444
522
  }(jQuery, window, window.document));