locomotivecms_wagon 2.2.0.beta1 → 2.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/generators/blank/config/metafields_schema.yml +1 -1
  4. data/generators/bootstrap/config/metafields_schema.yml +1 -1
  5. data/generators/{foundation5 → foundation}/Gemfile.tt +1 -1
  6. data/generators/{foundation5 → foundation}/Guardfile +0 -0
  7. data/generators/foundation/app/content_types/.gitkeep +0 -0
  8. data/generators/foundation/app/views/pages/404.liquid +11 -0
  9. data/generators/{foundation5 → foundation}/app/views/pages/404.liquid.haml +4 -3
  10. data/generators/{foundation5 → foundation}/app/views/pages/index.liquid +54 -78
  11. data/generators/foundation/app/views/pages/index.liquid.haml +144 -0
  12. data/generators/foundation/app/views/snippets/.gitkeep +0 -0
  13. data/generators/{foundation5 → foundation}/config/deploy.yml +2 -1
  14. data/generators/{foundation5 → foundation}/config/metafields_schema.yml +1 -1
  15. data/generators/{foundation5/config/site.yml.tt → foundation/config/site.yml} +2 -2
  16. data/generators/{foundation5 → foundation}/config/translations.yml +0 -0
  17. data/generators/foundation/data/.gitkeep +0 -0
  18. data/generators/foundation/log/.gitkeep +0 -0
  19. data/generators/foundation/public/images/.gitkeep +0 -0
  20. data/generators/foundation/public/javascripts/app.js +1 -0
  21. data/generators/foundation/public/javascripts/vendor/foundation.js +7472 -0
  22. data/generators/foundation/public/javascripts/vendor/foundation.min.js +3 -0
  23. data/generators/foundation/public/javascripts/vendor/what-input.js +212 -0
  24. data/generators/foundation/public/javascripts/vendor/what-input.min.js +1 -0
  25. data/generators/foundation/public/stylesheets/_settings.scss +529 -0
  26. data/generators/foundation/public/stylesheets/app.css +3 -0
  27. data/generators/foundation/public/stylesheets/app.scss +43 -0
  28. data/generators/foundation/public/stylesheets/foundation.css +3499 -0
  29. data/generators/foundation/public/stylesheets/foundation6/_global.scss +197 -0
  30. data/generators/foundation/public/stylesheets/foundation6/components/_accordion-menu.scss +28 -0
  31. data/generators/foundation/public/stylesheets/foundation6/components/_accordion.scss +112 -0
  32. data/generators/foundation/public/stylesheets/foundation6/components/_badge.scss +55 -0
  33. data/generators/foundation/public/stylesheets/foundation6/components/_breadcrumbs.scss +94 -0
  34. data/generators/foundation/public/stylesheets/foundation6/components/_button-group.scss +115 -0
  35. data/generators/foundation/public/stylesheets/foundation6/components/_button.scss +264 -0
  36. data/generators/foundation/public/stylesheets/foundation6/components/_callout.scss +115 -0
  37. data/generators/foundation/public/stylesheets/foundation6/components/_close-button.scss +61 -0
  38. data/generators/foundation/public/stylesheets/foundation6/components/_drilldown.scss +67 -0
  39. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown-menu.scss +123 -0
  40. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown.scss +64 -0
  41. data/generators/foundation/public/stylesheets/foundation6/components/_flex-video.scss +68 -0
  42. data/generators/foundation/public/stylesheets/foundation6/components/_float.scss +27 -0
  43. data/generators/foundation/public/stylesheets/foundation6/components/_label.scss +56 -0
  44. data/generators/foundation/public/stylesheets/foundation6/components/_media-object.scss +74 -0
  45. data/generators/foundation/public/stylesheets/foundation6/components/_menu.scss +213 -0
  46. data/generators/foundation/public/stylesheets/foundation6/components/_off-canvas.scss +170 -0
  47. data/generators/foundation/public/stylesheets/foundation6/components/_orbit.scss +186 -0
  48. data/generators/foundation/public/stylesheets/foundation6/components/_pagination.scss +161 -0
  49. data/generators/foundation/public/stylesheets/foundation6/components/_progress-bar.scss +83 -0
  50. data/generators/foundation/public/stylesheets/foundation6/components/_reveal.scss +155 -0
  51. data/generators/foundation/public/stylesheets/foundation6/components/_slider.scss +158 -0
  52. data/generators/foundation/public/stylesheets/foundation6/components/_sticky.scss +38 -0
  53. data/generators/foundation/public/stylesheets/foundation6/components/_switch.scss +231 -0
  54. data/generators/foundation/public/stylesheets/foundation6/components/_table.scss +212 -0
  55. data/generators/foundation/public/stylesheets/foundation6/components/_tabs.scss +137 -0
  56. data/generators/foundation/public/stylesheets/foundation6/components/_thumbnail.scss +54 -0
  57. data/generators/foundation/public/stylesheets/foundation6/components/_title-bar.scss +44 -0
  58. data/generators/foundation/public/stylesheets/foundation6/components/_tooltip.scss +110 -0
  59. data/generators/foundation/public/stylesheets/foundation6/components/_top-bar.scss +57 -0
  60. data/generators/foundation/public/stylesheets/foundation6/components/_visibility.scss +131 -0
  61. data/generators/foundation/public/stylesheets/foundation6/forms/_checkbox.scss +36 -0
  62. data/generators/foundation/public/stylesheets/foundation6/forms/_error.scss +81 -0
  63. data/generators/foundation/public/stylesheets/foundation6/forms/_fieldset.scss +53 -0
  64. data/generators/foundation/public/stylesheets/foundation6/forms/_forms.scss +32 -0
  65. data/generators/foundation/public/stylesheets/foundation6/forms/_help-text.scss +30 -0
  66. data/generators/foundation/public/stylesheets/foundation6/forms/_input-group.scss +70 -0
  67. data/generators/foundation/public/stylesheets/foundation6/forms/_label.scss +48 -0
  68. data/generators/foundation/public/stylesheets/foundation6/forms/_select.scss +64 -0
  69. data/generators/foundation/public/stylesheets/foundation6/forms/_text.scss +153 -0
  70. data/generators/foundation/public/stylesheets/foundation6/foundation.scss +91 -0
  71. data/generators/foundation/public/stylesheets/foundation6/grid/_classes.scss +132 -0
  72. data/generators/foundation/public/stylesheets/foundation6/grid/_column.scss +112 -0
  73. data/generators/foundation/public/stylesheets/foundation6/grid/_flex-grid.scss +191 -0
  74. data/generators/foundation/public/stylesheets/foundation6/grid/_grid.scss +33 -0
  75. data/generators/foundation/public/stylesheets/foundation6/grid/_gutter.scss +31 -0
  76. data/generators/foundation/public/stylesheets/foundation6/grid/_layout.scss +32 -0
  77. data/generators/foundation/public/stylesheets/foundation6/grid/_position.scss +71 -0
  78. data/generators/foundation/public/stylesheets/foundation6/grid/_row.scss +72 -0
  79. data/generators/foundation/public/stylesheets/foundation6/grid/_size.scss +24 -0
  80. data/generators/foundation/public/stylesheets/foundation6/motion-ui/_classes.scss +102 -0
  81. data/generators/foundation/public/stylesheets/foundation6/motion-ui/_settings.scss +61 -0
  82. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_fade.scss +29 -0
  83. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_hinge.scss +65 -0
  84. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_shake.scss +15 -0
  85. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_slide.scss +41 -0
  86. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_spin.scss +28 -0
  87. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_wiggle.scss +13 -0
  88. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_zoom.scss +15 -0
  89. data/generators/foundation/public/stylesheets/foundation6/motion-ui/motion-ui.scss +29 -0
  90. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_fade.scss +28 -0
  91. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_hinge.scss +43 -0
  92. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_slide.scss +42 -0
  93. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_spin.scss +39 -0
  94. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_zoom.scss +39 -0
  95. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_animation.scss +7 -0
  96. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_args.scss +15 -0
  97. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_keyframe.scss +136 -0
  98. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_selector.scss +23 -0
  99. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_series.scss +54 -0
  100. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_transition.scss +45 -0
  101. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_unit.scss +7 -0
  102. data/generators/foundation/public/stylesheets/foundation6/motion-ui.scss +4 -0
  103. data/generators/foundation/public/stylesheets/foundation6/settings/_settings.scss +531 -0
  104. data/generators/foundation/public/stylesheets/foundation6/typography/_alignment.scss +21 -0
  105. data/generators/foundation/public/stylesheets/foundation6/typography/_base.scss +436 -0
  106. data/generators/foundation/public/stylesheets/foundation6/typography/_helpers.scss +77 -0
  107. data/generators/foundation/public/stylesheets/foundation6/typography/_print.scss +73 -0
  108. data/generators/foundation/public/stylesheets/foundation6/typography/_typography.scss +28 -0
  109. data/generators/foundation/public/stylesheets/foundation6/util/_breakpoint.scss +182 -0
  110. data/generators/foundation/public/stylesheets/foundation6/util/_color.scss +41 -0
  111. data/generators/foundation/public/stylesheets/foundation6/util/_mixins.scss +190 -0
  112. data/generators/foundation/public/stylesheets/foundation6/util/_selector.scss +39 -0
  113. data/generators/foundation/public/stylesheets/foundation6/util/_unit.scss +69 -0
  114. data/generators/foundation/public/stylesheets/foundation6/util/_util.scss +15 -0
  115. data/generators/foundation/public/stylesheets/foundation6/util/_value.scss +117 -0
  116. data/generators/{foundation5/public/stylesheets/normalize.css.scss → foundation/public/stylesheets/foundation6/vendor/normalize.scss} +8 -11
  117. data/generators/site_metafields/schema.yml.tt +1 -1
  118. data/lib/locomotive/wagon/commands/push_command.rb +1 -0
  119. data/lib/locomotive/wagon/commands/serve_command.rb +1 -0
  120. data/lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb +3 -3
  121. data/lib/locomotive/wagon/decorators/content_type_decorator.rb +5 -1
  122. data/lib/locomotive/wagon/generators/site/{foundation5.rb → foundation.rb} +8 -12
  123. data/lib/locomotive/wagon/generators/site.rb +1 -1
  124. data/lib/locomotive/wagon/version.rb +1 -1
  125. data/locomotivecms_wagon.gemspec +3 -2
  126. data/spec/fixtures/cassettes/authenticate.yml +38 -38
  127. data/spec/fixtures/cassettes/delete.yml +211 -211
  128. data/spec/fixtures/cassettes/push.yml +1333 -1374
  129. data/spec/integration/cli_spec.rb +1 -1
  130. data/spec/unit/decorators/content_entry_decorator_spec.rb +23 -0
  131. metadata +133 -104
  132. data/generators/foundation5/app/content_types/.empty_directory +0 -1
  133. data/generators/foundation5/app/views/pages/404.liquid +0 -10
  134. data/generators/foundation5/app/views/pages/index.liquid.haml +0 -157
  135. data/generators/foundation5/data/.empty_directory +0 -1
  136. data/generators/foundation5/icon.png +0 -0
  137. data/generators/foundation5/public/fonts/.empty_directory +0 -1
  138. data/generators/foundation5/public/images/.empty_directory +0 -1
  139. data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +0 -299
  140. data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +0 -59
  141. data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +0 -43
  142. data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +0 -534
  143. data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +0 -311
  144. data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +0 -74
  145. data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +0 -331
  146. data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +0 -843
  147. data/generators/foundation5/public/javascripts/foundation/foundation.js +0 -611
  148. data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +0 -178
  149. data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +0 -108
  150. data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +0 -610
  151. data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +0 -437
  152. data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +0 -199
  153. data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +0 -167
  154. data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +0 -298
  155. data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +0 -425
  156. data/generators/foundation5/public/javascripts/foundation.js +0 -4161
  157. data/generators/foundation5/public/javascripts/foundation.min.js +0 -10
  158. data/generators/foundation5/public/javascripts/vendor/custom.modernizr.js +0 -4
  159. data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +0 -1
  160. data/generators/foundation5/public/javascripts/vendor/fastclick.js +0 -9
  161. data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +0 -11
  162. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +0 -645
  163. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +0 -1
  164. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +0 -8
  165. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +0 -8
  166. data/generators/foundation5/public/javascripts/vendor/jquery.js +0 -26
  167. data/generators/foundation5/public/javascripts/vendor/jquery.min.js +0 -27
  168. data/generators/foundation5/public/javascripts/vendor/modernizr.js +0 -8
  169. data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +0 -1
  170. data/generators/foundation5/public/javascripts/vendor/placeholder.js +0 -2
  171. data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +0 -1
  172. data/generators/foundation5/public/samples/.empty_directory +0 -1
  173. data/generators/foundation5/public/stylesheets/application.css +0 -2
  174. data/generators/foundation5/public/stylesheets/application.css.scss +0 -3
  175. data/generators/foundation5/public/stylesheets/foundation/_functions.scss +0 -102
  176. data/generators/foundation5/public/stylesheets/foundation/_settings.scss +0 -1441
  177. data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +0 -157
  178. data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +0 -128
  179. data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +0 -132
  180. data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
  181. data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +0 -197
  182. data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +0 -259
  183. data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +0 -247
  184. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +0 -130
  185. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +0 -262
  186. data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +0 -51
  187. data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +0 -585
  188. data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +0 -460
  189. data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +0 -275
  190. data/generators/foundation5/public/stylesheets/foundation/components/_icon-bar.scss +0 -293
  191. data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +0 -57
  192. data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +0 -222
  193. data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +0 -61
  194. data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +0 -106
  195. data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +0 -34
  196. data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +0 -513
  197. data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +0 -368
  198. data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +0 -162
  199. data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +0 -95
  200. data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +0 -150
  201. data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +0 -79
  202. data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +0 -168
  203. data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +0 -222
  204. data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +0 -116
  205. data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +0 -191
  206. data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +0 -123
  207. data/generators/foundation5/public/stylesheets/foundation/components/_switches.scss +0 -230
  208. data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +0 -135
  209. data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +0 -123
  210. data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +0 -66
  211. data/generators/foundation5/public/stylesheets/foundation/components/_toolbar.scss +0 -70
  212. data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +0 -142
  213. data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +0 -685
  214. data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +0 -525
  215. data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +0 -408
  216. data/generators/foundation5/public/stylesheets/foundation.css +0 -6138
  217. data/generators/foundation5/public/stylesheets/foundation.css.scss +0 -45
  218. data/generators/foundation5/public/stylesheets/normalize.css +0 -357
  219. data/lib/locomotive/wagon/generators/site/foundation4.rb +0 -34
