helios 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +82 -37
- data/README.md +16 -0
- data/bin/helios +4 -0
- data/example/Gemfile +7 -0
- data/example/Gemfile.lock +149 -0
- data/example/Procfile +1 -0
- data/example/Sample.xcdatamodeld/Sample.xcdatamodel/contents +23 -0
- data/example/config.ru +6 -0
- data/helios.gemspec +17 -7
- data/lib/helios.rb +15 -1
- data/lib/helios/backend.rb +46 -0
- data/lib/helios/backend/data.rb +36 -0
- data/lib/helios/backend/in-app-purchase.rb +33 -0
- data/lib/helios/backend/passbook.rb +25 -0
- data/lib/helios/backend/push-notification.rb +90 -0
- data/lib/helios/commands.rb +1 -0
- data/lib/helios/commands/new.rb +27 -0
- data/lib/helios/frontend.rb +56 -0
- data/lib/helios/frontend/images/data.png +0 -0
- data/lib/helios/frontend/images/data.svg +1 -0
- data/lib/helios/frontend/images/in-app-purchase.png +0 -0
- data/lib/helios/frontend/images/in-app-purchase.svg +1 -0
- data/lib/helios/frontend/images/passbook.png +0 -0
- data/lib/helios/frontend/images/passbook.svg +1 -0
- data/lib/helios/frontend/images/push-notification.png +0 -0
- data/lib/helios/frontend/images/push-notification.svg +1 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.alerts.js +50 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.clearing.js +478 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.cookie.js +74 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.dropdown.js +122 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.forms.js +403 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.joyride.js +613 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.js +331 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.magellan.js +130 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.orbit.js +355 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.placeholder.js +159 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.reveal.js +272 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.section.js +183 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.tooltips.js +195 -0
- data/lib/helios/frontend/javascripts/foundation/foundation.topbar.js +208 -0
- data/lib/helios/frontend/javascripts/helios.coffee +48 -0
- data/lib/helios/frontend/javascripts/helios/collections.coffee +30 -0
- data/lib/helios/frontend/javascripts/helios/models.coffee +23 -0
- data/lib/helios/frontend/javascripts/helios/router.coffee +52 -0
- data/lib/helios/frontend/javascripts/helios/views.coffee +92 -0
- data/lib/helios/frontend/javascripts/vendor/backbone.datagrid.js +662 -0
- data/lib/helios/frontend/javascripts/vendor/backbone.js +1487 -0
- data/lib/helios/frontend/javascripts/vendor/jquery.js +9597 -0
- data/lib/helios/frontend/javascripts/vendor/underscore.js +1227 -0
- data/lib/helios/frontend/stylesheets/_settings.scss +988 -0
- data/lib/helios/frontend/stylesheets/screen.sass +98 -0
- data/lib/helios/frontend/templates/data/entities.hbs +7 -0
- data/lib/helios/frontend/templates/data/entity.hbs +17 -0
- data/lib/helios/frontend/templates/in-app-purchase/receipt.hbs +53 -0
- data/lib/helios/frontend/templates/in-app-purchase/receipts.hbs +39 -0
- data/lib/helios/frontend/templates/passbook/passes.hbs +25 -0
- data/lib/helios/frontend/templates/push-notification/device.hbs +35 -0
- data/lib/helios/frontend/templates/push-notification/devices.hbs +37 -0
- data/lib/helios/frontend/views/devices.jst.tpl +3 -0
- data/lib/helios/frontend/views/entities.jst.tpl +9 -0
- data/lib/helios/frontend/views/index.haml +30 -0
- data/lib/helios/frontend/views/passes.jst.tpl +3 -0
- data/lib/helios/frontend/views/receipts.jst.tpl +3 -0
- data/lib/helios/templates/Gemfile.erb +7 -0
- data/lib/helios/templates/Procfile.erb +1 -0
- data/lib/helios/templates/README.md.erb +9 -0
- data/lib/helios/templates/config.ru.erb +6 -0
- data/lib/helios/version.rb +3 -0
- metadata +199 -26
@@ -0,0 +1,272 @@
|
|
1
|
+
/*jslint unparam: true, browser: true, indent: 2 */
|
2
|
+
|
3
|
+
;(function ($, window, document, undefined) {
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
Foundation.libs.reveal = {
|
7
|
+
name: 'reveal',
|
8
|
+
|
9
|
+
version : '4.0.4',
|
10
|
+
|
11
|
+
locked : false,
|
12
|
+
|
13
|
+
settings : {
|
14
|
+
animation: 'fadeAndPop',
|
15
|
+
animationSpeed: 250,
|
16
|
+
closeOnBackgroundClick: true,
|
17
|
+
dismissModalClass: 'close-reveal-modal',
|
18
|
+
bgClass: 'reveal-modal-bg',
|
19
|
+
open: function(){},
|
20
|
+
opened: function(){},
|
21
|
+
close: function(){},
|
22
|
+
closed: function(){},
|
23
|
+
bg : $('.reveal-modal-bg'),
|
24
|
+
css : {
|
25
|
+
open : {
|
26
|
+
'opacity': 0,
|
27
|
+
'visibility': 'visible',
|
28
|
+
'display' : 'block'
|
29
|
+
},
|
30
|
+
close : {
|
31
|
+
'opacity': 1,
|
32
|
+
'visibility': 'hidden',
|
33
|
+
'display': 'none'
|
34
|
+
}
|
35
|
+
}
|
36
|
+
},
|
37
|
+
|
38
|
+
init : function (scope, method, options) {
|
39
|
+
this.scope = scope || this.scope;
|
40
|
+
Foundation.inherit(this, 'data_options delay');
|
41
|
+
|
42
|
+
if (typeof method === 'object') {
|
43
|
+
$.extend(true, this.settings, method);
|
44
|
+
}
|
45
|
+
|
46
|
+
if (typeof method != 'string') {
|
47
|
+
if (!this.settings.init) this.events();
|
48
|
+
|
49
|
+
return this.settings.init;
|
50
|
+
} else {
|
51
|
+
return this[method].call(this, options);
|
52
|
+
}
|
53
|
+
},
|
54
|
+
|
55
|
+
events : function () {
|
56
|
+
var self = this;
|
57
|
+
|
58
|
+
$(this.scope)
|
59
|
+
.on('click.fndtn.reveal', '[data-reveal-id]', function (e) {
|
60
|
+
e.preventDefault();
|
61
|
+
if (!self.locked) {
|
62
|
+
self.locked = true;
|
63
|
+
self.open.call(self, $(this));
|
64
|
+
}
|
65
|
+
})
|
66
|
+
.on('click.fndtn.reveal touchend.click.fndtn.reveal', this.close_targets(), function (e) {
|
67
|
+
if (!self.locked) {
|
68
|
+
self.locked = true;
|
69
|
+
self.close.call(self, $(this).closest('.reveal-modal'));
|
70
|
+
}
|
71
|
+
})
|
72
|
+
.on('open.fndtn.reveal', '.reveal-modal', this.settings.open)
|
73
|
+
.on('opened.fndtn.reveal', '.reveal-modal', this.settings.opened)
|
74
|
+
.on('opened.fndtn.reveal', '.reveal-modal', this.open_video)
|
75
|
+
.on('close.fndtn.reveal', '.reveal-modal', this.settings.close)
|
76
|
+
.on('closed.fndtn.reveal', '.reveal-modal', this.settings.closed)
|
77
|
+
.on('closed.fndtn.reveal', '.reveal-modal', this.close_video);
|
78
|
+
},
|
79
|
+
|
80
|
+
open : function (target) {
|
81
|
+
if (target) {
|
82
|
+
var modal = $('#' + target.data('reveal-id'));
|
83
|
+
} else {
|
84
|
+
var modal = $(this.scope);
|
85
|
+
}
|
86
|
+
|
87
|
+
var open_modal = $('.reveal-modal.open');
|
88
|
+
|
89
|
+
if (!modal.data('css-top')) {
|
90
|
+
modal.data('css-top', parseInt(modal.css('top'), 10))
|
91
|
+
.data('offset', this.cache_offset(modal));
|
92
|
+
}
|
93
|
+
|
94
|
+
modal.trigger('open');
|
95
|
+
|
96
|
+
if (open_modal.length < 1) {
|
97
|
+
this.toggle_bg(modal);
|
98
|
+
}
|
99
|
+
|
100
|
+
this.toggle_modals(open_modal, modal);
|
101
|
+
},
|
102
|
+
|
103
|
+
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);
|
110
|
+
},
|
111
|
+
|
112
|
+
close_targets : function () {
|
113
|
+
var base = '.' + this.settings.dismissModalClass;
|
114
|
+
|
115
|
+
if (this.settings.closeOnBackgroundClick) {
|
116
|
+
return base + ', .' + this.settings.bgClass;
|
117
|
+
}
|
118
|
+
|
119
|
+
return base;
|
120
|
+
},
|
121
|
+
|
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
|
+
toggle_bg : function (modal) {
|
135
|
+
if (this.settings.bg.length === 0) {
|
136
|
+
this.settings.bg = $('<div />', {'class': this.settings.bgClass})
|
137
|
+
.insertAfter(modal);
|
138
|
+
}
|
139
|
+
|
140
|
+
if (this.settings.bg.filter(':visible').length > 0) {
|
141
|
+
this.hide(this.settings.bg);
|
142
|
+
} else {
|
143
|
+
this.show(this.settings.bg);
|
144
|
+
}
|
145
|
+
},
|
146
|
+
|
147
|
+
show : function (el, css) {
|
148
|
+
// is modal
|
149
|
+
if (css) {
|
150
|
+
if (/pop/i.test(this.settings.animation)) {
|
151
|
+
css.top = $(window).scrollTop() - el.data('offset') + 'px';
|
152
|
+
var end_css = {
|
153
|
+
top: $(window).scrollTop() + el.data('css-top') + 'px',
|
154
|
+
opacity: 1
|
155
|
+
}
|
156
|
+
|
157
|
+
return this.delay(function () {
|
158
|
+
return el
|
159
|
+
.css(css)
|
160
|
+
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
161
|
+
this.locked = false;
|
162
|
+
el.trigger('opened');
|
163
|
+
}.bind(this))
|
164
|
+
.addClass('open');
|
165
|
+
}.bind(this), this.settings.animationSpeed / 2);
|
166
|
+
}
|
167
|
+
|
168
|
+
if (/fade/i.test(this.settings.animation)) {
|
169
|
+
var end_css = {opacity: 1};
|
170
|
+
|
171
|
+
return this.delay(function () {
|
172
|
+
return el
|
173
|
+
.css(css)
|
174
|
+
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
175
|
+
this.locked = false;
|
176
|
+
el.trigger('opened');
|
177
|
+
}.bind(this))
|
178
|
+
.addClass('open');
|
179
|
+
}.bind(this), this.settings.animationSpeed / 2);
|
180
|
+
}
|
181
|
+
|
182
|
+
return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened');
|
183
|
+
}
|
184
|
+
|
185
|
+
// should we animate the background?
|
186
|
+
if (/fade/i.test(this.settings.animation)) {
|
187
|
+
return el.fadeIn(this.settings.animationSpeed / 2);
|
188
|
+
}
|
189
|
+
|
190
|
+
return el.show();
|
191
|
+
},
|
192
|
+
|
193
|
+
hide : function (el, css) {
|
194
|
+
// is modal
|
195
|
+
if (css) {
|
196
|
+
if (/pop/i.test(this.settings.animation)) {
|
197
|
+
var end_css = {
|
198
|
+
top: - $(window).scrollTop() - el.data('offset') + 'px',
|
199
|
+
opacity: 0
|
200
|
+
};
|
201
|
+
|
202
|
+
return this.delay(function () {
|
203
|
+
return el
|
204
|
+
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
205
|
+
this.locked = false;
|
206
|
+
el.css(css).trigger('closed');
|
207
|
+
}.bind(this))
|
208
|
+
.removeClass('open');
|
209
|
+
}.bind(this), this.settings.animationSpeed / 2);
|
210
|
+
}
|
211
|
+
|
212
|
+
if (/fade/i.test(this.settings.animation)) {
|
213
|
+
var end_css = {opacity: 0};
|
214
|
+
|
215
|
+
return this.delay(function () {
|
216
|
+
return el
|
217
|
+
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
218
|
+
this.locked = false;
|
219
|
+
el.css(css).trigger('closed');
|
220
|
+
}.bind(this))
|
221
|
+
.removeClass('open');
|
222
|
+
}.bind(this), this.settings.animationSpeed / 2);
|
223
|
+
}
|
224
|
+
|
225
|
+
return el.hide().css(css).removeClass('open').trigger('closed');
|
226
|
+
}
|
227
|
+
|
228
|
+
// should we animate the background?
|
229
|
+
if (/fade/i.test(this.settings.animation)) {
|
230
|
+
return el.fadeOut(this.settings.animationSpeed / 2);
|
231
|
+
}
|
232
|
+
|
233
|
+
return el.hide();
|
234
|
+
},
|
235
|
+
|
236
|
+
close_video : function (e) {
|
237
|
+
var video = $(this).find('.flex-video'),
|
238
|
+
iframe = video.find('iframe');
|
239
|
+
|
240
|
+
if (iframe.length > 0) {
|
241
|
+
iframe.attr('data-src', iframe[0].src);
|
242
|
+
iframe.attr('src', 'about:blank');
|
243
|
+
video.fadeOut(100).hide();
|
244
|
+
}
|
245
|
+
},
|
246
|
+
|
247
|
+
open_video : function (e) {
|
248
|
+
var video = $(this).find('.flex-video'),
|
249
|
+
iframe = video.find('iframe');
|
250
|
+
|
251
|
+
if (iframe.length > 0) {
|
252
|
+
var data_src = iframe.attr('data-src');
|
253
|
+
if (typeof data_src === 'string') {
|
254
|
+
iframe[0].src = iframe.attr('data-src');
|
255
|
+
}
|
256
|
+
video.show().fadeIn(100);
|
257
|
+
}
|
258
|
+
},
|
259
|
+
|
260
|
+
cache_offset : function (modal) {
|
261
|
+
var offset = modal.show().height() + parseInt(modal.css('top'), 10);
|
262
|
+
|
263
|
+
modal.hide();
|
264
|
+
|
265
|
+
return offset;
|
266
|
+
},
|
267
|
+
|
268
|
+
off : function () {
|
269
|
+
$(this.scope).off('.fndtn.reveal');
|
270
|
+
}
|
271
|
+
};
|
272
|
+
}(Foundation.zj, this, this.document));
|
@@ -0,0 +1,183 @@
|
|
1
|
+
/*jslint unparam: true, browser: true, indent: 2 */
|
2
|
+
|
3
|
+
;(function ($, window, document, undefined) {
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
Foundation.libs.section = {
|
7
|
+
name: 'section',
|
8
|
+
|
9
|
+
version : '4.0.3',
|
10
|
+
|
11
|
+
settings : {
|
12
|
+
deep_linking: false,
|
13
|
+
one_up: true,
|
14
|
+
callback: function (){}
|
15
|
+
},
|
16
|
+
|
17
|
+
init : function (scope, method, options) {
|
18
|
+
this.scope = scope || this.scope;
|
19
|
+
Foundation.inherit(this, 'throttle data_options');
|
20
|
+
|
21
|
+
if (typeof method === 'object') {
|
22
|
+
$.extend(true, this.settings, method);
|
23
|
+
}
|
24
|
+
|
25
|
+
if (typeof method != 'string') {
|
26
|
+
this.set_active_from_hash();
|
27
|
+
if (!this.settings.init) this.events();
|
28
|
+
|
29
|
+
return this.settings.init;
|
30
|
+
} else {
|
31
|
+
return this[method].call(this, options);
|
32
|
+
}
|
33
|
+
},
|
34
|
+
|
35
|
+
events : function () {
|
36
|
+
var self = this;
|
37
|
+
$(this.scope).on('click.fndtn.section', '[data-section] .title', function (e) {
|
38
|
+
$.extend(true, self.settings, self.data_options($(this).closest('[data-section]')));
|
39
|
+
self.toggle_active.call(this, e, self);
|
40
|
+
});
|
41
|
+
|
42
|
+
$(window).on('resize.fndtn.section', self.throttle(function () {
|
43
|
+
self.resize.call(this);
|
44
|
+
}, 30)).trigger('resize');
|
45
|
+
|
46
|
+
this.settings.init = true;
|
47
|
+
},
|
48
|
+
|
49
|
+
toggle_active : function (e, self) {
|
50
|
+
var $this = $(this),
|
51
|
+
section = $this.closest('section, .section'),
|
52
|
+
content = section.find('.content'),
|
53
|
+
parent = section.closest('[data-section]'),
|
54
|
+
self = Foundation.libs.section;
|
55
|
+
|
56
|
+
if (!self.settings.deep_linking && content.length > 0) {
|
57
|
+
e.preventDefault();
|
58
|
+
}
|
59
|
+
|
60
|
+
if (section.hasClass('active')) {
|
61
|
+
if (self.small(parent)
|
62
|
+
|| self.is_vertical(parent)
|
63
|
+
|| self.is_accordion(parent)) {
|
64
|
+
section
|
65
|
+
.removeClass('active')
|
66
|
+
.attr('style', '');
|
67
|
+
}
|
68
|
+
} else {
|
69
|
+
if (self.small(parent) || self.settings.one_up) {
|
70
|
+
$this
|
71
|
+
.closest('[data-section]')
|
72
|
+
.find('section, .section')
|
73
|
+
.removeClass('active')
|
74
|
+
.attr('style', '');
|
75
|
+
|
76
|
+
section.css('padding-top', self.outerHeight(section.find('.title')) - 1);
|
77
|
+
}
|
78
|
+
|
79
|
+
if (self.small(parent)) {
|
80
|
+
section.attr('style', '');
|
81
|
+
}
|
82
|
+
|
83
|
+
section.addClass('active');
|
84
|
+
}
|
85
|
+
|
86
|
+
self.settings.callback();
|
87
|
+
},
|
88
|
+
|
89
|
+
resize : function () {
|
90
|
+
var sections = $('[data-section]'),
|
91
|
+
self = Foundation.libs.section;
|
92
|
+
|
93
|
+
sections.each(function() {
|
94
|
+
var $this = $(this),
|
95
|
+
active_section = $this.find('section.active, .section.active');
|
96
|
+
if (active_section.length > 1) {
|
97
|
+
active_section
|
98
|
+
.not(':first')
|
99
|
+
.removeClass('active')
|
100
|
+
.attr('style', '');
|
101
|
+
} else if (active_section.length < 1
|
102
|
+
&& !self.is_vertical($this)
|
103
|
+
&& !self.is_accordion($this)) {
|
104
|
+
var first = $this.find('section, .section').first();
|
105
|
+
first.addClass('active');
|
106
|
+
|
107
|
+
if (self.small($this)) {
|
108
|
+
first.attr('style', '');
|
109
|
+
} else {
|
110
|
+
first.css('padding-top', self.outerHeight(first.find('.title')) - 1);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
if (self.small($this)) {
|
115
|
+
active_section.attr('style', '');
|
116
|
+
} else {
|
117
|
+
active_section.css('padding-top', self.outerHeight(active_section.find('.title')) - 1);
|
118
|
+
}
|
119
|
+
self.position_titles($this);
|
120
|
+
});
|
121
|
+
},
|
122
|
+
|
123
|
+
is_vertical : function (el) {
|
124
|
+
return el.hasClass('vertical-nav');
|
125
|
+
},
|
126
|
+
|
127
|
+
is_accordion : function (el) {
|
128
|
+
return el.hasClass('accordion');
|
129
|
+
},
|
130
|
+
|
131
|
+
set_active_from_hash : function () {
|
132
|
+
var hash = window.location.hash.substring(1),
|
133
|
+
sections = $('[data-section]'),
|
134
|
+
self = this;
|
135
|
+
|
136
|
+
sections.each(function () {
|
137
|
+
var section = $(this);
|
138
|
+
$.extend(true, self.settings, self.data_options(section));
|
139
|
+
|
140
|
+
if (hash.length > 0 && self.settings.deep_linking) {
|
141
|
+
section
|
142
|
+
.find('.content[data-slug="' + hash + '"]')
|
143
|
+
.closest('section, .section')
|
144
|
+
.addClass('active');
|
145
|
+
}
|
146
|
+
});
|
147
|
+
},
|
148
|
+
|
149
|
+
position_titles : function (section, off) {
|
150
|
+
var titles = section.find('.title'),
|
151
|
+
previous_width = 0,
|
152
|
+
self = this;
|
153
|
+
|
154
|
+
if (typeof off === 'boolean') {
|
155
|
+
titles.attr('style', '');
|
156
|
+
} else {
|
157
|
+
titles.each(function () {
|
158
|
+
$(this).css('left', previous_width);
|
159
|
+
previous_width += self.outerWidth($(this));
|
160
|
+
});
|
161
|
+
}
|
162
|
+
},
|
163
|
+
|
164
|
+
small : function (el) {
|
165
|
+
if (el && this.is_accordion(el)) {
|
166
|
+
return true;
|
167
|
+
}
|
168
|
+
if ($('html').hasClass('lt-ie9')) {
|
169
|
+
return true;
|
170
|
+
}
|
171
|
+
if ($('html').hasClass('ie8compat')) {
|
172
|
+
return true;
|
173
|
+
}
|
174
|
+
return $(this.scope).width() < 768;
|
175
|
+
},
|
176
|
+
|
177
|
+
off : function () {
|
178
|
+
$(this.scope).off('.fndtn.section');
|
179
|
+
$(window).off('.fndtn.section');
|
180
|
+
this.settings.init = false;
|
181
|
+
}
|
182
|
+
};
|
183
|
+
}(Foundation.zj, this, this.document));
|