helios_aim 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +173 -0
  4. data/LICENSE +19 -0
  5. data/README.md +363 -0
  6. data/Rakefile +10 -0
  7. data/bin/helios +20 -0
  8. data/helios_aim.gemspec +47 -0
  9. data/lib/helios.rb +27 -0
  10. data/lib/helios/backend.rb +64 -0
  11. data/lib/helios/backend/data.rb +40 -0
  12. data/lib/helios/backend/in-app-purchase.rb +43 -0
  13. data/lib/helios/backend/newsstand.rb +97 -0
  14. data/lib/helios/backend/passbook.rb +41 -0
  15. data/lib/helios/backend/push-notification.rb +110 -0
  16. data/lib/helios/commands.rb +4 -0
  17. data/lib/helios/commands/console.rb +21 -0
  18. data/lib/helios/commands/link.rb +19 -0
  19. data/lib/helios/commands/new.rb +76 -0
  20. data/lib/helios/commands/server.rb +52 -0
  21. data/lib/helios/frontend.rb +66 -0
  22. data/lib/helios/frontend/fonts/icons.eot +0 -0
  23. data/lib/helios/frontend/fonts/icons.ttf +0 -0
  24. data/lib/helios/frontend/fonts/icons.woff +0 -0
  25. data/lib/helios/frontend/images/bg.jpg +0 -0
  26. data/lib/helios/frontend/images/helios.svg +33 -0
  27. data/lib/helios/frontend/javascripts/helios.coffee +72 -0
  28. data/lib/helios/frontend/javascripts/helios/collections.coffee +99 -0
  29. data/lib/helios/frontend/javascripts/helios/models.coffee +23 -0
  30. data/lib/helios/frontend/javascripts/helios/router.coffee +50 -0
  31. data/lib/helios/frontend/javascripts/helios/views.coffee +307 -0
  32. data/lib/helios/frontend/javascripts/vendor/backbone.datagrid.js +662 -0
  33. data/lib/helios/frontend/javascripts/vendor/backbone.js +1487 -0
  34. data/lib/helios/frontend/javascripts/vendor/backbone.paginator.js +1046 -0
  35. data/lib/helios/frontend/javascripts/vendor/codemirror.javascript.js +411 -0
  36. data/lib/helios/frontend/javascripts/vendor/codemirror.js +3047 -0
  37. data/lib/helios/frontend/javascripts/vendor/date.js +104 -0
  38. data/lib/helios/frontend/javascripts/vendor/foundation.js +331 -0
  39. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.alerts.js +50 -0
  40. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.clearing.js +478 -0
  41. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.cookie.js +74 -0
  42. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.dropdown.js +122 -0
  43. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.forms.js +403 -0
  44. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.joyride.js +613 -0
  45. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.magellan.js +130 -0
  46. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.orbit.js +355 -0
  47. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.placeholder.js +159 -0
  48. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.reveal.js +272 -0
  49. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.section.js +183 -0
  50. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.tooltips.js +195 -0
  51. data/lib/helios/frontend/javascripts/vendor/foundation/foundation.topbar.js +208 -0
  52. data/lib/helios/frontend/javascripts/vendor/jquery.js +9597 -0
  53. data/lib/helios/frontend/javascripts/vendor/jquery/jquery.fileupload-ui.js +807 -0
  54. data/lib/helios/frontend/javascripts/vendor/jquery/jquery.fileupload.js +1201 -0
  55. data/lib/helios/frontend/javascripts/vendor/jquery/jquery.ui.widget.js +530 -0
  56. data/lib/helios/frontend/javascripts/vendor/linkheaders.js +117 -0
  57. data/lib/helios/frontend/javascripts/vendor/underscore.js +1227 -0
  58. data/lib/helios/frontend/stylesheets/_codemirror.sass +219 -0
  59. data/lib/helios/frontend/stylesheets/_fonts.sass +80 -0
  60. data/lib/helios/frontend/stylesheets/_iphone.sass +141 -0
  61. data/lib/helios/frontend/stylesheets/_settings.scss +989 -0
  62. data/lib/helios/frontend/stylesheets/screen.sass +187 -0
  63. data/lib/helios/frontend/templates/data/entities.jst.tpl +11 -0
  64. data/lib/helios/frontend/templates/in-app-purchase/receipts.jst.tpl +11 -0
  65. data/lib/helios/frontend/templates/navigation.jst.tpl +31 -0
  66. data/lib/helios/frontend/templates/newsstand/issues.jst.tpl +16 -0
  67. data/lib/helios/frontend/templates/newsstand/new.jst.tpl +28 -0
  68. data/lib/helios/frontend/templates/passbook/passes.jst.tpl +11 -0
  69. data/lib/helios/frontend/templates/push-notification/compose.jst.tpl +70 -0
  70. data/lib/helios/frontend/templates/push-notification/devices.jst.tpl +17 -0
  71. data/lib/helios/frontend/views/index.haml +22 -0
  72. data/lib/helios/templates/.env.erb +1 -0
  73. data/lib/helios/templates/.gitignore +3 -0
  74. data/lib/helios/templates/Gemfile.erb +10 -0
  75. data/lib/helios/templates/Procfile.erb +1 -0
  76. data/lib/helios/templates/README.md.erb +4 -0
  77. data/lib/helios/templates/config.ru.erb +11 -0
  78. data/lib/helios/version.rb +3 -0
  79. metadata +475 -0