@@ -1,843 +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.2.3',
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
- tip_location : 'bottom', // 'top' or 'bottom' in relation to parent
15
- nub_position : 'auto', // override on a per tooltip bases
16
- scroll_speed : 1500, // Page scrolling speed in milliseconds, 0 = no scroll animation
17
- scroll_animation : 'linear', // supports 'swing' and 'linear', extend with jQuery UI.
18
- timer : 0, // 0 = no timer , all other numbers = timer in milliseconds
19
- start_timer_on_click : true, // true or false - true requires clicking the first button start the timer
20
- start_offset : 0, // the index of the tooltip you want to start on (index of the li)
21
- next_button : true, // true or false to control whether a next button is used
22
- tip_animation : 'fade', // 'pop' or 'fade' in each tip
23
- pause_after : [], // array of indexes where to pause the tour after
24
- exposed : [], // array of expose elements
25
- tip_animation_fade_speed : 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
26
- cookie_monster : false, // true or false to control whether cookies are used
27
- cookie_name : 'joyride', // Name the cookie you'll use
28
- cookie_domain : false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
29
- cookie_expires : 365, // set when you would like the cookie to expire.
30
- tip_container : 'body', // Where will the tip be attached
31
- abort_on_close : true, // When true, the close event will not fire any callback
32
- tip_location_patterns : {
33
- top: ['bottom'],
34
- bottom: [], // bottom should not need to be repositioned
35
- left: ['right', 'top', 'bottom'],
36
- right: ['left', 'top', 'bottom']
37
- },
38
- post_ride_callback : function (){}, // A method to call once the tour closes (canceled or complete)
39
- post_step_callback : function (){}, // A method to call after each step
40
- pre_step_callback : function (){}, // A method to call before each step
41
- pre_ride_callback : function (){}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
42
- post_expose_callback : function (){}, // A method to call after an element has been exposed
43
- 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>'
52
- },
53
- expose_add_class : '' // One or more space-separated class names to be added to exposed element
54
- },
55
-
56
- init : function (scope, method, options) {
57
- Foundation.inherit(this, 'throttle random_str');
58
-
59
- this.settings = this.settings || $.extend({}, this.defaults, (options || method));
60
-
61
- this.bindings(method, options)
62
- },
63
-
64
- events : function () {
65
- var self = this;
66
-
67
- $(this.scope)
68
- .off('.joyride')
69
- .on('click.fndtn.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
70
- 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
-
84
- }.bind(this))
85
-
86
- .on('click.fndtn.joyride', '.joyride-close-tip', function (e) {
87
- e.preventDefault();
88
- this.end(this.settings.abort_on_close);
89
- }.bind(this));
90
-
91
- $(window)
92
- .off('.joyride')
93
- .on('resize.fndtn.joyride', self.throttle(function () {
94
- if ($('[' + self.attr_name() + ']').length > 0 && self.settings.$next_tip) {
95
- if (self.settings.exposed.length > 0) {
96
- var $els = $(self.settings.exposed);
97
-
98
- $els.each(function () {
99
- var $this = $(this);
100
- self.un_expose($this);
101
- self.expose($this);
102
- });
103
- }
104
-
105
- if (self.is_phone()) {
106
- self.pos_phone();
107
- } else {
108
- self.pos_default(false);
109
- }
110
- }
111
- }, 100));
112
- },
113
-
114
- start : function () {
115
- var self = this,
116
- $this = $('[' + this.attr_name() + ']', this.scope),
117
- integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
118
- int_settings_count = integer_settings.length;
119
-
120
- if (!$this.length > 0) return;
121
-
122
- if (!this.settings.init) this.events();
123
-
124
- this.settings = $this.data(this.attr_name(true) + '-init');
125
-
126
- // non configureable settings
127
- this.settings.$content_el = $this;
128
- this.settings.$body = $(this.settings.tip_container);
129
- this.settings.body_offset = $(this.settings.tip_container).position();
130
- this.settings.$tip_content = this.settings.$content_el.find('> li');
131
- this.settings.paused = false;
132
- this.settings.attempts = 0;
133
-
134
- // can we create cookies?
135
- if (typeof $.cookie !== 'function') {
136
- this.settings.cookie_monster = false;
137
- }
138
-
139
- // generate the tips and insert into dom.
140
- if (!this.settings.cookie_monster || this.settings.cookie_monster && !$.cookie(this.settings.cookie_name)) {
141
- this.settings.$tip_content.each(function (index) {
142
- var $this = $(this);
143
- this.settings = $.extend({}, self.defaults, self.data_options($this));
144
-
145
- // Make sure that settings parsed from data_options are integers where necessary
146
- var i = int_settings_count;
147
- while (i--) {
148
- self.settings[integer_settings[i]] = parseInt(self.settings[integer_settings[i]], 10);
149
- }
150
- self.create({$li : $this, index : index});
151
- });
152
-
153
- // show first tip
154
- if (!this.settings.start_timer_on_click && this.settings.timer > 0) {
155
- this.show('init');
156
- this.startTimer();
157
- } else {
158
- this.show('init');
159
- }
160
-
161
- }
162
- },
163
-
164
- resume : function () {
165
- this.set_li();
166
- this.show();
167
- },
168
-
169
- tip_template : function (opts) {
170
- var $blank, content;
171
-
172
- opts.tip_class = opts.tip_class || '';
173
-
174
- $blank = $(this.settings.template.tip).addClass(opts.tip_class);
175
- content = $.trim($(opts.li).html()) +
176
- this.button_text(opts.button_text) +
177
- this.settings.template.link +
178
- this.timer_instance(opts.index);
179
-
180
- $blank.append($(this.settings.template.wrapper));
181
- $blank.first().attr(this.add_namespace('data-index'), opts.index);
182
- $('.joyride-content-wrapper', $blank).append(content);
183
-
184
- return $blank[0];
185
- },
186
-
187
- timer_instance : function (index) {
188
- var txt;
189
-
190
- if ((index === 0 && this.settings.start_timer_on_click && this.settings.timer > 0) || this.settings.timer === 0) {
191
- txt = '';
192
- } else {
193
- txt = $(this.settings.template.timer)[0].outerHTML;
194
- }
195
- return txt;
196
- },
197
-
198
- button_text : function (txt) {
199
- if (this.settings.next_button) {
200
- txt = $.trim(txt) || 'Next';
201
- txt = $(this.settings.template.button).append(txt)[0].outerHTML;
202
- } else {
203
- txt = '';
204
- }
205
- return txt;
206
- },
207
-
208
- create : function (opts) {
209
- var buttonText = opts.$li.attr(this.add_namespace('data-button'))
210
- || opts.$li.attr(this.add_namespace('data-text')),
211
- tipClass = opts.$li.attr('class'),
212
- $tip_content = $(this.tip_template({
213
- tip_class : tipClass,
214
- index : opts.index,
215
- button_text : buttonText,
216
- li : opts.$li
217
- }));
218
-
219
- $(this.settings.tip_container).append($tip_content);
220
- },
221
-
222
- show : function (init) {
223
- var $timer = null;
224
-
225
- // are we paused?
226
- if (this.settings.$li === undefined
227
- || ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
228
-
229
- // don't go to the next li if the tour was paused
230
- if (this.settings.paused) {
231
- this.settings.paused = false;
232
- } else {
233
- this.set_li(init);
234
- }
235
-
236
- this.settings.attempts = 0;
237
-
238
- if (this.settings.$li.length && this.settings.$target.length > 0) {
239
- if (init) { //run when we first start
240
- this.settings.pre_ride_callback(this.settings.$li.index(), this.settings.$next_tip);
241
- if (this.settings.modal) {
242
- this.show_modal();
243
- }
244
- }
245
-
246
- this.settings.pre_step_callback(this.settings.$li.index(), this.settings.$next_tip);
247
-
248
- if (this.settings.modal && this.settings.expose) {
249
- this.expose();
250
- }
251
-
252
- this.settings.tip_settings = $.extend({}, this.settings, this.data_options(this.settings.$li));
253
-
254
- this.settings.timer = parseInt(this.settings.timer, 10);
255
-
256
- this.settings.tip_settings.tip_location_pattern = this.settings.tip_location_patterns[this.settings.tip_settings.tip_location];
257
-
258
- // scroll if not modal
259
- if (!/body/i.test(this.settings.$target.selector)) {
260
- this.scroll_to();
261
- }
262
-
263
- if (this.is_phone()) {
264
- this.pos_phone(true);
265
- } else {
266
- this.pos_default(true);
267
- }
268
-
269
- $timer = this.settings.$next_tip.find('.joyride-timer-indicator');
270
-
271
- if (/pop/i.test(this.settings.tip_animation)) {
272
-
273
- $timer.width(0);
274
-
275
- if (this.settings.timer > 0) {
276
-
277
- this.settings.$next_tip.show();
278
-
279
- setTimeout(function () {
280
- $timer.animate({
281
- width: $timer.parent().width()
282
- }, this.settings.timer, 'linear');
283
- }.bind(this), this.settings.tip_animation_fade_speed);
284
-
285
- } else {
286
- this.settings.$next_tip.show();
287
-
288
- }
289
-
290
-
291
- } else if (/fade/i.test(this.settings.tip_animation)) {
292
-
293
- $timer.width(0);
294
-
295
- if (this.settings.timer > 0) {
296
-
297
- this.settings.$next_tip
298
- .fadeIn(this.settings.tip_animation_fade_speed)
299
- .show();
300
-
301
- setTimeout(function () {
302
- $timer.animate({
303
- width: $timer.parent().width()
304
- }, this.settings.timer, 'linear');
305
- }.bind(this), this.settings.tip_animation_fade_speed);
306
-
307
- } else {
308
- this.settings.$next_tip.fadeIn(this.settings.tip_animation_fade_speed);
309
- }
310
- }
311
-
312
- this.settings.$current_tip = this.settings.$next_tip;
313
-
314
- // skip non-existant targets
315
- } else if (this.settings.$li && this.settings.$target.length < 1) {
316
-
317
- this.show();
318
-
319
- } else {
320
-
321
- this.end();
322
-
323
- }
324
- } else {
325
-
326
- this.settings.paused = true;
327
-
328
- }
329
-
330
- },
331
-
332
- is_phone : function () {
333
- return matchMedia(Foundation.media_queries.small).matches &&
334
- !matchMedia(Foundation.media_queries.medium).matches;
335
- },
336
-
337
- hide : function () {
338
- if (this.settings.modal && this.settings.expose) {
339
- this.un_expose();
340
- }
341
-
342
- if (!this.settings.modal) {
343
- $('.joyride-modal-bg').hide();
344
- }
345
-
346
- // Prevent scroll bouncing...wait to remove from layout
347
- this.settings.$current_tip.css('visibility', 'hidden');
348
- setTimeout($.proxy(function() {
349
- this.hide();
350
- this.css('visibility', 'visible');
351
- }, this.settings.$current_tip), 0);
352
- this.settings.post_step_callback(this.settings.$li.index(),
353
- this.settings.$current_tip);
354
- },
355
-
356
- set_li : function (init) {
357
- if (init) {
358
- this.settings.$li = this.settings.$tip_content.eq(this.settings.start_offset);
359
- this.set_next_tip();
360
- this.settings.$current_tip = this.settings.$next_tip;
361
- } else {
362
- this.settings.$li = this.settings.$li.next();
363
- this.set_next_tip();
364
- }
365
-
366
- this.set_target();
367
- },
368
-
369
- set_next_tip : function () {
370
- this.settings.$next_tip = $(".joyride-tip-guide").eq(this.settings.$li.index());
371
- this.settings.$next_tip.data('closed', '');
372
- },
373
-
374
- set_target : function () {
375
- var cl = this.settings.$li.attr(this.add_namespace('data-class')),
376
- id = this.settings.$li.attr(this.add_namespace('data-id')),
377
- $sel = function () {
378
- if (id) {
379
- return $(document.getElementById(id));
380
- } else if (cl) {
381
- return $('.' + cl).first();
382
- } else {
383
- return $('body');
384
- }
385
- };
386
-
387
- this.settings.$target = $sel();
388
- },
389
-
390
- scroll_to : function () {
391
- var window_half, tipOffset;
392
-
393
- window_half = $(window).height() / 2;
394
- tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight());
395
-
396
- if (tipOffset != 0) {
397
- $('html, body').stop().animate({
398
- scrollTop: tipOffset
399
- }, this.settings.scroll_speed, 'swing');
400
- }
401
- },
402
-
403
- paused : function () {
404
- return ($.inArray((this.settings.$li.index() + 1), this.settings.pause_after) === -1);
405
- },
406
-
407
- restart : function () {
408
- this.hide();
409
- this.settings.$li = undefined;
410
- this.show('init');
411
- },
412
-
413
- pos_default : function (init) {
414
- var $nub = this.settings.$next_tip.find('.joyride-nub'),
415
- nub_width = Math.ceil($nub.outerWidth() / 2),
416
- nub_height = Math.ceil($nub.outerHeight() / 2),
417
- toggle = init || false;
418
-
419
- // tip must not be "display: none" to calculate position
420
- if (toggle) {
421
- this.settings.$next_tip.css('visibility', 'hidden');
422
- this.settings.$next_tip.show();
423
- }
424
-
425
- if (!/body/i.test(this.settings.$target.selector)) {
426
- if (this.bottom()) {
427
- if (this.rtl) {
428
- 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()});
431
- } else {
432
- 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});
435
- }
436
-
437
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'top');
438
-
439
- } else if (this.top()) {
440
- if (this.rtl) {
441
- this.settings.$next_tip.css({
442
- top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
443
- left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
444
- } else {
445
- 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});
448
- }
449
-
450
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'bottom');
451
-
452
- } else if (this.right()) {
453
-
454
- 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)});
457
-
458
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'left');
459
-
460
- } else if (this.left()) {
461
-
462
- 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)});
465
-
466
- this.nub_position($nub, this.settings.tip_settings.nub_position, 'right');
467
-
468
- }
469
-
470
- if (!this.visible(this.corners(this.settings.$next_tip)) && this.settings.attempts < this.settings.tip_settings.tip_location_pattern.length) {
471
-
472
- $nub.removeClass('bottom')
473
- .removeClass('top')
474
- .removeClass('right')
475
- .removeClass('left');
476
-
477
- this.settings.tip_settings.tip_location = this.settings.tip_settings.tip_location_pattern[this.settings.attempts];
478
-
479
- this.settings.attempts++;
480
-
481
- this.pos_default();
482
-
483
- }
484
-
485
- } else if (this.settings.$li.length) {
486
-
487
- this.pos_modal($nub);
488
-
489
- }
490
-
491
- if (toggle) {
492
- this.settings.$next_tip.hide();
493
- this.settings.$next_tip.css('visibility', 'visible');
494
- }
495
-
496
- },
497
-
498
- pos_phone : function (init) {
499
- var tip_height = this.settings.$next_tip.outerHeight(),
500
- tip_offset = this.settings.$next_tip.offset(),
501
- target_height = this.settings.$target.outerHeight(),
502
- $nub = $('.joyride-nub', this.settings.$next_tip),
503
- nub_height = Math.ceil($nub.outerHeight() / 2),
504
- toggle = init || false;
505
-
506
- $nub.removeClass('bottom')
507
- .removeClass('top')
508
- .removeClass('right')
509
- .removeClass('left');
510
-
511
- if (toggle) {
512
- this.settings.$next_tip.css('visibility', 'hidden');
513
- this.settings.$next_tip.show();
514
- }
515
-
516
- if (!/body/i.test(this.settings.$target.selector)) {
517
-
518
- if (this.top()) {
519
-
520
- this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height});
521
- $nub.addClass('bottom');
522
-
523
- } else {
524
-
525
- this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height});
526
- $nub.addClass('top');
527
-
528
- }
529
-
530
- } else if (this.settings.$li.length) {
531
- this.pos_modal($nub);
532
- }
533
-
534
- if (toggle) {
535
- this.settings.$next_tip.hide();
536
- this.settings.$next_tip.css('visibility', 'visible');
537
- }
538
- },
539
-
540
- pos_modal : function ($nub) {
541
- this.center();
542
- $nub.hide();
543
-
544
- this.show_modal();
545
- },
546
-
547
- show_modal : function () {
548
- if (!this.settings.$next_tip.data('closed')) {
549
- var joyridemodalbg = $('.joyride-modal-bg');
550
- if (joyridemodalbg.length < 1) {
551
- $('body').append(this.settings.template.modal).show();
552
- }
553
-
554
- if (/pop/i.test(this.settings.tip_animation)) {
555
- joyridemodalbg.show();
556
- } else {
557
- joyridemodalbg.fadeIn(this.settings.tip_animation_fade_speed);
558
- }
559
- }
560
- },
561
-
562
- expose : function () {
563
- var expose,
564
- exposeCover,
565
- el,
566
- origCSS,
567
- origClasses,
568
- randId = 'expose-' + this.random_str(6);
569
-
570
- if (arguments.length > 0 && arguments[0] instanceof $) {
571
- el = arguments[0];
572
- } else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
573
- el = this.settings.$target;
574
- } else {
575
- return false;
576
- }
577
-
578
- if(el.length < 1){
579
- if(window.console){
580
- console.error('element not valid', el);
581
- }
582
- return false;
583
- }
584
-
585
- expose = $(this.settings.template.expose);
586
- this.settings.$body.append(expose);
587
- expose.css({
588
- top: el.offset().top,
589
- left: el.offset().left,
590
- width: el.outerWidth(true),
591
- height: el.outerHeight(true)
592
- });
593
-
594
- exposeCover = $(this.settings.template.expose_cover);
595
-
596
- origCSS = {
597
- zIndex: el.css('z-index'),
598
- position: el.css('position')
599
- };
600
-
601
- origClasses = el.attr('class') == null ? '' : el.attr('class');
602
-
603
- el.css('z-index',parseInt(expose.css('z-index'))+1);
604
-
605
- if (origCSS.position == 'static') {
606
- el.css('position','relative');
607
- }
608
-
609
- el.data('expose-css',origCSS);
610
- el.data('orig-class', origClasses);
611
- el.attr('class', origClasses + ' ' + this.settings.expose_add_class);
612
-
613
- exposeCover.css({
614
- top: el.offset().top,
615
- left: el.offset().left,
616
- width: el.outerWidth(true),
617
- height: el.outerHeight(true)
618
- });
619
-
620
- if (this.settings.modal) this.show_modal();
621
-
622
- this.settings.$body.append(exposeCover);
623
- expose.addClass(randId);
624
- exposeCover.addClass(randId);
625
- el.data('expose', randId);
626
- this.settings.post_expose_callback(this.settings.$li.index(), this.settings.$next_tip, el);
627
- this.add_exposed(el);
628
- },
629
-
630
- un_expose : function () {
631
- var exposeId,
632
- el,
633
- expose ,
634
- origCSS,
635
- origClasses,
636
- clearAll = false;
637
-
638
- if (arguments.length > 0 && arguments[0] instanceof $) {
639
- el = arguments[0];
640
- } else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
641
- el = this.settings.$target;
642
- } else {
643
- return false;
644
- }
645
-
646
- if(el.length < 1){
647
- if (window.console) {
648
- console.error('element not valid', el);
649
- }
650
- return false;
651
- }
652
-
653
- exposeId = el.data('expose');
654
- expose = $('.' + exposeId);
655
-
656
- if (arguments.length > 1) {
657
- clearAll = arguments[1];
658
- }
659
-
660
- if (clearAll === true) {
661
- $('.joyride-expose-wrapper,.joyride-expose-cover').remove();
662
- } else {
663
- expose.remove();
664
- }
665
-
666
- origCSS = el.data('expose-css');
667
-
668
- if (origCSS.zIndex == 'auto') {
669
- el.css('z-index', '');
670
- } else {
671
- el.css('z-index', origCSS.zIndex);
672
- }
673
-
674
- if (origCSS.position != el.css('position')) {
675
- if(origCSS.position == 'static') {// this is default, no need to set it.
676
- el.css('position', '');
677
- } else {
678
- el.css('position', origCSS.position);
679
- }
680
- }
681
-
682
- origClasses = el.data('orig-class');
683
- el.attr('class', origClasses);
684
- el.removeData('orig-classes');
685
-
686
- el.removeData('expose');
687
- el.removeData('expose-z-index');
688
- this.remove_exposed(el);
689
- },
690
-
691
- add_exposed: function(el){
692
- this.settings.exposed = this.settings.exposed || [];
693
- if (el instanceof $ || typeof el === 'object') {
694
- this.settings.exposed.push(el[0]);
695
- } else if (typeof el == 'string') {
696
- this.settings.exposed.push(el);
697
- }
698
- },
699
-
700
- remove_exposed: function(el){
701
- var search, i;
702
- if (el instanceof $) {
703
- search = el[0]
704
- } else if (typeof el == 'string'){
705
- search = el;
706
- }
707
-
708
- this.settings.exposed = this.settings.exposed || [];
709
- i = this.settings.exposed.length;
710
-
711
- while (i--) {
712
- if (this.settings.exposed[i] == search) {
713
- this.settings.exposed.splice(i, 1);
714
- return;
715
- }
716
- }
717
- },
718
-
719
- center : function () {
720
- var $w = $(window);
721
-
722
- this.settings.$next_tip.css({
723
- top : ((($w.height() - this.settings.$next_tip.outerHeight()) / 2) + $w.scrollTop()),
724
- left : ((($w.width() - this.settings.$next_tip.outerWidth()) / 2) + $w.scrollLeft())
725
- });
726
-
727
- return true;
728
- },
729
-
730
- bottom : function () {
731
- return /bottom/i.test(this.settings.tip_settings.tip_location);
732
- },
733
-
734
- top : function () {
735
- return /top/i.test(this.settings.tip_settings.tip_location);
736
- },
737
-
738
- right : function () {
739
- return /right/i.test(this.settings.tip_settings.tip_location);
740
- },
741
-
742
- left : function () {
743
- return /left/i.test(this.settings.tip_settings.tip_location);
744
- },
745
-
746
- corners : function (el) {
747
- var w = $(window),
748
- window_half = w.height() / 2,
749
- //using this to calculate since scroll may not have finished yet.
750
- tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight()),
751
- right = w.width() + w.scrollLeft(),
752
- offsetBottom = w.height() + tipOffset,
753
- bottom = w.height() + w.scrollTop(),
754
- top = w.scrollTop();
755
-
756
- if (tipOffset < top) {
757
- if (tipOffset < 0) {
758
- top = 0;
759
- } else {
760
- top = tipOffset;
761
- }
762
- }
763
-
764
- if (offsetBottom > bottom) {
765
- bottom = offsetBottom;
766
- }
767
-
768
- return [
769
- el.offset().top < top,
770
- right < el.offset().left + el.outerWidth(),
771
- bottom < el.offset().top + el.outerHeight(),
772
- w.scrollLeft() > el.offset().left
773
- ];
774
- },
775
-
776
- visible : function (hidden_corners) {
777
- var i = hidden_corners.length;
778
-
779
- while (i--) {
780
- if (hidden_corners[i]) return false;
781
- }
782
-
783
- return true;
784
- },
785
-
786
- nub_position : function (nub, pos, def) {
787
- if (pos === 'auto') {
788
- nub.addClass(def);
789
- } else {
790
- nub.addClass(pos);
791
- }
792
- },
793
-
794
- startTimer : function () {
795
- if (this.settings.$li.length) {
796
- this.settings.automate = setTimeout(function () {
797
- this.hide();
798
- this.show();
799
- this.startTimer();
800
- }.bind(this), this.settings.timer);
801
- } else {
802
- clearTimeout(this.settings.automate);
803
- }
804
- },
805
-
806
- end : function (abort) {
807
- if (this.settings.cookie_monster) {
808
- $.cookie(this.settings.cookie_name, 'ridden', { expires: this.settings.cookie_expires, domain: this.settings.cookie_domain });
809
- }
810
-
811
- if (this.settings.timer > 0) {
812
- clearTimeout(this.settings.automate);
813
- }
814
-
815
- if (this.settings.modal && this.settings.expose) {
816
- this.un_expose();
817
- }
818
-
819
- this.settings.$next_tip.data('closed', true);
820
-
821
- $('.joyride-modal-bg').hide();
822
- this.settings.$current_tip.hide();
823
-
824
- if (typeof abort === 'undefined' || abort === false) {
825
- this.settings.post_step_callback(this.settings.$li.index(), this.settings.$current_tip);
826
- this.settings.post_ride_callback(this.settings.$li.index(), this.settings.$current_tip);
827
- }
828
-
829
- $('.joyride-tip-guide').remove();
830
- },
831
-
832
- off : function () {
833
- $(this.scope).off('.joyride');
834
- $(window).off('.joyride');
835
- $('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
836
- $('.joyride-tip-guide, .joyride-modal-bg').remove();
837
- clearTimeout(this.settings.automate);
838
- this.settings = {};
839
- },
840
-
841
- reflow : function () {}
842
- };
843
- }(jQuery, window, window.document));