zurb-foundation 3.2.5 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. data/.gitignore +6 -2
  2. data/CHANGELOG.md +1 -26
  3. data/CONTRIBUTING.md +18 -0
  4. data/Gemfile.lock +19 -0
  5. data/Gruntfile.js +27 -0
  6. data/README.md +5 -6
  7. data/{Capfile → docs/Capfile} +0 -1
  8. data/docs/Gemfile +8 -0
  9. data/docs/Gemfile.lock +43 -0
  10. data/docs/Procfile +2 -0
  11. data/docs/README.md +1 -0
  12. data/docs/_sidebar-components.html.erb +109 -0
  13. data/docs/_sidebar.html.erb +109 -0
  14. data/docs/_zurb-jobs.html.erb +5 -0
  15. data/docs/changelog.html.erb +185 -0
  16. data/docs/compile.rb +43 -0
  17. data/docs/components/alert-boxes.html.erb +202 -0
  18. data/docs/components/block-grid.html.erb +118 -0
  19. data/docs/components/breadcrumbs.html.erb +146 -0
  20. data/docs/components/button-groups.html.erb +174 -0
  21. data/docs/components/buttons.html.erb +220 -0
  22. data/docs/components/clearing.html.erb +152 -0
  23. data/docs/components/custom-forms.html.erb +306 -0
  24. data/docs/components/dropdown-buttons.html.erb +233 -0
  25. data/docs/components/dropdown.html.erb +186 -0
  26. data/docs/components/flex-video.html.erb +93 -0
  27. data/docs/components/forms.html.erb +468 -0
  28. data/docs/components/grid.html.erb +355 -0
  29. data/docs/components/inline-lists.html.erb +89 -0
  30. data/docs/components/joyride.html.erb +178 -0
  31. data/docs/components/keystrokes.html.erb +74 -0
  32. data/docs/components/labels.html.erb +98 -0
  33. data/docs/components/magellan.html.erb +84 -0
  34. data/docs/components/orbit.html.erb +262 -0
  35. data/docs/components/pagination.html.erb +181 -0
  36. data/docs/components/panels.html.erb +121 -0
  37. data/docs/components/pricing-tables.html.erb +154 -0
  38. data/docs/components/progress-bars.html.erb +120 -0
  39. data/docs/components/reveal.html.erb +147 -0
  40. data/docs/components/section.html.erb +156 -0
  41. data/docs/components/side-nav.html.erb +122 -0
  42. data/docs/components/split-buttons.html.erb +218 -0
  43. data/docs/components/sub-nav.html.erb +120 -0
  44. data/docs/components/switch.html.erb +288 -0
  45. data/docs/components/tables.html.erb +123 -0
  46. data/docs/components/thumbnails.html.erb +87 -0
  47. data/docs/components/tooltips.html.erb +73 -0
  48. data/docs/components/top-bar.html.erb +219 -0
  49. data/docs/components/type.html.erb +359 -0
  50. data/docs/components/visibility.html.erb +102 -0
  51. data/docs/config.ru +12 -0
  52. data/docs/config/deploy.rb +33 -0
  53. data/docs/controller.rb +43 -0
  54. data/docs/css/_coderay.scss +116 -0
  55. data/docs/css/_settings.scss +1 -0
  56. data/docs/css/docs.scss +174 -0
  57. data/docs/css/normalize.scss +396 -0
  58. data/docs/css/qunit-composite.css +13 -0
  59. data/docs/css/qunit.css +235 -0
  60. data/docs/faq.html.erb +61 -0
  61. data/docs/img/demos/demo1-th.png +0 -0
  62. data/docs/img/demos/demo1.png +0 -0
  63. data/docs/img/demos/demo2-th.png +0 -0
  64. data/docs/img/demos/demo2.png +0 -0
  65. data/docs/img/demos/demo3-th.png +0 -0
  66. data/docs/img/demos/demo3.png +0 -0
  67. data/docs/img/demos/demo4-th.png +0 -0
  68. data/docs/img/demos/demo4.png +0 -0
  69. data/docs/img/demos/demo5-th.png +0 -0
  70. data/docs/img/demos/demo5.png +0 -0
  71. data/docs/index.html.erb +299 -0
  72. data/docs/javascript.html.erb +133 -0
  73. data/docs/js/docs.js +3 -0
  74. data/docs/js/qunit-composite.js +105 -0
  75. data/docs/js/qunit.js +1977 -0
  76. data/docs/js/tests/tabs/simple_tabs.html +57 -0
  77. data/docs/js/tests/tabs/simple_tabs.js +54 -0
  78. data/docs/js/tests/tooltips/tooltips.html +39 -0
  79. data/docs/js/tests/tooltips/tooltips.js +11 -0
  80. data/docs/layout.html.erb +99 -0
  81. data/docs/rails.html.erb +66 -0
  82. data/docs/sass.html.erb +299 -0
  83. data/docs/support.html.erb +134 -0
  84. data/foundation.gemspec +2 -4
  85. data/index.html +3 -23
  86. data/js/foundation/foundation.alerts.js +50 -0
  87. data/js/foundation/foundation.clearing.js +478 -0
  88. data/{vendor/assets/javascripts/foundation/jquery.cookie.js → js/foundation/foundation.cookie.js} +3 -1
  89. data/js/foundation/foundation.dropdown.js +122 -0
  90. data/js/foundation/foundation.forms.js +403 -0
  91. data/js/foundation/foundation.joyride.js +613 -0
  92. data/js/foundation/foundation.js +331 -0
  93. data/js/foundation/foundation.magellan.js +130 -0
  94. data/js/foundation/foundation.orbit.js +355 -0
  95. data/{vendor/assets/javascripts/foundation/jquery.placeholder.js → js/foundation/foundation.placeholder.js} +4 -2
  96. data/js/foundation/foundation.reveal.js +264 -0
  97. data/js/foundation/foundation.section.js +180 -0
  98. data/js/foundation/foundation.tooltips.js +195 -0
  99. data/js/foundation/foundation.topbar.js +187 -0
  100. data/js/foundation/index.js +16 -0
  101. data/{vendor/assets/javascripts/foundation/modernizr.foundation.js → js/vendor/custom.modernizr.js} +0 -0
  102. data/js/vendor/jquery.js +9597 -0
  103. data/js/vendor/zepto.js +1782 -0
  104. data/lib/foundation/engine.rb +8 -1
  105. data/lib/foundation/generators/install_generator.rb +24 -1
  106. data/lib/foundation/generators/templates/application.html.erb +20 -6
  107. data/lib/foundation/generators/templates/application.html.haml +2 -6
  108. data/lib/foundation/generators/templates/application.html.slim +2 -5
  109. data/lib/foundation/version.rb +1 -1
  110. data/lib/zurb-foundation.rb +7 -9
  111. data/package.json +9 -0
  112. data/scss/foundation.scss +42 -15
  113. data/scss/foundation/_foundation-global.scss +226 -0
  114. data/scss/foundation/components/_alert-boxes.scss +106 -0
  115. data/scss/foundation/components/_block-grid.scss +63 -0
  116. data/scss/foundation/components/_breadcrumbs.scss +117 -0
  117. data/scss/foundation/components/_button-groups.scss +59 -0
  118. data/scss/foundation/components/_buttons.scss +217 -0
  119. data/scss/foundation/components/_clearing.scss +209 -0
  120. data/scss/foundation/components/_custom-forms.scss +232 -0
  121. data/scss/foundation/components/_dropdown-buttons.scss +114 -0
  122. data/scss/foundation/components/_dropdown.scss +137 -0
  123. data/scss/foundation/components/_flex-video.scss +45 -0
  124. data/scss/foundation/components/_forms.scss +309 -0
  125. data/scss/foundation/components/_grid.scss +149 -71
  126. data/scss/foundation/components/_inline-lists.scss +47 -0
  127. data/scss/foundation/components/_joyride.scss +193 -0
  128. data/scss/foundation/components/_keystrokes.scss +56 -0
  129. data/scss/foundation/components/_labels.scss +81 -0
  130. data/scss/foundation/components/_magellan.scss +15 -0
  131. data/scss/foundation/components/_orbit.scss +193 -0
  132. data/scss/foundation/components/_pagination.scss +99 -0
  133. data/scss/foundation/components/_panels.scss +76 -0
  134. data/scss/foundation/components/_pricing-tables.scss +130 -0
  135. data/scss/foundation/components/_progress-bars.scss +68 -0
  136. data/scss/foundation/components/_reveal.scss +131 -0
  137. data/scss/foundation/components/_section.scss +194 -0
  138. data/scss/foundation/components/_side-nav.scss +68 -0
  139. data/scss/foundation/components/_split-buttons.scss +159 -0
  140. data/scss/foundation/components/_sub-nav.scss +67 -0
  141. data/scss/foundation/components/_switch.scss +242 -0
  142. data/scss/foundation/components/_tables.scss +80 -0
  143. data/scss/foundation/components/_thumbs.scss +45 -0
  144. data/scss/foundation/components/_tooltips.scss +113 -0
  145. data/scss/foundation/components/_top-bar.scss +443 -0
  146. data/scss/foundation/components/_type.scss +411 -0
  147. data/scss/foundation/components/_visibility.scss +117 -0
  148. data/scss/normalize.scss +396 -0
  149. data/templates/project/config.rb +26 -0
  150. data/templates/project/index.html +28 -43
  151. data/templates/project/manifest.rb +21 -28
  152. data/templates/project/scss/_settings.scss +4 -243
  153. data/templates/project/scss/app.scss +37 -44
  154. data/templates/project/scss/normalize.scss +396 -0
  155. data/test/stylesheets/styles.css +955 -0
  156. metadata +144 -153
  157. data/config/deploy.rb +0 -42
  158. data/lib/foundation/generators/layout_generator.rb +0 -28
  159. data/scss/foundation/_settings.scss +0 -281
  160. data/scss/foundation/common/_base.scss +0 -4
  161. data/scss/foundation/common/_forms.scss +0 -117
  162. data/scss/foundation/common/_globals.scss +0 -35
  163. data/scss/foundation/common/_ratios.scss +0 -19
  164. data/scss/foundation/common/_typography.scss +0 -104
  165. data/scss/foundation/components/modules/_all.scss +0 -10
  166. data/scss/foundation/components/modules/_buttons.scss +0 -178
  167. data/scss/foundation/components/modules/_clearing.scss +0 -61
  168. data/scss/foundation/components/modules/_joyride.scss +0 -33
  169. data/scss/foundation/components/modules/_mqueries.scss +0 -458
  170. data/scss/foundation/components/modules/_navbar.scss +0 -74
  171. data/scss/foundation/components/modules/_offcanvas.scss +0 -55
  172. data/scss/foundation/components/modules/_orbit.scss +0 -90
  173. data/scss/foundation/components/modules/_reveal.scss +0 -34
  174. data/scss/foundation/components/modules/_tabs.scss +0 -67
  175. data/scss/foundation/components/modules/_topbar.scss +0 -167
  176. data/scss/foundation/components/modules/_ui.scss +0 -292
  177. data/scss/foundation/functions/_all.scss +0 -2
  178. data/scss/foundation/functions/_convert-number-to-word.scss +0 -10
  179. data/scss/foundation/functions/_grid-calc.scss +0 -5
  180. data/scss/foundation/functions/modular-scale.scss +0 -3
  181. data/scss/foundation/mixins/_all.scss +0 -5
  182. data/scss/foundation/mixins/_clearfix.scss +0 -13
  183. data/scss/foundation/mixins/_css-triangle.scss +0 -22
  184. data/scss/foundation/mixins/_font-size.scss +0 -13
  185. data/scss/foundation/mixins/_respond-to.scss +0 -11
  186. data/scss/foundation/mixins/_semantic-grid.scss +0 -66
  187. data/test/buttons.html +0 -189
  188. data/test/clearing.html +0 -85
  189. data/test/config.rb +0 -11
  190. data/test/elements.html +0 -490
  191. data/test/forms.html +0 -371
  192. data/test/grid.html +0 -543
  193. data/test/images/orbit-demo/demo1.jpeg +0 -0
  194. data/test/images/orbit-demo/demo2.jpeg +0 -0
  195. data/test/images/orbit-demo/demo3.jpeg +0 -0
  196. data/test/images/orbit-demo/slider-background.jpeg +0 -0
  197. data/test/index.html +0 -83
  198. data/test/joyride.html +0 -127
  199. data/test/magellan.html +0 -112
  200. data/test/navigation.html +0 -269
  201. data/test/orbit.html +0 -112
  202. data/test/reveal.html +0 -91
  203. data/test/scss/_settings.scss +0 -245
  204. data/test/scss/styles.scss +0 -50
  205. data/test/tabs.html +0 -197
  206. data/test/template.html +0 -52
  207. data/test/topbar-login.html +0 -194
  208. data/test/topbar.html +0 -139
  209. data/test/type.html +0 -188
  210. data/vendor/assets/images/foundation/orbit/bullets.jpg +0 -0
  211. data/vendor/assets/images/foundation/orbit/left-arrow-small.png +0 -0
  212. data/vendor/assets/images/foundation/orbit/left-arrow.png +0 -0
  213. data/vendor/assets/images/foundation/orbit/loading.gif +0 -0
  214. data/vendor/assets/images/foundation/orbit/mask-black.png +0 -0
  215. data/vendor/assets/images/foundation/orbit/pause-black.png +0 -0
  216. data/vendor/assets/images/foundation/orbit/right-arrow-small.png +0 -0
  217. data/vendor/assets/images/foundation/orbit/right-arrow.png +0 -0
  218. data/vendor/assets/images/foundation/orbit/rotator-black.png +0 -0
  219. data/vendor/assets/images/foundation/orbit/timer-black.png +0 -0
  220. data/vendor/assets/javascripts/foundation/app.js +0 -41
  221. data/vendor/assets/javascripts/foundation/index.js +0 -19
  222. data/vendor/assets/javascripts/foundation/jquery.event.move.js +0 -580
  223. data/vendor/assets/javascripts/foundation/jquery.event.swipe.js +0 -130
  224. data/vendor/assets/javascripts/foundation/jquery.foundation.accordion.js +0 -47
  225. data/vendor/assets/javascripts/foundation/jquery.foundation.alerts.js +0 -20
  226. data/vendor/assets/javascripts/foundation/jquery.foundation.buttons.js +0 -83
  227. data/vendor/assets/javascripts/foundation/jquery.foundation.clearing.js +0 -413
  228. data/vendor/assets/javascripts/foundation/jquery.foundation.forms.js +0 -502
  229. data/vendor/assets/javascripts/foundation/jquery.foundation.joyride.js +0 -639
  230. data/vendor/assets/javascripts/foundation/jquery.foundation.magellan.js +0 -96
  231. data/vendor/assets/javascripts/foundation/jquery.foundation.mediaQueryToggle.js +0 -27
  232. data/vendor/assets/javascripts/foundation/jquery.foundation.navigation.js +0 -55
  233. data/vendor/assets/javascripts/foundation/jquery.foundation.orbit.js +0 -919
  234. data/vendor/assets/javascripts/foundation/jquery.foundation.reveal.js +0 -794
  235. data/vendor/assets/javascripts/foundation/jquery.foundation.tabs.js +0 -66
  236. data/vendor/assets/javascripts/foundation/jquery.foundation.tooltips.js +0 -211
  237. data/vendor/assets/javascripts/foundation/jquery.foundation.topbar.js +0 -174
  238. data/vendor/assets/javascripts/foundation/jquery.js +0 -9555
  239. data/vendor/assets/javascripts/foundation/jquery.offcanvas.js +0 -50
