va_common 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -4
  3. data/app/assets/js/va_common_main.js +16 -1
  4. data/lib/va_common/version.rb +1 -1
  5. data/lib/va_common.rb +4 -0
  6. data/va_common.gemspec +15 -0
  7. metadata +200 -177
  8. data/app/assets/js/foundation/foundation.abide.js +0 -408
  9. data/app/assets/js/foundation/foundation.accordion.js +0 -88
  10. data/app/assets/js/foundation/foundation.alert.js +0 -43
  11. data/app/assets/js/foundation/foundation.clearing.js +0 -586
  12. data/app/assets/js/foundation/foundation.dropdown.js +0 -463
  13. data/app/assets/js/foundation/foundation.equalizer.js +0 -104
  14. data/app/assets/js/foundation/foundation.interchange.js +0 -359
  15. data/app/assets/js/foundation/foundation.joyride.js +0 -932
  16. data/app/assets/js/foundation/foundation.js +0 -725
  17. data/app/assets/js/foundation/foundation.magellan.js +0 -215
  18. data/app/assets/js/foundation/foundation.offcanvas.js +0 -152
  19. data/app/assets/js/foundation/foundation.orbit.js +0 -476
  20. data/app/assets/js/foundation/foundation.reveal.js +0 -498
  21. data/app/assets/js/foundation/foundation.slider.js +0 -281
  22. data/app/assets/js/foundation/foundation.tab.js +0 -249
  23. data/app/assets/js/foundation/foundation.tooltip.js +0 -339
  24. data/app/assets/js/foundation/foundation.topbar.js +0 -458
  25. data/app/assets/js/foundation.min.js +0 -6376
  26. data/app/assets/js/vendor/html5shiv.js +0 -8
  27. data/app/assets/js/vendor/jquery-1.11.0.min.js +0 -4
  28. data/app/assets/js/vendor/jquery.js +0 -9789
  29. data/app/assets/js/vendor/jquery.smooth-scroll.js +0 -255
  30. data/app/assets/js/vendor/jquery.stellar.js +0 -651
  31. data/app/assets/js/vendor/jquery.tipsy.js +0 -258
  32. data/app/assets/js/vendor/menu.js +0 -40
  33. data/app/assets/js/vendor/modernizr.custom.js +0 -4
  34. data/app/assets/js/vendor/respond.min.js +0 -6
  35. data/app/assets/js/vendor/selectivizr-1.0.3b.js +0 -560
  36. data/app/assets/js/vendor/tota11y.min.js +0 -28
  37. data/app/assets/js/vendor/wow.min.js +0 -2
  38. data/app/assets/stylesheets/foundation/_functions.scss +0 -146
  39. data/app/assets/stylesheets/foundation/_settings.scss +0 -1467
  40. data/app/assets/stylesheets/foundation/_variables.scss +0 -1286
  41. data/app/assets/stylesheets/foundation/components/_accordion.scss +0 -157
  42. data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +0 -128
  43. data/app/assets/stylesheets/foundation/components/_block-grid.scss +0 -132
  44. data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
  45. data/app/assets/stylesheets/foundation/components/_button-groups.scss +0 -200
  46. data/app/assets/stylesheets/foundation/components/_buttons.scss +0 -259
  47. data/app/assets/stylesheets/foundation/components/_clearing.scss +0 -256
  48. data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -131
  49. data/app/assets/stylesheets/foundation/components/_dropdown.scss +0 -262
  50. data/app/assets/stylesheets/foundation/components/_flex-video.scss +0 -51
  51. data/app/assets/stylesheets/foundation/components/_forms.scss +0 -570
  52. data/app/assets/stylesheets/foundation/components/_global.scss +0 -481
  53. data/app/assets/stylesheets/foundation/components/_grid.scss +0 -289
  54. data/app/assets/stylesheets/foundation/components/_icon-bar.scss +0 -358
  55. data/app/assets/stylesheets/foundation/components/_inline-lists.scss +0 -57
  56. data/app/assets/stylesheets/foundation/components/_joyride.scss +0 -222
  57. data/app/assets/stylesheets/foundation/components/_keystrokes.scss +0 -61
  58. data/app/assets/stylesheets/foundation/components/_labels.scss +0 -106
  59. data/app/assets/stylesheets/foundation/components/_magellan.scss +0 -34
  60. data/app/assets/stylesheets/foundation/components/_offcanvas.scss +0 -515
  61. data/app/assets/stylesheets/foundation/components/_orbit.scss +0 -368
  62. data/app/assets/stylesheets/foundation/components/_pagination.scss +0 -162
  63. data/app/assets/stylesheets/foundation/components/_panels.scss +0 -101
  64. data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -150
  65. data/app/assets/stylesheets/foundation/components/_progress-bars.scss +0 -79
  66. data/app/assets/stylesheets/foundation/components/_range-slider.scss +0 -169
  67. data/app/assets/stylesheets/foundation/components/_reveal.scss +0 -202
  68. data/app/assets/stylesheets/foundation/components/_side-nav.scss +0 -116
  69. data/app/assets/stylesheets/foundation/components/_split-buttons.scss +0 -199
  70. data/app/assets/stylesheets/foundation/components/_sub-nav.scss +0 -123
  71. data/app/assets/stylesheets/foundation/components/_switches.scss +0 -238
  72. data/app/assets/stylesheets/foundation/components/_tables.scss +0 -135
  73. data/app/assets/stylesheets/foundation/components/_tabs.scss +0 -123
  74. data/app/assets/stylesheets/foundation/components/_thumbs.scss +0 -66
  75. data/app/assets/stylesheets/foundation/components/_toolbar.scss +0 -70
  76. data/app/assets/stylesheets/foundation/components/_tooltips.scss +0 -142
  77. data/app/assets/stylesheets/foundation/components/_top-bar.scss +0 -691
  78. data/app/assets/stylesheets/foundation/components/_type.scss +0 -525
  79. data/app/assets/stylesheets/foundation/components/_visibility.scss +0 -408
  80. data/app/assets/stylesheets/lib/_normalize.scss +0 -427
  81. data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +0 -411
  82. data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +0 -87
  83. data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +0 -26
  84. data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +0 -48
  85. data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +0 -25
  86. data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +0 -25
  87. data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +0 -64
  88. data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +0 -25
  89. data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +0 -30
  90. data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +0 -31
  91. data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +0 -27
  92. data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +0 -26
  93. data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +0 -26
  94. data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +0 -48
  95. data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +0 -66
  96. data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +0 -25
  97. data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +0 -51
  98. data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +0 -112
  99. data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +0 -34
  100. data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +0 -63
  101. data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +0 -29
  102. data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +0 -43
  103. data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +0 -3
  104. data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +0 -3
  105. data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +0 -42
  106. data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +0 -55
  107. data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +0 -59
  108. data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +0 -4
  109. data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +0 -47
  110. data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +0 -4
  111. data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +0 -287
  112. data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +0 -24
  113. data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +0 -4
  114. data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +0 -10
  115. data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +0 -4
  116. data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +0 -14
  117. data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +0 -36
  118. data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +0 -38
  119. data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +0 -8
  120. data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +0 -8
  121. data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +0 -39
  122. data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +0 -42
  123. data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +0 -19
  124. data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +0 -15
  125. data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +0 -71
  126. data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +0 -3
  127. data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +0 -11
  128. data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +0 -20
  129. data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +0 -26
  130. data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +0 -11
  131. data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +0 -21
  132. data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +0 -11
  133. data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +0 -13
  134. data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +0 -69
  135. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +0 -13
  136. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +0 -15
  137. data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +0 -24
  138. data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +0 -17
  139. data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +0 -24
  140. data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +0 -22
  141. data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +0 -27
  142. data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +0 -21
  143. data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +0 -96
  144. data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +0 -43
  145. data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +0 -13
  146. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +0 -25
  147. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +0 -41
  148. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +0 -61
  149. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +0 -31
  150. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +0 -69
  151. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +0 -50
  152. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +0 -18
  153. data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +0 -26
  154. data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +0 -10
  155. data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +0 -50
  156. data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +0 -7
  157. data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +0 -9
  158. data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +0 -1
  159. data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +0 -8
  160. data/app/assets/stylesheets/lib/neat/_neat.scss +0 -23
  161. data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +0 -49
  162. data/app/assets/stylesheets/lib/neat/functions/_private.scss +0 -114
  163. data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +0 -15
  164. data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +0 -33
  165. data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +0 -28
  166. data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +0 -22
  167. data/app/assets/stylesheets/lib/neat/grid/_media.scss +0 -92
  168. data/app/assets/stylesheets/lib/neat/grid/_omega.scss +0 -87
  169. data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +0 -38
  170. data/app/assets/stylesheets/lib/neat/grid/_pad.scss +0 -25
  171. data/app/assets/stylesheets/lib/neat/grid/_private.scss +0 -35
  172. data/app/assets/stylesheets/lib/neat/grid/_row.scss +0 -52
  173. data/app/assets/stylesheets/lib/neat/grid/_shift.scss +0 -50
  174. data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +0 -94
  175. data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +0 -97
  176. data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +0 -42
  177. data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +0 -13
  178. data/app/assets/stylesheets/lib/neat/settings/_grid.scss +0 -51
  179. data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +0 -27
  180. data/app/assets/stylesheets/va_common_main.css.scss +0 -18
  181. /data/app/assets/js/{vendor/scroll-settings.js → scroll-settings.js} +0 -0
  182. /data/app/assets/js/{vendor/stellar-settings.js → stellar-settings.js} +0 -0
