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,12 +6,14 @@
6
6
  Foundation.libs.tooltips = {
7
7
  name: 'tooltips',
8
8
 
9
- version : '4.0.2',
9
+ version : '4.2.2',
10
10
 
11
11
  settings : {
12
12
  selector : '.has-tip',
13
13
  additionalInheritableClasses : [],
14
14
  tooltipClass : '.tooltip',
15
+ appendTo: 'body',
16
+ 'disable-for-touch': false,
15
17
  tipTemplate : function (selector, content) {
16
18
  return '<span data-selector="' + selector + '" class="'
17
19
  + Foundation.libs.tooltips.settings.tooltipClass.substring(1)
@@ -22,21 +24,26 @@
22
24
  cache : {},
23
25
 
24
26
  init : function (scope, method, options) {
27
+ Foundation.inherit(this, 'data_options');
25
28
  var self = this;
26
- this.scope = scope || this.scope;
27
29
 
28
30
  if (typeof method === 'object') {
29
31
  $.extend(true, this.settings, method);
32
+ } else if (typeof options !== 'undefined') {
33
+ $.extend(true, this.settings, options);
30
34
  }
31
35
 
32
- if (typeof method != 'string') {
36
+ if (typeof method !== 'string') {
33
37
  if (Modernizr.touch) {
34
38
  $(this.scope)
35
39
  .on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
36
40
  '[data-tooltip]', function (e) {
37
- e.preventDefault();
38
- $(self.settings.tooltipClass).hide();
39
- self.showOrCreateTip($(this));
41
+ var settings = $.extend({}, self.settings, self.data_options($(this)));
42
+ if (!settings['disable-for-touch']) {
43
+ e.preventDefault();
44
+ $(settings.tooltipClass).hide();
45
+ self.showOrCreateTip($(this));
46
+ }
40
47
  })
41
48
  .on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
42
49
  this.settings.tooltipClass, function (e) {
@@ -49,7 +56,7 @@
49
56
  '[data-tooltip]', function (e) {
50
57
  var $this = $(this);
51
58
 
52
- if (e.type === 'mouseover' || e.type === 'mouseenter') {
59
+ if (/enter|over/i.test(e.type)) {
53
60
  self.showOrCreateTip($this);
54
61
  } else if (e.type === 'mouseout' || e.type === 'mouseleave') {
55
62
  self.hide($this);
@@ -79,7 +86,7 @@
79
86
  tip = null;
80
87
 
81
88
  if (selector) {
82
- tip = $('span[data-selector=' + selector + ']' + this.settings.tooltipClass);
89
+ tip = $('span[data-selector="' + selector + '"]' + this.settings.tooltipClass);
83
90
  }
84
91
 
85
92
  return (typeof tip === 'object') ? tip : false;
@@ -98,10 +105,10 @@
98
105
  },
99
106
 
100
107
  create : function ($target) {
101
- var $tip = $(this.settings.tipTemplate(this.selector($target), $('<div>').html($target.attr('title')).html())),
108
+ var $tip = $(this.settings.tipTemplate(this.selector($target), $('<div></div>').html($target.attr('title')).html())),
102
109
  classes = this.inheritable_classes($target);
103
110
 
104
- $tip.addClass(classes).appendTo('body');
111
+ $tip.addClass(classes).appendTo(this.settings.appendTo);
105
112
  if (Modernizr.touch) {
106
113
  $tip.append('<span class="tap-to-close">tap to close </span>');
107
114
  }
@@ -136,10 +143,14 @@
136
143
  tip.addClass('tip-override');
137
144
  objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
138
145
  } else {
139
- objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', target.offset().left, width);
146
+ var left = target.offset().left;
147
+ if (Foundation.rtl) {
148
+ left = target.offset().left + target.offset().width - this.outerWidth(tip);
149
+ }
150
+ objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', left, width);
140
151
  tip.removeClass('tip-override');
141
152
  if (classes && classes.indexOf('tip-top') > -1) {
142
- objPos(tip, (target.offset().top - this.outerHeight(tip)), 'auto', 'auto', target.offset().left, width)
153
+ objPos(tip, (target.offset().top - this.outerHeight(tip)), 'auto', 'auto', left, width)
143
154
  .removeClass('tip-override');
144
155
  } else if (classes && classes.indexOf('tip-left') > -1) {
145
156
  objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left - this.outerWidth(tip) - nubHeight), width)
@@ -190,6 +201,8 @@
190
201
  $(this.settings.tooltipClass).each(function (i) {
191
202
  $('[data-tooltip]').get(i).attr('title', $(this).text());
192
203
  }).remove();
193
- }
204
+ },
205
+
206
+ reflow : function () {}
194
207
  };
195
208
  }(Foundation.zj, this, this.document));
@@ -6,32 +6,36 @@
6
6
  Foundation.libs.topbar = {
7
7
  name : 'topbar',
8
8
 
9
- version : '4.0.0',
9
+ version : '4.2.3',
10
10
 
11
11
  settings : {
12
12
  index : 0,
13
13
  stickyClass : 'sticky',
14
- back_text: '&laquo; Back',
14
+ custom_back_text: true,
15
+ back_text: 'Back',
16
+ is_hover: true,
17
+ scrolltop : true, // jump to top when sticky nav menu toggle is clicked
15
18
  init : false
16
19
  },
17
20
 
18
- init : function (scope, method, options) {
21
+ init : function (section, method, options) {
22
+ Foundation.inherit(this, 'data_options');
19
23
  var self = this;
20
- this.scope = scope || this.scope;
21
24
 
22
25
  if (typeof method === 'object') {
23
26
  $.extend(true, this.settings, method);
27
+ } else if (typeof options !== 'undefined') {
28
+ $.extend(true, this.settings, options);
24
29
  }
25
30
 
26
- if (typeof method != 'string') {
31
+ if (typeof method !== 'string') {
27
32
 
28
- $('nav.top-bar').each(function () {
33
+ $('.top-bar, [data-topbar]').each(function () {
34
+ $.extend(true, self.settings, self.data_options($(this)));
29
35
  self.settings.$w = $(window);
30
36
  self.settings.$topbar = $(this);
31
37
  self.settings.$section = self.settings.$topbar.find('section');
32
38
  self.settings.$titlebar = self.settings.$topbar.children('ul').first();
33
-
34
-
35
39
  self.settings.$topbar.data('index', 0);
36
40
 
37
41
  var breakpoint = $("<div class='top-bar-js-breakpoint'/>").insertAfter(self.settings.$topbar);
@@ -58,78 +62,157 @@
58
62
 
59
63
  events : function () {
60
64
  var self = this;
61
-
65
+ var offst = this.outerHeight($('.top-bar, [data-topbar]'));
62
66
  $(this.scope)
63
- .on('click.fndtn.topbar', '.top-bar .toggle-topbar', function (e) {
64
- var topbar = $(this).closest('.top-bar'),
67
+ .off('.fndtn.topbar')
68
+ .on('click.fndtn.topbar', '.top-bar .toggle-topbar, [data-topbar] .toggle-topbar', function (e) {
69
+ var topbar = $(this).closest('.top-bar, [data-topbar]'),
65
70
  section = topbar.find('section, .section'),
66
71
  titlebar = topbar.children('ul').first();
67
72
 
68
- if (!self.settings.$topbar.data('height')) self.largestUL();
69
-
70
73
  e.preventDefault();
71
74
 
72
75
  if (self.breakpoint()) {
76
+ if (!self.rtl) {
77
+ section.css({left: '0%'});
78
+ section.find('>.name').css({left: '100%'});
79
+ } else {
80
+ section.css({right: '0%'});
81
+ section.find('>.name').css({right: '100%'});
82
+ }
83
+
84
+ section.find('li.moved').removeClass('moved');
85
+ topbar.data('index', 0);
86
+
73
87
  topbar
74
88
  .toggleClass('expanded')
75
- .css('min-height', '');
89
+ .css('height', '');
76
90
  }
77
91
 
78
92
  if (!topbar.hasClass('expanded')) {
79
- section.css({left: '0%'});
80
- section.find('>.name').css({left: '100%'});
81
- section.find('li.moved').removeClass('moved');
82
- topbar.data('index', 0);
93
+ if (topbar.hasClass('fixed')) {
94
+ topbar.parent().addClass('fixed');
95
+ topbar.removeClass('fixed');
96
+ $('body').css('padding-top',offst);
97
+ }
98
+ } else if (topbar.parent().hasClass('fixed')) {
99
+ topbar.parent().removeClass('fixed');
100
+ topbar.addClass('fixed');
101
+ $('body').css('padding-top','0');
102
+
103
+ if (self.settings.scrolltop) {
104
+ window.scrollTo(0,0);
105
+ }
83
106
  }
84
107
  })
85
108
 
86
- .on('click.fndtn.topbar', '.top-bar .has-dropdown>a', function (e) {
87
- var topbar = $(this).closest('.top-bar'),
88
- section = topbar.find('section, .section'),
89
- titlebar = topbar.children('ul').first();
109
+ .on('mouseenter mouseleave', '.top-bar li', function (e) {
110
+ if (!self.settings.is_hover) return;
111
+
112
+ if (/enter|over/i.test(e.type)) {
113
+ $(this).addClass('hover');
114
+ } else {
115
+ $(this).removeClass('hover');
116
+ }
117
+ })
118
+
119
+ .on('click.fndtn.topbar', '.top-bar li.has-dropdown', function (e) {
120
+ if (self.breakpoint()) return;
90
121
 
91
- if (Modernizr.touch || self.breakpoint()) {
122
+ var li = $(this),
123
+ target = $(e.target),
124
+ topbar = li.closest('[data-topbar], .top-bar'),
125
+ is_hover = topbar.data('topbar');
126
+
127
+ if (self.settings.is_hover && !Modernizr.touch) return;
128
+
129
+ e.stopImmediatePropagation();
130
+
131
+ if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) {
92
132
  e.preventDefault();
93
133
  }
94
134
 
135
+ if (li.hasClass('hover')) {
136
+ li
137
+ .removeClass('hover')
138
+ .find('li')
139
+ .removeClass('hover');
140
+ } else {
141
+ li.addClass('hover');
142
+ }
143
+ })
144
+
145
+ .on('click.fndtn.topbar', '.top-bar .has-dropdown>a, [data-topbar] .has-dropdown>a', function (e) {
95
146
  if (self.breakpoint()) {
147
+ e.preventDefault();
148
+
96
149
  var $this = $(this),
150
+ topbar = $this.closest('.top-bar, [data-topbar]'),
151
+ section = topbar.find('section, .section'),
152
+ titlebar = topbar.children('ul').first(),
153
+ dropdownHeight = $this.next('.dropdown').outerHeight(),
97
154
  $selectedLi = $this.closest('li');
98
155
 
99
156
  topbar.data('index', topbar.data('index') + 1);
100
157
  $selectedLi.addClass('moved');
101
- section.css({left: -(100 * topbar.data('index')) + '%'});
102
- section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
103
158
 
104
- $this.siblings('ul')
105
- .height(topbar.data('height') + self.outerHeight(titlebar, true));
106
- topbar
107
- .css('min-height', topbar.data('height') + self.outerHeight(titlebar, true) * 2)
159
+ if (!self.rtl) {
160
+ section.css({left: -(100 * topbar.data('index')) + '%'});
161
+ section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
162
+ } else {
163
+ section.css({right: -(100 * topbar.data('index')) + '%'});
164
+ section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
165
+ }
166
+
167
+ topbar.css('height', self.outerHeight($this.siblings('ul'), true) + self.outerHeight(titlebar, true));
108
168
  }
109
- });
169
+ });
110
170
 
111
171
  $(window).on('resize.fndtn.topbar', function () {
112
- if (!this.breakpoint()) {
113
- $('.top-bar').css('min-height', '');
172
+ if (!self.breakpoint()) {
173
+ $('.top-bar, [data-topbar]')
174
+ .css('height', '')
175
+ .removeClass('expanded')
176
+ .find('li')
177
+ .removeClass('hover');
114
178
  }
115
179
  }.bind(this));
116
180
 
181
+ $('body').on('click.fndtn.topbar', function (e) {
182
+ var parent = $(e.target).closest('[data-topbar], .top-bar');
183
+
184
+ if (parent.length > 0) {
185
+ return;
186
+ }
187
+
188
+ $('.top-bar li, [data-topbar] li').removeClass('hover');
189
+ });
190
+
117
191
  // Go up a level on Click
118
- $(this.scope).on('click.fndtn', '.top-bar .has-dropdown .back', function (e) {
192
+ $(this.scope).on('click.fndtn', '.top-bar .has-dropdown .back, [data-topbar] .has-dropdown .back', function (e) {
119
193
  e.preventDefault();
120
194
 
121
195
  var $this = $(this),
122
- topbar = $this.closest('.top-bar'),
196
+ topbar = $this.closest('.top-bar, [data-topbar]'),
197
+ titlebar = topbar.children('ul').first(),
123
198
  section = topbar.find('section, .section'),
124
199
  $movedLi = $this.closest('li.moved'),
125
200
  $previousLevelUl = $movedLi.parent();
126
201
 
127
202
  topbar.data('index', topbar.data('index') - 1);
128
- section.css({left: -(100 * topbar.data('index')) + '%'});
129
- section.find('>.name').css({'left': 100 * topbar.data('index') + '%'});
203
+
204
+ if (!self.rtl) {
205
+ section.css({left: -(100 * topbar.data('index')) + '%'});
206
+ section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
207
+ } else {
208
+ section.css({right: -(100 * topbar.data('index')) + '%'});
209
+ section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
210
+ }
130
211
 
131
212
  if (topbar.data('index') === 0) {
132
- topbar.css('min-height', 0);
213
+ topbar.css('height', '');
214
+ } else {
215
+ topbar.css('height', self.outerHeight($previousLevelUl, true) + self.outerHeight(titlebar, true));
133
216
  }
134
217
 
135
218
  setTimeout(function () {
@@ -139,7 +222,7 @@
139
222
  },
140
223
 
141
224
  breakpoint : function () {
142
- return $(window).width() <= this.settings.breakPoint || $('html').hasClass('lt-ie9');
225
+ return $(document).width() <= this.settings.breakPoint || $('html').hasClass('lt-ie9');
143
226
  },
144
227
 
145
228
  assemble : function () {
@@ -150,8 +233,20 @@
150
233
  this.settings.$section.find('.has-dropdown>a').each(function () {
151
234
  var $link = $(this),
152
235
  $dropdown = $link.siblings('.dropdown'),
153
- $titleLi = $('<li class="title back js-generated"><h5><a href="#">' + self.settings.back_text + '</a></h5></li>');
236
+ url = $link.attr('href');
237
+
238
+ if (url && url.length > 1) {
239
+ var $titleLi = $('<li class="title back js-generated"><h5><a href="#"></a></h5></li><li><a class="parent-link js-generated" href="' + url + '">' + $link.text() +'</a></li>');
240
+ } else {
241
+ var $titleLi = $('<li class="title back js-generated"><h5><a href="#"></a></h5></li>');
242
+ }
243
+
154
244
  // Copy link to subnav
245
+ if (self.settings.custom_back_text == true) {
246
+ $titleLi.find('h5>a').html('&laquo; ' + self.settings.back_text);
247
+ } else {
248
+ $titleLi.find('h5>a').html('&laquo; ' + $link.html());
249
+ }
155
250
  $dropdown.prepend($titleLi);
156
251
  });
157
252
 
@@ -162,21 +257,13 @@
162
257
  this.sticky();
163
258
  },
164
259
 
165
- largestUL : function () {
166
- var uls = this.settings.$topbar.find('section ul ul'),
167
- largest = uls.first(),
168
- total = 0,
260
+ height : function (ul) {
261
+ var total = 0,
169
262
  self = this;
170
263
 
171
- uls.each(function () {
172
- if ($(this).children('li').length > largest.children('li').length) {
173
- largest = $(this);
174
- }
175
- });
176
-
177
- largest.children('li').each(function () { total += self.outerHeight($(this), true); });
264
+ ul.find('> li').each(function () { total += self.outerHeight($(this), true); });
178
265
 
179
- this.settings.$topbar.data('height', total);
266
+ return total;
180
267
  },
181
268
 
182
269
  sticky : function () {
@@ -184,18 +271,24 @@
184
271
  if ($(klass).length > 0) {
185
272
  var distance = $(klass).length ? $(klass).offset().top: 0,
186
273
  $window = $(window);
187
- var offst = this.outerHeight($('nav.top-bar'))+20;
188
-
274
+ var offst = this.outerHeight($('.top-bar'));
275
+ //Whe resize elements of the page on windows resize. Must recalculate distance
276
+ $(window).resize(function() {
277
+ clearTimeout(t_top);
278
+ t_top = setTimeout (function() {
279
+ distance = $(klass).offset().top;
280
+ },105);
281
+ });
189
282
  $window.scroll(function() {
190
- if ($window.scrollTop() >= (distance)) {
191
- $(klass).addClass("fixed");
192
- $('body').css('padding-top',offst);
283
+ if ($window.scrollTop() > (distance)) {
284
+ $(klass).addClass("fixed");
285
+ $('body').css('padding-top',offst);
193
286
  }
194
287
 
195
- else if ($window.scrollTop() < distance) {
288
+ else if ($window.scrollTop() <= distance) {
196
289
  $(klass).removeClass("fixed");
197
290
  $('body').css('padding-top','0');
198
- }
291
+ }
199
292
  });
200
293
  }
201
294
  },
@@ -203,6 +296,8 @@
203
296
  off : function () {
204
297
  $(this.scope).off('.fndtn.topbar');
205
298
  $(window).off('.fndtn.topbar');
206
- }
299
+ },
300
+
301
+ reflow : function () {}
207
302
  };
208
303
  }(Foundation.zj, this, this.document));
@@ -0,0 +1,17 @@
1
+ /*
2
+ =require foundation/foundation
3
+ =require foundation/foundation.alerts
4
+ =require foundation/foundation.clearing
5
+ =require foundation/foundation.cookie
6
+ =require foundation/foundation.dropdown
7
+ =require foundation/foundation.forms
8
+ =require foundation/foundation.joyride
9
+ =require foundation/foundation.magellan
10
+ =require foundation/foundation.orbit
11
+ =require foundation/foundation.reveal
12
+ =require foundation/foundation.section
13
+ =require foundation/foundation.tooltips
14
+ =require foundation/foundation.topbar
15
+ =require foundation/foundation.interchange
16
+ =require foundation/foundation.placeholder
17
+ */
@@ -162,7 +162,6 @@ body
162
162
  margin-right: 15px
163
163
 
164
164
  #entities
165
- margin-left: -77px
166
165
  font-size: 1.5em
167
166
 
168
167
  a