@@ -1,130 +0,0 @@
1
- // jQuery.event.swipe
2
- // 0.5
3
- // Stephen Band
4
-
5
- // Dependencies
6
- // jQuery.event.move 1.2
7
-
8
- // One of swipeleft, swiperight, swipeup or swipedown is triggered on
9
- // moveend, when the move has covered a threshold ratio of the dimension
10
- // of the target node, or has gone really fast. Threshold and velocity
11
- // sensitivity changed with:
12
- //
13
- // jQuery.event.special.swipe.settings.threshold
14
- // jQuery.event.special.swipe.settings.sensitivity
15
-
16
- (function (module) {
17
- if (typeof define === 'function' && define.amd) {
18
- // AMD. Register as an anonymous module.
19
- define(['jquery'], module);
20
- } else {
21
- // Browser globals
22
- module(jQuery);
23
- }
24
- })(function(jQuery, undefined){
25
- var add = jQuery.event.add,
26
-
27
- remove = jQuery.event.remove,
28
-
29
- // Just sugar, so we can have arguments in the same order as
30
- // add and remove.
31
- trigger = function(node, type, data) {
32
- jQuery.event.trigger(type, data, node);
33
- },
34
-
35
- settings = {
36
- // Ratio of distance over target finger must travel to be
37
- // considered a swipe.
38
- threshold: 0.4,
39
- // Faster fingers can travel shorter distances to be considered
40
- // swipes. 'sensitivity' controls how much. Bigger is shorter.
41
- sensitivity: 6
42
- };
43
-
44
- function moveend(e) {
45
- var w, h, event;
46
-
47
- w = e.target.offsetWidth;
48
- h = e.target.offsetHeight;
49
-
50
- // Copy over some useful properties from the move event
51
- event = {
52
- distX: e.distX,
53
- distY: e.distY,
54
- velocityX: e.velocityX,
55
- velocityY: e.velocityY,
56
- finger: e.finger
57
- };
58
-
59
- // Find out which of the four directions was swiped
60
- if (e.distX > e.distY) {
61
- if (e.distX > -e.distY) {
62
- if (e.distX/w > settings.threshold || e.velocityX * e.distX/w * settings.sensitivity > 1) {
63
- event.type = 'swiperight';
64
- trigger(e.currentTarget, event);
65
- }
66
- }
67
- else {
68
- if (-e.distY/h > settings.threshold || e.velocityY * e.distY/w * settings.sensitivity > 1) {
69
- event.type = 'swipeup';
70
- trigger(e.currentTarget, event);
71
- }
72
- }
73
- }
74
- else {
75
- if (e.distX > -e.distY) {
76
- if (e.distY/h > settings.threshold || e.velocityY * e.distY/w * settings.sensitivity > 1) {
77
- event.type = 'swipedown';
78
- trigger(e.currentTarget, event);
79
- }
80
- }
81
- else {
82
- if (-e.distX/w > settings.threshold || e.velocityX * e.distX/w * settings.sensitivity > 1) {
83
- event.type = 'swipeleft';
84
- trigger(e.currentTarget, event);
85
- }
86
- }
87
- }
88
- }
89
-
90
- function getData(node) {
91
- var data = jQuery.data(node, 'event_swipe');
92
-
93
- if (!data) {
94
- data = { count: 0 };
95
- jQuery.data(node, 'event_swipe', data);
96
- }
97
-
98
- return data;
99
- }
100
-
101
- jQuery.event.special.swipe =
102
- jQuery.event.special.swipeleft =
103
- jQuery.event.special.swiperight =
104
- jQuery.event.special.swipeup =
105
- jQuery.event.special.swipedown = {
106
- setup: function( data, namespaces, eventHandle ) {
107
- var data = getData(this);
108
-
109
- // If another swipe event is already setup, don't setup again.
110
- if (data.count++ > 0) { return; }
111
-
112
- add(this, 'moveend', moveend);
113
-
114
- return true;
115
- },
116
-
117
- teardown: function() {
118
- var data = getData(this);
119
-
120
- // If another swipe event is still setup, don't teardown.
121
- if (--data.count > 0) { return; }
122
-
123
- remove(this, 'moveend', moveend);
124
-
125
- return true;
126
- },
127
-
128
- settings: settings
129
- };
130
- });
@@ -1,47 +0,0 @@
1
- ;(function ($, window, undefined){
2
- 'use strict';
3
-
4
- $.fn.foundationAccordion = function (options) {
5
-
6
- // DRY up the logic used to determine if the event logic should execute.
7
- var hasHover = function(accordion) {
8
- return accordion.hasClass('hover') && !Modernizr.touch
9
- };
10
-
11
- $(document).on('mouseenter', '.accordion li', function () {
12
- var p = $(this).parent();
13
-
14
- if (hasHover(p)) {
15
- var flyout = $(this).children('.content').first();
16
-
17
- $('.content', p).not(flyout).hide().parent('li').removeClass('active');
18
- flyout.show(0, function () {
19
- flyout.parent('li').addClass('active');
20
- });
21
- }
22
- }
23
- );
24
-
25
- $(document).on('click.fndtn', '.accordion li .title', function () {
26
- var li = $(this).closest('li'),
27
- p = li.parent();
28
-
29
- if(!hasHover(p)) {
30
- var flyout = li.children('.content').first();
31
-
32
- if (li.hasClass('active')) {
33
- p.find('li').removeClass('active').end().find('.content').hide();
34
- } else {
35
- $('.content', p).not(flyout).hide().parent('li').removeClass('active');
36
- flyout.show(0, function () {
37
- flyout.parent('li').addClass('active');
38
- });
39
- }
40
- }
41
- }
42
- );
43
-
44
- };
45
-
46
- })( jQuery, this );
47
-
@@ -1,20 +0,0 @@
1
- ;(function ($, window, undefined) {
2
- 'use strict';
3
-
4
- $.fn.foundationAlerts = function (options) {
5
- var settings = $.extend({
6
- callback: $.noop
7
- }, options);
8
-
9
- $(document).on("click", ".alert-box a.close", function (e) {
10
- e.preventDefault();
11
- $(this).closest(".alert-box").fadeOut(function () {
12
- $(this).remove();
13
- // Do something else after the alert closes
14
- settings.callback();
15
- });
16
- });
17
-
18
- };
19
-
20
- })(jQuery, this);
@@ -1,83 +0,0 @@
1
- ;(function ($, window, undefined) {
2
- 'use strict';
3
-
4
- $.fn.foundationButtons = function (options) {
5
- var $doc = $(document),
6
- config = $.extend({
7
- dropdownAsToggle:false,
8
- activeClass:'active'
9
- }, options),
10
-
11
- // close all dropdowns except for the dropdown passed
12
- closeDropdowns = function (dropdown) {
13
- // alert(dropdown.html());
14
- $('.button.dropdown').find('ul').not(dropdown).removeClass('show-dropdown');
15
- },
16
- // reset all toggle states except for the button passed
17
- resetToggles = function (button) {
18
- // alert(button.html());
19
- var buttons = $('.button.dropdown').not(button);
20
- buttons.add($('> span.' + config.activeClass, buttons)).removeClass(config.activeClass);
21
- };
22
-
23
- // Prevent event propagation on disabled buttons
24
- $doc.on('click.fndtn', '.button.disabled', function (e) {
25
- e.preventDefault();
26
- });
27
-
28
- $('.button.dropdown > ul', this).addClass('no-hover');
29
-
30
- // reset other active states
31
- $doc.on('click.fndtn', '.button.dropdown:not(.split), .button.dropdown.split span', function (e) {
32
- var $el = $(this),
33
- button = $el.closest('.button.dropdown'),
34
- dropdown = $('> ul', button);
35
-
36
- // If the click is registered on an actual link or on button element then do not preventDefault which stops the browser from following the link
37
- if ($.inArray(e.target.nodeName, ['A', 'BUTTON'])){
38
- e.preventDefault();
39
- }
40
-
41
- // close other dropdowns
42
- setTimeout(function () {
43
- closeDropdowns(config.dropdownAsToggle ? '' : dropdown);
44
- dropdown.toggleClass('show-dropdown');
45
-
46
- if (config.dropdownAsToggle) {
47
- resetToggles(button);
48
- $el.toggleClass(config.activeClass);
49
- }
50
- }, 0);
51
- });
52
-
53
- // close all dropdowns and deactivate all buttons
54
- $doc.on('click.fndtn', 'body, html', function (e) {
55
- if (undefined == e.originalEvent) { return; }
56
- // check original target instead of stopping event propagation to play nice with other events
57
- if (!$(e.originalEvent.target).is('.button.dropdown:not(.split), .button.dropdown.split span')) {
58
- closeDropdowns();
59
- if (config.dropdownAsToggle) {
60
- resetToggles();
61
- }
62
- }
63
- });
64
-
65
- // Positioning the Flyout List
66
- var normalButtonHeight = $('.button.dropdown:not(.large):not(.small):not(.tiny):visible', this).outerHeight() - 1,
67
- largeButtonHeight = $('.button.large.dropdown:visible', this).outerHeight() - 1,
68
- smallButtonHeight = $('.button.small.dropdown:visible', this).outerHeight() - 1,
69
- tinyButtonHeight = $('.button.tiny.dropdown:visible', this).outerHeight() - 1;
70
-
71
- $('.button.dropdown:not(.large):not(.small):not(.tiny) > ul', this).css('top', normalButtonHeight);
72
- $('.button.dropdown.large > ul', this).css('top', largeButtonHeight);
73
- $('.button.dropdown.small > ul', this).css('top', smallButtonHeight);
74
- $('.button.dropdown.tiny > ul', this).css('top', tinyButtonHeight);
75
-
76
- $('.button.dropdown.up:not(.large):not(.small):not(.tiny) > ul', this).css('top', 'auto').css('bottom', normalButtonHeight - 2);
77
- $('.button.dropdown.up.large > ul', this).css('top', 'auto').css('bottom', largeButtonHeight - 2);
78
- $('.button.dropdown.up.small > ul', this).css('top', 'auto').css('bottom', smallButtonHeight - 2);
79
- $('.button.dropdown.up.tiny > ul', this).css('top', 'auto').css('bottom', tinyButtonHeight - 2);
80
-
81
- };
82
-
83
- })( jQuery, this );
@@ -1,413 +0,0 @@
1
- /*
2
- * jQuery Foundation Clearing 1.2.1
3
- * http://foundation.zurb.com
4
- * Copyright 2012, ZURB
5
- * Free to use under the MIT license.
6
- * http://www.opensource.org/licenses/mit-license.php
7
- */
8
-
9
- /*jslint unparam: true, browser: true, indent: 2 */
10
-
11
- ;(function ($, window, document, undefined) {
12
- 'use strict';
13
-
14
- var defaults = {
15
- templates : {
16
- viewing : '<a href="#" class="clearing-close">&times;</a>' +
17
- '<div class="visible-img" style="display: none"><img src="#">' +
18
- '<p class="clearing-caption"></p><a href="#" class="clearing-main-left"></a>' +
19
- '<a href="#" class="clearing-main-right"></a></div>'
20
- },
21
-
22
- // comma delimited list of selectors that, on click, will close clearing,
23
- // add 'div.clearing-blackout, div.visible-img' to close on background click
24
- close_selectors : 'a.clearing-close',
25
-
26
- // event initializers and locks
27
- initialized : false,
28
- locked : false
29
- },
30
-
31
- cl = {
32
- init : function (options, extendMethods) {
33
- return this.find('ul[data-clearing]').each(function () {
34
- var doc = $(document),
35
- $el = $(this),
36
- options = options || {},
37
- extendMethods = extendMethods || {},
38
- settings = $el.data('fndtn.clearing.settings');
39
-
40
- if (!settings) {
41
- options.$parent = $el.parent();
42
-
43
- $el.data('fndtn.clearing.settings', $.extend({}, defaults, options));
44
-
45
- cl.assemble($el.find('li'));
46
-
47
- if (!defaults.initialized) {
48
- cl.events($el);
49
- if (Modernizr.touch) cl.swipe_events();
50
- }
51
-
52
- }
53
- });
54
- },
55
-
56
- events : function (el) {
57
- var settings = el.data('fndtn.clearing.settings');
58
-
59
- $(document)
60
- .on('click.fndtn.clearing', 'ul[data-clearing] li', function (e, current, target) {
61
- var current = current || $(this),
62
- target = target || current,
63
- settings = current.parent().data('fndtn.clearing.settings');
64
-
65
- e.preventDefault();
66
-
67
- if (!settings) {
68
- current.parent().foundationClearing();
69
- }
70
-
71
- // set current and target to the clicked li if not otherwise defined.
72
- cl.open($(e.target), current, target);
73
- cl.update_paddles(target);
74
- })
75
-
76
- .on('click.fndtn.clearing', '.clearing-main-right', function (e) { cl.nav(e, 'next') })
77
- .on('click.fndtn.clearing', '.clearing-main-left', function (e) { cl.nav(e, 'prev') })
78
- .on('click.fndtn.clearing', settings.close_selectors, this.close)
79
- .on('keydown.fndtn.clearing', this.keydown);
80
-
81
- $(window).on('resize.fndtn.clearing', this.resize);
82
-
83
- defaults.initialized = true;
84
- },
85
-
86
- swipe_events : function () {
87
- $(document)
88
- .bind('swipeleft', 'ul[data-clearing]', function (e) { cl.nav(e, 'next') })
89
- .bind('swiperight', 'ul[data-clearing]', function (e) { cl.nav(e, 'prev') })
90
- .bind('movestart', 'ul[data-clearing]', function (e) {
91
- if ((e.distX > e.distY && e.distX < -e.distY) ||
92
- (e.distX < e.distY && e.distX > -e.distY)) {
93
- e.preventDefault();
94
- }
95
- });
96
- },
97
-
98
- assemble : function ($li) {
99
- var $el = $li.parent(),
100
- settings = $el.data('fndtn.clearing.settings'),
101
- grid = $el.detach(),
102
- data = {
103
- grid: '<div class="carousel">' + this.outerHTML(grid[0]) + '</div>',
104
- viewing: settings.templates.viewing
105
- },
106
- wrapper = '<div class="clearing-assembled"><div>' + data.viewing + data.grid + '</div></div>';
107
-
108
- return settings.$parent.append(wrapper);
109
- },
110
-
111
- open : function ($image, current, target) {
112
- var root = target.closest('.clearing-assembled'),
113
- container = root.find('div:first'),
114
- visible_image = container.find('.visible-img'),
115
- image = visible_image.find('img').not($image);
116
-
117
- if (!cl.locked()) {
118
-
119
- // set the image to the selected thumbnail
120
- image.attr('src', this.load($image));
121
-
122
- image.loaded(function () {
123
- // toggle the gallery if not visible
124
- root.addClass('clearing-blackout');
125
- container.addClass('clearing-container');
126
- this.caption(visible_image.find('.clearing-caption'), $image);
127
- visible_image.show();
128
- this.fix_height(target);
129
- this.center(image);
130
-
131
- // shift the thumbnails if necessary
132
- this.shift(current, target, function () {
133
- target.siblings().removeClass('visible');
134
- target.addClass('visible');
135
- });
136
- }.bind(this));
137
- }
138
- },
139
-
140
- close : function (e) {
141
- e.preventDefault();
142
-
143
- var root = (function (target) {
144
- if (/blackout/.test(target.selector)) {
145
- return target;
146
- } else {
147
- return target.closest('.clearing-blackout');
148
- }
149
- }($(this))), container, visible_image;
150
-
151
- if (this === e.target && root) {
152
- container = root.find('div:first'),
153
- visible_image = container.find('.visible-img');
154
-
155
- defaults.prev_index = 0;
156
-
157
- root.find('ul[data-clearing]').attr('style', '')
158
- root.removeClass('clearing-blackout');
159
- container.removeClass('clearing-container');
160
- visible_image.hide();
161
- }
162
-
163
- return false;
164
- },
165
-
166
- keydown : function (e) {
167
- var clearing = $('.clearing-blackout').find('ul[data-clearing]');
168
-
169
- if (e.which === 39) cl.go(clearing, 'next');
170
- if (e.which === 37) cl.go(clearing, 'prev');
171
- if (e.which === 27) $('a.clearing-close').trigger('click');
172
- },
173
-
174
- nav : function (e, direction) {
175
- var clearing = $('.clearing-blackout').find('ul[data-clearing]');
176
-
177
- e.preventDefault();
178
- this.go(clearing, direction);
179
- },
180
-
181
- resize : function () {
182
- var image = $('.clearing-blackout .visible-img').find('img');
183
-
184
- if (image.length > 0) {
185
- cl.center(image);
186
- }
187
- },
188
-
189
- fix_height : function (target) {
190
- var lis = target.siblings();
191
-
192
- lis.each(function () {
193
- var li = $(this),
194
- image = li.find('img');
195
-
196
- if (li.height() > image.outerHeight()) {
197
- li.addClass('fix-height');
198
- }
199
- })
200
- .closest('ul').width(lis.length * 100 + '%');
201
- },
202
-
203
- update_paddles : function (target) {
204
- var visible_image = target.closest('.carousel').siblings('.visible-img');
205
-
206
- if (target.next().length > 0) {
207
- visible_image.find('.clearing-main-right').removeClass('disabled');
208
- } else {
209
- visible_image.find('.clearing-main-right').addClass('disabled');
210
- }
211
-
212
- if (target.prev().length > 0) {
213
- visible_image.find('.clearing-main-left').removeClass('disabled');
214
- } else {
215
- visible_image.find('.clearing-main-left').addClass('disabled');
216
- }
217
- },
218
-
219
- load : function ($image) {
220
- var href = $image.parent().attr('href');
221
-
222
- this.preload($image);
223
-
224
- if (href) return href;
225
- return $image.attr('src');
226
- },
227
-
228
- preload : function ($image) {
229
- this.img($image.closest('li').next());
230
- this.img($image.closest('li').prev());
231
- },
232
-
233
- img : function (img) {
234
- if (img.length > 0) {
235
- var new_img = new Image(),
236
- new_a = img.find('a');
237
-
238
- if (new_a.length > 0) {
239
- new_img.src = new_a.attr('href');
240
- } else {
241
- new_img.src = img.find('img').attr('src');
242
- }
243
- }
244
- },
245
-
246
- caption : function (container, $image) {
247
- var caption = $image.data('caption');
248
-
249
- if (caption) {
250
- container.text(caption).show();
251
- } else {
252
- container.text('').hide();
253
- }
254
- },
255
-
256
- go : function ($ul, direction) {
257
- var current = $ul.find('.visible'),
258
- target = current[direction]();
259
-
260
- if (target.length > 0) {
261
- target.find('img').trigger('click', [current, target]);
262
- }
263
- },
264
-
265
- shift : function (current, target, callback) {
266
- var clearing = target.parent(),
267
- old_index = defaults.prev_index,
268
- direction = this.direction(clearing, current, target),
269
- left = parseInt(clearing.css('left'), 10),
270
- width = target.outerWidth(),
271
- skip_shift;
272
-
273
- // we use jQuery animate instead of CSS transitions because we
274
- // need a callback to unlock the next animation
275
- if (target.index() !== old_index && !/skip/.test(direction)){
276
- if (/left/.test(direction)) {
277
- this.lock();
278
- clearing.animate({left : left + width}, 300, this.unlock);
279
- } else if (/right/.test(direction)) {
280
- this.lock();
281
- clearing.animate({left : left - width}, 300, this.unlock);
282
- }
283
- } else if (/skip/.test(direction)) {
284
-
285
- // the target image is not adjacent to the current image, so
286
- // do we scroll right or not
287
- skip_shift = target.index() - defaults.up_count;
288
- this.lock();
289
-
290
- if (skip_shift > 0) {
291
- clearing.animate({left : -(skip_shift * width)}, 300, this.unlock);
292
- } else {
293
- clearing.animate({left : 0}, 300, this.unlock);
294
- }
295
- }
296
-
297
- callback();
298
- },
299
-
300
- lock : function () {
301
- defaults.locked = true;
302
- },
303
-
304
- unlock : function () {
305
- defaults.locked = false;
306
- },
307
-
308
- locked : function () {
309
- return defaults.locked;
310
- },
311
-
312
- direction : function ($el, current, target) {
313
- var lis = $el.find('li'),
314
- li_width = lis.outerWidth() + (lis.outerWidth() / 4),
315
- up_count = Math.floor($('.clearing-container').outerWidth() / li_width) - 1,
316
- target_index = lis.index(target),
317
- response;
318
-
319
- defaults.up_count = up_count;
320
-
321
- if (this.adjacent(defaults.prev_index, target_index)) {
322
- if ((target_index > up_count) && target_index > defaults.prev_index) {
323
- response = 'right';
324
- } else if ((target_index > up_count - 1) && target_index <= defaults.prev_index) {
325
- response = 'left';
326
- } else {
327
- response = false;
328
- }
329
- } else {
330
- response = 'skip';
331
- }
332
-
333
- defaults.prev_index = target_index;
334
-
335
- return response;
336
- },
337
-
338
- adjacent : function (current_index, target_index) {
339
- for (var i = target_index + 1; i >= target_index - 1; i--) {
340
- if (i === current_index) return true;
341
- }
342
- return false;
343
- },
344
-
345
- center : function (target) {
346
- target.css({
347
- marginLeft : -(target.outerWidth() / 2),
348
- marginTop : -(target.outerHeight() / 2)
349
- });
350
- },
351
-
352
- outerHTML : function (el) {
353
- // support FireFox < 11
354
- return el.outerHTML || new XMLSerializer().serializeToString(el);
355
- }
356
-
357
- };
358
-
359
- $.fn.foundationClearing = function (method) {
360
- if (cl[method]) {
361
- return cl[method].apply(this, Array.prototype.slice.call(arguments, 1));
362
- } else if (typeof method === 'object' || !method) {
363
- return cl.init.apply(this, arguments);
364
- } else {
365
- $.error('Method ' + method + ' does not exist on jQuery.foundationClearing');
366
- }
367
- };
368
-
369
- // jquery.imageready.js
370
- // @weblinc, @jsantell, (c) 2012
371
-
372
- (function( $ ) {
373
- $.fn.loaded = function ( callback, userSettings ) {
374
- var
375
- options = $.extend( {}, $.fn.loaded.defaults, userSettings ),
376
- $images = this.find( 'img' ).add( this.filter( 'img' ) ),
377
- unloadedImages = $images.length;
378
-
379
- function loaded () {
380
- unloadedImages -= 1;
381
- !unloadedImages && callback();
382
- }
383
-
384
- function bindLoad () {
385
- this.one( 'load', loaded );
386
- if ( $.browser.msie ) {
387
- var
388
- src = this.attr( 'src' ),
389
- param = src.match( /\?/ ) ? '&' : '?';
390
- param += options.cachePrefix + '=' + ( new Date() ).getTime();
391
- this.attr( 'src', src + param );
392
- }
393
- }
394
-
395
- return $images.each(function () {
396
- var $this = $( this );
397
- if ( !$this.attr( 'src' ) ) {
398
- loaded();
399
- return;
400
- }
401
- this.complete || this.readyState === 4 ?
402
- loaded() :
403
- bindLoad.call( $this );
404
- });
405
- };
406
-
407
- $.fn.loaded.defaults = {
408
- cachePrefix: 'random'
409
- };
410
-
411
- }(jQuery));
412
-
413
- }(jQuery, this, this.document));