TokiCLI 0.2.1 → 0.3.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 (129) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +9 -17
  4. data/.rspec +3 -0
  5. data/.travis.yml +3 -0
  6. data/CHANGELOG.md +4 -0
  7. data/README.md +99 -163
  8. data/Rakefile +5 -0
  9. data/TokiCLI.gemspec +5 -4
  10. data/bin/toki +2 -2
  11. data/lib/API/helpers.rb +27 -170
  12. data/lib/API/toki_api.rb +227 -0
  13. data/lib/API/toki_db.rb +67 -0
  14. data/lib/TokiCLI.rb +270 -5
  15. data/lib/TokiCLI/adnimport.rb +202 -0
  16. data/lib/TokiCLI/fileops.rb +187 -0
  17. data/lib/TokiCLI/status.rb +49 -37
  18. data/lib/TokiCLI/version.rb +1 -1
  19. data/lib/TokiCLI/view.rb +133 -86
  20. data/lib/TokiServer/.bowerrc +3 -0
  21. data/lib/TokiServer/.gitignore +2 -0
  22. data/lib/TokiServer/Gemfile +1 -0
  23. data/lib/TokiServer/bower.json +0 -0
  24. data/lib/TokiServer/bower_components/fastclick/.bower.json +4 -4
  25. data/lib/TokiServer/bower_components/fastclick/bower.json +1 -1
  26. data/lib/TokiServer/bower_components/fastclick/lib/fastclick.js +33 -2
  27. data/lib/TokiServer/bower_components/foundation/.bower.json +5 -4
  28. data/lib/TokiServer/bower_components/foundation/bower.json +2 -1
  29. data/lib/TokiServer/bower_components/foundation/css/foundation.css +2173 -922
  30. data/lib/TokiServer/bower_components/foundation/css/foundation.css.map +7 -0
  31. data/lib/TokiServer/bower_components/foundation/css/normalize.css +53 -16
  32. data/lib/TokiServer/bower_components/foundation/css/normalize.css.map +7 -0
  33. data/lib/TokiServer/bower_components/foundation/js/foundation.js +782 -542
  34. data/lib/TokiServer/bower_components/foundation/js/foundation.min.js +4 -3
  35. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.abide.js +45 -31
  36. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.accordion.js +12 -6
  37. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.alert.js +5 -5
  38. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.clearing.js +34 -10
  39. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.dropdown.js +83 -29
  40. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.equalizer.js +3 -3
  41. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.interchange.js +25 -12
  42. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.joyride.js +112 -40
  43. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.js +19 -5
  44. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.magellan.js +22 -11
  45. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.offcanvas.js +52 -8
  46. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.orbit.js +133 -271
  47. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.reveal.js +27 -20
  48. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.slider.js +73 -33
  49. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tab.js +88 -31
  50. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tooltip.js +7 -5
  51. data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.topbar.js +44 -24
  52. data/lib/TokiServer/bower_components/foundation/js/vendor/fastclick.js +2 -2
  53. data/lib/TokiServer/bower_components/foundation/js/vendor/modernizr.js +2 -2
  54. data/lib/TokiServer/bower_components/foundation/scss/foundation.scss +38 -38
  55. data/lib/TokiServer/bower_components/foundation/scss/foundation/_functions.scss +3 -3
  56. data/lib/TokiServer/bower_components/foundation/scss/foundation/_settings.scss +417 -271
  57. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_accordion.scss +110 -6
  58. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +2 -2
  59. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_block-grid.scss +2 -2
  60. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +8 -3
  61. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_button-groups.scss +99 -9
  62. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_buttons.scss +66 -28
  63. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_clearing.scss +5 -5
  64. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +4 -4
  65. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown.scss +48 -35
  66. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_forms.scss +104 -32
  67. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_global.scss +48 -30
  68. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_grid.scss +19 -4
  69. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_icon-bar.scss +293 -0
  70. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_joyride.scss +11 -9
  71. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_keystrokes.scss +4 -4
  72. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_labels.scss +4 -2
  73. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_magellan.scss +1 -1
  74. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_offcanvas.scss +193 -35
  75. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_orbit.scss +92 -147
  76. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pagination.scss +22 -10
  77. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_panels.scss +10 -7
  78. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +11 -11
  79. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_progress-bars.scss +2 -2
  80. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_range-slider.scss +29 -9
  81. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal.scss +60 -56
  82. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_side-nav.scss +3 -2
  83. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_split-buttons.scss +2 -2
  84. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_sub-nav.scss +2 -2
  85. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_switches.scss +226 -0
  86. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tables.scss +13 -7
  87. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tabs.scss +22 -8
  88. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_thumbs.scss +2 -4
  89. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_toolbar.scss +70 -0
  90. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tooltips.scss +9 -7
  91. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_top-bar.scss +77 -44
  92. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_type.scss +21 -9
  93. data/lib/TokiServer/bower_components/modernizr/.bower.json +4 -4
  94. data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-blobworkers.js +2 -2
  95. data/lib/TokiServer/bower_components/modernizr/grunt.js +1 -1
  96. data/lib/TokiServer/bower_components/modernizr/modernizr.js +2 -2
  97. data/lib/TokiServer/config.rb +0 -0
  98. data/lib/TokiServer/humans.txt +0 -0
  99. data/lib/TokiServer/{itunesicon.rb → itunesicons.rb} +25 -23
  100. data/lib/TokiServer/js/app.js +0 -0
  101. data/lib/TokiServer/public/stylesheets/app.css +2636 -1610
  102. data/lib/TokiServer/robots.txt +0 -0
  103. data/lib/TokiServer/scss/_settings.scss +0 -0
  104. data/lib/TokiServer/scss/app.scss +7 -1
  105. data/lib/TokiServer/tokiserver.rb +239 -244
  106. data/lib/TokiServer/views/activity.erb +42 -0
  107. data/lib/TokiServer/views/apps_total.erb +8 -2
  108. data/lib/TokiServer/views/error.erb +13 -4
  109. data/lib/TokiServer/views/index.erb +36 -27
  110. data/lib/TokiServer/views/logs_total.erb +34 -0
  111. data/spec/TokiCLI_spec.rb +354 -0
  112. data/spec/mock/mock.sqlite3 +0 -0
  113. data/spec/spec_helper.rb +26 -0
  114. metadata +78 -23
  115. data/lib/API/dbapi.rb +0 -488
  116. data/lib/TokiCLI/app.rb +0 -389
  117. data/lib/TokiCLI/authorize.rb +0 -77
  118. data/lib/TokiCLI/export.rb +0 -81
  119. data/lib/TokiCLI/get_channels.rb +0 -22
  120. data/lib/TokiCLI/get_messages.rb +0 -32
  121. data/lib/TokiCLI/import.rb +0 -122
  122. data/lib/TokiCLI/scan.rb +0 -19
  123. data/lib/TokiCLI/search_messages.rb +0 -23
  124. data/lib/TokiServer/README.md +0 -37
  125. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal-new.scss +0 -0
  126. data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_switch.scss +0 -294
  127. data/lib/TokiServer/views/name_log.erb +0 -50
  128. data/lib/TokiServer/views/name_split.erb +0 -37
  129. data/lib/TokiServer/views/name_total.erb +0 -34
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.equalizer = {
5
5
  name : 'equalizer',
6
6
 
7
- version : '5.2.3',
7
+ version : '5.4.3',
8
8
 
9
9
  settings : {
10
10
  use_tallest: true,
@@ -33,7 +33,7 @@
33
33
  if (vals.length === 0) return;
34
34
  var firstTopOffset = vals.first().offset().top;
35
35
  settings.before_height_change();
36
- equalizer.trigger('before-height-change');
36
+ equalizer.trigger('before-height-change').trigger('before-height-change.fndth.equalizer');
37
37
  vals.height('inherit');
38
38
  vals.each(function(){
39
39
  var el = $(this);
@@ -56,7 +56,7 @@
56
56
  vals.css('height', min);
57
57
  }
58
58
  settings.after_height_change();
59
- equalizer.trigger('after-height-change');
59
+ equalizer.trigger('after-height-change').trigger('after-height-change.fndtn.equalizer');
60
60
  },
61
61
 
62
62
  reflow : function () {
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.interchange = {
5
5
  name : 'interchange',
6
6
 
7
- version : '5.2.3',
7
+ version : '5.4.3',
8
8
 
9
9
  cache : {},
10
10
 
@@ -53,7 +53,8 @@
53
53
 
54
54
  return trigger(el[0].src);
55
55
  }
56
- var last_path = el.data(this.data_attr + '-last-path');
56
+ var last_path = el.data(this.data_attr + '-last-path'),
57
+ self = this;
57
58
 
58
59
  if (last_path == path) return;
59
60
 
@@ -65,7 +66,7 @@
65
66
 
66
67
  return $.get(path, function (response) {
67
68
  el.html(response);
68
- el.data(this.data_attr + '-last-path', path);
69
+ el.data(self.data_attr + '-last-path', path);
69
70
  trigger();
70
71
  });
71
72
 
@@ -231,11 +232,7 @@
231
232
  this.object($(this['cached_' + type][i]));
232
233
  }
233
234
 
234
- return $(window).trigger('resize');
235
- },
236
-
237
- parse_params : function (path, directive, mq) {
238
- return [this.trim(path), this.convert_directive(directive), this.trim(mq)];
235
+ return $(window).trigger('resize').trigger('resize.fndtn.interchange');
239
236
  },
240
237
 
241
238
  convert_directive : function (directive) {
@@ -249,6 +246,25 @@
249
246
  return 'replace';
250
247
  },
251
248
 
249
+ parse_scenario : function (scenario) {
250
+ // This logic had to be made more complex since some users were using commas in the url path
251
+ // So we cannot simply just split on a comma
252
+ var directive_match = scenario[0].match(/(.+),\s*(\w+)\s*$/),
253
+ media_query = scenario[1];
254
+
255
+ if (directive_match) {
256
+ var path = directive_match[1],
257
+ directive = directive_match[2];
258
+ }
259
+ else {
260
+ var cached_split = scenario[0].split(/,\s*$/),
261
+ path = cached_split[0],
262
+ directive = '';
263
+ }
264
+
265
+ return [this.trim(path), this.convert_directive(directive), this.trim(media_query)];
266
+ },
267
+
252
268
  object : function(el) {
253
269
  var raw_arr = this.parse_data_attr(el),
254
270
  scenarios = [],
@@ -259,10 +275,7 @@
259
275
  var split = raw_arr[i].split(/\((.*?)(\))$/);
260
276
 
261
277
  if (split.length > 1) {
262
- var cached_split = split[0].split(/\, /),
263
- params = this.parse_params(cached_split[0],
264
- cached_split[1], split[1]);
265
-
278
+ var params = this.parse_scenario(split);
266
279
  scenarios.push(params);
267
280
  }
268
281
  }
@@ -6,11 +6,12 @@
6
6
  Foundation.libs.joyride = {
7
7
  name : 'joyride',
8
8
 
9
- version : '5.2.3',
9
+ version : '5.4.3',
10
10
 
11
11
  defaults : {
12
12
  expose : false, // turn on or off the expose feature
13
13
  modal : true, // Whether to cover page with modal during the tour
14
+ keyboard : true, // enable left, right and esc keystrokes
14
15
  tip_location : 'bottom', // 'top' or 'bottom' in relation to parent
15
16
  nub_position : 'auto', // override on a per tooltip bases
16
17
  scroll_speed : 1500, // Page scrolling speed in milliseconds, 0 = no scroll animation
@@ -19,6 +20,7 @@
19
20
  start_timer_on_click : true, // true or false - true requires clicking the first button start the timer
20
21
  start_offset : 0, // the index of the tooltip you want to start on (index of the li)
21
22
  next_button : true, // true or false to control whether a next button is used
23
+ prev_button : true, // true or false to control whether a prev button is used
22
24
  tip_animation : 'fade', // 'pop' or 'fade' in each tip
23
25
  pause_after : [], // array of indexes where to pause the tour after
24
26
  exposed : [], // array of expose elements
@@ -41,14 +43,15 @@
41
43
  pre_ride_callback : function (){}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
42
44
  post_expose_callback : function (){}, // A method to call after an element has been exposed
43
45
  template : { // HTML segments for tip layout
44
- link : '<a href="#close" class="joyride-close-tip">&times;</a>',
45
- timer : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
46
- tip : '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',
47
- wrapper : '<div class="joyride-content-wrapper"></div>',
48
- button : '<a href="#" class="small button joyride-next-tip"></a>',
49
- modal : '<div class="joyride-modal-bg"></div>',
50
- expose : '<div class="joyride-expose-wrapper"></div>',
51
- expose_cover: '<div class="joyride-expose-cover"></div>'
46
+ link : '<a href="#close" class="joyride-close-tip">&times;</a>',
47
+ timer : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
48
+ tip : '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',
49
+ wrapper : '<div class="joyride-content-wrapper"></div>',
50
+ button : '<a href="#" class="small button joyride-next-tip"></a>',
51
+ prev_button : '<a href="#" class="small button joyride-prev-tip"></a>',
52
+ modal : '<div class="joyride-modal-bg"></div>',
53
+ expose : '<div class="joyride-expose-wrapper"></div>',
54
+ expose_cover : '<div class="joyride-expose-cover"></div>'
52
55
  },
53
56
  expose_add_class : '' // One or more space-separated class names to be added to exposed element
54
57
  },
@@ -61,6 +64,34 @@
61
64
  this.bindings(method, options)
62
65
  },
63
66
 
67
+ go_next : function() {
68
+ if (this.settings.$li.next().length < 1) {
69
+ this.end();
70
+ } else if (this.settings.timer > 0) {
71
+ clearTimeout(this.settings.automate);
72
+ this.hide();
73
+ this.show();
74
+ this.startTimer();
75
+ } else {
76
+ this.hide();
77
+ this.show();
78
+ }
79
+ },
80
+
81
+ go_prev : function() {
82
+ if (this.settings.$li.prev().length < 1) {
83
+ // Do nothing if there are no prev element
84
+ } else if (this.settings.timer > 0) {
85
+ clearTimeout(this.settings.automate);
86
+ this.hide();
87
+ this.show(null, true);
88
+ this.startTimer();
89
+ } else {
90
+ this.hide();
91
+ this.show(null, true);
92
+ }
93
+ },
94
+
64
95
  events : function () {
65
96
  var self = this;
66
97
 
@@ -68,30 +99,40 @@
68
99
  .off('.joyride')
69
100
  .on('click.fndtn.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
70
101
  e.preventDefault();
71
-
72
- if (this.settings.$li.next().length < 1) {
73
- this.end();
74
- } else if (this.settings.timer > 0) {
75
- clearTimeout(this.settings.automate);
76
- this.hide();
77
- this.show();
78
- this.startTimer();
79
- } else {
80
- this.hide();
81
- this.show();
82
- }
83
-
102
+ this.go_next()
103
+ }.bind(this))
104
+ .on('click.fndtn.joyride', '.joyride-prev-tip', function (e) {
105
+ e.preventDefault();
106
+ this.go_prev();
84
107
  }.bind(this))
85
108
 
86
109
  .on('click.fndtn.joyride', '.joyride-close-tip', function (e) {
87
110
  e.preventDefault();
88
111
  this.end(this.settings.abort_on_close);
112
+ }.bind(this))
113
+
114
+ .on("keyup.joyride", function(e) {
115
+ if (!this.settings.keyboard) return;
116
+
117
+ switch (e.which) {
118
+ case 39: // right arrow
119
+ e.preventDefault();
120
+ this.go_next();
121
+ break;
122
+ case 37: // left arrow
123
+ e.preventDefault();
124
+ this.go_prev();
125
+ break;
126
+ case 27: // escape
127
+ e.preventDefault();
128
+ this.end(this.settings.abort_on_close);
129
+ }
89
130
  }.bind(this));
90
131
 
91
132
  $(window)
92
133
  .off('.joyride')
93
134
  .on('resize.fndtn.joyride', self.throttle(function () {
94
- if ($('[' + self.attr_name() + ']').length > 0 && self.settings.$next_tip) {
135
+ if ($('[' + self.attr_name() + ']').length > 0 && self.settings.$next_tip && self.settings.riding) {
95
136
  if (self.settings.exposed.length > 0) {
96
137
  var $els = $(self.settings.exposed);
97
138
 
@@ -130,6 +171,7 @@
130
171
  this.settings.$tip_content = this.settings.$content_el.find('> li');
131
172
  this.settings.paused = false;
132
173
  this.settings.attempts = 0;
174
+ this.settings.riding = true;
133
175
 
134
176
  // can we create cookies?
135
177
  if (typeof $.cookie !== 'function') {
@@ -173,6 +215,7 @@
173
215
 
174
216
  $blank = $(this.settings.template.tip).addClass(opts.tip_class);
175
217
  content = $.trim($(opts.li).html()) +
218
+ this.prev_button_text(opts.prev_button_text, opts.index) +
176
219
  this.button_text(opts.button_text) +
177
220
  this.settings.template.link +
178
221
  this.timer_instance(opts.index);
@@ -196,7 +239,7 @@
196
239
  },
197
240
 
198
241
  button_text : function (txt) {
199
- if (this.settings.next_button) {
242
+ if (this.settings.tip_settings.next_button) {
200
243
  txt = $.trim(txt) || 'Next';
201
244
  txt = $(this.settings.template.button).append(txt)[0].outerHTML;
202
245
  } else {
@@ -205,21 +248,40 @@
205
248
  return txt;
206
249
  },
207
250
 
251
+ prev_button_text : function (txt, idx) {
252
+ if (this.settings.tip_settings.prev_button) {
253
+ txt = $.trim(txt) || 'Previous';
254
+
255
+ // Add the disabled class to the button if it's the first element
256
+ if (idx == 0)
257
+ txt = $(this.settings.template.prev_button).append(txt).addClass('disabled')[0].outerHTML;
258
+ else
259
+ txt = $(this.settings.template.prev_button).append(txt)[0].outerHTML;
260
+ } else {
261
+ txt = '';
262
+ }
263
+ return txt;
264
+ },
265
+
208
266
  create : function (opts) {
209
- var buttonText = opts.$li.attr(this.add_namespace('data-button'))
267
+ this.settings.tip_settings = $.extend({}, this.settings, this.data_options(opts.$li));
268
+ var buttonText = opts.$li.attr(this.add_namespace('data-button'))
210
269
  || opts.$li.attr(this.add_namespace('data-text')),
270
+ prevButtonText = opts.$li.attr(this.add_namespace('data-button-prev'))
271
+ || opts.$li.attr(this.add_namespace('data-prev-text')),
211
272
  tipClass = opts.$li.attr('class'),
212
273
  $tip_content = $(this.tip_template({
213
274
  tip_class : tipClass,
214
275
  index : opts.index,
215
276
  button_text : buttonText,
277
+ prev_button_text : prevButtonText,
216
278
  li : opts.$li
217
279
  }));
218
280
 
219
281
  $(this.settings.tip_container).append($tip_content);
220
282
  },
221
283
 
222
- show : function (init) {
284
+ show : function (init, is_prev) {
223
285
  var $timer = null;
224
286
 
225
287
  // are we paused?
@@ -230,7 +292,7 @@
230
292
  if (this.settings.paused) {
231
293
  this.settings.paused = false;
232
294
  } else {
233
- this.set_li(init);
295
+ this.set_li(init, is_prev);
234
296
  }
235
297
 
236
298
  this.settings.attempts = 0;
@@ -353,13 +415,16 @@
353
415
  this.settings.$current_tip);
354
416
  },
355
417
 
356
- set_li : function (init) {
418
+ set_li : function (init, is_prev) {
357
419
  if (init) {
358
420
  this.settings.$li = this.settings.$tip_content.eq(this.settings.start_offset);
359
421
  this.set_next_tip();
360
422
  this.settings.$current_tip = this.settings.$next_tip;
361
423
  } else {
362
- this.settings.$li = this.settings.$li.next();
424
+ if (is_prev)
425
+ this.settings.$li = this.settings.$li.prev();
426
+ else
427
+ this.settings.$li = this.settings.$li.next();
363
428
  this.set_next_tip();
364
429
  }
365
430
 
@@ -423,15 +488,18 @@
423
488
  }
424
489
 
425
490
  if (!/body/i.test(this.settings.$target.selector)) {
491
+ var topAdjustment = this.settings.tip_settings.tipAdjustmentY ? parseInt(this.settings.tip_settings.tipAdjustmentY) : 0,
492
+ leftAdjustment = this.settings.tip_settings.tipAdjustmentX ? parseInt(this.settings.tip_settings.tipAdjustmentX) : 0;
493
+
426
494
  if (this.bottom()) {
427
495
  if (this.rtl) {
428
496
  this.settings.$next_tip.css({
429
- top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight()),
430
- left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
497
+ top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
498
+ left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth() + leftAdjustment});
431
499
  } else {
432
500
  this.settings.$next_tip.css({
433
- top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight()),
434
- left: this.settings.$target.offset().left});
501
+ top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
502
+ left: this.settings.$target.offset().left + leftAdjustment});
435
503
  }
436
504
 
437
505
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'top');
@@ -439,12 +507,12 @@
439
507
  } else if (this.top()) {
440
508
  if (this.rtl) {
441
509
  this.settings.$next_tip.css({
442
- top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
510
+ top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
443
511
  left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
444
512
  } else {
445
513
  this.settings.$next_tip.css({
446
- top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
447
- left: this.settings.$target.offset().left});
514
+ top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
515
+ left: this.settings.$target.offset().left + leftAdjustment});
448
516
  }
449
517
 
450
518
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'bottom');
@@ -452,16 +520,16 @@
452
520
  } else if (this.right()) {
453
521
 
454
522
  this.settings.$next_tip.css({
455
- top: this.settings.$target.offset().top,
456
- left: (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width)});
523
+ top: this.settings.$target.offset().top + topAdjustment,
524
+ left: (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width + leftAdjustment)});
457
525
 
458
526
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'left');
459
527
 
460
528
  } else if (this.left()) {
461
529
 
462
530
  this.settings.$next_tip.css({
463
- top: this.settings.$target.offset().top,
464
- left: (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width)});
531
+ top: this.settings.$target.offset().top + topAdjustment,
532
+ left: (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width + leftAdjustment)});
465
533
 
466
534
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'right');
467
535
 