@@ -1,932 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- var Modernizr = Modernizr || false;
5
-
6
- Foundation.libs.joyride = {
7
- name : 'joyride',
8
-
9
- version : '5.5.2',
10
-
11
- defaults : {
12
- expose : false, // turn on or off the expose feature
13
- modal : true, // Whether to cover page with modal during the tour
14
- keyboard : true, // enable left, right and esc keystrokes
15
- tip_location : 'bottom', // 'top' or 'bottom' in relation to parent
16
- nub_position : 'auto', // override on a per tooltip bases
17
- scroll_speed : 1500, // Page scrolling speed in milliseconds, 0 = no scroll animation
18
- scroll_animation : 'linear', // supports 'swing' and 'linear', extend with jQuery UI.
19
- timer : 0, // 0 = no timer , all other numbers = timer in milliseconds
20
- start_timer_on_click : true, // true or false - true requires clicking the first button start the timer
21
- start_offset : 0, // the index of the tooltip you want to start on (index of the li)
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
24
- tip_animation : 'fade', // 'pop' or 'fade' in each tip
25
- pause_after : [], // array of indexes where to pause the tour after
26
- exposed : [], // array of expose elements
27
- tip_animation_fade_speed : 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
28
- cookie_monster : false, // true or false to control whether cookies are used
29
- cookie_name : 'joyride', // Name the cookie you'll use
30
- cookie_domain : false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
31
- cookie_expires : 365, // set when you would like the cookie to expire.
32
- tip_container : 'body', // Where will the tip be attached
33
- abort_on_close : true, // When true, the close event will not fire any callback
34
- tip_location_patterns : {
35
- top : ['bottom'],
36
- bottom : [], // bottom should not need to be repositioned
37
- left : ['right', 'top', 'bottom'],
38
- right : ['left', 'top', 'bottom']
39
- },
40
- post_ride_callback : function () {}, // A method to call once the tour closes (canceled or complete)
41
- post_step_callback : function () {}, // A method to call after each step
42
- pre_step_callback : function () {}, // A method to call before each step
43
- pre_ride_callback : function () {}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
44
- post_expose_callback : function () {}, // A method to call after an element has been exposed
45
- template : { // HTML segments for tip layout
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>'
55
- },
56
- expose_add_class : '' // One or more space-separated class names to be added to exposed element
57
- },
58
-
59
- init : function (scope, method, options) {
60
- Foundation.inherit(this, 'throttle random_str');
61
-
62
- this.settings = this.settings || $.extend({}, this.defaults, (options || method));
63
-
64
- this.bindings(method, options)
65
- },
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
-
95
- events : function () {
96
- var self = this;
97
-
98
- $(this.scope)
99
- .off('.joyride')
100
- .on('click.fndtn.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
101
- e.preventDefault();
102
- this.go_next()
103
- }.bind(this))
104
- .on('click.fndtn.joyride', '.joyride-prev-tip', function (e) {
105
- e.preventDefault();
106
- this.go_prev();
107
- }.bind(this))
108
-
109
- .on('click.fndtn.joyride', '.joyride-close-tip', function (e) {
110
- e.preventDefault();
111
- this.end(this.settings.abort_on_close);
112
- }.bind(this))
113
-
114
- .on('keyup.fndtn.joyride', function (e) {
115
- // Don't do anything if keystrokes are disabled
116
- // or if the joyride is not being shown
117
- if (!this.settings.keyboard || !this.settings.riding) {
118
- return;
119
- }
120
-
121
- switch (e.which) {
122
- case 39: // right arrow
123
- e.preventDefault();
124
- this.go_next();
125
- break;
126
- case 37: // left arrow
127
- e.preventDefault();
128
- this.go_prev();
129
- break;
130
- case 27: // escape
131
- e.preventDefault();
132
- this.end(this.settings.abort_on_close);
133
- }
134
- }.bind(this));
135
-
136
- $(window)
137
- .off('.joyride')
138
- .on('resize.fndtn.joyride', self.throttle(function () {
139
- if ($('[' + self.attr_name() + ']').length > 0 && self.settings.$next_tip && self.settings.riding) {
140
- if (self.settings.exposed.length > 0) {
141
- var $els = $(self.settings.exposed);
142
-
143
- $els.each(function () {
144
- var $this = $(this);
145
- self.un_expose($this);
146
- self.expose($this);
147
- });
148
- }
149
-
150
- if (self.is_phone()) {
151
- self.pos_phone();
152
- } else {
153
- self.pos_default(false);
154
- }
155
- }
156
- }, 100));
157
- },
158
-
159
- start : function () {
160
- var self = this,
161
- $this = $('[' + this.attr_name() + ']', this.scope),
162
- integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
163
- int_settings_count = integer_settings.length;
164
-
165
- if (!$this.length > 0) {
166
- return;
167
- }
168
-
169
- if (!this.settings.init) {
170
- this.events();
171
- }
172
-
173
- this.settings = $this.data(this.attr_name(true) + '-init');
174
-
175
- // non configureable settings
176
- this.settings.$content_el = $this;
177
- this.settings.$body = $(this.settings.tip_container);
178
- this.settings.body_offset = $(this.settings.tip_container).position();
179
- this.settings.$tip_content = this.settings.$content_el.find('> li');
180
- this.settings.paused = false;
181
- this.settings.attempts = 0;
182
- this.settings.riding = true;
183
-
184
- // can we create cookies?
185
- if (typeof $.cookie !== 'function') {
186
- this.settings.cookie_monster = false;
187
- }
188
-
189
- // generate the tips and insert into dom.
190
- if (!this.settings.cookie_monster || this.settings.cookie_monster && !$.cookie(this.settings.cookie_name)) {
191
- this.settings.$tip_content.each(function (index) {
192
- var $this = $(this);
193
- this.settings = $.extend({}, self.defaults, self.data_options($this));
194
-
195
- // Make sure that settings parsed from data_options are integers where necessary
196
- var i = int_settings_count;
197
- while (i--) {
198
- self.settings[integer_settings[i]] = parseInt(self.settings[integer_settings[i]], 10);
199
- }
200
- self.create({$li : $this, index : index});
201
- });
202
-
203
- // show first tip
204
- if (!this.settings.start_timer_on_click && this.settings.timer > 0) {
205
- this.show('init');
206
- this.startTimer();
207
- } else {
208
- this.show('init');
209
- }
210
-
211
- }
212
- },
213
-
214
- resume : function () {
215
- this.set_li();
216
- this.show();
217
- },
218
-
219
- tip_template : function (opts) {
220
- var $blank, content;
221
-
222
- opts.tip_class = opts.tip_class || '';
223
-
224
- $blank = $(this.settings.template.tip).addClass(opts.tip_class);
225
- content = $.trim($(opts.li).html()) +
226
- this.prev_button_text(opts.prev_button_text, opts.index) +
227
- this.button_text(opts.button_text) +
228
- this.settings.template.link +
229
- this.timer_instance(opts.index);
230
-
231
- $blank.append($(this.settings.template.wrapper));
232
- $blank.first().attr(this.add_namespace('data-index'), opts.index);
233
- $('.joyride-content-wrapper', $blank).append(content);
234
-
235
- return $blank[0];
236
- },
237
-
238
- timer_instance : function (index) {
239
- var txt;
240
-
241
- if ((index === 0 && this.settings.start_timer_on_click && this.settings.timer > 0) || this.settings.timer === 0) {
242
- txt = '';
243
- } else {
244
- txt = $(this.settings.template.timer)[0].outerHTML;
245
- }
246
- return txt;
247
- },
248
-
249
- button_text : function (txt) {
250
- if (this.settings.tip_settings.next_button) {
251
- txt = $.trim(txt) || 'Next';
252
- txt = $(this.settings.template.button).append(txt)[0].outerHTML;
253
- } else {
254
- txt = '';
255
- }
256
- return txt;
257
- },
258
-
259
- prev_button_text : function (txt, idx) {
260
- if (this.settings.tip_settings.prev_button) {
261
- txt = $.trim(txt) || 'Previous';
262
-
263
- // Add the disabled class to the button if it's the first element
264
- if (idx == 0) {
265
- txt = $(this.settings.template.prev_button).append(txt).addClass('disabled')[0].outerHTML;
266
- } else {
267
- txt = $(this.settings.template.prev_button).append(txt)[0].outerHTML;
268
- }
269
- } else {
270
- txt = '';
271
- }
272
- return txt;
273
- },
274
-
275
- create : function (opts) {
276
- this.settings.tip_settings = $.extend({}, this.settings, this.data_options(opts.$li));
277
- var buttonText = opts.$li.attr(this.add_namespace('data-button')) || opts.$li.attr(this.add_namespace('data-text')),
278
- prevButtonText = opts.$li.attr(this.add_namespace('data-button-prev')) || opts.$li.attr(this.add_namespace('data-prev-text')),
279
- tipClass = opts.$li.attr('class'),
280
- $tip_content = $(this.tip_template({
281
- tip_class : tipClass,
282
- index : opts.index,
283
- button_text : buttonText,
284
- prev_button_text : prevButtonText,
285
- li : opts.$li
286
- }));
287
-
288
- $(this.settings.tip_container).append($tip_content);
289
- },
290
-
291
- show : function (init, is_prev) {
292
- var $timer = null;
293
-
294
- // are we paused?
295
- if (this.settings.$li === undefined || ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
296
-
297
- // don't go to the next li if the tour was paused
298
- if (this.settings.paused) {
299
- this.settings.paused = false;
300
- } else {
301
- this.set_li(init, is_prev);
302
- }
303
-
304
- this.settings.attempts = 0;
305
-
306
- if (this.settings.$li.length && this.settings.$target.length > 0) {
307
- if (init) { //run when we first start
308
- this.settings.pre_ride_callback(this.settings.$li.index(), this.settings.$next_tip);
309
- if (this.settings.modal) {
310
- this.show_modal();
311
- }
312
- }
313
-
314
- this.settings.pre_step_callback(this.settings.$li.index(), this.settings.$next_tip);
315
-
316
- if (this.settings.modal && this.settings.expose) {
317
- this.expose();
318
- }
319
-
320
- this.settings.tip_settings = $.extend({}, this.settings, this.data_options(this.settings.$li));
321
-
322
- this.settings.timer = parseInt(this.settings.timer, 10);
323
-
324
- this.settings.tip_settings.tip_location_pattern = this.settings.tip_location_patterns[this.settings.tip_settings.tip_location];
325
-
326
- // scroll and hide bg if not modal
327
- if (!/body/i.test(this.settings.$target.selector)) {
328
- var joyridemodalbg = $('.joyride-modal-bg');
329
- if (/pop/i.test(this.settings.tipAnimation)) {
330
- joyridemodalbg.hide();
331
- } else {
332
- joyridemodalbg.fadeOut(this.settings.tipAnimationFadeSpeed);
333
- }
334
- this.scroll_to();
335
- }
336
-
337
- if (this.is_phone()) {
338
- this.pos_phone(true);
339
- } else {
340
- this.pos_default(true);
341
- }
342
-
343
- $timer = this.settings.$next_tip.find('.joyride-timer-indicator');
344
-
345
- if (/pop/i.test(this.settings.tip_animation)) {
346
-
347
- $timer.width(0);
348
-
349
- if (this.settings.timer > 0) {
350
-
351
- this.settings.$next_tip.show();
352
-
353
- setTimeout(function () {
354
- $timer.animate({
355
- width : $timer.parent().width()
356
- }, this.settings.timer, 'linear');
357
- }.bind(this), this.settings.tip_animation_fade_speed);
358
-
359
- } else {
360
- this.settings.$next_tip.show();
361
-
362
- }
363
-
364
- } else if (/fade/i.test(this.settings.tip_animation)) {
365
-
366
- $timer.width(0);
367
-
368
- if (this.settings.timer > 0) {
369
-
370
- this.settings.$next_tip
371
- .fadeIn(this.settings.tip_animation_fade_speed)
372
- .show();
373
-
374
- setTimeout(function () {
375
- $timer.animate({
376
- width : $timer.parent().width()
377
- }, this.settings.timer, 'linear');
378
- }.bind(this), this.settings.tip_animation_fade_speed);
379
-
380
- } else {
381
- this.settings.$next_tip.fadeIn(this.settings.tip_animation_fade_speed);
382
- }
383
- }
384
-
385
- this.settings.$current_tip = this.settings.$next_tip;
386
-
387
- // skip non-existant targets
388
- } else if (this.settings.$li && this.settings.$target.length < 1) {
389
-
390
- this.show(init, is_prev);
391
-
392
- } else {
393
-
394
- this.end();
395
-
396
- }
397
- } else {
398
-
399
- this.settings.paused = true;
400
-
401
- }
402
-
403
- },
404
-
405
- is_phone : function () {
406
- return matchMedia(Foundation.media_queries.small).matches &&
407
- !matchMedia(Foundation.media_queries.medium).matches;
408
- },
409
-
410
- hide : function () {
411
- if (this.settings.modal && this.settings.expose) {
412
- this.un_expose();
413
- }
414
-
415
- if (!this.settings.modal) {
416
- $('.joyride-modal-bg').hide();
417
- }
418
-
419
- // Prevent scroll bouncing...wait to remove from layout
420
- this.settings.$current_tip.css('visibility', 'hidden');
421
- setTimeout($.proxy(function () {
422
- this.hide();
423
- this.css('visibility', 'visible');
424
- }, this.settings.$current_tip), 0);
425
- this.settings.post_step_callback(this.settings.$li.index(),
426
- this.settings.$current_tip);
427
- },
428
-
429
- set_li : function (init, is_prev) {
430
- if (init) {
431
- this.settings.$li = this.settings.$tip_content.eq(this.settings.start_offset);
432
- this.set_next_tip();
433
- this.settings.$current_tip = this.settings.$next_tip;
434
- } else {
435
- if (is_prev) {
436
- this.settings.$li = this.settings.$li.prev();
437
- } else {
438
- this.settings.$li = this.settings.$li.next();
439
- }
440
- this.set_next_tip();
441
- }
442
-
443
- this.set_target();
444
- },
445
-
446
- set_next_tip : function () {
447
- this.settings.$next_tip = $('.joyride-tip-guide').eq(this.settings.$li.index());
448
- this.settings.$next_tip.data('closed', '');
449
- },
450
-
451
- set_target : function () {
452
- var cl = this.settings.$li.attr(this.add_namespace('data-class')),
453
- id = this.settings.$li.attr(this.add_namespace('data-id')),
454
- $sel = function () {
455
- if (id) {
456
- return $(document.getElementById(id));
457
- } else if (cl) {
458
- return $('.' + cl).first();
459
- } else {
460
- return $('body');
461
- }
462
- };
463
-
464
- this.settings.$target = $sel();
465
- },
466
-
467
- scroll_to : function () {
468
- var window_half, tipOffset;
469
-
470
- window_half = $(window).height() / 2;
471
- tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight());
472
-
473
- if (tipOffset != 0) {
474
- $('html, body').stop().animate({
475
- scrollTop : tipOffset
476
- }, this.settings.scroll_speed, 'swing');
477
- }
478
- },
479
-
480
- paused : function () {
481
- return ($.inArray((this.settings.$li.index() + 1), this.settings.pause_after) === -1);
482
- },
483
-
484
- restart : function () {
485
- this.hide();
486
- this.settings.$li = undefined;
487
- this.show('init');
488
- },
489
-
490
- pos_default : function (init) {
491
- var $nub = this.settings.$next_tip.find('.joyride-nub'),
492
- nub_width = Math.ceil($nub.outerWidth() / 2),
493
- nub_height = Math.ceil($nub.outerHeight() / 2),
494
- toggle = init || false;
495
-
496
- // tip must not be "display: none" to calculate position
497
- if (toggle) {
498
- this.settings.$next_tip.css('visibility', 'hidden');
499
- this.settings.$next_tip.show();
500
- }
501
-
502
- if (!/body/i.test(this.settings.$target.selector)) {
503
- var topAdjustment = this.settings.tip_settings.tipAdjustmentY ? parseInt(this.settings.tip_settings.tipAdjustmentY) : 0,
504
- leftAdjustment = this.settings.tip_settings.tipAdjustmentX ? parseInt(this.settings.tip_settings.tipAdjustmentX) : 0;
505
-
506
- if (this.bottom()) {
507
- if (this.rtl) {
508
- this.settings.$next_tip.css({
509
- top : (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
510
- left : this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth() + leftAdjustment});
511
- } else {
512
- this.settings.$next_tip.css({
513
- top : (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
514
- left : this.settings.$target.offset().left + leftAdjustment});
515
- }
516
-
517
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'top');
518
-
519
- } else if (this.top()) {
520
- if (this.rtl) {
521
- this.settings.$next_tip.css({
522
- top : (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
523
- left : this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
524
- } else {
525
- this.settings.$next_tip.css({
526
- top : (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
527
- left : this.settings.$target.offset().left + leftAdjustment});
528
- }
529
-
530
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'bottom');
531
-
532
- } else if (this.right()) {
533
-
534
- this.settings.$next_tip.css({
535
- top : this.settings.$target.offset().top + topAdjustment,
536
- left : (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width + leftAdjustment)});
537
-
538
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'left');
539
-
540
- } else if (this.left()) {
541
-
542
- this.settings.$next_tip.css({
543
- top : this.settings.$target.offset().top + topAdjustment,
544
- left : (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width + leftAdjustment)});
545
-
546
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'right');
547
-
548
- }
549
-
550
- if (!this.visible(this.corners(this.settings.$next_tip)) && this.settings.attempts < this.settings.tip_settings.tip_location_pattern.length) {
551
-
552
- $nub.removeClass('bottom')
553
- .removeClass('top')
554
- .removeClass('right')
555
- .removeClass('left');
556
-
557
- this.settings.tip_settings.tip_location = this.settings.tip_settings.tip_location_pattern[this.settings.attempts];
558
-
559
- this.settings.attempts++;
560
-
561
- this.pos_default();
562
-
563
- }
564
-
565
- } else if (this.settings.$li.length) {
566
-
567
- this.pos_modal($nub);
568
-
569
- }
570
-
571
- if (toggle) {
572
- this.settings.$next_tip.hide();
573
- this.settings.$next_tip.css('visibility', 'visible');
574
- }
575
-
576
- },
577
-
578
- pos_phone : function (init) {
579
- var tip_height = this.settings.$next_tip.outerHeight(),
580
- tip_offset = this.settings.$next_tip.offset(),
581
- target_height = this.settings.$target.outerHeight(),
582
- $nub = $('.joyride-nub', this.settings.$next_tip),
583
- nub_height = Math.ceil($nub.outerHeight() / 2),
584
- toggle = init || false;
585
-
586
- $nub.removeClass('bottom')
587
- .removeClass('top')
588
- .removeClass('right')
589
- .removeClass('left');
590
-
591
- if (toggle) {
592
- this.settings.$next_tip.css('visibility', 'hidden');
593
- this.settings.$next_tip.show();
594
- }
595
-
596
- if (!/body/i.test(this.settings.$target.selector)) {
597
-
598
- if (this.top()) {
599
-
600
- this.settings.$next_tip.offset({top : this.settings.$target.offset().top - tip_height - nub_height});
601
- $nub.addClass('bottom');
602
-
603
- } else {
604
-
605
- this.settings.$next_tip.offset({top : this.settings.$target.offset().top + target_height + nub_height});
606
- $nub.addClass('top');
607
-
608
- }
609
-
610
- } else if (this.settings.$li.length) {
611
- this.pos_modal($nub);
612
- }
613
-
614
- if (toggle) {
615
- this.settings.$next_tip.hide();
616
- this.settings.$next_tip.css('visibility', 'visible');
617
- }
618
- },
619
-
620
- pos_modal : function ($nub) {
621
- this.center();
622
- $nub.hide();
623
-
624
- this.show_modal();
625
- },
626
-
627
- show_modal : function () {
628
- if (!this.settings.$next_tip.data('closed')) {
629
- var joyridemodalbg = $('.joyride-modal-bg');
630
- if (joyridemodalbg.length < 1) {
631
- var joyridemodalbg = $(this.settings.template.modal);
632
- joyridemodalbg.appendTo('body');
633
- }
634
-
635
- if (/pop/i.test(this.settings.tip_animation)) {
636
- joyridemodalbg.show();
637
- } else {
638
- joyridemodalbg.fadeIn(this.settings.tip_animation_fade_speed);
639
- }
640
- }
641
- },
642
-
643
- expose : function () {
644
- var expose,
645
- exposeCover,
646
- el,
647
- origCSS,
648
- origClasses,
649
- randId = 'expose-' + this.random_str(6);
650
-
651
- if (arguments.length > 0 && arguments[0] instanceof $) {
652
- el = arguments[0];
653
- } else if (this.settings.$target && !/body/i.test(this.settings.$target.selector)) {
654
- el = this.settings.$target;
655
- } else {
656
- return false;
657
- }
658
-
659
- if (el.length < 1) {
660
- if (window.console) {
661
- console.error('element not valid', el);
662
- }
663
- return false;
664
- }
665
-
666
- expose = $(this.settings.template.expose);
667
- this.settings.$body.append(expose);
668
- expose.css({
669
- top : el.offset().top,
670
- left : el.offset().left,
671
- width : el.outerWidth(true),
672
- height : el.outerHeight(true)
673
- });
674
-
675
- exposeCover = $(this.settings.template.expose_cover);
676
-
677
- origCSS = {
678
- zIndex : el.css('z-index'),
679
- position : el.css('position')
680
- };
681
-
682
- origClasses = el.attr('class') == null ? '' : el.attr('class');
683
-
684
- el.css('z-index', parseInt(expose.css('z-index')) + 1);
685
-
686
- if (origCSS.position == 'static') {
687
- el.css('position', 'relative');
688
- }
689
-
690
- el.data('expose-css', origCSS);
691
- el.data('orig-class', origClasses);
692
- el.attr('class', origClasses + ' ' + this.settings.expose_add_class);
693
-
694
- exposeCover.css({
695
- top : el.offset().top,
696
- left : el.offset().left,
697
- width : el.outerWidth(true),
698
- height : el.outerHeight(true)
699
- });
700
-
701
- if (this.settings.modal) {
702
- this.show_modal();
703
- }
704
-
705
- this.settings.$body.append(exposeCover);
706
- expose.addClass(randId);
707
- exposeCover.addClass(randId);
708
- el.data('expose', randId);
709
- this.settings.post_expose_callback(this.settings.$li.index(), this.settings.$next_tip, el);
710
- this.add_exposed(el);
711
- },
712
-
713
- un_expose : function () {
714
- var exposeId,
715
- el,
716
- expose,
717
- origCSS,
718
- origClasses,
719
- clearAll = false;
720
-
721
- if (arguments.length > 0 && arguments[0] instanceof $) {
722
- el = arguments[0];
723
- } else if (this.settings.$target && !/body/i.test(this.settings.$target.selector)) {
724
- el = this.settings.$target;
725
- } else {
726
- return false;
727
- }
728
-
729
- if (el.length < 1) {
730
- if (window.console) {
731
- console.error('element not valid', el);
732
- }
733
- return false;
734
- }
735
-
736
- exposeId = el.data('expose');
737
- expose = $('.' + exposeId);
738
-
739
- if (arguments.length > 1) {
740
- clearAll = arguments[1];
741
- }
742
-
743
- if (clearAll === true) {
744
- $('.joyride-expose-wrapper,.joyride-expose-cover').remove();
745
- } else {
746
- expose.remove();
747
- }
748
-
749
- origCSS = el.data('expose-css');
750
-
751
- if (origCSS.zIndex == 'auto') {
752
- el.css('z-index', '');
753
- } else {
754
- el.css('z-index', origCSS.zIndex);
755
- }
756
-
757
- if (origCSS.position != el.css('position')) {
758
- if (origCSS.position == 'static') {// this is default, no need to set it.
759
- el.css('position', '');
760
- } else {
761
- el.css('position', origCSS.position);
762
- }
763
- }
764
-
765
- origClasses = el.data('orig-class');
766
- el.attr('class', origClasses);
767
- el.removeData('orig-classes');
768
-
769
- el.removeData('expose');
770
- el.removeData('expose-z-index');
771
- this.remove_exposed(el);
772
- },
773
-
774
- add_exposed : function (el) {
775
- this.settings.exposed = this.settings.exposed || [];
776
- if (el instanceof $ || typeof el === 'object') {
777
- this.settings.exposed.push(el[0]);
778
- } else if (typeof el == 'string') {
779
- this.settings.exposed.push(el);
780
- }
781
- },
782
-
783
- remove_exposed : function (el) {
784
- var search, i;
785
- if (el instanceof $) {
786
- search = el[0]
787
- } else if (typeof el == 'string') {
788
- search = el;
789
- }
790
-
791
- this.settings.exposed = this.settings.exposed || [];
792
- i = this.settings.exposed.length;
793
-
794
- while (i--) {
795
- if (this.settings.exposed[i] == search) {
796
- this.settings.exposed.splice(i, 1);
797
- return;
798
- }
799
- }
800
- },
801
-
802
- center : function () {
803
- var $w = $(window);
804
-
805
- this.settings.$next_tip.css({
806
- top : ((($w.height() - this.settings.$next_tip.outerHeight()) / 2) + $w.scrollTop()),
807
- left : ((($w.width() - this.settings.$next_tip.outerWidth()) / 2) + $w.scrollLeft())
808
- });
809
-
810
- return true;
811
- },
812
-
813
- bottom : function () {
814
- return /bottom/i.test(this.settings.tip_settings.tip_location);
815
- },
816
-
817
- top : function () {
818
- return /top/i.test(this.settings.tip_settings.tip_location);
819
- },
820
-
821
- right : function () {
822
- return /right/i.test(this.settings.tip_settings.tip_location);
823
- },
824
-
825
- left : function () {
826
- return /left/i.test(this.settings.tip_settings.tip_location);
827
- },
828
-
829
- corners : function (el) {
830
- var w = $(window),
831
- window_half = w.height() / 2,
832
- //using this to calculate since scroll may not have finished yet.
833
- tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight()),
834
- right = w.width() + w.scrollLeft(),
835
- offsetBottom = w.height() + tipOffset,
836
- bottom = w.height() + w.scrollTop(),
837
- top = w.scrollTop();
838
-
839
- if (tipOffset < top) {
840
- if (tipOffset < 0) {
841
- top = 0;
842
- } else {
843
- top = tipOffset;
844
- }
845
- }
846
-
847
- if (offsetBottom > bottom) {
848
- bottom = offsetBottom;
849
- }
850
-
851
- return [
852
- el.offset().top < top,
853
- right < el.offset().left + el.outerWidth(),
854
- bottom < el.offset().top + el.outerHeight(),
855
- w.scrollLeft() > el.offset().left
856
- ];
857
- },
858
-
859
- visible : function (hidden_corners) {
860
- var i = hidden_corners.length;
861
-
862
- while (i--) {
863
- if (hidden_corners[i]) {
864
- return false;
865
- }
866
- }
867
-
868
- return true;
869
- },
870
-
871
- nub_position : function (nub, pos, def) {
872
- if (pos === 'auto') {
873
- nub.addClass(def);
874
- } else {
875
- nub.addClass(pos);
876
- }
877
- },
878
-
879
- startTimer : function () {
880
- if (this.settings.$li.length) {
881
- this.settings.automate = setTimeout(function () {
882
- this.hide();
883
- this.show();
884
- this.startTimer();
885
- }.bind(this), this.settings.timer);
886
- } else {
887
- clearTimeout(this.settings.automate);
888
- }
889
- },
890
-
891
- end : function (abort) {
892
- if (this.settings.cookie_monster) {
893
- $.cookie(this.settings.cookie_name, 'ridden', {expires : this.settings.cookie_expires, domain : this.settings.cookie_domain});
894
- }
895
-
896
- if (this.settings.timer > 0) {
897
- clearTimeout(this.settings.automate);
898
- }
899
-
900
- if (this.settings.modal && this.settings.expose) {
901
- this.un_expose();
902
- }
903
-
904
- // Unplug keystrokes listener
905
- $(this.scope).off('keyup.joyride')
906
-
907
- this.settings.$next_tip.data('closed', true);
908
- this.settings.riding = false;
909
-
910
- $('.joyride-modal-bg').hide();
911
- this.settings.$current_tip.hide();
912
-
913
- if (typeof abort === 'undefined' || abort === false) {
914
- this.settings.post_step_callback(this.settings.$li.index(), this.settings.$current_tip);
915
- this.settings.post_ride_callback(this.settings.$li.index(), this.settings.$current_tip);
916
- }
917
-
918
- $('.joyride-tip-guide').remove();
919
- },
920
-
921
- off : function () {
922
- $(this.scope).off('.joyride');
923
- $(window).off('.joyride');
924
- $('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
925
- $('.joyride-tip-guide, .joyride-modal-bg').remove();
926
- clearTimeout(this.settings.automate);
927
- this.settings = {};
928
- },
929
-
930
- reflow : function () {}
931
- };
932
- }(jQuery, window, window.document));