@@ -0,0 +1,613 @@
1
+ /*jslint unparam: true, browser: true, indent: 2 */
2
+
3
+ ;(function ($, window, document, undefined) {
4
+ 'use strict';
5
+
6
+ Foundation.libs.joyride = {
7
+ name: 'joyride',
8
+
9
+ version : '4.0.0',
10
+
11
+ defaults : {
12
+ tipLocation : 'bottom', // 'top' or 'bottom' in relation to parent
13
+ nubPosition : 'auto', // override on a per tooltip bases
14
+ scrollSpeed : 300, // Page scrolling speed in milliseconds
15
+ timer : 0, // 0 = no timer , all other numbers = timer in milliseconds
16
+ startTimerOnClick : true, // true or false - true requires clicking the first button start the timer
17
+ startOffset : 0, // the index of the tooltip you want to start on (index of the li)
18
+ nextButton : true, // true or false to control whether a next button is used
19
+ tipAnimation : 'fade', // 'pop' or 'fade' in each tip
20
+ pauseAfter : [], // array of indexes where to pause the tour after
21
+ tipAnimationFadeSpeed: 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
22
+ cookieMonster : false, // true or false to control whether cookies are used
23
+ cookieName : 'joyride', // Name the cookie you'll use
24
+ cookieDomain : false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
25
+ cookieExpires : 365, // set when you would like the cookie to expire.
26
+ tipContainer : 'body', // Where will the tip be attached
27
+ postRideCallback : function (){}, // A method to call once the tour closes (canceled or complete)
28
+ postStepCallback : function (){}, // A method to call after each step
29
+ template : { // HTML segments for tip layout
30
+ link : '<a href="#close" class="joyride-close-tip">&times;</a>',
31
+ timer : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
32
+ tip : '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',
33
+ wrapper : '<div class="joyride-content-wrapper"></div>',
34
+ button : '<a href="#" class="small button joyride-next-tip"></a>'
35
+ }
36
+ },
37
+
38
+ settings : {},
39
+
40
+ init : function (scope, method, options) {
41
+ this.scope = scope || this.scope;
42
+ Foundation.inherit(this, 'throttle data_options scrollTo scrollLeft delay');
43
+
44
+ if (typeof method === 'object') {
45
+ $.extend(true, this.settings, this.defaults, method);
46
+ } else {
47
+ $.extend(true, this.settings, this.defaults, options);
48
+ }
49
+
50
+ if (typeof method != 'string') {
51
+ if (!this.settings.init) this.events();
52
+
53
+ return this.settings.init;
54
+ } else {
55
+ return this[method].call(this, options);
56
+ }
57
+ },
58
+
59
+ events : function () {
60
+ var self = this;
61
+
62
+ $(this.scope)
63
+ .on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
64
+ e.preventDefault();
65
+
66
+ if (this.settings.$li.next().length < 1) {
67
+ this.end();
68
+ } else if (this.settings.timer > 0) {
69
+ clearTimeout(this.settings.automate);
70
+ this.hide();
71
+ this.show();
72
+ this.startTimer();
73
+ } else {
74
+ this.hide();
75
+ this.show();
76
+ }
77
+
78
+ }.bind(this))
79
+
80
+ .on('click.joyride', '.joyride-close-tip', function (e) {
81
+ e.preventDefault();
82
+ this.end();
83
+ }.bind(this));
84
+
85
+ $(window).on('resize.fndtn.joyride', self.throttle(function () {
86
+ if ($('[data-joyride]').length > 0 && self.settings.$next_tip) {
87
+ if (self.is_phone()) {
88
+ self.pos_phone();
89
+ } else {
90
+ self.pos_default();
91
+ }
92
+ }
93
+ }, 100));
94
+
95
+ this.settings.init = true;
96
+ },
97
+
98
+ start : function () {
99
+ var self = this,
100
+ $this = $(this.scope).find('[data-joyride]'),
101
+ integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
102
+ int_settings_count = integer_settings.length;
103
+
104
+ if (!this.settings.init) this.init();
105
+ $.extend(true, this.settings, this.data_options($this));
106
+
107
+ // non configureable settings
108
+ this.settings.$content_el = $this;
109
+ this.settings.body_offset = $(this.settings.tipContainer).position();
110
+ this.settings.$tip_content = this.settings.$content_el.find('> li');
111
+ this.settings.paused = false;
112
+ this.settings.attempts = 0;
113
+
114
+ // Make sure that settings parsed from data_options are integers where necessary
115
+ for (var i = int_settings_count - 1; i >= 0; i--) {
116
+ this.settings[integer_settings[i]] = parseInt(this.settings[integer_settings[i]], 10);
117
+ }
118
+
119
+ this.settings.tipLocationPatterns = {
120
+ top: ['bottom'],
121
+ bottom: [], // bottom should not need to be repositioned
122
+ left: ['right', 'top', 'bottom'],
123
+ right: ['left', 'top', 'bottom']
124
+ };
125
+
126
+ // can we create cookies?
127
+ if (typeof $.cookie !== 'function') {
128
+ this.settings.cookieMonster = false;
129
+ }
130
+
131
+ // generate the tips and insert into dom.
132
+ if (!this.settings.cookieMonster || this.settings.cookieMonster && $.cookie(this.settings.cookieName) === null) {
133
+
134
+ this.settings.$tip_content.each(function (index) {
135
+ self.create({$li : $(this), index : index});
136
+ });
137
+
138
+ // show first tip
139
+ if (!this.settings.startTimerOnClick && this.settings.timer > 0) {
140
+ this.show('init');
141
+ this.startTimer();
142
+ } else {
143
+ this.show('init');
144
+ }
145
+
146
+ }
147
+ },
148
+
149
+ resume : function () {
150
+ this.set_li();
151
+ this.show();
152
+ },
153
+
154
+ tip_template : function (opts) {
155
+ var $blank, content;
156
+
157
+ opts.tip_class = opts.tip_class || '';
158
+
159
+ $blank = $(this.settings.template.tip).addClass(opts.tip_class);
160
+ content = $.trim($(opts.li).html()) +
161
+ this.button_text(opts.button_text) +
162
+ this.settings.template.link +
163
+ this.timer_instance(opts.index);
164
+
165
+ $blank.append($(this.settings.template.wrapper));
166
+ $blank.first().attr('data-index', opts.index);
167
+ $('.joyride-content-wrapper', $blank).append(content);
168
+
169
+ return $blank[0];
170
+ },
171
+
172
+ timer_instance : function (index) {
173
+ var txt;
174
+
175
+ if ((index === 0 && this.settings.startTimerOnClick && this.settings.timer > 0) || this.settings.timer === 0) {
176
+ txt = '';
177
+ } else {
178
+ txt = this.outerHTML($(this.settings.template.timer)[0]);
179
+ }
180
+ return txt;
181
+ },
182
+
183
+ button_text : function (txt) {
184
+ if (this.settings.nextButton) {
185
+ txt = $.trim(txt) || 'Next';
186
+ txt = this.outerHTML($(this.settings.template.button).append(txt)[0]);
187
+ } else {
188
+ txt = '';
189
+ }
190
+ return txt;
191
+ },
192
+
193
+ create : function (opts) {
194
+ // backwards compatability with data-text attribute
195
+ var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
196
+ tipClass = opts.$li.attr('class'),
197
+ $tip_content = $(this.tip_template({
198
+ tip_class : tipClass,
199
+ index : opts.index,
200
+ button_text : buttonText,
201
+ li : opts.$li
202
+ }));
203
+
204
+ $(this.settings.tipContainer).append($tip_content);
205
+ },
206
+
207
+ show : function (init) {
208
+ var $timer = null;
209
+
210
+ // are we paused?
211
+ if (this.settings.$li === undefined
212
+ || ($.inArray(this.settings.$li.index(), this.settings.pauseAfter) === -1)) {
213
+
214
+ // don't go to the next li if the tour was paused
215
+ if (this.settings.paused) {
216
+ this.settings.paused = false;
217
+ } else {
218
+ this.set_li(init);
219
+ }
220
+
221
+ this.settings.attempts = 0;
222
+
223
+ if (this.settings.$li.length && this.settings.$target.length > 0) {
224
+
225
+ this.settings.tipSettings = $.extend(true,
226
+ this.settings, this.data_options(this.settings.$li));
227
+
228
+ this.settings.timer = parseInt(this.settings.timer, 10);
229
+
230
+ this.settings.tipSettings.tipLocationPattern = this.settings.tipLocationPatterns[this.settings.tipSettings.tipLocation];
231
+
232
+ // scroll if not modal
233
+ if (!/body/i.test(this.settings.$target.selector)) {
234
+ this.scroll_to();
235
+ }
236
+
237
+ if (this.is_phone()) {
238
+ this.pos_phone(true);
239
+ } else {
240
+ this.pos_default(true);
241
+ }
242
+
243
+ $timer = this.settings.$next_tip.find('.joyride-timer-indicator');
244
+
245
+ if (/pop/i.test(this.settings.tipAnimation)) {
246
+
247
+ $timer.width(0);
248
+
249
+ if (thsi.settings.timer > 0) {
250
+
251
+ this.settings.$next_tip.show();
252
+
253
+ this.delay(function () {
254
+ $timer.animate({
255
+ width: $timer.parent().width()
256
+ }, this.settings.timer, 'linear');
257
+ }.bind(this), this.settings.tipAnimationFadeSpeed);
258
+
259
+ } else {
260
+ this.settings.$next_tip.show();
261
+
262
+ }
263
+
264
+
265
+ } else if (/fade/i.test(this.settings.tipAnimation)) {
266
+
267
+ $timer.width(0);
268
+
269
+ if (this.settings.timer > 0) {
270
+
271
+ this.settings.$next_tip
272
+ .fadeIn(this.settings.tipAnimationFadeSpeed)
273
+ .show();
274
+
275
+ this.delay(function () {
276
+ $timer.animate({
277
+ width: $timer.parent().width()
278
+ }, this.settings.timer, 'linear');
279
+ }.bind(this), this.settings.tipAnimationFadeSpeed);
280
+
281
+ } else {
282
+ this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed);
283
+
284
+ }
285
+ }
286
+
287
+ this.settings.$current_tip = this.settings.$next_tip;
288
+
289
+ // skip non-existant targets
290
+ } else if (this.settings.$li && this.settings.$target.length < 1) {
291
+
292
+ this.show();
293
+
294
+ } else {
295
+
296
+ this.end();
297
+
298
+ }
299
+ } else {
300
+
301
+ this.settings.paused = true;
302
+
303
+ }
304
+
305
+ },
306
+
307
+ is_phone : function () {
308
+ if (Modernizr) {
309
+ return Modernizr.mq('only screen and (max-width: 767px)') || $('.lt-ie9').length > 0;
310
+ }
311
+
312
+ return (this.settings.$window.width() < 767) ? true : false;
313
+ },
314
+
315
+ hide : function () {
316
+ this.settings.postStepCallback(this.settings.$li.index(),
317
+ this.settings.$current_tip);
318
+ $('.joyride-modal-bg').hide();
319
+ this.settings.$current_tip.hide();
320
+ },
321
+
322
+ set_li : function (init) {
323
+ if (init) {
324
+ this.settings.$li = this.settings.$tip_content.eq(this.settings.startOffset);
325
+ this.set_next_tip();
326
+ this.settings.$current_tip = this.settings.$next_tip;
327
+ } else {
328
+ this.settings.$li = this.settings.$li.next();
329
+ this.set_next_tip();
330
+ }
331
+
332
+ this.set_target();
333
+ },
334
+
335
+ set_next_tip : function () {
336
+ this.settings.$next_tip = $(".joyride-tip-guide[data-index='" + this.settings.$li.index() + "']");
337
+ },
338
+
339
+ set_target : function () {
340
+ var cl = this.settings.$li.attr('data-class'),
341
+ id = this.settings.$li.attr('data-id'),
342
+ $sel = function () {
343
+ if (id) {
344
+ return $(document.getElementById(id));
345
+ } else if (cl) {
346
+ return $('.' + cl).first();
347
+ } else {
348
+ return $('body');
349
+ }
350
+ };
351
+
352
+ this.settings.$target = $sel();
353
+ },
354
+
355
+ scroll_to : function () {
356
+ var window_half, tipOffset;
357
+
358
+ window_half = $(window).height() / 2;
359
+ tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.outerHeight(this.settings.$next_tip));
360
+ if (tipOffset > 0) {
361
+ this.scrollTo($('html, body'), tipOffset, this.settings.scrollSpeed);
362
+ }
363
+ },
364
+
365
+ paused : function () {
366
+ if (($.inArray((this.settings.$li.index() + 1), this.settings.pauseAfter) === -1)) {
367
+ return true;
368
+ }
369
+
370
+ return false;
371
+ },
372
+
373
+ restart : function () {
374
+ this.hide();
375
+ this.settings.$li = undefined;
376
+ this.show('init');
377
+ },
378
+
379
+ pos_default : function (init) {
380
+ var half_fold = Math.ceil($(window).height() / 2),
381
+ tip_position = this.settings.$next_tip.offset(),
382
+ $nub = this.settings.$next_tip.find('.joyride-nub'),
383
+ nub_height = Math.ceil(this.outerHeight($nub) / 2),
384
+ toggle = init || false;
385
+
386
+ // tip must not be "display: none" to calculate position
387
+ if (toggle) {
388
+ this.settings.$next_tip.css('visibility', 'hidden');
389
+ this.settings.$next_tip.show();
390
+ }
391
+
392
+ if (!/body/i.test(this.settings.$target.selector)) {
393
+
394
+ if (this.bottom()) {
395
+ this.settings.$next_tip.css({
396
+ top: (this.settings.$target.offset().top + nub_height + this.outerHeight(this.settings.$target)),
397
+ left: this.settings.$target.offset().left});
398
+
399
+ this.nub_position($nub, this.settings.tipSettings.nubPosition, 'top');
400
+
401
+ } else if (this.top()) {
402
+
403
+ this.settings.$next_tip.css({
404
+ top: (this.settings.$target.offset().top - this.outerHeight(this.settings.$next_tip) - nub_height),
405
+ left: this.settings.$target.offset().left});
406
+
407
+ this.nub_position($nub, this.settings.tipSettings.nubPosition, 'bottom');
408
+
409
+ } else if (this.right()) {
410
+
411
+ this.settings.$next_tip.css({
412
+ top: this.settings.$target.offset().top,
413
+ left: (this.outerWidth(this.settings.$target) + this.settings.$target.offset().left)});
414
+
415
+ this.nub_position($nub, this.settings.tipSettings.nubPosition, 'left');
416
+
417
+ } else if (this.left()) {
418
+
419
+ this.settings.$next_tip.css({
420
+ top: this.settings.$target.offset().top,
421
+ left: (this.settings.$target.offset().left - this.outerWidth(this.settings.$next_tip) - nub_height)});
422
+
423
+ this.nub_position($nub, this.settings.tipSettings.nubPosition, 'right');
424
+
425
+ }
426
+
427
+ if (!this.visible(this.corners(this.settings.$next_tip)) && this.settings.attempts < this.settings.tipSettings.tipLocationPattern.length) {
428
+
429
+ $nub.removeClass('bottom')
430
+ .removeClass('top')
431
+ .removeClass('right')
432
+ .removeClass('left');
433
+
434
+ this.settings.tipSettings.tipLocation = this.settings.tipSettings.tipLocationPattern[this.settings.attempts];
435
+
436
+ this.settings.attempts++;
437
+
438
+ this.pos_default(true);
439
+
440
+ }
441
+
442
+ } else if (this.settings.$li.length) {
443
+
444
+ this.pos_modal($nub);
445
+
446
+ }
447
+
448
+ if (toggle) {
449
+ this.settings.$next_tip.hide();
450
+ this.settings.$next_tip.css('visibility', 'visible');
451
+ }
452
+
453
+ },
454
+
455
+ pos_phone : function (init) {
456
+ var tip_height = this.outerHeight(this.settings.$next_tip),
457
+ tip_offset = this.settings.$next_tip.offset(),
458
+ target_height = this.outerHeight(this.settings.$target),
459
+ $nub = $('.joyride-nub', this.settings.$next_tip),
460
+ nub_height = Math.ceil(this.outerHeight($nub) / 2),
461
+ toggle = init || false;
462
+
463
+ $nub.removeClass('bottom')
464
+ .removeClass('top')
465
+ .removeClass('right')
466
+ .removeClass('left');
467
+
468
+ if (toggle) {
469
+ this.settings.$next_tip.css('visibility', 'hidden');
470
+ this.settings.$next_tip.show();
471
+ }
472
+
473
+ if (!/body/i.test(this.settings.$target.selector)) {
474
+
475
+ if (this.top()) {
476
+
477
+ this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height});
478
+ $nub.addClass('bottom');
479
+
480
+ } else {
481
+
482
+ this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height});
483
+ $nub.addClass('top');
484
+
485
+ }
486
+
487
+ } else if (this.settings.$li.length) {
488
+
489
+ this.pos_modal($nub);
490
+
491
+ }
492
+
493
+ if (toggle) {
494
+ this.settings.$next_tip.hide();
495
+ this.settings.$next_tip.css('visibility', 'visible');
496
+ }
497
+ },
498
+
499
+ pos_modal : function ($nub) {
500
+ this.center();
501
+ $nub.hide();
502
+
503
+ if ($('.joyride-modal-bg').length < 1) {
504
+ $('body').append('<div class="joyride-modal-bg">').show();
505
+ }
506
+
507
+ if (/pop/i.test(this.settings.tipAnimation)) {
508
+ $('.joyride-modal-bg').show();
509
+ } else {
510
+ $('.joyride-modal-bg').fadeIn(this.settings.tipAnimationFadeSpeed);
511
+ }
512
+ },
513
+
514
+ center : function () {
515
+ var $w = $(window);
516
+
517
+ this.settings.$next_tip.css({
518
+ top : ((($w.height() - this.outerHeight(this.settings.$next_tip)) / 2) + $w.scrollTop()),
519
+ left : ((($w.width() - this.outerWidth(this.settings.$next_tip)) / 2) + this.scrollLeft($w))
520
+ });
521
+
522
+ return true;
523
+ },
524
+
525
+ bottom : function () {
526
+ return /bottom/i.test(this.settings.tipSettings.tipLocation);
527
+ },
528
+
529
+ top : function () {
530
+ return /top/i.test(this.settings.tipSettings.tipLocation);
531
+ },
532
+
533
+ right : function () {
534
+ return /right/i.test(this.settings.tipSettings.tipLocation);
535
+ },
536
+
537
+ left : function () {
538
+ return /left/i.test(this.settings.tipSettings.tipLocation);
539
+ },
540
+
541
+ corners : function (el) {
542
+ var w = $(window),
543
+ right = w.width() + this.scrollLeft(w),
544
+ bottom = w.width() + w.scrollTop();
545
+
546
+ return [
547
+ el.offset().top <= w.scrollTop(),
548
+ right <= el.offset().left + this.outerWidth(el),
549
+ bottom <= el.offset().top + this.outerHeight(el),
550
+ this.scrollLeft(w) >= el.offset().left
551
+ ];
552
+ },
553
+
554
+ visible : function (hidden_corners) {
555
+ var i = hidden_corners.length;
556
+
557
+ while (i--) {
558
+ if (hidden_corners[i]) return false;
559
+ }
560
+
561
+ return true;
562
+ },
563
+
564
+ nub_position : function (nub, pos, def) {
565
+ if (pos === 'auto') {
566
+ nub.addClass(def);
567
+ } else {
568
+ nub.addClass(pos);
569
+ }
570
+ },
571
+
572
+ startTimer : function () {
573
+ if (this.settings.$li.length) {
574
+ this.settings.automate = setTimeout(function () {
575
+ this.hide();
576
+ this.show();
577
+ this.startTimer();
578
+ }.bind(this), this.settings.timer);
579
+ } else {
580
+ clearTimeout(this.settings.automate);
581
+ }
582
+ },
583
+
584
+ end : function () {
585
+ if (this.settings.cookieMonster) {
586
+ $.cookie(this.settings.cookieName, 'ridden', { expires: this.settings.cookieExpires, domain: this.settings.cookieDomain });
587
+ }
588
+
589
+ if (this.settings.timer > 0) {
590
+ clearTimeout(this.settings.automate);
591
+ }
592
+
593
+ $('.joyride-modal-bg').hide();
594
+ this.settings.$current_tip.hide();
595
+ this.settings.postStepCallback(this.settings.$li.index(), this.settings.$current_tip);
596
+ this.settings.postRideCallback(this.settings.$li.index(), this.settings.$current_tip);
597
+ },
598
+
599
+ outerHTML : function (el) {
600
+ // support FireFox < 11
601
+ return el.outerHTML || new XMLSerializer().serializeToString(el);
602
+ },
603
+
604
+ off : function () {
605
+ $(this.scope).off('.joyride');
606
+ $(window).off('.joyride');
607
+ $('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
608
+ $('.joyride-tip-guide, .joyride-modal-bg').remove();
609
+ clearTimeout(this.settings.automate);
610
+ this.settings = {};
611
+ }
612
+ };
613
+ }(Foundation.zj, this, this.document));