@@ -816,7 +884,11 @@
816
884
  this.un_expose();
817
885
  }
818
886
 
887
+ // Unplug keystrokes listener
888
+ $(this.scope).off('keyup.joyride')
889
+
819
890
  this.settings.$next_tip.data('closed', true);
891
+ this.settings.riding = false;
820
892
 
821
893
  $('.joyride-modal-bg').hide();
822
894
  this.settings.$current_tip.hide();
@@ -98,9 +98,6 @@
98
98
  var self = this,
99
99
  should_bind_events = !S(this).data(this.attr_name(true));
100
100
 
101
- if (typeof method === 'string') {
102
- return this[method].call(this, options);
103
- }
104
101
 
105
102
  if (S(this.scope).is('[' + this.attr_name() +']')) {
106
103
  S(this.scope).data(this.attr_name(true) + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope))));
@@ -119,6 +116,11 @@
119
116
  }
120
117
  });
121
118
  }
119
+ // # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating.
120
+ if (typeof method === 'string') {
121
+ return this[method].call(this, options);
122
+ }
123
+
122
124
  };
123
125
 
124
126
  var single_image_loaded = function (image, callback) {
@@ -276,7 +278,7 @@
276
278
  window.Foundation = {
277
279
  name : 'Foundation',
278
280
 
279
- version : '5.2.3',
281
+ version : '5.4.3',
280
282
 
281
283
  media_queries : {
282
284
  small : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
@@ -314,6 +316,18 @@
314
316
  }
315
317
  }
316
318
 
319
+ S(window).load(function(){
320
+ S(window)
321
+ .trigger('resize.fndtn.clearing')
322
+ .trigger('resize.fndtn.dropdown')
323
+ .trigger('resize.fndtn.equalizer')
324
+ .trigger('resize.fndtn.interchange')
325
+ .trigger('resize.fndtn.joyride')
326
+ .trigger('resize.fndtn.magellan')
327
+ .trigger('resize.fndtn.topbar')
328
+ .trigger('resize.fndtn.slider');
329
+ });
330
+
317
331
  return scope;
318
332
  },
319
333
 
@@ -530,7 +544,7 @@
530
544
  // Class (String): Class name for the generated <meta> tag
531
545
  register_media : function (media, media_class) {
532
546
  if(Foundation.media_queries[media] === undefined) {
533
- $('head').append('<meta class="' + media_class + '">');
547
+ $('head').append('<meta class="' + media_class + '"/>');
534
548
  Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
535
549
  }
536
550
  },