helios 0.3.0 → 0.4.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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +93 -71
  3. data/README.md +150 -127
  4. data/helios.gemspec +5 -4
  5. data/lib/helios/backend/push-notification.rb +1 -0
  6. data/lib/helios/commands/link.rb +2 -0
  7. data/lib/helios/commands/new.rb +1 -0
  8. data/lib/helios/frontend/javascripts/vendor/foundation.js +163 -47
  9. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.alerts.js +6 -4
  10. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.clearing.js +70 -32
  11. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.dropdown.js +87 -31
  12. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.forms.js +360 -238
  13. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.interchange.js +271 -0
  14. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.joyride.js +279 -48
  15. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.magellan.js +8 -4
  16. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.orbit.js +59 -24
  17. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.placeholder.js +21 -1
  18. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.reveal.js +100 -42
  19. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.section.js +299 -60
  20. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.tooltips.js +26 -13
  21. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.topbar.js +154 -59
  22. data/lib/helios/frontend/javascripts/vendor/foundation/index.js +17 -0
  23. data/lib/helios/frontend/stylesheets/screen.sass +0 -1
  24. data/lib/helios/frontend/templates/push-notification/devices.jst.tpl +0 -3
  25. data/lib/helios/templates/.gitignore.erb +32 -0
  26. data/lib/helios/version.rb +1 -1
  27. metadata +31 -14
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.magellan = {
7
7
  name : 'magellan',
8
8
 
9
- version : '4.0.0',
9
+ version : '4.2.2',
10
10
 
11
11
  settings : {
12
12
  activeClass: 'active'
@@ -20,7 +20,7 @@
20
20
  $.extend(true, this.settings, method);
21
21
  }
22
22
 
23
- if (typeof method != 'string') {
23
+ if (typeof method !== 'string') {
24
24
  if (!this.settings.init) {
25
25
  this.fixed_magellan = $("[data-magellan-expedition]");
26
26
  this.set_threshold();
@@ -54,7 +54,7 @@
54
54
  .on('update-position.fndtn.magellan', function(){
55
55
  var $el = $(this);
56
56
  // $el.data("magellan-fixed-position","");
57
- //$el.data("magellan-top-offset", "");
57
+ // $el.data("magellan-top-offset", "");
58
58
  })
59
59
  .trigger('update-position');
60
60
 
@@ -79,8 +79,10 @@
79
79
  if ($expedition.data("magellan-fixed-position") != fixed_position) {
80
80
  $expedition.data("magellan-fixed-position", fixed_position);
81
81
  if (fixed_position) {
82
+ $expedition.addClass('fixed');
82
83
  $expedition.css({position:"fixed", top:0});
83
84
  } else {
85
+ $expedition.removeClass('fixed');
84
86
  $expedition.css({position:"", top:""});
85
87
  }
86
88
  if (fixed_position && typeof attr != 'undefined' && attr != false) {
@@ -125,6 +127,8 @@
125
127
 
126
128
  off : function () {
127
129
  $(this.scope).off('.fndtn.magellan');
128
- }
130
+ },
131
+
132
+ reflow : function () {}
129
133
  };
130
134
  }(Foundation.zj, this, this.document));
@@ -4,13 +4,19 @@
4
4
  Foundation.libs = Foundation.libs || {};
5
5
 
6
6
  Foundation.libs.orbit = {
7
- version: '4.0.0',
7
+ name: 'orbit',
8
+
9
+ version: '4.2.0',
8
10
 
9
11
  settings: {
10
12
  timer_speed: 10000,
13
+ pause_on_hover: true,
14
+ resume_on_mouseout: false,
11
15
  animation_speed: 500,
12
16
  bullets: true,
13
17
  stack_on_small: true,
18
+ navigation_arrows: true,
19
+ slide_number: true,
14
20
  container_class: 'orbit-container',
15
21
  stack_on_small_class: 'orbit-stack-on-small',
16
22
  next_class: 'orbit-next',
@@ -29,12 +35,21 @@
29
35
 
30
36
  init: function (scope, method, options) {
31
37
  var self = this;
38
+ Foundation.inherit(self, 'data_options');
32
39
 
33
40
  if (typeof method === 'object') {
34
41
  $.extend(true, self.settings, method);
35
42
  }
36
43
 
37
- $('[data-orbit]', scope).each($.proxy(self._init, self));
44
+ if ($(scope).is('[data-orbit]')) {
45
+ var scoped_self = $.extend(true, {}, self);
46
+ scoped_self._init(idx, el);
47
+ }
48
+
49
+ $('[data-orbit]', scope).each(function(idx, el) {
50
+ var scoped_self = $.extend(true, {}, self);
51
+ scoped_self._init(idx, el);
52
+ });
38
53
  },
39
54
 
40
55
  _container_html: function() {
@@ -88,14 +103,20 @@
88
103
  $slides_container = $(slider),
89
104
  $container = $slides_container.wrap(self._container_html()).parent(),
90
105
  $slides = $slides_container.children();
106
+
107
+ $.extend(true, self.settings, self.data_options($slides_container));
91
108
 
92
- $container.append(self._prev_html());
93
- $container.append(self._next_html());
109
+ if (self.settings.navigation_arrows) {
110
+ $container.append(self._prev_html());
111
+ $container.append(self._next_html());
112
+ }
94
113
  $slides_container.addClass(self.settings.slides_container_class);
95
114
  if (self.settings.stack_on_small) {
96
115
  $container.addClass(self.settings.stack_on_small_class);
97
116
  }
98
- $container.append(self._slide_number_html(1, $slides.length));
117
+ if (self.settings.slide_number) {
118
+ $container.append(self._slide_number_html(1, $slides.length));
119
+ }
99
120
  $container.append(self._timer_html());
100
121
  if (self.settings.bullets) {
101
122
  $container.after(self._bullets_container_html($slides));
@@ -105,7 +126,7 @@
105
126
  $slides_container.append($slides.first().clone().attr('data-orbit-slide',''));
106
127
  $slides_container.prepend($slides.last().clone().attr('data-orbit-slide',''));
107
128
  // Make the first "real" slide active
108
- $slides_container.css('marginLeft', '-100%');
129
+ $slides_container.css(Foundation.rtl ? 'marginRight' : 'marginLeft', '-100%');
109
130
  $slides.first().addClass(self.settings.active_slide_class);
110
131
 
111
132
  self._init_events($slides_container);
@@ -135,7 +156,7 @@
135
156
 
136
157
  if ($slide.length === 1) {
137
158
  self._reset_timer($slides_container, true);
138
- self.goto($slides_container, $slide.index(), function() {});
159
+ self._goto($slides_container, $slide.index(), function() {});
139
160
  }
140
161
  });
141
162
 
@@ -143,10 +164,20 @@
143
164
  .on('click.fndtn.orbit', '[data-orbit-slide-number]', function(e) {
144
165
  e.preventDefault();
145
166
  self._reset_timer($slides_container, true);
146
- self.goto($slides_container, $(e.currentTarget).data('orbit-slide-number'),function() {});
167
+ self._goto($slides_container, $(e.currentTarget).data('orbit-slide-number'),function() {});
147
168
  });
148
169
 
149
170
  $container
171
+ .on('mouseenter.fndtn.orbit', function(e) {
172
+ if (self.settings.pause_on_hover) {
173
+ self._stop_timer($slides_container);
174
+ }
175
+ })
176
+ .on('mouseleave.fndtn.orbit', function(e) {
177
+ if (self.settings.resume_on_mouseout) {
178
+ self._start_timer($slides_container);
179
+ }
180
+ })
150
181
  .on('orbit:after-slide-change.fndtn.orbit', function(e, orbit) {
151
182
  var $slide_number = $container.find('.' + self.settings.slide_number_class);
152
183
 
@@ -154,15 +185,15 @@
154
185
  $slide_number.replaceWith(self._slide_number_html(orbit.slide_number, orbit.total_slides));
155
186
  }
156
187
  })
157
- .on('orbit:next-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.next_class, function(e) {
188
+ .on('orbit:next-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.next_class.split(" ").join("."), function(e) {
158
189
  e.preventDefault();
159
190
  self._reset_timer($slides_container, true);
160
- self.goto($slides_container, 'next', function() {});
191
+ self._goto($slides_container, 'next', function() {});
161
192
  })
162
- .on('orbit:prev-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.prev_class, function(e) {
193
+ .on('orbit:prev-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.prev_class.split(" ").join("."), function(e) {
163
194
  e.preventDefault();
164
195
  self._reset_timer($slides_container, true);
165
- self.goto($slides_container, 'prev', function() {});
196
+ self._goto($slides_container, 'prev', function() {});
166
197
  })
167
198
  .on('orbit:toggle-play-pause.fndtn.orbit click.fndtn.orbit touchstart.fndtn.orbit', '.' + self.settings.timer_container_class, function(e) {
168
199
  e.preventDefault();
@@ -177,6 +208,7 @@
177
208
  }
178
209
  })
179
210
  .on('touchstart.fndtn.orbit', function(e) {
211
+ if (!e.touches) { e = e.originalEvent; }
180
212
  var data = {
181
213
  start_page_x: e.touches[0].pageX,
182
214
  start_page_y: e.touches[0].pageY,
@@ -188,6 +220,7 @@
188
220
  e.stopPropagation();
189
221
  })
190
222
  .on('touchmove.fndtn.orbit', function(e) {
223
+ if (!e.touches) { e = e.originalEvent; }
191
224
  // Ignore pinch/zoom events
192
225
  if(e.touches.length > 1 || e.scale && e.scale !== 1) return;
193
226
 
@@ -207,7 +240,7 @@
207
240
  self._stop_timer($slides_container);
208
241
  var direction = (data.delta_x < 0) ? 'next' : 'prev';
209
242
  data.active = true;
210
- self.goto($slides_container, direction, function() {});
243
+ self._goto($slides_container, direction, function() {});
211
244
  }
212
245
  })
213
246
  .on('touchend.fndtn.orbit', function(e) {
@@ -232,7 +265,7 @@
232
265
 
233
266
  var callback = function() {
234
267
  self._reset_timer($slides_container, false);
235
- self.goto($slides_container, 'next', function() {
268
+ self._goto($slides_container, 'next', function() {
236
269
  self._start_timer($slides_container);
237
270
  });
238
271
  };
@@ -242,7 +275,7 @@
242
275
  progress_pct = ($progress.width() / $timer.width()),
243
276
  delay = self.settings.timer_speed - (progress_pct * self.settings.timer_speed);
244
277
 
245
- $progress.animate({'width': '100%'}, delay, 'linear', callback).data('is-original', 'beans?');
278
+ $progress.animate({'width': '100%'}, delay, 'linear', callback);
246
279
  $slides_container.trigger('orbit:timer-started');
247
280
  },
248
281
 
@@ -251,7 +284,7 @@
251
284
  $container = $slides_container.parent(),
252
285
  $timer = $container.find('.' + self.settings.timer_container_class),
253
286
  $progress = $timer.find('.' + self.settings.timer_progress_class),
254
- progress_pct = $progress.width() / $timer.width()
287
+ progress_pct = $progress.width() / $timer.width();
255
288
  self._rebuild_timer($container, progress_pct * 100 + '%');
256
289
  // $progress.stop();
257
290
  $slides_container.trigger('orbit:timer-stopped');
@@ -290,12 +323,13 @@
290
323
  }
291
324
  },
292
325
 
293
- goto: function($slides_container, index_or_direction, callback) {
326
+ _goto: function($slides_container, index_or_direction, callback) {
294
327
  var self = this,
295
328
  $container = $slides_container.parent(),
296
329
  $slides = $slides_container.children(),
297
330
  $active_slide = $slides_container.find('.' + self.settings.active_slide_class),
298
- active_index = $active_slide.index();
331
+ active_index = $active_slide.index(),
332
+ margin_position = Foundation.rtl ? 'marginRight' : 'marginLeft';
299
333
 
300
334
  if ($container.hasClass(self.settings.orbit_transition_class)) {
301
335
  return false;
@@ -316,11 +350,11 @@
316
350
  active_index = (index_or_direction % $slides.length);
317
351
  }
318
352
  if (active_index === ($slides.length - 1) && index_or_direction === 'next') {
319
- $slides_container.css('marginLeft', '0%');
353
+ $slides_container.css(margin_position, '0%');
320
354
  active_index = 1;
321
355
  }
322
356
  else if (active_index === 0 && index_or_direction === 'prev') {
323
- $slides_container.css('marginLeft', '-' + ($slides.length - 1) * 100 + '%');
357
+ $slides_container.css(margin_position, '-' + ($slides.length - 1) * 100 + '%');
324
358
  active_index = $slides.length - 2;
325
359
  }
326
360
  // Start transition, make next slide active
@@ -337,14 +371,15 @@
337
371
  // Check to see if animation will occur, otherwise perform
338
372
  // callbacks manually
339
373
  $slides_container.trigger('orbit:before-slide-change');
340
- if ($slides_container.css('marginLeft') === new_margin_left) {
374
+ if ($slides_container.css(margin_position) === new_margin_left) {
341
375
  $container.removeClass(self.settings.orbit_transition_class);
342
376
  $slides_container.trigger('orbit:after-slide-change', [{slide_number: active_index, total_slides: $slides_container.children().length - 2}]);
343
377
  callback();
344
378
  } else {
345
- $slides_container.animate({
346
- 'marginLeft' : new_margin_left
347
- }, self.settings.animation_speed, 'linear', function() {
379
+ var properties = {};
380
+ properties[margin_position] = new_margin_left;
381
+
382
+ $slides_container.animate(properties, self.settings.animation_speed, 'linear', function() {
348
383
  $container.removeClass(self.settings.orbit_transition_class);
349
384
  $slides_container.trigger('orbit:after-slide-change', [{slide_number: active_index, total_slides: $slides_container.children().length - 2}]);
350
385
  callback();
@@ -156,4 +156,24 @@
156
156
  }
157
157
  }
158
158
 
159
- }(this, document, Foundation.zj));
159
+ }(this, document, Foundation.zj));
160
+
161
+ ;(function ($, window, document, undefined) {
162
+ 'use strict';
163
+
164
+ Foundation.libs.placeholder = {
165
+ name : 'placeholder',
166
+
167
+ version : '4.2.2',
168
+
169
+ init : function (scope, method, options) {
170
+ this.scope = scope || this.scope;
171
+
172
+ if (typeof method !== 'string') {
173
+ window.onload = function () {
174
+ $('input, textarea').placeholder();
175
+ }
176
+ }
177
+ }
178
+ };
179
+ }(Foundation.zj, this, this.document));
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.reveal = {
7
7
  name: 'reveal',
8
8
 
9
- version : '4.0.4',
9
+ version : '4.2.2',
10
10
 
11
11
  locked : false,
12
12
 
@@ -14,6 +14,7 @@
14
14
  animation: 'fadeAndPop',
15
15
  animationSpeed: 250,
16
16
  closeOnBackgroundClick: true,
17
+ closeOnEsc: true,
17
18
  dismissModalClass: 'close-reveal-modal',
18
19
  bgClass: 'reveal-modal-bg',
19
20
  open: function(){},
@@ -36,15 +37,16 @@
36
37
  },
37
38
 
38
39
  init : function (scope, method, options) {
39
- this.scope = scope || this.scope;
40
40
  Foundation.inherit(this, 'data_options delay');
41
41
 
42
42
  if (typeof method === 'object') {
43
43
  $.extend(true, this.settings, method);
44
+ } else if (typeof options !== 'undefined') {
45
+ $.extend(true, this.settings, options);
44
46
  }
45
47
 
46
- if (typeof method != 'string') {
47
- if (!this.settings.init) this.events();
48
+ if (typeof method !== 'string') {
49
+ this.events();
48
50
 
49
51
  return this.settings.init;
50
52
  } else {
@@ -56,15 +58,33 @@
56
58
  var self = this;
57
59
 
58
60
  $(this.scope)
61
+ .off('.fndtn.reveal')
59
62
  .on('click.fndtn.reveal', '[data-reveal-id]', function (e) {
60
63
  e.preventDefault();
64
+
61
65
  if (!self.locked) {
66
+ var element = $(this),
67
+ ajax = element.data('reveal-ajax');
68
+
62
69
  self.locked = true;
63
- self.open.call(self, $(this));
70
+
71
+ if (typeof ajax === 'undefined') {
72
+ self.open.call(self, element);
73
+ } else {
74
+ var url = ajax === true ? element.attr('href') : ajax;
75
+
76
+ self.open.call(self, element, {url: url});
77
+ }
64
78
  }
65
79
  })
66
- .on('click.fndtn.reveal touchend.click.fndtn.reveal', this.close_targets(), function (e) {
80
+ .on('click.fndtn.reveal', this.close_targets(), function (e) {
81
+ e.preventDefault();
67
82
  if (!self.locked) {
83
+ var settings = $.extend({}, self.settings, self.data_options($('.reveal-modal.open')));
84
+ if ($(e.target)[0] === $('.' + settings.bgClass)[0] && !settings.closeOnBackgroundClick) {
85
+ return;
86
+ }
87
+
68
88
  self.locked = true;
69
89
  self.close.call(self, $(this).closest('.reveal-modal'));
70
90
  }
@@ -75,38 +95,82 @@
75
95
  .on('close.fndtn.reveal', '.reveal-modal', this.settings.close)
76
96
  .on('closed.fndtn.reveal', '.reveal-modal', this.settings.closed)
77
97
  .on('closed.fndtn.reveal', '.reveal-modal', this.close_video);
98
+
99
+ $( 'body' ).bind( 'keyup.reveal', function ( event ) {
100
+ var open_modal = $('.reveal-modal.open'),
101
+ settings = $.extend({}, self.settings, self.data_options(open_modal));
102
+ if ( event.which === 27 && settings.closeOnEsc) { // 27 is the keycode for the Escape key
103
+ open_modal.foundation('reveal', 'close');
104
+ }
105
+ });
106
+
107
+ return true;
78
108
  },
79
109
 
80
- open : function (target) {
110
+ open : function (target, ajax_settings) {
81
111
  if (target) {
82
- var modal = $('#' + target.data('reveal-id'));
112
+ if (typeof target.selector !== 'undefined') {
113
+ var modal = $('#' + target.data('reveal-id'));
114
+ } else {
115
+ var modal = $(this.scope);
116
+
117
+ ajax_settings = target;
118
+ }
83
119
  } else {
84
120
  var modal = $(this.scope);
85
121
  }
86
122
 
87
- var open_modal = $('.reveal-modal.open');
123
+ if (!modal.hasClass('open')) {
124
+ var open_modal = $('.reveal-modal.open');
88
125
 
89
- if (!modal.data('css-top')) {
90
- modal.data('css-top', parseInt(modal.css('top'), 10))
91
- .data('offset', this.cache_offset(modal));
92
- }
126
+ if (typeof modal.data('css-top') === 'undefined') {
127
+ modal.data('css-top', parseInt(modal.css('top'), 10))
128
+ .data('offset', this.cache_offset(modal));
129
+ }
93
130
 
94
- modal.trigger('open');
131
+ modal.trigger('open');
95
132
 
96
- if (open_modal.length < 1) {
97
- this.toggle_bg(modal);
98
- }
133
+ if (open_modal.length < 1) {
134
+ this.toggle_bg(modal);
135
+ }
136
+
137
+ if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
138
+ this.hide(open_modal, this.settings.css.close);
139
+ this.show(modal, this.settings.css.open);
140
+ } else {
141
+ var self = this,
142
+ old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
143
+
144
+ $.extend(ajax_settings, {
145
+ success: function (data, textStatus, jqXHR) {
146
+ if ( $.isFunction(old_success) ) {
147
+ old_success(data, textStatus, jqXHR);
148
+ }
99
149
 
100
- this.toggle_modals(open_modal, modal);
150
+ modal.html(data);
151
+ $(modal).foundation('section', 'reflow');
152
+
153
+ self.hide(open_modal, self.settings.css.close);
154
+ self.show(modal, self.settings.css.open);
155
+ }
156
+ });
157
+
158
+ $.ajax(ajax_settings);
159
+ }
160
+ }
101
161
  },
102
162
 
103
163
  close : function (modal) {
104
- var modal = modal || $(this.scope);
105
- this.locked = true;
106
- var open_modal = $('.reveal-modal.open').not(modal);
107
- modal.trigger('close');
108
- this.toggle_bg(modal);
109
- this.toggle_modals(open_modal, modal);
164
+
165
+ var modal = modal && modal.length ? modal : $(this.scope),
166
+ open_modals = $('.reveal-modal.open');
167
+
168
+ if (open_modals.length > 0) {
169
+ this.locked = true;
170
+ modal.trigger('close');
171
+ this.toggle_bg(modal);
172
+ this.hide(open_modals, this.settings.css.close);
173
+ }
110
174
  },
111
175
 
112
176
  close_targets : function () {
@@ -119,22 +183,10 @@
119
183
  return base;
120
184
  },
121
185
 
122
- toggle_modals : function (open_modal, modal) {
123
- if (open_modal.length > 0) {
124
- this.hide(open_modal, this.settings.css.close);
125
- }
126
-
127
- if (modal.filter(':visible').length > 0) {
128
- this.hide(modal, this.settings.css.close);
129
- } else {
130
- this.show(modal, this.settings.css.open);
131
- }
132
- },
133
-
134
186
  toggle_bg : function (modal) {
135
- if (this.settings.bg.length === 0) {
187
+ if ($('.reveal-modal-bg').length === 0) {
136
188
  this.settings.bg = $('<div />', {'class': this.settings.bgClass})
137
- .insertAfter(modal);
189
+ .appendTo('body');
138
190
  }
139
191
 
140
192
  if (this.settings.bg.filter(':visible').length > 0) {
@@ -152,7 +204,7 @@
152
204
  var end_css = {
153
205
  top: $(window).scrollTop() + el.data('css-top') + 'px',
154
206
  opacity: 1
155
- }
207
+ };
156
208
 
157
209
  return this.delay(function () {
158
210
  return el
@@ -240,7 +292,7 @@
240
292
  if (iframe.length > 0) {
241
293
  iframe.attr('data-src', iframe[0].src);
242
294
  iframe.attr('src', 'about:blank');
243
- video.fadeOut(100).hide();
295
+ video.hide();
244
296
  }
245
297
  },
246
298
 
@@ -252,8 +304,12 @@
252
304
  var data_src = iframe.attr('data-src');
253
305
  if (typeof data_src === 'string') {
254
306
  iframe[0].src = iframe.attr('data-src');
307
+ } else {
308
+ var src = iframe[0].src;
309
+ iframe[0].src = undefined;
310
+ iframe[0].src = src;
255
311
  }
256
- video.show().fadeIn(100);
312
+ video.show();
257
313
  }
258
314
  },
259
315
 
@@ -267,6 +323,8 @@
267
323
 
268
324
  off : function () {
269
325
  $(this.scope).off('.fndtn.reveal');
270
- }
326
+ },
327
+
328
+ reflow : function () {}
271
329
  };
272
330
  }(Foundation.zj, this, this.document));