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,339 @@
|
|
|
1
|
+
;(function ($, window, document, undefined) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Foundation.libs.tooltip = {
|
|
5
|
+
name : 'tooltip',
|
|
6
|
+
|
|
7
|
+
version : '5.5.2',
|
|
8
|
+
|
|
9
|
+
settings : {
|
|
10
|
+
additional_inheritable_classes : [],
|
|
11
|
+
tooltip_class : '.tooltip',
|
|
12
|
+
append_to : 'body',
|
|
13
|
+
touch_close_text : 'Tap To Close',
|
|
14
|
+
disable_for_touch : false,
|
|
15
|
+
hover_delay : 200,
|
|
16
|
+
show_on : 'all',
|
|
17
|
+
tip_template : function (selector, content) {
|
|
18
|
+
return '<span data-selector="' + selector + '" id="' + selector + '" class="'
|
|
19
|
+
+ Foundation.libs.tooltip.settings.tooltip_class.substring(1)
|
|
20
|
+
+ '" role="tooltip">' + content + '<span class="nub"></span></span>';
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
cache : {},
|
|
25
|
+
|
|
26
|
+
init : function (scope, method, options) {
|
|
27
|
+
Foundation.inherit(this, 'random_str');
|
|
28
|
+
this.bindings(method, options);
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
should_show : function (target, tip) {
|
|
32
|
+
var settings = $.extend({}, this.settings, this.data_options(target));
|
|
33
|
+
|
|
34
|
+
if (settings.show_on === 'all') {
|
|
35
|
+
return true;
|
|
36
|
+
} else if (this.small() && settings.show_on === 'small') {
|
|
37
|
+
return true;
|
|
38
|
+
} else if (this.medium() && settings.show_on === 'medium') {
|
|
39
|
+
return true;
|
|
40
|
+
} else if (this.large() && settings.show_on === 'large') {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
medium : function () {
|
|
47
|
+
return matchMedia(Foundation.media_queries['medium']).matches;
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
large : function () {
|
|
51
|
+
return matchMedia(Foundation.media_queries['large']).matches;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
events : function (instance) {
|
|
55
|
+
var self = this,
|
|
56
|
+
S = self.S;
|
|
57
|
+
|
|
58
|
+
self.create(this.S(instance));
|
|
59
|
+
|
|
60
|
+
function _startShow(elt, $this, immediate) {
|
|
61
|
+
if (elt.timer) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (immediate) {
|
|
66
|
+
elt.timer = null;
|
|
67
|
+
self.showTip($this);
|
|
68
|
+
} else {
|
|
69
|
+
elt.timer = setTimeout(function () {
|
|
70
|
+
elt.timer = null;
|
|
71
|
+
self.showTip($this);
|
|
72
|
+
}.bind(elt), self.settings.hover_delay);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _startHide(elt, $this) {
|
|
77
|
+
if (elt.timer) {
|
|
78
|
+
clearTimeout(elt.timer);
|
|
79
|
+
elt.timer = null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
self.hide($this);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
$(this.scope)
|
|
86
|
+
.off('.tooltip')
|
|
87
|
+
.on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip',
|
|
88
|
+
'[' + this.attr_name() + ']', function (e) {
|
|
89
|
+
var $this = S(this),
|
|
90
|
+
settings = $.extend({}, self.settings, self.data_options($this)),
|
|
91
|
+
is_touch = false;
|
|
92
|
+
|
|
93
|
+
if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type) && S(e.target).is('a')) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (/mouse/i.test(e.type) && self.ie_touch(e)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if ($this.hasClass('open')) {
|
|
102
|
+
if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
}
|
|
105
|
+
self.hide($this);
|
|
106
|
+
} else {
|
|
107
|
+
if (settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
|
|
108
|
+
return;
|
|
109
|
+
} else if (!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
S(settings.tooltip_class + '.open').hide();
|
|
112
|
+
is_touch = true;
|
|
113
|
+
// close other open tooltips on touch
|
|
114
|
+
if ($('.open[' + self.attr_name() + ']').length > 0) {
|
|
115
|
+
var prevOpen = S($('.open[' + self.attr_name() + ']')[0]);
|
|
116
|
+
self.hide(prevOpen);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (/enter|over/i.test(e.type)) {
|
|
121
|
+
_startShow(this, $this);
|
|
122
|
+
|
|
123
|
+
} else if (e.type === 'mouseout' || e.type === 'mouseleave') {
|
|
124
|
+
_startHide(this, $this);
|
|
125
|
+
} else {
|
|
126
|
+
_startShow(this, $this, true);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
.on('mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', '[' + this.attr_name() + '].open', function (e) {
|
|
131
|
+
if (/mouse/i.test(e.type) && self.ie_touch(e)) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if ($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') {
|
|
136
|
+
return;
|
|
137
|
+
} else if ($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {
|
|
138
|
+
self.convert_to_touch($(this));
|
|
139
|
+
} else {
|
|
140
|
+
_startHide(this, $(this));
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
.on('DOMNodeRemoved DOMAttrModified', '[' + this.attr_name() + ']:not(a)', function (e) {
|
|
144
|
+
_startHide(this, S(this));
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
ie_touch : function (e) {
|
|
149
|
+
// How do I distinguish between IE11 and Windows Phone 8?????
|
|
150
|
+
return false;
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
showTip : function ($target) {
|
|
154
|
+
var $tip = this.getTip($target);
|
|
155
|
+
if (this.should_show($target, $tip)) {
|
|
156
|
+
return this.show($target);
|
|
157
|
+
}
|
|
158
|
+
return;
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
getTip : function ($target) {
|
|
162
|
+
var selector = this.selector($target),
|
|
163
|
+
settings = $.extend({}, this.settings, this.data_options($target)),
|
|
164
|
+
tip = null;
|
|
165
|
+
|
|
166
|
+
if (selector) {
|
|
167
|
+
tip = this.S('span[data-selector="' + selector + '"]' + settings.tooltip_class);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return (typeof tip === 'object') ? tip : false;
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
selector : function ($target) {
|
|
174
|
+
var dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
|
|
175
|
+
|
|
176
|
+
if (typeof dataSelector != 'string') {
|
|
177
|
+
dataSelector = this.random_str(6);
|
|
178
|
+
$target
|
|
179
|
+
.attr('data-selector', dataSelector)
|
|
180
|
+
.attr('aria-describedby', dataSelector);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return dataSelector;
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
create : function ($target) {
|
|
187
|
+
var self = this,
|
|
188
|
+
settings = $.extend({}, this.settings, this.data_options($target)),
|
|
189
|
+
tip_template = this.settings.tip_template;
|
|
190
|
+
|
|
191
|
+
if (typeof settings.tip_template === 'string' && window.hasOwnProperty(settings.tip_template)) {
|
|
192
|
+
tip_template = window[settings.tip_template];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
var $tip = $(tip_template(this.selector($target), $('<div></div>').html($target.attr('title')).html())),
|
|
196
|
+
classes = this.inheritable_classes($target);
|
|
197
|
+
|
|
198
|
+
$tip.addClass(classes).appendTo(settings.append_to);
|
|
199
|
+
|
|
200
|
+
if (Modernizr.touch) {
|
|
201
|
+
$tip.append('<span class="tap-to-close">' + settings.touch_close_text + '</span>');
|
|
202
|
+
$tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function (e) {
|
|
203
|
+
self.hide($target);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
$target.removeAttr('title').attr('title', '');
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
reposition : function (target, tip, classes) {
|
|
211
|
+
var width, nub, nubHeight, nubWidth, column, objPos;
|
|
212
|
+
|
|
213
|
+
tip.css('visibility', 'hidden').show();
|
|
214
|
+
|
|
215
|
+
width = target.data('width');
|
|
216
|
+
nub = tip.children('.nub');
|
|
217
|
+
nubHeight = nub.outerHeight();
|
|
218
|
+
nubWidth = nub.outerHeight();
|
|
219
|
+
|
|
220
|
+
if (this.small()) {
|
|
221
|
+
tip.css({'width' : '100%'});
|
|
222
|
+
} else {
|
|
223
|
+
tip.css({'width' : (width) ? width : 'auto'});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
objPos = function (obj, top, right, bottom, left, width) {
|
|
227
|
+
return obj.css({
|
|
228
|
+
'top' : (top) ? top : 'auto',
|
|
229
|
+
'bottom' : (bottom) ? bottom : 'auto',
|
|
230
|
+
'left' : (left) ? left : 'auto',
|
|
231
|
+
'right' : (right) ? right : 'auto'
|
|
232
|
+
}).end();
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', target.offset().left);
|
|
236
|
+
|
|
237
|
+
if (this.small()) {
|
|
238
|
+
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', 12.5, $(this.scope).width());
|
|
239
|
+
tip.addClass('tip-override');
|
|
240
|
+
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
|
|
241
|
+
} else {
|
|
242
|
+
var left = target.offset().left;
|
|
243
|
+
if (Foundation.rtl) {
|
|
244
|
+
nub.addClass('rtl');
|
|
245
|
+
left = target.offset().left + target.outerWidth() - tip.outerWidth();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', left);
|
|
249
|
+
// reset nub from small styles, if they've been applied
|
|
250
|
+
if (nub.attr('style')) {
|
|
251
|
+
nub.removeAttr('style');
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
tip.removeClass('tip-override');
|
|
255
|
+
if (classes && classes.indexOf('tip-top') > -1) {
|
|
256
|
+
if (Foundation.rtl) {
|
|
257
|
+
nub.addClass('rtl');
|
|
258
|
+
}
|
|
259
|
+
objPos(tip, (target.offset().top - tip.outerHeight()), 'auto', 'auto', left)
|
|
260
|
+
.removeClass('tip-override');
|
|
261
|
+
} else if (classes && classes.indexOf('tip-left') > -1) {
|
|
262
|
+
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left - tip.outerWidth() - nubHeight))
|
|
263
|
+
.removeClass('tip-override');
|
|
264
|
+
nub.removeClass('rtl');
|
|
265
|
+
} else if (classes && classes.indexOf('tip-right') > -1) {
|
|
266
|
+
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left + target.outerWidth() + nubHeight))
|
|
267
|
+
.removeClass('tip-override');
|
|
268
|
+
nub.removeClass('rtl');
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
tip.css('visibility', 'visible').hide();
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
small : function () {
|
|
276
|
+
return matchMedia(Foundation.media_queries.small).matches &&
|
|
277
|
+
!matchMedia(Foundation.media_queries.medium).matches;
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
inheritable_classes : function ($target) {
|
|
281
|
+
var settings = $.extend({}, this.settings, this.data_options($target)),
|
|
282
|
+
inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'radius', 'round'].concat(settings.additional_inheritable_classes),
|
|
283
|
+
classes = $target.attr('class'),
|
|
284
|
+
filtered = classes ? $.map(classes.split(' '), function (el, i) {
|
|
285
|
+
if ($.inArray(el, inheritables) !== -1) {
|
|
286
|
+
return el;
|
|
287
|
+
}
|
|
288
|
+
}).join(' ') : '';
|
|
289
|
+
|
|
290
|
+
return $.trim(filtered);
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
convert_to_touch : function ($target) {
|
|
294
|
+
var self = this,
|
|
295
|
+
$tip = self.getTip($target),
|
|
296
|
+
settings = $.extend({}, self.settings, self.data_options($target));
|
|
297
|
+
|
|
298
|
+
if ($tip.find('.tap-to-close').length === 0) {
|
|
299
|
+
$tip.append('<span class="tap-to-close">' + settings.touch_close_text + '</span>');
|
|
300
|
+
$tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function (e) {
|
|
301
|
+
self.hide($target);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
$target.data('tooltip-open-event-type', 'touch');
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
show : function ($target) {
|
|
309
|
+
var $tip = this.getTip($target);
|
|
310
|
+
|
|
311
|
+
if ($target.data('tooltip-open-event-type') == 'touch') {
|
|
312
|
+
this.convert_to_touch($target);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
this.reposition($target, $tip, $target.attr('class'));
|
|
316
|
+
$target.addClass('open');
|
|
317
|
+
$tip.fadeIn(150);
|
|
318
|
+
},
|
|
319
|
+
|
|
320
|
+
hide : function ($target) {
|
|
321
|
+
var $tip = this.getTip($target);
|
|
322
|
+
$tip.fadeOut(150, function () {
|
|
323
|
+
$tip.find('.tap-to-close').remove();
|
|
324
|
+
$tip.off('click.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose');
|
|
325
|
+
$target.removeClass('open');
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
off : function () {
|
|
330
|
+
var self = this;
|
|
331
|
+
this.S(this.scope).off('.fndtn.tooltip');
|
|
332
|
+
this.S(this.settings.tooltip_class).each(function (i) {
|
|
333
|
+
$('[' + self.attr_name() + ']').eq(i).attr('title', $(this).text());
|
|
334
|
+
}).remove();
|
|
335
|
+
},
|
|
336
|
+
|
|
337
|
+
reflow : function () {}
|
|
338
|
+
};
|
|
339
|
+
}(jQuery, window, window.document));
|