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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/README.md +66 -0
- data/Rakefile +1 -0
- data/app/assets/fonts/merriweather-bold-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-bold-webfont.svg +294 -0
- data/app/assets/fonts/merriweather-bold-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-bold-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-bold-webfont.woff2 +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.svg +283 -0
- data/app/assets/fonts/merriweather-italic-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-italic-webfont.woff2 +0 -0
- data/app/assets/fonts/merriweather-light-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-light-webfont.svg +299 -0
- data/app/assets/fonts/merriweather-light-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-light-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-light-webfont.woff2 +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.eot +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.svg +294 -0
- data/app/assets/fonts/merriweather-regular-webfont.ttf +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.woff +0 -0
- data/app/assets/fonts/merriweather-regular-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.svg +965 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-bold-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.svg +853 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-italic-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.svg +915 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-light-webfont.woff2 +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.eot +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.svg +989 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.ttf +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.woff +0 -0
- data/app/assets/fonts/sourcesanspro-regular-webfont.woff2 +0 -0
- data/app/assets/images/design/background/thread.png +0 -0
- data/app/assets/images/design/logo/logo-alt-hover.png +0 -0
- data/app/assets/images/design/logo/logo-alt.png +0 -0
- data/app/assets/images/design/logo/logo-hover.png +0 -0
- data/app/assets/images/design/logo/logo-small.png +0 -0
- data/app/assets/images/design/logo/logo.png +0 -0
- data/app/assets/images/design/logo/og-image.jpg +0 -0
- data/app/assets/images/design/seal/seal-footer.png +0 -0
- data/app/assets/images/design/seal/seal-footer.svg +1 -0
- data/app/assets/images/design/seal/seal.png +0 -0
- data/app/assets/images/design/seal/stars.png +0 -0
- data/app/assets/images/icons/apple-touch-icon-114x114.png +0 -0
- data/app/assets/images/icons/apple-touch-icon-152x152.png +0 -0
- data/app/assets/images/icons/apple-touch-icon-72x72.png +0 -0
- data/app/assets/images/icons/apple-touch-icon.png +0 -0
- data/app/assets/images/icons/favicon.ico +0 -0
- data/app/assets/images/icons/va.png +0 -0
- data/app/assets/images/icons/watermark.png +0 -0
- data/app/assets/images/icons/wrench.png +0 -0
- data/app/assets/images/social-icons/png/facebook25.png +0 -0
- data/app/assets/images/social-icons/png/rss25.png +0 -0
- data/app/assets/images/social-icons/png/twitter16.png +0 -0
- data/app/assets/images/social-icons/png/youtube15.png +0 -0
- data/app/assets/images/social-icons/svg/facebook25.svg +11 -0
- data/app/assets/images/social-icons/svg/rss25.svg +1 -0
- data/app/assets/images/social-icons/svg/twitter16.svg +15 -0
- data/app/assets/images/social-icons/svg/youtube15.svg +1 -0
- data/app/assets/js/components.js +376 -0
- data/app/assets/js/foundation/foundation.abide.js +408 -0
- data/app/assets/js/foundation/foundation.accordion.js +88 -0
- data/app/assets/js/foundation/foundation.alert.js +43 -0
- data/app/assets/js/foundation/foundation.clearing.js +586 -0
- data/app/assets/js/foundation/foundation.dropdown.js +463 -0
- data/app/assets/js/foundation/foundation.equalizer.js +104 -0
- data/app/assets/js/foundation/foundation.interchange.js +359 -0
- data/app/assets/js/foundation/foundation.joyride.js +932 -0
- data/app/assets/js/foundation/foundation.js +725 -0
- data/app/assets/js/foundation/foundation.magellan.js +215 -0
- data/app/assets/js/foundation/foundation.offcanvas.js +152 -0
- data/app/assets/js/foundation/foundation.orbit.js +476 -0
- data/app/assets/js/foundation/foundation.reveal.js +498 -0
- data/app/assets/js/foundation/foundation.slider.js +281 -0
- data/app/assets/js/foundation/foundation.tab.js +249 -0
- data/app/assets/js/foundation/foundation.tooltip.js +339 -0
- data/app/assets/js/foundation/foundation.topbar.js +458 -0
- data/app/assets/js/foundation.min.js +6376 -0
- data/app/assets/js/scripts-no-touch.js +33 -0
- data/app/assets/js/scripts-touch.js +33 -0
- data/app/assets/js/va_common_main.js +1 -0
- data/app/assets/js/vendor/classie.js +80 -0
- data/app/assets/js/vendor/html5shiv.js +8 -0
- data/app/assets/js/vendor/jquery-1.11.0.min.js +4 -0
- data/app/assets/js/vendor/jquery.js +9789 -0
- data/app/assets/js/vendor/jquery.smooth-scroll.js +255 -0
- data/app/assets/js/vendor/jquery.stellar.js +651 -0
- data/app/assets/js/vendor/jquery.tipsy.js +258 -0
- data/app/assets/js/vendor/menu.js +40 -0
- data/app/assets/js/vendor/modernizr.custom.js +4 -0
- data/app/assets/js/vendor/nwmatcher-1.2.5-min.js +7 -0
- data/app/assets/js/vendor/respond.min.js +6 -0
- data/app/assets/js/vendor/scroll-settings.js +3 -0
- data/app/assets/js/vendor/selectivizr-1.0.3b.js +560 -0
- data/app/assets/js/vendor/stellar-settings.js +8 -0
- data/app/assets/js/vendor/svg-injector.js +450 -0
- data/app/assets/js/vendor/tota11y.min.js +28 -0
- data/app/assets/js/vendor/wow.min.js +2 -0
- data/app/assets/stylesheets/_va.scss +2377 -0
- data/app/assets/stylesheets/components/_accordions.scss +98 -0
- data/app/assets/stylesheets/core/_base.scss +20 -0
- data/app/assets/stylesheets/core/_defaults.scss +92 -0
- data/app/assets/stylesheets/core/_grid-settings.scss +10 -0
- data/app/assets/stylesheets/core/_grid.scss +116 -0
- data/app/assets/stylesheets/core/_utilities.scss +105 -0
- data/app/assets/stylesheets/core/_variables.scss +88 -0
- data/app/assets/stylesheets/elements/_buttons.scss +189 -0
- data/app/assets/stylesheets/elements/_figure.scss +9 -0
- data/app/assets/stylesheets/elements/_inputs.scss +328 -0
- data/app/assets/stylesheets/elements/_labels.scss +39 -0
- data/app/assets/stylesheets/elements/_list.scss +82 -0
- data/app/assets/stylesheets/elements/_table.scss +39 -0
- data/app/assets/stylesheets/elements/_typography.scss +220 -0
- data/app/assets/stylesheets/foundation/_functions.scss +146 -0
- data/app/assets/stylesheets/foundation/_settings.scss +1467 -0
- data/app/assets/stylesheets/foundation/_variables.scss +1286 -0
- data/app/assets/stylesheets/foundation/components/_accordion.scss +157 -0
- data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +128 -0
- data/app/assets/stylesheets/foundation/components/_block-grid.scss +132 -0
- data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +132 -0
- data/app/assets/stylesheets/foundation/components/_button-groups.scss +200 -0
- data/app/assets/stylesheets/foundation/components/_buttons.scss +259 -0
- data/app/assets/stylesheets/foundation/components/_clearing.scss +256 -0
- data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +131 -0
- data/app/assets/stylesheets/foundation/components/_dropdown.scss +262 -0
- data/app/assets/stylesheets/foundation/components/_flex-video.scss +51 -0
- data/app/assets/stylesheets/foundation/components/_forms.scss +570 -0
- data/app/assets/stylesheets/foundation/components/_global.scss +481 -0
- data/app/assets/stylesheets/foundation/components/_grid.scss +289 -0
- data/app/assets/stylesheets/foundation/components/_icon-bar.scss +358 -0
- data/app/assets/stylesheets/foundation/components/_inline-lists.scss +57 -0
- data/app/assets/stylesheets/foundation/components/_joyride.scss +222 -0
- data/app/assets/stylesheets/foundation/components/_keystrokes.scss +61 -0
- data/app/assets/stylesheets/foundation/components/_labels.scss +106 -0
- data/app/assets/stylesheets/foundation/components/_magellan.scss +34 -0
- data/app/assets/stylesheets/foundation/components/_offcanvas.scss +515 -0
- data/app/assets/stylesheets/foundation/components/_orbit.scss +368 -0
- data/app/assets/stylesheets/foundation/components/_pagination.scss +162 -0
- data/app/assets/stylesheets/foundation/components/_panels.scss +101 -0
- data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +150 -0
- data/app/assets/stylesheets/foundation/components/_progress-bars.scss +79 -0
- data/app/assets/stylesheets/foundation/components/_range-slider.scss +169 -0
- data/app/assets/stylesheets/foundation/components/_reveal.scss +202 -0
- data/app/assets/stylesheets/foundation/components/_side-nav.scss +116 -0
- data/app/assets/stylesheets/foundation/components/_split-buttons.scss +199 -0
- data/app/assets/stylesheets/foundation/components/_sub-nav.scss +123 -0
- data/app/assets/stylesheets/foundation/components/_switches.scss +238 -0
- data/app/assets/stylesheets/foundation/components/_tables.scss +135 -0
- data/app/assets/stylesheets/foundation/components/_tabs.scss +123 -0
- data/app/assets/stylesheets/foundation/components/_thumbs.scss +66 -0
- data/app/assets/stylesheets/foundation/components/_toolbar.scss +70 -0
- data/app/assets/stylesheets/foundation/components/_tooltips.scss +142 -0
- data/app/assets/stylesheets/foundation/components/_top-bar.scss +691 -0
- data/app/assets/stylesheets/foundation/components/_type.scss +525 -0
- data/app/assets/stylesheets/foundation/components/_visibility.scss +408 -0
- data/app/assets/stylesheets/functions/_new-breakpoint.scss +49 -0
- data/app/assets/stylesheets/functions/_private.scss +114 -0
- data/app/assets/stylesheets/lib/_normalize.scss +427 -0
- data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
- data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +87 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +48 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +64 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +30 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +31 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +27 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +48 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +66 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +51 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +112 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +34 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +63 -0
- data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +29 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +43 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +3 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +3 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +42 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +55 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +59 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +47 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +287 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +24 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +10 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +4 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +14 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +36 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +38 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +8 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +8 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +39 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +42 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +19 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +15 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +71 -0
- data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +3 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +11 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +20 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +11 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +21 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +11 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +13 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +69 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +13 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +15 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +24 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +17 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +24 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +22 -0
- data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +27 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +21 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +96 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +43 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +13 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +25 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +41 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +61 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +69 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +50 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +18 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +26 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +10 -0
- data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +50 -0
- data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +7 -0
- data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +9 -0
- data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +1 -0
- data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +8 -0
- data/app/assets/stylesheets/lib/neat/_neat.scss +23 -0
- data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +49 -0
- data/app/assets/stylesheets/lib/neat/functions/_private.scss +114 -0
- data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +15 -0
- data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +33 -0
- data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +28 -0
- data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +22 -0
- data/app/assets/stylesheets/lib/neat/grid/_media.scss +92 -0
- data/app/assets/stylesheets/lib/neat/grid/_omega.scss +87 -0
- data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +38 -0
- data/app/assets/stylesheets/lib/neat/grid/_pad.scss +25 -0
- data/app/assets/stylesheets/lib/neat/grid/_private.scss +35 -0
- data/app/assets/stylesheets/lib/neat/grid/_row.scss +52 -0
- data/app/assets/stylesheets/lib/neat/grid/_shift.scss +50 -0
- data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +94 -0
- data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +97 -0
- data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +42 -0
- data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +13 -0
- data/app/assets/stylesheets/lib/neat/settings/_grid.scss +51 -0
- data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +27 -0
- data/app/assets/stylesheets/va_common_main.css.scss +18 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/generators/files/_footer.html.erb +89 -0
- data/lib/generators/files/_header.html.erb +7 -0
- data/lib/generators/va_common_generator.rb +6 -0
- data/lib/generators/va_footer_generator.rb +7 -0
- data/lib/generators/va_header_generator.rb +7 -0
- data/lib/va_common/engine.rb +4 -0
- data/lib/va_common/version.rb +3 -0
- data/lib/va_common.rb +2 -0
- data/va_common.gemspec +22 -0
- metadata +354 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
;(function ($, window, document, undefined) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Foundation.libs.interchange = {
|
|
5
|
+
name : 'interchange',
|
|
6
|
+
|
|
7
|
+
version : '5.5.2',
|
|
8
|
+
|
|
9
|
+
cache : {},
|
|
10
|
+
|
|
11
|
+
images_loaded : false,
|
|
12
|
+
nodes_loaded : false,
|
|
13
|
+
|
|
14
|
+
settings : {
|
|
15
|
+
load_attr : 'interchange',
|
|
16
|
+
|
|
17
|
+
named_queries : {
|
|
18
|
+
'default' : 'only screen',
|
|
19
|
+
'small' : Foundation.media_queries['small'],
|
|
20
|
+
'small-only' : Foundation.media_queries['small-only'],
|
|
21
|
+
'medium' : Foundation.media_queries['medium'],
|
|
22
|
+
'medium-only' : Foundation.media_queries['medium-only'],
|
|
23
|
+
'large' : Foundation.media_queries['large'],
|
|
24
|
+
'large-only' : Foundation.media_queries['large-only'],
|
|
25
|
+
'xlarge' : Foundation.media_queries['xlarge'],
|
|
26
|
+
'xlarge-only' : Foundation.media_queries['xlarge-only'],
|
|
27
|
+
'xxlarge' : Foundation.media_queries['xxlarge'],
|
|
28
|
+
'landscape' : 'only screen and (orientation: landscape)',
|
|
29
|
+
'portrait' : 'only screen and (orientation: portrait)',
|
|
30
|
+
'retina' : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
|
|
31
|
+
'only screen and (min--moz-device-pixel-ratio: 2),' +
|
|
32
|
+
'only screen and (-o-min-device-pixel-ratio: 2/1),' +
|
|
33
|
+
'only screen and (min-device-pixel-ratio: 2),' +
|
|
34
|
+
'only screen and (min-resolution: 192dpi),' +
|
|
35
|
+
'only screen and (min-resolution: 2dppx)'
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
directives : {
|
|
39
|
+
replace : function (el, path, trigger) {
|
|
40
|
+
// The trigger argument, if called within the directive, fires
|
|
41
|
+
// an event named after the directive on the element, passing
|
|
42
|
+
// any parameters along to the event that you pass to trigger.
|
|
43
|
+
//
|
|
44
|
+
// ex. trigger(), trigger([a, b, c]), or trigger(a, b, c)
|
|
45
|
+
//
|
|
46
|
+
// This allows you to bind a callback like so:
|
|
47
|
+
// $('#interchangeContainer').on('replace', function (e, a, b, c) {
|
|
48
|
+
// console.log($(this).html(), a, b, c);
|
|
49
|
+
// });
|
|
50
|
+
|
|
51
|
+
if (el !== null && /IMG/.test(el[0].nodeName)) {
|
|
52
|
+
var orig_path = el[0].src;
|
|
53
|
+
|
|
54
|
+
if (new RegExp(path, 'i').test(orig_path)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
el.attr("src", path);
|
|
59
|
+
|
|
60
|
+
return trigger(el[0].src);
|
|
61
|
+
}
|
|
62
|
+
var last_path = el.data(this.data_attr + '-last-path'),
|
|
63
|
+
self = this;
|
|
64
|
+
|
|
65
|
+
if (last_path == path) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i.test(path)) {
|
|
70
|
+
$(el).css('background-image', 'url(' + path + ')');
|
|
71
|
+
el.data('interchange-last-path', path);
|
|
72
|
+
return trigger(path);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return $.get(path, function (response) {
|
|
76
|
+
el.html(response);
|
|
77
|
+
el.data(self.data_attr + '-last-path', path);
|
|
78
|
+
trigger();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
init : function (scope, method, options) {
|
|
86
|
+
Foundation.inherit(this, 'throttle random_str');
|
|
87
|
+
|
|
88
|
+
this.data_attr = this.set_data_attr();
|
|
89
|
+
$.extend(true, this.settings, method, options);
|
|
90
|
+
this.bindings(method, options);
|
|
91
|
+
this.reflow();
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
get_media_hash : function () {
|
|
95
|
+
var mediaHash = '';
|
|
96
|
+
for (var queryName in this.settings.named_queries ) {
|
|
97
|
+
mediaHash += matchMedia(this.settings.named_queries[queryName]).matches.toString();
|
|
98
|
+
}
|
|
99
|
+
return mediaHash;
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
events : function () {
|
|
103
|
+
var self = this, prevMediaHash;
|
|
104
|
+
|
|
105
|
+
$(window)
|
|
106
|
+
.off('.interchange')
|
|
107
|
+
.on('resize.fndtn.interchange', self.throttle(function () {
|
|
108
|
+
var currMediaHash = self.get_media_hash();
|
|
109
|
+
if (currMediaHash !== prevMediaHash) {
|
|
110
|
+
self.resize();
|
|
111
|
+
}
|
|
112
|
+
prevMediaHash = currMediaHash;
|
|
113
|
+
}, 50));
|
|
114
|
+
|
|
115
|
+
return this;
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
resize : function () {
|
|
119
|
+
var cache = this.cache;
|
|
120
|
+
|
|
121
|
+
if (!this.images_loaded || !this.nodes_loaded) {
|
|
122
|
+
setTimeout($.proxy(this.resize, this), 50);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
for (var uuid in cache) {
|
|
127
|
+
if (cache.hasOwnProperty(uuid)) {
|
|
128
|
+
var passed = this.results(uuid, cache[uuid]);
|
|
129
|
+
if (passed) {
|
|
130
|
+
this.settings.directives[passed
|
|
131
|
+
.scenario[1]].call(this, passed.el, passed.scenario[0], (function (passed) {
|
|
132
|
+
if (arguments[0] instanceof Array) {
|
|
133
|
+
var args = arguments[0];
|
|
134
|
+
} else {
|
|
135
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return function() {
|
|
139
|
+
passed.el.trigger(passed.scenario[1], args);
|
|
140
|
+
}
|
|
141
|
+
}(passed)));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
results : function (uuid, scenarios) {
|
|
149
|
+
var count = scenarios.length;
|
|
150
|
+
|
|
151
|
+
if (count > 0) {
|
|
152
|
+
var el = this.S('[' + this.add_namespace('data-uuid') + '="' + uuid + '"]');
|
|
153
|
+
|
|
154
|
+
while (count--) {
|
|
155
|
+
var mq, rule = scenarios[count][2];
|
|
156
|
+
if (this.settings.named_queries.hasOwnProperty(rule)) {
|
|
157
|
+
mq = matchMedia(this.settings.named_queries[rule]);
|
|
158
|
+
} else {
|
|
159
|
+
mq = matchMedia(rule);
|
|
160
|
+
}
|
|
161
|
+
if (mq.matches) {
|
|
162
|
+
return {el : el, scenario : scenarios[count]};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return false;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
load : function (type, force_update) {
|
|
171
|
+
if (typeof this['cached_' + type] === 'undefined' || force_update) {
|
|
172
|
+
this['update_' + type]();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return this['cached_' + type];
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
update_images : function () {
|
|
179
|
+
var images = this.S('img[' + this.data_attr + ']'),
|
|
180
|
+
count = images.length,
|
|
181
|
+
i = count,
|
|
182
|
+
loaded_count = 0,
|
|
183
|
+
data_attr = this.data_attr;
|
|
184
|
+
|
|
185
|
+
this.cache = {};
|
|
186
|
+
this.cached_images = [];
|
|
187
|
+
this.images_loaded = (count === 0);
|
|
188
|
+
|
|
189
|
+
while (i--) {
|
|
190
|
+
loaded_count++;
|
|
191
|
+
if (images[i]) {
|
|
192
|
+
var str = images[i].getAttribute(data_attr) || '';
|
|
193
|
+
|
|
194
|
+
if (str.length > 0) {
|
|
195
|
+
this.cached_images.push(images[i]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (loaded_count === count) {
|
|
200
|
+
this.images_loaded = true;
|
|
201
|
+
this.enhance('images');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return this;
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
update_nodes : function () {
|
|
209
|
+
var nodes = this.S('[' + this.data_attr + ']').not('img'),
|
|
210
|
+
count = nodes.length,
|
|
211
|
+
i = count,
|
|
212
|
+
loaded_count = 0,
|
|
213
|
+
data_attr = this.data_attr;
|
|
214
|
+
|
|
215
|
+
this.cached_nodes = [];
|
|
216
|
+
this.nodes_loaded = (count === 0);
|
|
217
|
+
|
|
218
|
+
while (i--) {
|
|
219
|
+
loaded_count++;
|
|
220
|
+
var str = nodes[i].getAttribute(data_attr) || '';
|
|
221
|
+
|
|
222
|
+
if (str.length > 0) {
|
|
223
|
+
this.cached_nodes.push(nodes[i]);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (loaded_count === count) {
|
|
227
|
+
this.nodes_loaded = true;
|
|
228
|
+
this.enhance('nodes');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return this;
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
enhance : function (type) {
|
|
236
|
+
var i = this['cached_' + type].length;
|
|
237
|
+
|
|
238
|
+
while (i--) {
|
|
239
|
+
this.object($(this['cached_' + type][i]));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return $(window).trigger('resize.fndtn.interchange');
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
convert_directive : function (directive) {
|
|
246
|
+
|
|
247
|
+
var trimmed = this.trim(directive);
|
|
248
|
+
|
|
249
|
+
if (trimmed.length > 0) {
|
|
250
|
+
return trimmed;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return 'replace';
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
parse_scenario : function (scenario) {
|
|
257
|
+
// This logic had to be made more complex since some users were using commas in the url path
|
|
258
|
+
// So we cannot simply just split on a comma
|
|
259
|
+
|
|
260
|
+
var directive_match = scenario[0].match(/(.+),\s*(\w+)\s*$/),
|
|
261
|
+
// getting the mq has gotten a bit complicated since we started accounting for several use cases
|
|
262
|
+
// of URLs. For now we'll continue to match these scenarios, but we may consider having these scenarios
|
|
263
|
+
// as nested objects or arrays in F6.
|
|
264
|
+
// regex: match everything before close parenthesis for mq
|
|
265
|
+
media_query = scenario[1].match(/(.*)\)/);
|
|
266
|
+
|
|
267
|
+
if (directive_match) {
|
|
268
|
+
var path = directive_match[1],
|
|
269
|
+
directive = directive_match[2];
|
|
270
|
+
|
|
271
|
+
} else {
|
|
272
|
+
var cached_split = scenario[0].split(/,\s*$/),
|
|
273
|
+
path = cached_split[0],
|
|
274
|
+
directive = '';
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return [this.trim(path), this.convert_directive(directive), this.trim(media_query[1])];
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
object : function (el) {
|
|
281
|
+
var raw_arr = this.parse_data_attr(el),
|
|
282
|
+
scenarios = [],
|
|
283
|
+
i = raw_arr.length;
|
|
284
|
+
|
|
285
|
+
if (i > 0) {
|
|
286
|
+
while (i--) {
|
|
287
|
+
// split array between comma delimited content and mq
|
|
288
|
+
// regex: comma, optional space, open parenthesis
|
|
289
|
+
var scenario = raw_arr[i].split(/,\s?\(/);
|
|
290
|
+
|
|
291
|
+
if (scenario.length > 1) {
|
|
292
|
+
var params = this.parse_scenario(scenario);
|
|
293
|
+
scenarios.push(params);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return this.store(el, scenarios);
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
store : function (el, scenarios) {
|
|
302
|
+
var uuid = this.random_str(),
|
|
303
|
+
current_uuid = el.data(this.add_namespace('uuid', true));
|
|
304
|
+
|
|
305
|
+
if (this.cache[current_uuid]) {
|
|
306
|
+
return this.cache[current_uuid];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
el.attr(this.add_namespace('data-uuid'), uuid);
|
|
310
|
+
return this.cache[uuid] = scenarios;
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
trim : function (str) {
|
|
314
|
+
|
|
315
|
+
if (typeof str === 'string') {
|
|
316
|
+
return $.trim(str);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return str;
|
|
320
|
+
},
|
|
321
|
+
|
|
322
|
+
set_data_attr : function (init) {
|
|
323
|
+
if (init) {
|
|
324
|
+
if (this.namespace.length > 0) {
|
|
325
|
+
return this.namespace + '-' + this.settings.load_attr;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return this.settings.load_attr;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (this.namespace.length > 0) {
|
|
332
|
+
return 'data-' + this.namespace + '-' + this.settings.load_attr;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return 'data-' + this.settings.load_attr;
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
parse_data_attr : function (el) {
|
|
339
|
+
var raw = el.attr(this.attr_name()).split(/\[(.*?)\]/),
|
|
340
|
+
i = raw.length,
|
|
341
|
+
output = [];
|
|
342
|
+
|
|
343
|
+
while (i--) {
|
|
344
|
+
if (raw[i].replace(/[\W\d]+/, '').length > 4) {
|
|
345
|
+
output.push(raw[i]);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return output;
|
|
350
|
+
},
|
|
351
|
+
|
|
352
|
+
reflow : function () {
|
|
353
|
+
this.load('images', true);
|
|
354
|
+
this.load('nodes', true);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
}(jQuery, window, window.document));
|