va_common 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +4 -0
  4. data/CODE_OF_CONDUCT.md +13 -0
  5. data/Gemfile +4 -0
  6. data/README.md +66 -0
  7. data/Rakefile +1 -0
  8. data/app/assets/fonts/merriweather-bold-webfont.eot +0 -0
  9. data/app/assets/fonts/merriweather-bold-webfont.svg +294 -0
  10. data/app/assets/fonts/merriweather-bold-webfont.ttf +0 -0
  11. data/app/assets/fonts/merriweather-bold-webfont.woff +0 -0
  12. data/app/assets/fonts/merriweather-bold-webfont.woff2 +0 -0
  13. data/app/assets/fonts/merriweather-italic-webfont.eot +0 -0
  14. data/app/assets/fonts/merriweather-italic-webfont.svg +283 -0
  15. data/app/assets/fonts/merriweather-italic-webfont.ttf +0 -0
  16. data/app/assets/fonts/merriweather-italic-webfont.woff +0 -0
  17. data/app/assets/fonts/merriweather-italic-webfont.woff2 +0 -0
  18. data/app/assets/fonts/merriweather-light-webfont.eot +0 -0
  19. data/app/assets/fonts/merriweather-light-webfont.svg +299 -0
  20. data/app/assets/fonts/merriweather-light-webfont.ttf +0 -0
  21. data/app/assets/fonts/merriweather-light-webfont.woff +0 -0
  22. data/app/assets/fonts/merriweather-light-webfont.woff2 +0 -0
  23. data/app/assets/fonts/merriweather-regular-webfont.eot +0 -0
  24. data/app/assets/fonts/merriweather-regular-webfont.svg +294 -0
  25. data/app/assets/fonts/merriweather-regular-webfont.ttf +0 -0
  26. data/app/assets/fonts/merriweather-regular-webfont.woff +0 -0
  27. data/app/assets/fonts/merriweather-regular-webfont.woff2 +0 -0
  28. data/app/assets/fonts/sourcesanspro-bold-webfont.eot +0 -0
  29. data/app/assets/fonts/sourcesanspro-bold-webfont.svg +965 -0
  30. data/app/assets/fonts/sourcesanspro-bold-webfont.ttf +0 -0
  31. data/app/assets/fonts/sourcesanspro-bold-webfont.woff +0 -0
  32. data/app/assets/fonts/sourcesanspro-bold-webfont.woff2 +0 -0
  33. data/app/assets/fonts/sourcesanspro-italic-webfont.eot +0 -0
  34. data/app/assets/fonts/sourcesanspro-italic-webfont.svg +853 -0
  35. data/app/assets/fonts/sourcesanspro-italic-webfont.ttf +0 -0
  36. data/app/assets/fonts/sourcesanspro-italic-webfont.woff +0 -0
  37. data/app/assets/fonts/sourcesanspro-italic-webfont.woff2 +0 -0
  38. data/app/assets/fonts/sourcesanspro-light-webfont.eot +0 -0
  39. data/app/assets/fonts/sourcesanspro-light-webfont.svg +915 -0
  40. data/app/assets/fonts/sourcesanspro-light-webfont.ttf +0 -0
  41. data/app/assets/fonts/sourcesanspro-light-webfont.woff +0 -0
  42. data/app/assets/fonts/sourcesanspro-light-webfont.woff2 +0 -0
  43. data/app/assets/fonts/sourcesanspro-regular-webfont.eot +0 -0
  44. data/app/assets/fonts/sourcesanspro-regular-webfont.svg +989 -0
  45. data/app/assets/fonts/sourcesanspro-regular-webfont.ttf +0 -0
  46. data/app/assets/fonts/sourcesanspro-regular-webfont.woff +0 -0
  47. data/app/assets/fonts/sourcesanspro-regular-webfont.woff2 +0 -0
  48. data/app/assets/images/design/background/thread.png +0 -0
  49. data/app/assets/images/design/logo/logo-alt-hover.png +0 -0
  50. data/app/assets/images/design/logo/logo-alt.png +0 -0
  51. data/app/assets/images/design/logo/logo-hover.png +0 -0
  52. data/app/assets/images/design/logo/logo-small.png +0 -0
  53. data/app/assets/images/design/logo/logo.png +0 -0
  54. data/app/assets/images/design/logo/og-image.jpg +0 -0
  55. data/app/assets/images/design/seal/seal-footer.png +0 -0
  56. data/app/assets/images/design/seal/seal-footer.svg +1 -0
  57. data/app/assets/images/design/seal/seal.png +0 -0
  58. data/app/assets/images/design/seal/stars.png +0 -0
  59. data/app/assets/images/icons/apple-touch-icon-114x114.png +0 -0
  60. data/app/assets/images/icons/apple-touch-icon-152x152.png +0 -0
  61. data/app/assets/images/icons/apple-touch-icon-72x72.png +0 -0
  62. data/app/assets/images/icons/apple-touch-icon.png +0 -0
  63. data/app/assets/images/icons/favicon.ico +0 -0
  64. data/app/assets/images/icons/va.png +0 -0
  65. data/app/assets/images/icons/watermark.png +0 -0
  66. data/app/assets/images/icons/wrench.png +0 -0
  67. data/app/assets/images/social-icons/png/facebook25.png +0 -0
  68. data/app/assets/images/social-icons/png/rss25.png +0 -0
  69. data/app/assets/images/social-icons/png/twitter16.png +0 -0
  70. data/app/assets/images/social-icons/png/youtube15.png +0 -0
  71. data/app/assets/images/social-icons/svg/facebook25.svg +11 -0
  72. data/app/assets/images/social-icons/svg/rss25.svg +1 -0
  73. data/app/assets/images/social-icons/svg/twitter16.svg +15 -0
  74. data/app/assets/images/social-icons/svg/youtube15.svg +1 -0
  75. data/app/assets/js/components.js +376 -0
  76. data/app/assets/js/foundation/foundation.abide.js +408 -0
  77. data/app/assets/js/foundation/foundation.accordion.js +88 -0
  78. data/app/assets/js/foundation/foundation.alert.js +43 -0
  79. data/app/assets/js/foundation/foundation.clearing.js +586 -0
  80. data/app/assets/js/foundation/foundation.dropdown.js +463 -0
  81. data/app/assets/js/foundation/foundation.equalizer.js +104 -0
  82. data/app/assets/js/foundation/foundation.interchange.js +359 -0
  83. data/app/assets/js/foundation/foundation.joyride.js +932 -0
  84. data/app/assets/js/foundation/foundation.js +725 -0
  85. data/app/assets/js/foundation/foundation.magellan.js +215 -0
  86. data/app/assets/js/foundation/foundation.offcanvas.js +152 -0
  87. data/app/assets/js/foundation/foundation.orbit.js +476 -0
  88. data/app/assets/js/foundation/foundation.reveal.js +498 -0
  89. data/app/assets/js/foundation/foundation.slider.js +281 -0
  90. data/app/assets/js/foundation/foundation.tab.js +249 -0
  91. data/app/assets/js/foundation/foundation.tooltip.js +339 -0
  92. data/app/assets/js/foundation/foundation.topbar.js +458 -0
  93. data/app/assets/js/foundation.min.js +6376 -0
  94. data/app/assets/js/scripts-no-touch.js +33 -0
  95. data/app/assets/js/scripts-touch.js +33 -0
  96. data/app/assets/js/va_common_main.js +1 -0
  97. data/app/assets/js/vendor/classie.js +80 -0
  98. data/app/assets/js/vendor/html5shiv.js +8 -0
  99. data/app/assets/js/vendor/jquery-1.11.0.min.js +4 -0
  100. data/app/assets/js/vendor/jquery.js +9789 -0
  101. data/app/assets/js/vendor/jquery.smooth-scroll.js +255 -0
  102. data/app/assets/js/vendor/jquery.stellar.js +651 -0
  103. data/app/assets/js/vendor/jquery.tipsy.js +258 -0
  104. data/app/assets/js/vendor/menu.js +40 -0
  105. data/app/assets/js/vendor/modernizr.custom.js +4 -0
  106. data/app/assets/js/vendor/nwmatcher-1.2.5-min.js +7 -0
  107. data/app/assets/js/vendor/respond.min.js +6 -0
  108. data/app/assets/js/vendor/scroll-settings.js +3 -0
  109. data/app/assets/js/vendor/selectivizr-1.0.3b.js +560 -0
  110. data/app/assets/js/vendor/stellar-settings.js +8 -0
  111. data/app/assets/js/vendor/svg-injector.js +450 -0
  112. data/app/assets/js/vendor/tota11y.min.js +28 -0
  113. data/app/assets/js/vendor/wow.min.js +2 -0
  114. data/app/assets/stylesheets/_va.scss +2377 -0
  115. data/app/assets/stylesheets/components/_accordions.scss +98 -0
  116. data/app/assets/stylesheets/core/_base.scss +20 -0
  117. data/app/assets/stylesheets/core/_defaults.scss +92 -0
  118. data/app/assets/stylesheets/core/_grid-settings.scss +10 -0
  119. data/app/assets/stylesheets/core/_grid.scss +116 -0
  120. data/app/assets/stylesheets/core/_utilities.scss +105 -0
  121. data/app/assets/stylesheets/core/_variables.scss +88 -0
  122. data/app/assets/stylesheets/elements/_buttons.scss +189 -0
  123. data/app/assets/stylesheets/elements/_figure.scss +9 -0
  124. data/app/assets/stylesheets/elements/_inputs.scss +328 -0
  125. data/app/assets/stylesheets/elements/_labels.scss +39 -0
  126. data/app/assets/stylesheets/elements/_list.scss +82 -0
  127. data/app/assets/stylesheets/elements/_table.scss +39 -0
  128. data/app/assets/stylesheets/elements/_typography.scss +220 -0
  129. data/app/assets/stylesheets/foundation/_functions.scss +146 -0
  130. data/app/assets/stylesheets/foundation/_settings.scss +1467 -0
  131. data/app/assets/stylesheets/foundation/_variables.scss +1286 -0
  132. data/app/assets/stylesheets/foundation/components/_accordion.scss +157 -0
  133. data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +128 -0
  134. data/app/assets/stylesheets/foundation/components/_block-grid.scss +132 -0
  135. data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +132 -0
  136. data/app/assets/stylesheets/foundation/components/_button-groups.scss +200 -0
  137. data/app/assets/stylesheets/foundation/components/_buttons.scss +259 -0
  138. data/app/assets/stylesheets/foundation/components/_clearing.scss +256 -0
  139. data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +131 -0
  140. data/app/assets/stylesheets/foundation/components/_dropdown.scss +262 -0
  141. data/app/assets/stylesheets/foundation/components/_flex-video.scss +51 -0
  142. data/app/assets/stylesheets/foundation/components/_forms.scss +570 -0
  143. data/app/assets/stylesheets/foundation/components/_global.scss +481 -0
  144. data/app/assets/stylesheets/foundation/components/_grid.scss +289 -0
  145. data/app/assets/stylesheets/foundation/components/_icon-bar.scss +358 -0
  146. data/app/assets/stylesheets/foundation/components/_inline-lists.scss +57 -0
  147. data/app/assets/stylesheets/foundation/components/_joyride.scss +222 -0
  148. data/app/assets/stylesheets/foundation/components/_keystrokes.scss +61 -0
  149. data/app/assets/stylesheets/foundation/components/_labels.scss +106 -0
  150. data/app/assets/stylesheets/foundation/components/_magellan.scss +34 -0
  151. data/app/assets/stylesheets/foundation/components/_offcanvas.scss +515 -0
  152. data/app/assets/stylesheets/foundation/components/_orbit.scss +368 -0
  153. data/app/assets/stylesheets/foundation/components/_pagination.scss +162 -0
  154. data/app/assets/stylesheets/foundation/components/_panels.scss +101 -0
  155. data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +150 -0
  156. data/app/assets/stylesheets/foundation/components/_progress-bars.scss +79 -0
  157. data/app/assets/stylesheets/foundation/components/_range-slider.scss +169 -0
  158. data/app/assets/stylesheets/foundation/components/_reveal.scss +202 -0
  159. data/app/assets/stylesheets/foundation/components/_side-nav.scss +116 -0
  160. data/app/assets/stylesheets/foundation/components/_split-buttons.scss +199 -0
  161. data/app/assets/stylesheets/foundation/components/_sub-nav.scss +123 -0
  162. data/app/assets/stylesheets/foundation/components/_switches.scss +238 -0
  163. data/app/assets/stylesheets/foundation/components/_tables.scss +135 -0
  164. data/app/assets/stylesheets/foundation/components/_tabs.scss +123 -0
  165. data/app/assets/stylesheets/foundation/components/_thumbs.scss +66 -0
  166. data/app/assets/stylesheets/foundation/components/_toolbar.scss +70 -0
  167. data/app/assets/stylesheets/foundation/components/_tooltips.scss +142 -0
  168. data/app/assets/stylesheets/foundation/components/_top-bar.scss +691 -0
  169. data/app/assets/stylesheets/foundation/components/_type.scss +525 -0
  170. data/app/assets/stylesheets/foundation/components/_visibility.scss +408 -0
  171. data/app/assets/stylesheets/functions/_new-breakpoint.scss +49 -0
  172. data/app/assets/stylesheets/functions/_private.scss +114 -0
  173. data/app/assets/stylesheets/lib/_normalize.scss +427 -0
  174. data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
  175. data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +87 -0
  176. data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +26 -0
  177. data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +48 -0
  178. data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +25 -0
  179. data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +25 -0
  180. data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +64 -0
  181. data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +25 -0
  182. data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +30 -0
  183. data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +31 -0
  184. data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +27 -0
  185. data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +26 -0
  186. data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +26 -0
  187. data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +48 -0
  188. data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +66 -0
  189. data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +25 -0
  190. data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +51 -0
  191. data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +112 -0
  192. data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +34 -0
  193. data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +63 -0
  194. data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +29 -0
  195. data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +43 -0
  196. data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +3 -0
  197. data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +3 -0
  198. data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +42 -0
  199. data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +55 -0
  200. data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +59 -0
  201. data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +4 -0
  202. data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +47 -0
  203. data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +4 -0
  204. data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +287 -0
  205. data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +24 -0
  206. data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +4 -0
  207. data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +10 -0
  208. data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +4 -0
  209. data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +14 -0
  210. data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +36 -0
  211. data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +38 -0
  212. data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +8 -0
  213. data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +8 -0
  214. data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +39 -0
  215. data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +42 -0
  216. data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +19 -0
  217. data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +15 -0
  218. data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +71 -0
  219. data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +3 -0
  220. data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +11 -0
  221. data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +20 -0
  222. data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +26 -0
  223. data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +11 -0
  224. data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +21 -0
  225. data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +11 -0
  226. data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +13 -0
  227. data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +69 -0
  228. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +13 -0
  229. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +15 -0
  230. data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +24 -0
  231. data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +17 -0
  232. data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +24 -0
  233. data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +22 -0
  234. data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +27 -0
  235. data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +21 -0
  236. data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +96 -0
  237. data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +43 -0
  238. data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +13 -0
  239. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +25 -0
  240. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +41 -0
  241. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +61 -0
  242. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
  243. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +69 -0
  244. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +50 -0
  245. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +18 -0
  246. data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +26 -0
  247. data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +10 -0
  248. data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +50 -0
  249. data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +7 -0
  250. data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +9 -0
  251. data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +1 -0
  252. data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +8 -0
  253. data/app/assets/stylesheets/lib/neat/_neat.scss +23 -0
  254. data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +49 -0
  255. data/app/assets/stylesheets/lib/neat/functions/_private.scss +114 -0
  256. data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +15 -0
  257. data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +33 -0
  258. data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +28 -0
  259. data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +22 -0
  260. data/app/assets/stylesheets/lib/neat/grid/_media.scss +92 -0
  261. data/app/assets/stylesheets/lib/neat/grid/_omega.scss +87 -0
  262. data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +38 -0
  263. data/app/assets/stylesheets/lib/neat/grid/_pad.scss +25 -0
  264. data/app/assets/stylesheets/lib/neat/grid/_private.scss +35 -0
  265. data/app/assets/stylesheets/lib/neat/grid/_row.scss +52 -0
  266. data/app/assets/stylesheets/lib/neat/grid/_shift.scss +50 -0
  267. data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +94 -0
  268. data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +97 -0
  269. data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +42 -0
  270. data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +13 -0
  271. data/app/assets/stylesheets/lib/neat/settings/_grid.scss +51 -0
  272. data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +27 -0
  273. data/app/assets/stylesheets/va_common_main.css.scss +18 -0
  274. data/bin/console +14 -0
  275. data/bin/setup +7 -0
  276. data/lib/generators/files/_footer.html.erb +89 -0
  277. data/lib/generators/files/_header.html.erb +7 -0
  278. data/lib/generators/va_common_generator.rb +6 -0
  279. data/lib/generators/va_footer_generator.rb +7 -0
  280. data/lib/generators/va_header_generator.rb +7 -0
  281. data/lib/va_common/engine.rb +4 -0
  282. data/lib/va_common/version.rb +3 -0
  283. data/lib/va_common.rb +2 -0
  284. data/va_common.gemspec +22 -0
  285. metadata +354 -0
