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,794 +0,0 @@
1
- /*
2
- * jQuery Reveal Plugin 1.1
3
- * www.ZURB.com
4
- * Copyright 2010, ZURB
5
- * Free to use under the MIT license.
6
- * http://www.opensource.org/licenses/mit-license.php
7
- */
8
- /*globals jQuery */
9
-
10
- (function ($) {
11
- 'use strict';
12
- //
13
- // Global variable.
14
- // Helps us determine if the current modal is being queued for display.
15
- //
16
- var modalQueued = false;
17
-
18
- //
19
- // Bind the live 'click' event to all anchor elemnets with the data-reveal-id attribute.
20
- //
21
- $(document).on('click', 'a[data-reveal-id]', function ( event ) {
22
- //
23
- // Prevent default action of the event.
24
- //
25
- event.preventDefault();
26
- //
27
- // Get the clicked anchor data-reveal-id attribute value.
28
- //
29
- var modalLocation = $( this ).attr( 'data-reveal-id' );
30
- //
31
- // Find the element with that modalLocation id and call the reveal plugin.
32
- //
33
- $( '#' + modalLocation ).reveal( $( this ).data() );
34
-
35
- });
36
-
37
- /**
38
- * @module reveal
39
- * @property {Object} [options] Reveal options
40
- */
41
- $.fn.reveal = function ( options ) {
42
- /*
43
- * Cache the document object.
44
- */
45
- var $doc = $( document ),
46
- /*
47
- * Default property values.
48
- */
49
- defaults = {
50
- /**
51
- * Possible options: fade, fadeAndPop, none
52
- *
53
- * @property animation
54
- * @type {String}
55
- * @default fadeAndPop
56
- */
57
- animation: 'fadeAndPop',
58
- /**
59
- * Speed at which the reveal should show. How fast animtions are.
60
- *
61
- * @property animationSpeed
62
- * @type {Integer}
63
- * @default 300
64
- */
65
- animationSpeed: 300,
66
- /**
67
- * Should the modal close when the background is clicked?
68
- *
69
- * @property closeOnBackgroundClick
70
- * @type {Boolean}
71
- * @default true
72
- */
73
- closeOnBackgroundClick: true,
74
- /**
75
- * Specify a class name for the 'close modal' element.
76
- * This element will close an open modal.
77
- *
78
- @example
79
- <a href='#close' class='close-reveal-modal'>Close Me</a>
80
- *
81
- * @property dismissModalClass
82
- * @type {String}
83
- * @default close-reveal-modal
84
- */
85
- dismissModalClass: 'close-reveal-modal',
86
- /**
87
- * Specify a callback function that triggers 'before' the modal opens.
88
- *
89
- * @property open
90
- * @type {Function}
91
- * @default function(){}
92
- */
93
- open: $.noop,
94
- /**
95
- * Specify a callback function that triggers 'after' the modal is opened.
96
- *
97
- * @property opened
98
- * @type {Function}
99
- * @default function(){}
100
- */
101
- opened: $.noop,
102
- /**
103
- * Specify a callback function that triggers 'before' the modal prepares to close.
104
- *
105
- * @property close
106
- * @type {Function}
107
- * @default function(){}
108
- */
109
- close: $.noop,
110
- /**
111
- * Specify a callback function that triggers 'after' the modal is closed.
112
- *
113
- * @property closed
114
- * @type {Function}
115
- * @default function(){}
116
- */
117
- closed: $.noop
118
- }
119
- ;
120
- //
121
- // Extend the default options.
122
- // This replaces the passed in option (options) values with default values.
123
- //
124
- options = $.extend( {}, defaults, options );
125
-
126
- //
127
- // Apply the plugin functionality to each element in the jQuery collection.
128
- //
129
- return this.not('.reveal-modal.open').each( function () {
130
- //
131
- // Cache the modal element
132
- //
133
- var modal = $( this ),
134
- //
135
- // Get the current css 'top' property value in decimal format.
136
- //
137
- topMeasure = parseInt( modal.css( 'top' ), 10 ),
138
- //
139
- // Calculate the top offset.
140
- //
141
- topOffset = modal.height() + topMeasure,
142
- //
143
- // Helps determine if the modal is locked.
144
- // This way we keep the modal from triggering while it's in the middle of animating.
145
- //
146
- locked = false,
147
- //
148
- // Get the modal background element.
149
- //
150
- modalBg = $( '.reveal-modal-bg' ),
151
- //
152
- // Show modal properties
153
- //
154
- cssOpts = {
155
- //
156
- // Used, when we show the modal.
157
- //
158
- open : {
159
- //
160
- // Set the 'top' property to the document scroll minus the calculated top offset.
161
- //
162
- 'top': 0,
163
- //
164
- // Opacity gets set to 0.
165
- //
166
- 'opacity': 0,
167
- //
168
- // Show the modal
169
- //
170
- 'visibility': 'visible',
171
- //
172
- // Ensure it's displayed as a block element.
173
- //
174
- 'display': 'block'
175
- },
176
- //
177
- // Used, when we hide the modal.
178
- //
179
- close : {
180
- //
181
- // Set the default 'top' property value.
182
- //
183
- 'top': topMeasure,
184
- //
185
- // Has full opacity.
186
- //
187
- 'opacity': 1,
188
- //
189
- // Hide the modal
190
- //
191
- 'visibility': 'hidden',
192
- //
193
- // Ensure the elment is hidden.
194
- //
195
- 'display': 'none'
196
- }
197
-
198
- },
199
- //
200
- // Initial closeButton variable.
201
- //
202
- $closeButton
203
- ;
204
-
205
- //
206
- // Do we have a modal background element?
207
- //
208
- if ( modalBg.length === 0 ) {
209
- //
210
- // No we don't. So, let's create one.
211
- //
212
- modalBg = $( '<div />', { 'class' : 'reveal-modal-bg' } )
213
- //
214
- // Then insert it after the modal element.
215
- //
216
- .insertAfter( modal );
217
- //
218
- // Now, fade it out a bit.
219
- //
220
- modalBg.fadeTo( 'fast', 0.8 );
221
- }
222
-
223
- //
224
- // Helper Methods
225
- //
226
-
227
- /**
228
- * Unlock the modal for animation.
229
- *
230
- * @method unlockModal
231
- */
232
- function unlockModal() {
233
- locked = false;
234
- }
235
-
236
- /**
237
- * Lock the modal to prevent further animation.
238
- *
239
- * @method lockModal
240
- */
241
- function lockModal() {
242
- locked = true;
243
- }
244
-
245
- /**
246
- * Closes all open modals.
247
- *
248
- * @method closeOpenModal
249
- */
250
- function closeOpenModals() {
251
- //
252
- // Get all reveal-modal elements with the .open class.
253
- //
254
- var $openModals = $( ".reveal-modal.open" );
255
- //
256
- // Do we have modals to close?
257
- //
258
- if ( $openModals.length === 1 ) {
259
- //
260
- // Set the modals for animation queuing.
261
- //
262
- modalQueued = true;
263
- //
264
- // Trigger the modal close event.
265
- //
266
- $openModals.trigger( "reveal:close" );
267
- }
268
-
269
- }
270
- /**
271
- * Animates the modal opening.
272
- * Handles the modal 'open' event.
273
- *
274
- * @method openAnimation
275
- */
276
- function openAnimation() {
277
- //
278
- // First, determine if we're in the middle of animation.
279
- //
280
- if ( !locked ) {
281
- //
282
- // We're not animating, let's lock the modal for animation.
283
- //
284
- lockModal();
285
- //
286
- // Close any opened modals.
287
- //
288
- closeOpenModals();
289
- //
290
- // Now, add the open class to this modal.
291
- //
292
- modal.addClass( "open" );
293
-
294
- //
295
- // Are we executing the 'fadeAndPop' animation?
296
- //
297
- if ( options.animation === "fadeAndPop" ) {
298
- //
299
- // Yes, we're doing the 'fadeAndPop' animation.
300
- // Okay, set the modal css properties.
301
- //
302
- //
303
- // Set the 'top' property to the document scroll minus the calculated top offset.
304
- //
305
- cssOpts.open.top = $doc.scrollTop() - topOffset;
306
- //
307
- // Flip the opacity to 0.
308
- //
309
- cssOpts.open.opacity = 0;
310
- //
311
- // Set the css options.
312
- //
313
- modal.css( cssOpts.open );
314
- //
315
- // Fade in the background element, at half the speed of the modal element.
316
- // So, faster than the modal element.
317
- //
318
- modalBg.fadeIn( options.animationSpeed / 2 );
319
-
320
- //
321
- // Let's delay the next animation queue.
322
- // We'll wait until the background element is faded in.
323
- //
324
- modal.delay( options.animationSpeed / 2 )
325
- //
326
- // Animate the following css properties.
327
- //
328
- .animate( {
329
- //
330
- // Set the 'top' property to the document scroll plus the calculated top measure.
331
- //
332
- "top": $doc.scrollTop() + topMeasure + 'px',
333
- //
334
- // Set it to full opacity.
335
- //
336
- "opacity": 1
337
-
338
- },
339
- /*
340
- * Fade speed.
341
- */
342
- options.animationSpeed,
343
- /*
344
- * End of animation callback.
345
- */
346
- function () {
347
- //
348
- // Trigger the modal reveal:opened event.
349
- // This should trigger the functions set in the options.opened property.
350
- //
351
- modal.trigger( 'reveal:opened' );
352
-
353
- }); // end of animate.
354
-
355
- } // end if 'fadeAndPop'
356
-
357
- //
358
- // Are executing the 'fade' animation?
359
- //
360
- if ( options.animation === "fade" ) {
361
- //
362
- // Yes, were executing 'fade'.
363
- // Okay, let's set the modal properties.
364
- //
365
- cssOpts.open.top = $doc.scrollTop() + topMeasure;
366
- //
367
- // Flip the opacity to 0.
368
- //
369
- cssOpts.open.opacity = 0;
370
- //
371
- // Set the css options.
372
- //
373
- modal.css( cssOpts.open );
374
- //
375
- // Fade in the modal background at half the speed of the modal.
376
- // So, faster than modal.
377
- //
378
- modalBg.fadeIn( options.animationSpeed / 2 );
379
-
380
- //
381
- // Delay the modal animation.
382
- // Wait till the modal background is done animating.
383
- //
384
- modal.delay( options.animationSpeed / 2 )
385
- //
386
- // Now animate the modal.
387
- //
388
- .animate( {
389
- //
390
- // Set to full opacity.
391
- //
392
- "opacity": 1
393
- },
394
-
395
- /*
396
- * Animation speed.
397
- */
398
- options.animationSpeed,
399
-
400
- /*
401
- * End of animation callback.
402
- */
403
- function () {
404
- //
405
- // Trigger the modal reveal:opened event.
406
- // This should trigger the functions set in the options.opened property.
407
- //
408
- modal.trigger( 'reveal:opened' );
409
-
410
- });
411
-
412
- } // end if 'fade'
413
-
414
- //
415
- // Are we not animating?
416
- //
417
- if ( options.animation === "none" ) {
418
- //
419
- // We're not animating.
420
- // Okay, let's set the modal css properties.
421
- //
422
- //
423
- // Set the top property.
424
- //
425
- cssOpts.open.top = $doc.scrollTop() + topMeasure;
426
- //
427
- // Set the opacity property to full opacity, since we're not fading (animating).
428
- //
429
- cssOpts.open.opacity = 1;
430
- //
431
- // Set the css property.
432
- //
433
- modal.css( cssOpts.open );
434
- //
435
- // Show the modal Background.
436
- //
437
- modalBg.css( { "display": "block" } );
438
- //
439
- // Trigger the modal opened event.
440
- //
441
- modal.trigger( 'reveal:opened' );
442
-
443
- } // end if animating 'none'
444
-
445
- }// end if !locked
446
-
447
- }// end openAnimation
448
-
449
-
450
- function openVideos() {
451
- var video = modal.find('.flex-video'),
452
- iframe = video.find('iframe');
453
- if (iframe.length > 0) {
454
- iframe.attr("src", iframe.data("src"));
455
- video.fadeIn(100);
456
- }
457
- }
458
-
459
- //
460
- // Bind the reveal 'open' event.
461
- // When the event is triggered, openAnimation is called
462
- // along with any function set in the options.open property.
463
- //
464
- modal.bind( 'reveal:open.reveal', openAnimation );
465
- modal.bind( 'reveal:open.reveal', openVideos);
466
-
467
- /**
468
- * Closes the modal element(s)
469
- * Handles the modal 'close' event.
470
- *
471
- * @method closeAnimation
472
- */
473
- function closeAnimation() {
474
- //
475
- // First, determine if we're in the middle of animation.
476
- //
477
- if ( !locked ) {
478
- //
479
- // We're not animating, let's lock the modal for animation.
480
- //
481
- lockModal();
482
- //
483
- // Clear the modal of the open class.
484
- //
485
- modal.removeClass( "open" );
486
-
487
- //
488
- // Are we using the 'fadeAndPop' animation?
489
- //
490
- if ( options.animation === "fadeAndPop" ) {
491
- //
492
- // Yes, okay, let's set the animation properties.
493
- //
494
- modal.animate( {
495
- //
496
- // Set the top property to the document scrollTop minus calculated topOffset.
497
- //
498
- "top": $doc.scrollTop() - topOffset + 'px',
499
- //
500
- // Fade the modal out, by using the opacity property.
501
- //
502
- "opacity": 0
503
-
504
- },
505
- /*
506
- * Fade speed.
507
- */
508
- options.animationSpeed / 2,
509
- /*
510
- * End of animation callback.
511
- */
512
- function () {
513
- //
514
- // Set the css hidden options.
515
- //
516
- modal.css( cssOpts.close );
517
-
518
- });
519
- //
520
- // Is the modal animation queued?
521
- //
522
- if ( !modalQueued ) {
523
- //
524
- // Oh, the modal(s) are mid animating.
525
- // Let's delay the animation queue.
526
- //
527
- modalBg.delay( options.animationSpeed )
528
- //
529
- // Fade out the modal background.
530
- //
531
- .fadeOut(
532
- /*
533
- * Animation speed.
534
- */
535
- options.animationSpeed,
536
- /*
537
- * End of animation callback.
538
- */
539
- function () {
540
- //
541
- // Trigger the modal 'closed' event.
542
- // This should trigger any method set in the options.closed property.
543
- //
544
- modal.trigger( 'reveal:closed' );
545
-
546
- });
547
-
548
- } else {
549
- //
550
- // We're not mid queue.
551
- // Trigger the modal 'closed' event.
552
- // This should trigger any method set in the options.closed propety.
553
- //
554
- modal.trigger( 'reveal:closed' );
555
-
556
- } // end if !modalQueued
557
-
558
- } // end if animation 'fadeAndPop'
559
-
560
- //
561
- // Are we using the 'fade' animation.
562
- //
563
- if ( options.animation === "fade" ) {
564
- //
565
- // Yes, we're using the 'fade' animation.
566
- //
567
- modal.animate( { "opacity" : 0 },
568
- /*
569
- * Animation speed.
570
- */
571
- options.animationSpeed,
572
- /*
573
- * End of animation callback.
574
- */
575
- function () {
576
- //
577
- // Set the css close options.
578
- //
579
- modal.css( cssOpts.close );
580
-
581
- }); // end animate
582
-
583
- //
584
- // Are we mid animating the modal(s)?
585
- //
586
- if ( !modalQueued ) {
587
- //
588
- // Oh, the modal(s) are mid animating.
589
- // Let's delay the animation queue.
590
- //
591
- modalBg.delay( options.animationSpeed )
592
- //
593
- // Let's fade out the modal background element.
594
- //
595
- .fadeOut(
596
- /*
597
- * Animation speed.
598
- */
599
- options.animationSpeed,
600
- /*
601
- * End of animation callback.
602
- */
603
- function () {
604
- //
605
- // Trigger the modal 'closed' event.
606
- // This should trigger any method set in the options.closed propety.
607
- //
608
- modal.trigger( 'reveal:closed' );
609
-
610
- }); // end fadeOut
611
-
612
- } else {
613
- //
614
- // We're not mid queue.
615
- // Trigger the modal 'closed' event.
616
- // This should trigger any method set in the options.closed propety.
617
- //
618
- modal.trigger( 'reveal:closed' );
619
-
620
- } // end if !modalQueued
621
-
622
- } // end if animation 'fade'
623
-
624
- //
625
- // Are we not animating?
626
- //
627
- if ( options.animation === "none" ) {
628
- //
629
- // We're not animating.
630
- // Set the modal close css options.
631
- //
632
- modal.css( cssOpts.close );
633
- //
634
- // Is the modal in the middle of an animation queue?
635
- //
636
- if ( !modalQueued ) {
637
- //
638
- // It's not mid queueu. Just hide it.
639
- //
640
- modalBg.css( { 'display': 'none' } );
641
- }
642
- //
643
- // Trigger the modal 'closed' event.
644
- // This should trigger any method set in the options.closed propety.
645
- //
646
- modal.trigger( 'reveal:closed' );
647
-
648
- } // end if not animating
649
- //
650
- // Reset the modalQueued variable.
651
- //
652
- modalQueued = false;
653
- } // end if !locked
654
-
655
- } // end closeAnimation
656
-
657
- /**
658
- * Destroys the modal and it's events.
659
- *
660
- * @method destroy
661
- */
662
- function destroy() {
663
- //
664
- // Unbind all .reveal events from the modal.
665
- //
666
- modal.unbind( '.reveal' );
667
- //
668
- // Unbind all .reveal events from the modal background.
669
- //
670
- modalBg.unbind( '.reveal' );
671
- //
672
- // Unbind all .reveal events from the modal 'close' button.
673
- //
674
- $closeButton.unbind( '.reveal' );
675
- //
676
- // Unbind all .reveal events from the body.
677
- //
678
- $( 'body' ).unbind( '.reveal' );
679
-
680
- }
681
-
682
- function closeVideos() {
683
- var video = modal.find('.flex-video'),
684
- iframe = video.find('iframe');
685
- if (iframe.length > 0) {
686
- iframe.data("src", iframe.attr("src"));
687
- iframe.attr("src", "");
688
- video.fadeOut(100);
689
- }
690
- }
691
-
692
- //
693
- // Bind the modal 'close' event
694
- //
695
- modal.bind( 'reveal:close.reveal', closeAnimation );
696
- modal.bind( 'reveal:closed.reveal', closeVideos );
697
- //
698
- // Bind the modal 'opened' + 'closed' event
699
- // Calls the unlockModal method.
700
- //
701
- modal.bind( 'reveal:opened.reveal reveal:closed.reveal', unlockModal );
702
- //
703
- // Bind the modal 'closed' event.
704
- // Calls the destroy method.
705
- //
706
- modal.bind( 'reveal:closed.reveal', destroy );
707
- //
708
- // Bind the modal 'open' event
709
- // Handled by the options.open property function.
710
- //
711
- modal.bind( 'reveal:open.reveal', options.open );
712
- //
713
- // Bind the modal 'opened' event.
714
- // Handled by the options.opened property function.
715
- //
716
- modal.bind( 'reveal:opened.reveal', options.opened );
717
- //
718
- // Bind the modal 'close' event.
719
- // Handled by the options.close property function.
720
- //
721
- modal.bind( 'reveal:close.reveal', options.close );
722
- //
723
- // Bind the modal 'closed' event.
724
- // Handled by the options.closed property function.
725
- //
726
- modal.bind( 'reveal:closed.reveal', options.closed );
727
-
728
- //
729
- // We're running this for the first time.
730
- // Trigger the modal 'open' event.
731
- //
732
- modal.trigger( 'reveal:open' );
733
-
734
- //
735
- // Get the closeButton variable element(s).
736
- //
737
- $closeButton = $( '.' + options.dismissModalClass )
738
- //
739
- // Bind the element 'click' event and handler.
740
- //
741
- .bind( 'click.reveal', function () {
742
- //
743
- // Trigger the modal 'close' event.
744
- //
745
- modal.trigger( 'reveal:close' );
746
-
747
- });
748
-
749
- //
750
- // Should we close the modal background on click?
751
- //
752
- if ( options.closeOnBackgroundClick ) {
753
- //
754
- // Yes, close the modal background on 'click'
755
- // Set the modal background css 'cursor' propety to pointer.
756
- // Adds a pointer symbol when you mouse over the modal background.
757
- //
758
- modalBg.css( { "cursor": "pointer" } );
759
- //
760
- // Bind a 'click' event handler to the modal background.
761
- //
762
- modalBg.bind( 'click.reveal', function () {
763
- //
764
- // Trigger the modal 'close' event.
765
- //
766
- modal.trigger( 'reveal:close' );
767
-
768
- });
769
-
770
- }
771
-
772
- //
773
- // Bind keyup functions on the body element.
774
- // We'll want to close the modal when the 'escape' key is hit.
775
- //
776
- $( 'body' ).bind( 'keyup.reveal', function ( event ) {
777
- //
778
- // Did the escape key get triggered?
779
- //
780
- if ( event.which === 27 ) { // 27 is the keycode for the Escape key
781
- //
782
- // Escape key was triggered.
783
- // Trigger the modal 'close' event.
784
- //
785
- modal.trigger( 'reveal:close' );
786
- }
787
-
788
- }); // end $(body)
789
-
790
- }); // end this.each
791
-
792
- }; // end $.fn
793
-
794
- } ( jQuery ) );