joyride-rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/joyride/joyride.js +15 -0
  5. data/app/assets/javascripts/joyride/jquery.joyride-1.0.3.js +329 -0
  6. data/app/assets/stylesheets/joyride/joyride-1.0.3.css.sass +132 -0
  7. data/app/assets/stylesheets/joyride/joyride.css +14 -0
  8. data/app/assets/stylesheets/joyride/variables.sass +14 -0
  9. data/app/controllers/joyride/application_controller.rb +4 -0
  10. data/app/helpers/joyride/application_helper.rb +4 -0
  11. data/app/views/layouts/joyride/application.html.erb +14 -0
  12. data/config/routes.rb +2 -0
  13. data/lib/joyride.rb +4 -0
  14. data/lib/joyride/engine.rb +5 -0
  15. data/lib/joyride/version.rb +3 -0
  16. data/lib/tasks/joyride_tasks.rake +4 -0
  17. data/test/dummy/README.rdoc +261 -0
  18. data/test/dummy/Rakefile +7 -0
  19. data/test/dummy/app/assets/javascripts/application.js +13 -0
  20. data/test/dummy/app/assets/javascripts/pages.js +2 -0
  21. data/test/dummy/app/assets/stylesheets/application.css.sass +3 -0
  22. data/test/dummy/app/assets/stylesheets/pages.css +4 -0
  23. data/test/dummy/app/controllers/application_controller.rb +3 -0
  24. data/test/dummy/app/controllers/pages_controller.rb +7 -0
  25. data/test/dummy/app/helpers/application_helper.rb +2 -0
  26. data/test/dummy/app/helpers/pages_helper.rb +2 -0
  27. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/test/dummy/app/views/pages/index.html.haml +7 -0
  29. data/test/dummy/app/views/pages/simple_test.html.haml +21 -0
  30. data/test/dummy/config.ru +4 -0
  31. data/test/dummy/config/application.rb +64 -0
  32. data/test/dummy/config/boot.rb +12 -0
  33. data/test/dummy/config/database.yml +25 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +37 -0
  36. data/test/dummy/config/environments/production.rb +67 -0
  37. data/test/dummy/config/environments/test.rb +37 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/inflections.rb +15 -0
  40. data/test/dummy/config/initializers/mime_types.rb +5 -0
  41. data/test/dummy/config/initializers/secret_token.rb +7 -0
  42. data/test/dummy/config/initializers/session_store.rb +8 -0
  43. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/test/dummy/config/locales/en.yml +5 -0
  45. data/test/dummy/config/routes.rb +8 -0
  46. data/test/dummy/log/development.log +3940 -0
  47. data/test/dummy/public/404.html +26 -0
  48. data/test/dummy/public/422.html +26 -0
  49. data/test/dummy/public/500.html +25 -0
  50. data/test/dummy/public/favicon.ico +0 -0
  51. data/test/dummy/script/rails +6 -0
  52. data/test/dummy/test/functional/pages_controller_test.rb +14 -0
  53. data/test/dummy/test/unit/helpers/pages_helper_test.rb +4 -0
  54. data/test/dummy/tmp/cache/assets/C4A/570/sprockets%2F15a04a49f19710781329a870b8d1f352 +0 -0
  55. data/test/dummy/tmp/cache/assets/C5A/BD0/sprockets%2F6e8287461f7b19335a41a29ed9195620 +0 -0
  56. data/test/dummy/tmp/cache/assets/C77/D30/sprockets%2Fca3a855423436369a12f4245be3c5545 +0 -0
  57. data/test/dummy/tmp/cache/assets/C91/E40/sprockets%2F880d46ff1082976e0eb68c528641b089 +0 -0
  58. data/test/dummy/tmp/cache/assets/CAC/040/sprockets%2F0b7d050189881e4fd2073328d92e1b2f +0 -0
  59. data/test/dummy/tmp/cache/assets/CCA/0C0/sprockets%2F6c3e053393afe303432ca73f1b41490b +0 -0
  60. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  61. data/test/dummy/tmp/cache/assets/CDE/440/sprockets%2Fb555f0d8c0d1671bc81430837d84dc92 +0 -0
  62. data/test/dummy/tmp/cache/assets/CE1/1C0/sprockets%2Fe704f02989daa684b32c3f72a4513f83 +0 -0
  63. data/test/dummy/tmp/cache/assets/D18/840/sprockets%2F50c1885539f61359c48af74fcae1df31 +0 -0
  64. data/test/dummy/tmp/cache/assets/D1E/2A0/sprockets%2F8d5d60255600aa010a32e1d1a9bc6db6 +0 -0
  65. data/test/dummy/tmp/cache/assets/D2A/450/sprockets%2F58e369b37e5157ea746a485eea17e9f7 +0 -0
  66. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  67. data/test/dummy/tmp/cache/assets/D3F/A90/sprockets%2Ff6e315f67f26b1665d870ba3fb8050db +0 -0
  68. data/test/dummy/tmp/cache/assets/D4B/720/sprockets%2Fe16c199f91934eaff7bf97321504da2f +0 -0
  69. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  70. data/test/dummy/tmp/cache/assets/D57/E70/sprockets%2Ff3d85fee7084763c5a76a1ea676f962f +0 -0
  71. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  72. data/test/dummy/tmp/cache/assets/D65/BA0/sprockets%2F2713bd3b713d71801af63fadc3b6dc89 +0 -0
  73. data/test/dummy/tmp/cache/assets/D6E/BC0/sprockets%2Fad954413ca960fe041e137d4cd7afd69 +0 -0
  74. data/test/dummy/tmp/cache/assets/D79/8D0/sprockets%2F9a557ef8b2aceee46711709937c44acc +0 -0
  75. data/test/dummy/tmp/cache/assets/D9D/5B0/sprockets%2Ff66dd1c082fb7b7730090dbfbff961b2 +0 -0
  76. data/test/dummy/tmp/cache/assets/DA1/950/sprockets%2F9eba13b549b22c3d8ea4aad8489ba893 +0 -0
  77. data/test/dummy/tmp/cache/assets/DA6/120/sprockets%2Fc5880aca76ccbb51f9388362e8afc1e6 +0 -0
  78. data/test/dummy/tmp/cache/assets/DA7/230/sprockets%2F7ae10239eda2588a95fdcc7d871bef52 +0 -0
  79. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  80. data/test/dummy/tmp/cache/assets/DE0/690/sprockets%2F2827893fa90fd9a8521fdddcef63a8be +0 -0
  81. data/test/dummy/tmp/cache/assets/E00/660/sprockets%2F6dfe5f0c215cba9cb22b3e08dc7f5f88 +0 -0
  82. data/test/dummy/tmp/cache/assets/E02/6C0/sprockets%2Ff206e49edc9afcd023989d53a4dafbe1 +0 -0
  83. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  84. data/test/dummy/tmp/cache/assets/E05/F10/sprockets%2Fb3d9b0e88cdded276ebdce333e338a85 +0 -0
  85. data/test/dummy/tmp/cache/sass/b6a29b56c31fc2a931d217c92dbad0128a12584a/application.css.sassc +0 -0
  86. data/test/integration/navigation_test.rb +10 -0
  87. data/test/joyride_test.rb +7 -0
  88. data/test/test_helper.rb +10 -0
  89. metadata +307 -0
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = Joyride
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Joyride'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require ./jquery.joyride-1.0.3
@@ -0,0 +1,329 @@
1
+ /*
2
+ * jQuery Joyride Plugin 1.0.3
3
+ * www.ZURB.com/playground
4
+ * Copyright 2011, ZURB
5
+ * Free to use under the MIT license.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ */
8
+
9
+ (function($) {
10
+ $.fn.joyride = function(options) {
11
+
12
+ // +++++++++++++++++++
13
+ // Defaults
14
+ // +++++++++++++++++++
15
+ var settings = {
16
+ 'tipLocation': 'bottom', // 'top' or 'bottom' in relation to parent
17
+ 'scrollSpeed': 300, // Page scrolling speed in milliseconds
18
+ 'timer': 0, // 0 = no timer, all other numbers = timer in milliseconds
19
+ 'startTimerOnClick': false, // true or false - true requires clicking the first button start the timer
20
+ 'nextButton': true, // true or false to control whether a next button is used
21
+ 'tipAnimation': 'pop', // 'pop' or 'fade' in each tip
22
+ 'tipAnimationFadeSpeed': 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
23
+ 'cookieMonster': false, // true or false to control whether cookies are used
24
+ 'cookieName': 'JoyRide', // Name the cookie you'll use
25
+ 'cookieDomain': false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
26
+ 'tipContainer': 'body', // Where will the tip be attached if not inline
27
+ 'inline': false, // true or false, if true the tip will be attached after the element
28
+ 'tipContent': '#joyRideTipContent', // What is the ID of the <ol> you put the content in
29
+ 'postRideCallback': $.noop, // A method to call once the tour closes (canceled or complete)
30
+ 'postStepCallback': $.noop // A method to call after each step
31
+ };
32
+
33
+ var options = $.extend(settings, options);
34
+
35
+ return this.each(function() {
36
+
37
+ if ($(options.tipContent).length === 0) return;
38
+
39
+ $(options.tipContent).hide();
40
+
41
+ var bodyOffset = $(options.tipContainer).children('*').first().position(),
42
+ tipContent = $(options.tipContent + ' li'),
43
+ count = skipCount = 0,
44
+ prevCount = -1,
45
+ timerIndicatorInstance,
46
+ timerIndicatorTemplate = '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
47
+ tipTemplate = function(tipClass, index, buttonText, self) { return '<div class="joyride-tip-guide ' +
48
+ tipClass + '" id="joyRidePopup' + index + '"><span class="joyride-nub"></span>' +
49
+ $(self).html() + buttonText + '<a href="#close" class="joyride-close-tip">X</a>' +
50
+ timerIndicatorInstance + '</div>'; },
51
+ tipLayout = function(tipClass, index, buttonText, self) {
52
+ if (index == 0 && settings.startTimerOnClick && settings.timer > 0 || settings.timer == 0) {
53
+ timerIndicatorInstance = '';
54
+ } else {
55
+ timerIndicatorInstance = timerIndicatorTemplate;
56
+ }
57
+ if (!tipClass) tipClass = '';
58
+ (buttonText != '') ? buttonText = '<a href="#" class="joyride-next-tip small nice radius yellow button">' + buttonText + '</a>': buttonText = '';
59
+ if (settings.inline) {
60
+ $(tipTemplate(tipClass, index, buttonText, self)).insertAfter('#' + $(self).data('id'));
61
+ } else {
62
+ $(options.tipContainer).append(tipTemplate(tipClass, index, buttonText, self));
63
+ }
64
+ };
65
+
66
+ if(!settings.cookieMonster || !$.cookie(settings.cookieName)) {
67
+
68
+ tipContent.each(function(index) {
69
+ var buttonText = $(this).data('text'),
70
+ tipClass = $(this).attr('class'),
71
+ self = this;
72
+
73
+ if (settings.nextButton && buttonText == undefined) {
74
+ buttonText = 'Next';
75
+ }
76
+ if (settings.nextButton || !settings.nextButton && settings.startTimerOnClick) {
77
+ if ($(this).attr('class')) {
78
+ tipLayout(tipClass, index, buttonText, self);
79
+ } else {
80
+ tipLayout(false, index, buttonText, self);
81
+ }
82
+ } else if (!settings.nextButton) {
83
+ if ($(this).attr('class')) {
84
+ tipLayout(tipClass, index, '', self);
85
+ } else {
86
+ tipLayout(false, index, '', self);
87
+ }
88
+ }
89
+ $('#joyRidePopup' + index).hide();
90
+ });
91
+ }
92
+
93
+ showNextTip = function() {
94
+ var parentElementID = $(tipContent[count]).data('id'),
95
+ parentElement = $('#' + parentElementID),
96
+ opt = {};
97
+ // Parse the options string
98
+ ($(tipContent[count]).data('options') || ':').split(';')
99
+ .map(function (s) {
100
+ var p = s.split(':');
101
+ if (p.length == 2) opt[p[0].trim()] = p[1].trim();
102
+ });
103
+ options = $.extend(options, opt); // Update options and settings
104
+ settings = $.extend(settings, opt);
105
+
106
+ while (parentElement.offset() === null) {
107
+ count++;
108
+ skipCount++;
109
+ ((tipContent.length - 1) > prevCount) ? prevCount++ : prevCount;
110
+ parentElementID = $(tipContent[count]).data('id'),
111
+ parentElement = $('#' + parentElementID);
112
+
113
+ if ($(tipContent).length < count)
114
+ break;
115
+ }
116
+ var windowHalf = Math.ceil($(window).height() / 2),
117
+ currentTip = $('#joyRidePopup' + count),
118
+ currentTipPosition = parentElement.offset(),
119
+ currentParentHeight = parentElement.outerHeight(),
120
+ currentTipHeight = currentTip.outerHeight(),
121
+ nubHeight = Math.ceil($('.joyride-nub').outerHeight() / 2),
122
+ tipOffset = 0;
123
+
124
+ if (currentTip.length === 0) return;
125
+
126
+ if (count < tipContent.length) {
127
+ if (settings.tipAnimation == "pop") {
128
+ $('.joyride-timer-indicator').width(0);
129
+ if (settings.timer > 0) {
130
+ currentTip.show().children('.joyride-timer-indicator-wrap')
131
+ .children('.joyride-timer-indicator')
132
+ .animate({width: $('.joyride-timer-indicator-wrap')
133
+ .width()}, settings.timer);
134
+ } else {
135
+ currentTip.show();
136
+ }
137
+ } else if (settings.tipAnimation == "fade") {
138
+ $('.joyride-timer-indicator').width(0);
139
+ if (settings.timer > 0) {
140
+ currentTip.fadeIn(settings.tipAnimationFadeSpeed)
141
+ .children('.joyride-timer-indicator-wrap')
142
+ .children('.joyride-timer-indicator')
143
+ .animate({width: $('.joyride-timer-indicator-wrap')
144
+ .width()}, settings.timer);
145
+ } else {
146
+ currentTip.fadeIn(settings.tipAnimationFadeSpeed);
147
+ }
148
+ }
149
+
150
+ // ++++++++++++++++++
151
+ // Tip Location
152
+ // ++++++++++++++++++
153
+
154
+ if (settings.tipLocation == "bottom") {
155
+ currentTip.offset({top: (currentTipPosition.top + currentParentHeight + nubHeight),
156
+ left: (currentTipPosition.left - bodyOffset.left)});
157
+ currentTip.children('.joyride-nub').addClass('top').removeClass('bottom');
158
+ } else if (settings.tipLocation == "top") {
159
+ if (currentTipHeight >= currentTipPosition.top) {
160
+ currentTip.offset({top: ((currentTipPosition.top + currentParentHeight + nubHeight) - bodyOffset.top),
161
+ left: (currentTipPosition.left - bodyOffset.left)});
162
+ currentTip.children('.joyride-nub').addClass('top').removeClass('bottom');
163
+ } else {
164
+ currentTip.offset({top: ((currentTipPosition.top) - (currentTipHeight + bodyOffset.top + nubHeight)),
165
+ left: (currentTipPosition.left - bodyOffset.left)});
166
+ currentTip.children('.joyride-nub').addClass('bottom').removeClass('top');
167
+ }
168
+ }
169
+
170
+ // Animate Scrolling when tip is off screen
171
+ tipOffset = Math.ceil(currentTip.offset().top - windowHalf);
172
+ $("html, body").animate({
173
+ scrollTop: tipOffset
174
+ }, settings.scrollSpeed);
175
+
176
+ if (count > 0) {
177
+ if (skipCount > 0) {
178
+ var hideCount = prevCount - skipCount;
179
+ skipCount = 0;
180
+ } else {
181
+ var hideCount = prevCount;
182
+ }
183
+ if (settings.tipAnimation == "pop") {
184
+ $('#joyRidePopup' + hideCount).hide();
185
+ } else if (settings.tipAnimation == "fade") {
186
+ $('#joyRidePopup' + hideCount).fadeOut(settings.tipAnimationFadeSpeed);
187
+ }
188
+ }
189
+
190
+ // Hide the last tip when clicked
191
+ } else if ((tipContent.length - 1) < count) {
192
+ if (skipCount > 0) {
193
+ var hideCount = prevCount - skipCount;
194
+ skipCount = 0;
195
+ } else {
196
+ var hideCount = prevCount;
197
+ }
198
+ if (settings.cookieMonster == true) {
199
+ $.cookie(settings.cookieName, 'ridden', { expires: 365, domain: settings.cookieDomain });
200
+ }
201
+ if (settings.tipAnimation == "pop") {
202
+ $('#joyRidePopup' + hideCount).fadeTo(0, 0);
203
+ } else if (settings.tipAnimation == "fade") {
204
+ $('#joyRidePopup' + hideCount).fadeTo(settings.tipAnimationFadeSpeed, 0);
205
+ }
206
+ }
207
+ count++;
208
+ if (prevCount < 0) {
209
+ prevCount = 0;
210
+ } else if ((tipContent.length - 1) > prevCount) {
211
+ prevCount++;
212
+ }
213
+ if (settings.postStepCallback != $.noop) {
214
+ settings.postStepCallback(prevCount);
215
+ }
216
+ }
217
+
218
+ if (!settings.inline || !settings.cookieMonster || !$.cookie(settings.cookieName)) {
219
+ $(window).resize(function() {
220
+ var parentElementID = $(tipContent[prevCount]).data('id'),
221
+ currentTipPosition = $('#' + parentElementID).offset(),
222
+ currentParentHeight = $('#' + parentElementID).outerHeight(),
223
+ currentTipHeight = $('#joyRidePopup' + prevCount).outerHeight(),
224
+ nubHeight = Math.ceil($('.joyride-nub').outerHeight() / 2);
225
+ if (settings.tipLocation == "bottom") {
226
+ $('#joyRidePopup' + prevCount).offset({top: (currentTipPosition.top + currentParentHeight + nubHeight),
227
+ left: currentTipPosition.left});
228
+ } else if (settings.tipLocation == "top") {
229
+ if (currentTipPosition.top <= currentTipHeight) {
230
+ $('#joyRidePopup' + prevCount).offset({top: (currentTipPosition.top + nubHeight + currentParentHeight),
231
+ left: currentTipPosition.left});
232
+ } else {
233
+ $('#joyRidePopup' + prevCount).offset({top: ((currentTipPosition.top) - (currentTipHeight + nubHeight)),
234
+ left: currentTipPosition.left});
235
+ }
236
+ }
237
+ });
238
+ }
239
+
240
+ // +++++++++++++++
241
+ // Timer
242
+ // +++++++++++++++
243
+
244
+ var interval_id = null,
245
+ showTimerState = false;
246
+
247
+ if (!settings.startTimerOnClick && settings.timer > 0){
248
+ showNextTip();
249
+ interval_id = setInterval(function() {showNextTip()}, settings.timer);
250
+ } else {
251
+ showNextTip();
252
+ }
253
+ var endTip = function(e, interval_id, cookie, self) {
254
+ e.preventDefault();
255
+ clearInterval(interval_id);
256
+ if (cookie) {
257
+ $.cookie(settings.cookieName, 'ridden', { expires: 365, domain: settings.cookieDomain });
258
+ }
259
+ $(self).parent().hide();
260
+ if (settings.postRideCallback != $.noop) {
261
+ settings.postRideCallback();
262
+ }
263
+ }
264
+ $('.joyride-close-tip').click(function(e) {
265
+ endTip(e, interval_id, settings.cookieMonster, this);
266
+ });
267
+
268
+ // When the next button is clicked, show the next tip, only when cookie isn't present
269
+ $('.joyride-next-tip').click(function(e) {
270
+ e.preventDefault();
271
+ if (count >= tipContent.length) {
272
+ endTip(e, interval_id, settings.cookieMonster, this);
273
+ }
274
+ if (settings.timer > 0 && settings.startTimerOnClick) {
275
+ showNextTip();
276
+ clearInterval(interval_id);
277
+ interval_id = setInterval(function() {showNextTip()}, settings.timer);
278
+ } else if (settings.timer > 0 && !settings.startTimerOnClick){
279
+ clearInterval(interval_id);
280
+ interval_id = setInterval(function() {showNextTip()}, settings.timer);
281
+ } else {
282
+ showNextTip();
283
+ }
284
+ });
285
+ });
286
+ };
287
+
288
+
289
+ // +++++++++++++++++++++++++++++
290
+ // jQuery Cookie plugin
291
+ // +++++++++++++++++++++++++++++
292
+
293
+ // Copyright (c) 2010 Klaus Hartl (stilbuero.de)
294
+ // Dual licensed under the MIT and GPL licenses:
295
+ // http://www.opensource.org/licenses/mit-license.php
296
+ // http://www.gnu.org/licenses/gpl.html
297
+ jQuery.cookie = function (key, value, options) {
298
+
299
+ // key and at least value given, set cookie...
300
+ if (arguments.length > 1 && String(value) !== "[object Object]") {
301
+ options = jQuery.extend({}, options);
302
+
303
+ if (value === null || value === undefined) {
304
+ options.expires = -1;
305
+ }
306
+
307
+ if (typeof options.expires === 'number') {
308
+ var days = options.expires, t = options.expires = new Date();
309
+ t.setDate(t.getDate() + days);
310
+ }
311
+
312
+ value = String(value);
313
+
314
+ return (document.cookie = [
315
+ encodeURIComponent(key), '=',
316
+ options.raw ? value : encodeURIComponent(value),
317
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
318
+ options.path ? '; path=' + options.path : '',
319
+ options.domain ? '; domain=' + options.domain : '',
320
+ options.secure ? '; secure' : ''
321
+ ].join(''));
322
+ }
323
+
324
+ // key and possibly options given, get cookie...
325
+ options = value || {};
326
+ var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
327
+ return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
328
+ };
329
+ })(jQuery);
@@ -0,0 +1,132 @@
1
+ /* Artfully masterminded by ZURB*/
2
+ @import "variables.sass"
3
+
4
+ body
5
+ position: relative
6
+
7
+ .joyride-tip-guide
8
+ position: absolute
9
+ background: $joyride_tip_background
10
+ padding: 10px 10px 10px 15px
11
+ color: $joyride_tip_text_color
12
+ width: $joyride_tip_width
13
+ z-index: 10
14
+ font-family: "HelveticaNeue", "Helvetica Neue", "Helvetica", Helvetica, Arial, Lucida, sans-serif
15
+ font-weight: normal
16
+ -moz-border-radius: $joyride_tip_border_radius
17
+ -webkit-border-radius: $joyride_tip_border_radius
18
+ border-radius: $joyride_tip_border_radius
19
+ span.joyride-nub
20
+ display: block
21
+ position: absolute
22
+ left: $joyride_tip_nub_offset_left
23
+ width: 0
24
+ height: 0
25
+ border: solid $joyride_tip_nub_height
26
+ &.top
27
+ border-top-color: transparent !important
28
+ border-left-color: transparent !important
29
+ border-right-color: transparent !important
30
+ border-bottom-color: $joyride_tip_background
31
+ top: $joyride_tip_nub_height*-2
32
+ bottom: none
33
+ &.bottom
34
+ border-bottom-color: transparent !important
35
+ border-left-color: transparent !important
36
+ border-right-color: transparent !important
37
+ border-top-color: $joyride_tip_background !important
38
+ bottom: $joyride_tip_nub_height*-2
39
+ bottom: none
40
+ h1, h2, h3, h4, h5, h6
41
+ line-height: 1.25
42
+ margin: 0
43
+ font-weight: bold
44
+ color: #fff
45
+ h1
46
+ font-size: 30px
47
+ h2
48
+ font-size: 26px
49
+ h3
50
+ font-size: 22px
51
+ h4
52
+ font-size: 18px
53
+ h5
54
+ font-size: 16px
55
+ h6
56
+ font-size: 14px
57
+ p
58
+ margin: 0 0 18px 0
59
+ font-size: $joyride_tip_text_size
60
+ line-height: 18px
61
+ a
62
+ color: rgb(255, 255, 255)
63
+ text-decoration: none
64
+ border-bottom: dotted 1px rgba(255, 255, 255, 0.6)
65
+ &:hover
66
+ color: rgba(255, 255, 255, 0.8)
67
+ border-bottom: none
68
+ .joyride-next-tip
69
+ &:after
70
+ clear: both
71
+ width: auto
72
+ padding: 6px 18px 4px
73
+ font-size: 13px
74
+ text-decoration: none
75
+ color: rgb(255, 255, 255)
76
+ float: left
77
+ margin: 0 6px 8px 0px
78
+ border: solid 1px darken(desaturate($joyride_tip_button_color,50%),15%)
79
+ background: $joyride_tip_button_color
80
+ background: -moz-linear-gradient(top, $joyride_tip_button_color 0%, $joyride_tip_button_color_2 100%)
81
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, $joyride_tip_button_color), color-stop(100%, $joyride_tip_button_color_2))
82
+ background: -webkit-linear-gradient(top, $joyride_tip_button_color 0%, $joyride_tip_button_color_2 100%)
83
+ background: -o-linear-gradient(top, $joyride_tip_button_color 0%, $joyride_tip_button_color_2 100%)
84
+ background: -ms-linear-gradient(top, $joyride_tip_button_color 0%, $joyride_tip_button_color_2 100%)
85
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0063ff', endColorstr='#0055d6',GradientType=0 )
86
+ background: linear-gradient(top, $joyride_tip_button_color 0%, $joyride_tip_button_color_2 100%)
87
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5)
88
+ -webkit-border-radius: 2px
89
+ -moz-border-radius: 2px
90
+ border-radius: 2px
91
+ -webkit-box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.3) inset
92
+ -moz-box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.3) inset
93
+ box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.3) inset
94
+
95
+ .joyride-next-tip:hover
96
+ color: rgb(255, 255, 255) !important
97
+ border: solid 1px darken(desaturate($joyride_tip_button_color,50%),15%) !important
98
+ background: $joyride_tip_button_hover_color
99
+ background: -moz-linear-gradient(top, $joyride_tip_button_hover_color 0%, $joyride_tip_button_hover_color_2 100%)
100
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, $joyride_tip_button_hover_color), color-stop(100%, $joyride_tip_button_hover_color_2))
101
+ background: -webkit-linear-gradient(top, $joyride_tip_button_hover_color 0%, $joyride_tip_button_hover_color_2 100%)
102
+ background: -o-linear-gradient(top, $joyride_tip_button_hover_color 0%, $joyride_tip_button_hover_color_2 100%)
103
+ background: -ms-linear-gradient(top, $joyride_tip_button_hover_color 0%, $joyride_tip_button_hover_color_2 100%)
104
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2b80ff', endColorstr='#1d66d3',GradientType=0 )
105
+ background: linear-gradient(top, $joyride_tip_button_hover_color 0%, $joyride_tip_button_hover_color_2 100%)
106
+
107
+ .joyride-timer-indicator-wrap
108
+ width: 50px
109
+ height: 3px
110
+ border: solid 1px rgba(255, 255, 255, 0.1)
111
+ position: absolute
112
+ right: 17px
113
+ bottom: 16px
114
+
115
+ .joyride-timer-indicator
116
+ display: block
117
+ width: 0
118
+ height: inherit
119
+ background: rgba(255, 255, 255, 0.25)
120
+
121
+ .joyride-close-tip
122
+ position: absolute
123
+ right: 10px
124
+ top: 10px
125
+ color: rgba(255, 255, 255, 0.6) !important
126
+ text-decoration: none
127
+ font-family: Verdana, sans-serif
128
+ font-size: 10px
129
+ font-weight: bold
130
+ border-bottom: none !important
131
+ &:hover
132
+ color: rgba(255, 255, 255, 0.9) !important