@@ -0,0 +1,498 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Foundation.libs.reveal = {
5
+ name : 'reveal',
6
+
7
+ version : '5.5.2',
8
+
9
+ locked : false,
10
+
11
+ settings : {
12
+ animation : 'fadeAndPop',
13
+ animation_speed : 250,
14
+ close_on_background_click : true,
15
+ close_on_esc : true,
16
+ dismiss_modal_class : 'close-reveal-modal',
17
+ multiple_opened : false,
18
+ bg_class : 'reveal-modal-bg',
19
+ root_element : 'body',
20
+ open : function(){},
21
+ opened : function(){},
22
+ close : function(){},
23
+ closed : function(){},
24
+ on_ajax_error: $.noop,
25
+ bg : $('.reveal-modal-bg'),
26
+ css : {
27
+ open : {
28
+ 'opacity' : 0,
29
+ 'visibility' : 'visible',
30
+ 'display' : 'block'
31
+ },
32
+ close : {
33
+ 'opacity' : 1,
34
+ 'visibility' : 'hidden',
35
+ 'display' : 'none'
36
+ }
37
+ }
38
+ },
39
+
40
+ init : function (scope, method, options) {
41
+ $.extend(true, this.settings, method, options);
42
+ this.bindings(method, options);
43
+ },
44
+
45
+ events : function (scope) {
46
+ var self = this,
47
+ S = self.S;
48
+
49
+ S(this.scope)
50
+ .off('.reveal')
51
+ .on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) {
52
+ e.preventDefault();
53
+
54
+ if (!self.locked) {
55
+ var element = S(this),
56
+ ajax = element.data(self.data_attr('reveal-ajax')),
57
+ replaceContentSel = element.data(self.data_attr('reveal-replace-content'));
58
+
59
+ self.locked = true;
60
+
61
+ if (typeof ajax === 'undefined') {
62
+ self.open.call(self, element);
63
+ } else {
64
+ var url = ajax === true ? element.attr('href') : ajax;
65
+ self.open.call(self, element, {url : url}, { replaceContentSel : replaceContentSel });
66
+ }
67
+ }
68
+ });
69
+
70
+ S(document)
71
+ .on('click.fndtn.reveal', this.close_targets(), function (e) {
72
+ e.preventDefault();
73
+ if (!self.locked) {
74
+ var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init') || self.settings,
75
+ bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];
76
+
77
+ if (bg_clicked) {
78
+ if (settings.close_on_background_click) {
79
+ e.stopPropagation();
80
+ } else {
81
+ return;
82
+ }
83
+ }
84
+
85
+ self.locked = true;
86
+ self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open:not(.toback)') : S(this).closest('[' + self.attr_name() + ']'));
87
+ }
88
+ });
89
+
90
+ if (S('[' + self.attr_name() + ']', this.scope).length > 0) {
91
+ S(this.scope)
92
+ // .off('.reveal')
93
+ .on('open.fndtn.reveal', this.settings.open)
94
+ .on('opened.fndtn.reveal', this.settings.opened)
95
+ .on('opened.fndtn.reveal', this.open_video)
96
+ .on('close.fndtn.reveal', this.settings.close)
97
+ .on('closed.fndtn.reveal', this.settings.closed)
98
+ .on('closed.fndtn.reveal', this.close_video);
99
+ } else {
100
+ S(this.scope)
101
+ // .off('.reveal')
102
+ .on('open.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.open)
103
+ .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.opened)
104
+ .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.open_video)
105
+ .on('close.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.close)
106
+ .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.closed)
107
+ .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.close_video);
108
+ }
109
+
110
+ return true;
111
+ },
112
+
113
+ // PATCH #3: turning on key up capture only when a reveal window is open
114
+ key_up_on : function (scope) {
115
+ var self = this;
116
+
117
+ // PATCH #1: fixing multiple keyup event trigger from single key press
118
+ self.S('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) {
119
+ var open_modal = self.S('[' + self.attr_name() + '].open'),
120
+ settings = open_modal.data(self.attr_name(true) + '-init') || self.settings ;
121
+ // PATCH #2: making sure that the close event can be called only while unlocked,
122
+ // so that multiple keyup.fndtn.reveal events don't prevent clean closing of the reveal window.
123
+ if ( settings && event.which === 27 && settings.close_on_esc && !self.locked) { // 27 is the keycode for the Escape key
124
+ self.close.call(self, open_modal);
125
+ }
126
+ });
127
+
128
+ return true;
129
+ },
130
+
131
+ // PATCH #3: turning on key up capture only when a reveal window is open
132
+ key_up_off : function (scope) {
133
+ this.S('body').off('keyup.fndtn.reveal');
134
+ return true;
135
+ },
136
+
137
+ open : function (target, ajax_settings) {
138
+ var self = this,
139
+ modal;
140
+
141
+ if (target) {
142
+ if (typeof target.selector !== 'undefined') {
143
+ // Find the named node; only use the first one found, since the rest of the code assumes there's only one node
144
+ modal = self.S('#' + target.data(self.data_attr('reveal-id'))).first();
145
+ } else {
146
+ modal = self.S(this.scope);
147
+
148
+ ajax_settings = target;
149
+ }
150
+ } else {
151
+ modal = self.S(this.scope);
152
+ }
153
+
154
+ var settings = modal.data(self.attr_name(true) + '-init');
155
+ settings = settings || this.settings;
156
+
157
+
158
+ if (modal.hasClass('open') && target.attr('data-reveal-id') == modal.attr('id')) {
159
+ return self.close(modal);
160
+ }
161
+
162
+ if (!modal.hasClass('open')) {
163
+ var open_modal = self.S('[' + self.attr_name() + '].open');
164
+
165
+ if (typeof modal.data('css-top') === 'undefined') {
166
+ modal.data('css-top', parseInt(modal.css('top'), 10))
167
+ .data('offset', this.cache_offset(modal));
168
+ }
169
+
170
+ modal.attr('tabindex','0').attr('aria-hidden','false');
171
+
172
+ this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
173
+
174
+ // Prevent namespace event from triggering twice
175
+ modal.on('open.fndtn.reveal', function(e) {
176
+ if (e.namespace !== 'fndtn.reveal') return;
177
+ });
178
+
179
+ modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal');
180
+
181
+ if (open_modal.length < 1) {
182
+ this.toggle_bg(modal, true);
183
+ }
184
+
185
+ if (typeof ajax_settings === 'string') {
186
+ ajax_settings = {
187
+ url : ajax_settings
188
+ };
189
+ }
190
+
191
+ if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
192
+ if (open_modal.length > 0) {
193
+ if (settings.multiple_opened) {
194
+ self.to_back(open_modal);
195
+ } else {
196
+ self.hide(open_modal, settings.css.close);
197
+ }
198
+ }
199
+
200
+ this.show(modal, settings.css.open);
201
+ } else {
202
+ var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
203
+ $.extend(ajax_settings, {
204
+ success : function (data, textStatus, jqXHR) {
205
+ if ( $.isFunction(old_success) ) {
206
+ var result = old_success(data, textStatus, jqXHR);
207
+ if (typeof result == 'string') {
208
+ data = result;
209
+ }
210
+ }
211
+
212
+ if (typeof options !== 'undefined' && typeof options.replaceContentSel !== 'undefined') {
213
+ modal.find(options.replaceContentSel).html(data);
214
+ } else {
215
+ modal.html(data);
216
+ }
217
+
218
+ self.S(modal).foundation('section', 'reflow');
219
+ self.S(modal).children().foundation();
220
+
221
+ if (open_modal.length > 0) {
222
+ if (settings.multiple_opened) {
223
+ self.to_back(open_modal);
224
+ } else {
225
+ self.hide(open_modal, settings.css.close);
226
+ }
227
+ }
228
+ self.show(modal, settings.css.open);
229
+ }
230
+ });
231
+
232
+ // check for if user initalized with error callback
233
+ if (settings.on_ajax_error !== $.noop) {
234
+ $.extend(ajax_settings, {
235
+ error : settings.on_ajax_error
236
+ });
237
+ }
238
+
239
+ $.ajax(ajax_settings);
240
+ }
241
+ }
242
+ self.S(window).trigger('resize');
243
+ },
244
+
245
+ close : function (modal) {
246
+ var modal = modal && modal.length ? modal : this.S(this.scope),
247
+ open_modals = this.S('[' + this.attr_name() + '].open'),
248
+ settings = modal.data(this.attr_name(true) + '-init') || this.settings,
249
+ self = this;
250
+
251
+ if (open_modals.length > 0) {
252
+
253
+ modal.removeAttr('tabindex','0').attr('aria-hidden','true');
254
+
255
+ this.locked = true;
256
+ this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open
257
+
258
+ modal.trigger('close.fndtn.reveal');
259
+
260
+ if ((settings.multiple_opened && open_modals.length === 1) || !settings.multiple_opened || modal.length > 1) {
261
+ self.toggle_bg(modal, false);
262
+ self.to_front(modal);
263
+ }
264
+
265
+ if (settings.multiple_opened) {
266
+ self.hide(modal, settings.css.close, settings);
267
+ self.to_front($($.makeArray(open_modals).reverse()[1]));
268
+ } else {
269
+ self.hide(open_modals, settings.css.close, settings);
270
+ }
271
+ }
272
+ },
273
+
274
+ close_targets : function () {
275
+ var base = '.' + this.settings.dismiss_modal_class;
276
+
277
+ if (this.settings.close_on_background_click) {
278
+ return base + ', .' + this.settings.bg_class;
279
+ }
280
+
281
+ return base;
282
+ },
283
+
284
+ toggle_bg : function (modal, state) {
285
+ if (this.S('.' + this.settings.bg_class).length === 0) {
286
+ this.settings.bg = $('<div />', {'class': this.settings.bg_class})
287
+ .appendTo('body').hide();
288
+ }
289
+
290
+ var visible = this.settings.bg.filter(':visible').length > 0;
291
+ if ( state != visible ) {
292
+ if ( state == undefined ? visible : !state ) {
293
+ this.hide(this.settings.bg);
294
+ } else {
295
+ this.show(this.settings.bg);
296
+ }
297
+ }
298
+ },
299
+
300
+ show : function (el, css) {
301
+ // is modal
302
+ if (css) {
303
+ var settings = el.data(this.attr_name(true) + '-init') || this.settings,
304
+ root_element = settings.root_element,
305
+ context = this;
306
+
307
+ if (el.parent(root_element).length === 0) {
308
+ var placeholder = el.wrap('<div style="display: none;" />').parent();
309
+
310
+ el.on('closed.fndtn.reveal.wrapped', function () {
311
+ el.detach().appendTo(placeholder);
312
+ el.unwrap().unbind('closed.fndtn.reveal.wrapped');
313
+ });
314
+
315
+ el.detach().appendTo(root_element);
316
+ }
317
+
318
+ var animData = getAnimationData(settings.animation);
319
+ if (!animData.animate) {
320
+ this.locked = false;
321
+ }
322
+ if (animData.pop) {
323
+ css.top = $(window).scrollTop() - el.data('offset') + 'px';
324
+ var end_css = {
325
+ top: $(window).scrollTop() + el.data('css-top') + 'px',
326
+ opacity: 1
327
+ };
328
+
329
+ return setTimeout(function () {
330
+ return el
331
+ .css(css)
332
+ .animate(end_css, settings.animation_speed, 'linear', function () {
333
+ context.locked = false;
334
+ el.trigger('opened.fndtn.reveal');
335
+ })
336
+ .addClass('open');
337
+ }, settings.animation_speed / 2);
338
+ }
339
+
340
+ if (animData.fade) {
341
+ css.top = $(window).scrollTop() + el.data('css-top') + 'px';
342
+ var end_css = {opacity: 1};
343
+
344
+ return setTimeout(function () {
345
+ return el
346
+ .css(css)
347
+ .animate(end_css, settings.animation_speed, 'linear', function () {
348
+ context.locked = false;
349
+ el.trigger('opened.fndtn.reveal');
350
+ })
351
+ .addClass('open');
352
+ }, settings.animation_speed / 2);
353
+ }
354
+
355
+ return el.css(css).show().css({opacity : 1}).addClass('open').trigger('opened.fndtn.reveal');
356
+ }
357
+
358
+ var settings = this.settings;
359
+
360
+ // should we animate the background?
361
+ if (getAnimationData(settings.animation).fade) {
362
+ return el.fadeIn(settings.animation_speed / 2);
363
+ }
364
+
365
+ this.locked = false;
366
+
367
+ return el.show();
368
+ },
369
+
370
+ to_back : function(el) {
371
+ el.addClass('toback');
372
+ },
373
+
374
+ to_front : function(el) {
375
+ el.removeClass('toback');
376
+ },
377
+
378
+ hide : function (el, css) {
379
+ // is modal
380
+ if (css) {
381
+ var settings = el.data(this.attr_name(true) + '-init'),
382
+ context = this;
383
+ settings = settings || this.settings;
384
+
385
+ var animData = getAnimationData(settings.animation);
386
+ if (!animData.animate) {
387
+ this.locked = false;
388
+ }
389
+ if (animData.pop) {
390
+ var end_css = {
391
+ top: - $(window).scrollTop() - el.data('offset') + 'px',
392
+ opacity: 0
393
+ };
394
+
395
+ return setTimeout(function () {
396
+ return el
397
+ .animate(end_css, settings.animation_speed, 'linear', function () {
398
+ context.locked = false;
399
+ el.css(css).trigger('closed.fndtn.reveal');
400
+ })
401
+ .removeClass('open');
402
+ }, settings.animation_speed / 2);
403
+ }
404
+
405
+ if (animData.fade) {
406
+ var end_css = {opacity : 0};
407
+
408
+ return setTimeout(function () {
409
+ return el
410
+ .animate(end_css, settings.animation_speed, 'linear', function () {
411
+ context.locked = false;
412
+ el.css(css).trigger('closed.fndtn.reveal');
413
+ })
414
+ .removeClass('open');
415
+ }, settings.animation_speed / 2);
416
+ }
417
+
418
+ return el.hide().css(css).removeClass('open').trigger('closed.fndtn.reveal');
419
+ }
420
+
421
+ var settings = this.settings;
422
+
423
+ // should we animate the background?
424
+ if (getAnimationData(settings.animation).fade) {
425
+ return el.fadeOut(settings.animation_speed / 2);
426
+ }
427
+
428
+ return el.hide();
429
+ },
430
+
431
+ close_video : function (e) {
432
+ var video = $('.flex-video', e.target),
433
+ iframe = $('iframe', video);
434
+
435
+ if (iframe.length > 0) {
436
+ iframe.attr('data-src', iframe[0].src);
437
+ iframe.attr('src', iframe.attr('src'));
438
+ video.hide();
439
+ }
440
+ },
441
+
442
+ open_video : function (e) {
443
+ var video = $('.flex-video', e.target),
444
+ iframe = video.find('iframe');
445
+
446
+ if (iframe.length > 0) {
447
+ var data_src = iframe.attr('data-src');
448
+ if (typeof data_src === 'string') {
449
+ iframe[0].src = iframe.attr('data-src');
450
+ } else {
451
+ var src = iframe[0].src;
452
+ iframe[0].src = undefined;
453
+ iframe[0].src = src;
454
+ }
455
+ video.show();
456
+ }
457
+ },
458
+
459
+ data_attr : function (str) {
460
+ if (this.namespace.length > 0) {
461
+ return this.namespace + '-' + str;
462
+ }
463
+
464
+ return str;
465
+ },
466
+
467
+ cache_offset : function (modal) {
468
+ var offset = modal.show().height() + parseInt(modal.css('top'), 10) + modal.scrollY;
469
+
470
+ modal.hide();
471
+
472
+ return offset;
473
+ },
474
+
475
+ off : function () {
476
+ $(this.scope).off('.fndtn.reveal');
477
+ },
478
+
479
+ reflow : function () {}
480
+ };
481
+
482
+ /*
483
+ * getAnimationData('popAndFade') // {animate: true, pop: true, fade: true}
484
+ * getAnimationData('fade') // {animate: true, pop: false, fade: true}
485
+ * getAnimationData('pop') // {animate: true, pop: true, fade: false}
486
+ * getAnimationData('foo') // {animate: false, pop: false, fade: false}
487
+ * getAnimationData(null) // {animate: false, pop: false, fade: false}
488
+ */
489
+ function getAnimationData(str) {
490
+ var fade = /fade/i.test(str);
491
+ var pop = /pop/i.test(str);
492
+ return {
493
+ animate : fade || pop,
494
+ pop : pop,
495
+ fade : fade
496
+ };
497
+ }
498
+ }(jQuery, window, window.document));