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,167 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- Foundation.libs.tab = {
5
- name : 'tab',
6
-
7
- version : '5.2.3',
8
-
9
- settings : {
10
- active_class: 'active',
11
- callback : function () {},
12
- deep_linking: false,
13
- scroll_to_content: true,
14
- is_hover: false
15
- },
16
-
17
- default_tab_hashes: [],
18
-
19
- init : function (scope, method, options) {
20
- var self = this,
21
- S = this.S;
22
-
23
- this.bindings(method, options);
24
- this.handle_location_hash_change();
25
-
26
- // Store the default active tabs which will be referenced when the
27
- // location hash is absent, as in the case of navigating the tabs and
28
- // returning to the first viewing via the browser Back button.
29
- S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () {
30
- self.default_tab_hashes.push(this.hash);
31
- });
32
- },
33
-
34
- events : function () {
35
- var self = this,
36
- S = this.S;
37
-
38
- S(this.scope)
39
- .off('.tab')
40
- // Click event: tab title
41
- .on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) {
42
- var settings = S(this).closest('[' + self.attr_name() +']').data(self.attr_name(true) + '-init');
43
- if (!settings.is_hover || Modernizr.touch) {
44
- e.preventDefault();
45
- e.stopPropagation();
46
- self.toggle_active_tab(S(this).parent());
47
- }
48
- })
49
- // Hover event: tab title
50
- .on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) {
51
- var settings = S(this).closest('[' + self.attr_name() +']').data(self.attr_name(true) + '-init');
52
- if (settings.is_hover) self.toggle_active_tab(S(this).parent());
53
- });
54
-
55
- // Location hash change event
56
- S(window).on('hashchange.fndtn.tab', function (e) {
57
- e.preventDefault();
58
- self.handle_location_hash_change();
59
- });
60
- },
61
-
62
- handle_location_hash_change : function () {
63
- var self = this,
64
- S = this.S;
65
-
66
- S('[' + this.attr_name() + ']', this.scope).each(function () {
67
- var settings = S(this).data(self.attr_name(true) + '-init');
68
- if (settings.deep_linking) {
69
- // Match the location hash to a label
70
- var hash = self.scope.location.hash;
71
- if (hash != '') {
72
- // Check whether the location hash references a tab content div or
73
- // another element on the page (inside or outside the tab content div)
74
- var hash_element = S(hash);
75
- if (hash_element.hasClass('content') && hash_element.parent().hasClass('tab-content')) {
76
- // Tab content div
77
- self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + hash + ']').parent());
78
- } else {
79
- // Not the tab content div. If inside the tab content, find the
80
- // containing tab and toggle it as active.
81
- var hash_tab_container_id = hash_element.closest('.content').attr('id');
82
- if (hash_tab_container_id != undefined) {
83
- self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=#' + hash_tab_container_id + ']').parent(), hash);
84
- }
85
- }
86
- } else {
87
- // Reference the default tab hashes which were initialized in the init function
88
- for (var ind in self.default_tab_hashes) {
89
- self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + self.default_tab_hashes[ind] + ']').parent());
90
- }
91
- }
92
- }
93
- });
94
- },
95
-
96
- toggle_active_tab: function (tab, location_hash) {
97
- var S = this.S,
98
- tabs = tab.closest('[' + this.attr_name() + ']'),
99
- anchor = tab.children('a').first(),
100
- target_hash = '#' + anchor.attr('href').split('#')[1],
101
- target = S(target_hash),
102
- siblings = tab.siblings(),
103
- settings = tabs.data(this.attr_name(true) + '-init');
104
-
105
- // allow usage of data-tab-content attribute instead of href
106
- if (S(this).data(this.data_attr('tab-content'))) {
107
- target_hash = '#' + S(this).data(this.data_attr('tab-content')).split('#')[1];
108
- target = S(target_hash);
109
- }
110
-
111
- if (settings.deep_linking) {
112
- // Get the scroll Y position prior to moving to the hash ID
113
- var cur_ypos = $('body,html').scrollTop();
114
-
115
- // Update the location hash to preserve browser history
116
- // Note that the hash does not need to correspond to the
117
- // tab content ID anchor; it can be an ID inside or outside of the tab
118
- // content div.
119
- if (location_hash != undefined) {
120
- window.location.hash = location_hash;
121
- } else {
122
- window.location.hash = target_hash;
123
- }
124
-
125
- if (settings.scroll_to_content) {
126
- // If the user is requesting the content of a tab, then scroll to the
127
- // top of the title area; otherwise, scroll to the element within
128
- // the content area as defined by the hash value.
129
- if (location_hash == undefined || location_hash == target_hash) {
130
- tab.parent()[0].scrollIntoView();
131
- } else {
132
- S(target_hash)[0].scrollIntoView();
133
- }
134
- } else {
135
- // Adjust the scrollbar to the Y position prior to setting the hash
136
- // Only do this for the tab content anchor, otherwise there will be
137
- // conflicts with in-tab anchor links nested in the tab-content div
138
- if (location_hash == undefined || location_hash == target_hash) {
139
- $('body,html').scrollTop(cur_ypos);
140
- }
141
- }
142
- }
143
-
144
- // WARNING: The activation and deactivation of the tab content must
145
- // occur after the deep linking in order to properly refresh the browser
146
- // window (notably in Chrome).
147
- tab.addClass(settings.active_class).triggerHandler('opened');
148
- siblings.removeClass(settings.active_class);
149
- target.siblings().removeClass(settings.active_class).end().addClass(settings.active_class);
150
- settings.callback(tab);
151
- target.triggerHandler('toggled', [tab]);
152
- tabs.triggerHandler('toggled', [target]);
153
- },
154
-
155
- data_attr: function (str) {
156
- if (this.namespace.length > 0) {
157
- return this.namespace + '-' + str;
158
- }
159
-
160
- return str;
161
- },
162
-
163
- off : function () {},
164
-
165
- reflow : function () {}
166
- };
167
- }(jQuery, window, window.document));
@@ -1,298 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- Foundation.libs.tooltip = {
5
- name : 'tooltip',
6
-
7
- version : '5.2.3',
8
-
9
- settings : {
10
- additional_inheritable_classes : [],
11
- tooltip_class : '.tooltip',
12
- append_to: 'body',
13
- touch_close_text: 'Tap To Close',
14
- disable_for_touch: false,
15
- hover_delay: 200,
16
- show_on : 'all',
17
- tip_template : function (selector, content) {
18
- return '<span data-selector="' + selector + '" class="'
19
- + Foundation.libs.tooltip.settings.tooltip_class.substring(1)
20
- + '">' + content + '<span class="nub"></span></span>';
21
- }
22
- },
23
-
24
- cache : {},
25
-
26
- init : function (scope, method, options) {
27
- Foundation.inherit(this, 'random_str');
28
- this.bindings(method, options);
29
- },
30
-
31
- should_show: function (target, tip) {
32
- var settings = $.extend({}, this.settings, this.data_options(target));
33
-
34
- if (settings.show_on === 'all') {
35
- return true;
36
- } else if (this.small() && settings.show_on === 'small') {
37
- return true;
38
- } else if (this.medium() && settings.show_on === 'medium') {
39
- return true;
40
- } else if (this.large() && settings.show_on === 'large') {
41
- return true;
42
- }
43
- return false;
44
- },
45
-
46
- medium : function () {
47
- return matchMedia(Foundation.media_queries['medium']).matches;
48
- },
49
-
50
- large : function () {
51
- return matchMedia(Foundation.media_queries['large']).matches;
52
- },
53
-
54
- events : function (instance) {
55
- var self = this,
56
- S = self.S;
57
-
58
- self.create(this.S(instance));
59
-
60
- $(this.scope)
61
- .off('.tooltip')
62
- .on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip',
63
- '[' + this.attr_name() + ']', function (e) {
64
- var $this = S(this),
65
- settings = $.extend({}, self.settings, self.data_options($this)),
66
- is_touch = false;
67
-
68
- if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type) && S(e.target).is('a')) {
69
- return false;
70
- }
71
-
72
- if (/mouse/i.test(e.type) && self.ie_touch(e)) return false;
73
-
74
- if ($this.hasClass('open')) {
75
- if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) e.preventDefault();
76
- self.hide($this);
77
- } else {
78
- if (settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
79
- return;
80
- } else if(!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
81
- e.preventDefault();
82
- S(settings.tooltip_class + '.open').hide();
83
- is_touch = true;
84
- }
85
-
86
- if (/enter|over/i.test(e.type)) {
87
- this.timer = setTimeout(function () {
88
- var tip = self.showTip($this);
89
- }.bind(this), self.settings.hover_delay);
90
- } else if (e.type === 'mouseout' || e.type === 'mouseleave') {
91
- clearTimeout(this.timer);
92
- self.hide($this);
93
- } else {
94
- self.showTip($this);
95
- }
96
- }
97
- })
98
- .on('mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', '[' + this.attr_name() + '].open', function (e) {
99
- if (/mouse/i.test(e.type) && self.ie_touch(e)) return false;
100
-
101
- if($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') {
102
- return;
103
- }
104
- else if($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {
105
- self.convert_to_touch($(this));
106
- } else {
107
- self.hide($(this));
108
- }
109
- })
110
- .on('DOMNodeRemoved DOMAttrModified', '[' + this.attr_name() + ']:not(a)', function (e) {
111
- self.hide(S(this));
112
- });
113
- },
114
-
115
- ie_touch : function (e) {
116
- // How do I distinguish between IE11 and Windows Phone 8?????
117
- return false;
118
- },
119
-
120
- showTip : function ($target) {
121
- var $tip = this.getTip($target);
122
- if (this.should_show($target, $tip)){
123
- return this.show($target);
124
- }
125
- return;
126
- },
127
-
128
- getTip : function ($target) {
129
- var selector = this.selector($target),
130
- settings = $.extend({}, this.settings, this.data_options($target)),
131
- tip = null;
132
-
133
- if (selector) {
134
- tip = this.S('span[data-selector="' + selector + '"]' + settings.tooltip_class);
135
- }
136
-
137
- return (typeof tip === 'object') ? tip : false;
138
- },
139
-
140
- selector : function ($target) {
141
- var id = $target.attr('id'),
142
- dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
143
-
144
- if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') {
145
- dataSelector = this.random_str(6);
146
- $target.attr('data-selector', dataSelector);
147
- }
148
-
149
- return (id && id.length > 0) ? id : dataSelector;
150
- },
151
-
152
- create : function ($target) {
153
- var self = this,
154
- settings = $.extend({}, this.settings, this.data_options($target)),
155
- tip_template = this.settings.tip_template;
156
-
157
- if (typeof settings.tip_template === 'string' && window.hasOwnProperty(settings.tip_template)) {
158
- tip_template = window[settings.tip_template];
159
- }
160
-
161
- var $tip = $(tip_template(this.selector($target), $('<div></div>').html($target.attr('title')).html())),
162
- classes = this.inheritable_classes($target);
163
-
164
- $tip.addClass(classes).appendTo(settings.append_to);
165
-
166
- if (Modernizr.touch) {
167
- $tip.append('<span class="tap-to-close">'+settings.touch_close_text+'</span>');
168
- $tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function(e) {
169
- self.hide($target);
170
- });
171
- }
172
-
173
- $target.removeAttr('title').attr('title','');
174
- },
175
-
176
- reposition : function (target, tip, classes) {
177
- var width, nub, nubHeight, nubWidth, column, objPos;
178
-
179
- tip.css('visibility', 'hidden').show();
180
-
181
- width = target.data('width');
182
- nub = tip.children('.nub');
183
- nubHeight = nub.outerHeight();
184
- nubWidth = nub.outerHeight();
185
-
186
- if (this.small()) {
187
- tip.css({'width' : '100%' });
188
- } else {
189
- tip.css({'width' : (width) ? width : 'auto'});
190
- }
191
-
192
- objPos = function (obj, top, right, bottom, left, width) {
193
- return obj.css({
194
- 'top' : (top) ? top : 'auto',
195
- 'bottom' : (bottom) ? bottom : 'auto',
196
- 'left' : (left) ? left : 'auto',
197
- 'right' : (right) ? right : 'auto'
198
- }).end();
199
- };
200
-
201
- objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', target.offset().left);
202
-
203
- if (this.small()) {
204
- objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', 12.5, $(this.scope).width());
205
- tip.addClass('tip-override');
206
- objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
207
- } else {
208
- var left = target.offset().left;
209
- if (Foundation.rtl) {
210
- nub.addClass('rtl');
211
- left = target.offset().left + target.outerWidth() - tip.outerWidth();
212
- }
213
- objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', left);
214
- tip.removeClass('tip-override');
215
- if (classes && classes.indexOf('tip-top') > -1) {
216
- if (Foundation.rtl) nub.addClass('rtl');
217
- objPos(tip, (target.offset().top - tip.outerHeight()), 'auto', 'auto', left)
218
- .removeClass('tip-override');
219
- } else if (classes && classes.indexOf('tip-left') > -1) {
220
- objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left - tip.outerWidth() - nubHeight))
221
- .removeClass('tip-override');
222
- nub.removeClass('rtl');
223
- } else if (classes && classes.indexOf('tip-right') > -1) {
224
- objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left + target.outerWidth() + nubHeight))
225
- .removeClass('tip-override');
226
- nub.removeClass('rtl');
227
- }
228
- }
229
-
230
- tip.css('visibility', 'visible').hide();
231
- },
232
-
233
- small : function () {
234
- return matchMedia(Foundation.media_queries.small).matches &&
235
- !matchMedia(Foundation.media_queries.medium).matches;
236
- },
237
-
238
- inheritable_classes : function ($target) {
239
- var settings = $.extend({}, this.settings, this.data_options($target)),
240
- inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'radius', 'round'].concat(settings.additional_inheritable_classes),
241
- classes = $target.attr('class'),
242
- filtered = classes ? $.map(classes.split(' '), function (el, i) {
243
- if ($.inArray(el, inheritables) !== -1) {
244
- return el;
245
- }
246
- }).join(' ') : '';
247
-
248
- return $.trim(filtered);
249
- },
250
-
251
- convert_to_touch : function($target) {
252
- var self = this,
253
- $tip = self.getTip($target),
254
- settings = $.extend({}, self.settings, self.data_options($target));
255
-
256
- if ($tip.find('.tap-to-close').length === 0) {
257
- $tip.append('<span class="tap-to-close">'+settings.touch_close_text+'</span>');
258
- $tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function(e) {
259
- self.hide($target);
260
- });
261
- }
262
-
263
- $target.data('tooltip-open-event-type', 'touch');
264
- },
265
-
266
- show : function ($target) {
267
- var $tip = this.getTip($target);
268
-
269
- if ($target.data('tooltip-open-event-type') == 'touch') {
270
- this.convert_to_touch($target);
271
- }
272
-
273
- this.reposition($target, $tip, $target.attr('class'));
274
- $target.addClass('open');
275
- $tip.fadeIn(150);
276
- },
277
-
278
- hide : function ($target) {
279
- var $tip = this.getTip($target);
280
-
281
- $tip.fadeOut(150, function() {
282
- $tip.find('.tap-to-close').remove();
283
- $tip.off('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose');
284
- $target.removeClass('open');
285
- });
286
- },
287
-
288
- off : function () {
289
- var self = this;
290
- this.S(this.scope).off('.fndtn.tooltip');
291
- this.S(this.settings.tooltip_class).each(function (i) {
292
- $('[' + self.attr_name() + ']').eq(i).attr('title', $(this).text());
293
- }).remove();
294
- },
295
-
296
- reflow : function () {}
297
- };
298
- }(jQuery, window, window.document));