locomotivecms_wagon 1.4.0 → 1.5.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile +6 -2
- data/README.md +7 -1
- data/bin/wagon +3 -0
- data/generators/blank/Gemfile.tt +1 -3
- data/generators/blank/config/site.yml.tt +3 -3
- data/generators/bootstrap/config/site.yml.tt +3 -3
- data/generators/bootstrap3/Gemfile.tt +1 -3
- data/generators/bootstrap3/app/views/pages/index.liquid +21 -63
- data/generators/bootstrap3/app/views/pages/index.liquid.haml +15 -57
- data/generators/bootstrap3/config/deploy.yml +15 -15
- data/generators/bootstrap3/config/site.yml.tt +2 -2
- data/generators/bootstrap3/icon.png +0 -0
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.svg +201 -200
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/generators/{bootstrap2/app/content_types → bootstrap3/public/images}/.empty_directory +0 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/affix.js +137 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/alert.js +88 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/button.js +107 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/carousel.js +205 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/collapse.js +170 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/dropdown.js +147 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/modal.js +243 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/popover.js +110 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/scrollspy.js +153 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/tab.js +125 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/tooltip.js +399 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/transition.js +48 -0
- data/generators/bootstrap3/public/javascripts/bootstrap.min.js +12 -6
- data/generators/bootstrap3/public/stylesheets/application.css +1 -0
- data/generators/bootstrap3/public/stylesheets/application.css.scss +8 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_alerts.scss +67 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_badges.scss +55 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_button-groups.scss +226 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_buttons.scss +159 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_carousel.scss +232 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_close.scss +35 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_code.scss +63 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_component-animations.scss +29 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_dropdowns.scss +213 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_forms.scss +436 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_glyphicons.scss +233 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_grid.scss +84 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_input-groups.scss +162 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_jumbotron.scss +44 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_labels.scss +64 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_list-group.scss +110 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_media.scss +56 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_mixins.scss +947 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_modals.scss +139 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_navbar.scss +620 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_navs.scss +242 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_normalize.scss +423 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_pager.scss +55 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_pagination.scss +88 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_panels.scss +241 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_popovers.scss +133 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_print.scss +101 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_progress-bars.scss +80 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_responsive-utilities.scss +74 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_scaffolding.scss +134 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_tables.scss +233 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_theme.scss +247 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_thumbnails.scss +38 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_tooltip.scss +95 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_type.scss +284 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_utilities.scss +56 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_variables.scss +833 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_wells.scss +29 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/bootstrap.css.scss +49 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap.css +2035 -3056
- data/generators/bootstrap3/public/stylesheets/bootstrap.css.scss +49 -0
- data/generators/cloned/Gemfile.tt +1 -3
- data/generators/content_type/app/content_types/%slug%.yml.tt +57 -0
- data/generators/content_type/data/{%name%.yml.tt → %slug%.yml.tt} +2 -2
- data/generators/{bootstrap2 → foundation5}/Gemfile.tt +1 -3
- data/generators/{bootstrap2/data → foundation5/app/content_types}/.empty_directory +0 -0
- data/generators/{foundation → foundation5}/app/views/pages/404.liquid +1 -4
- data/generators/{foundation → foundation5}/app/views/pages/404.liquid.haml +1 -1
- data/generators/foundation5/app/views/pages/index.liquid +196 -0
- data/generators/foundation5/app/views/pages/index.liquid.haml +157 -0
- data/generators/foundation5/config/deploy.yml +15 -0
- data/generators/{bootstrap2 → foundation5}/config/site.yml.tt +3 -4
- data/generators/{bootstrap2 → foundation5}/config/translations.yml +0 -0
- data/generators/{bootstrap2 → foundation5}/config.ru +0 -0
- data/generators/{bootstrap2/public/samples → foundation5/data}/.empty_directory +0 -0
- data/generators/foundation5/favicon.ico +0 -0
- data/generators/foundation5/icon.png +0 -0
- data/generators/{foundation/app/content_types → foundation5/public/fonts}/.empty_directory +0 -0
- data/generators/{foundation/data → foundation5/public/images}/.empty_directory +0 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +299 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +59 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +43 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +534 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +311 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +74 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +331 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +843 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.js +611 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +178 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +108 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +610 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +437 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +199 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +167 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +298 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +425 -0
- data/generators/foundation5/public/javascripts/foundation.js +4161 -0
- data/generators/foundation5/public/javascripts/foundation.min.js +10 -0
- data/generators/{foundation → foundation5}/public/javascripts/vendor/custom.modernizr.js +0 -0
- data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +1 -0
- data/generators/foundation5/public/javascripts/vendor/fastclick.js +9 -0
- data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +11 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +645 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +1 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +8 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +8 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.js +26 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.min.js +27 -0
- data/generators/foundation5/public/javascripts/vendor/modernizr.js +8 -0
- data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +1 -0
- data/generators/foundation5/public/javascripts/vendor/placeholder.js +2 -0
- data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +1 -0
- data/generators/{foundation/public/fonts → foundation5/public/samples}/.empty_directory +0 -0
- data/generators/foundation5/public/stylesheets/application.css +2 -0
- data/generators/foundation5/public/stylesheets/application.css.scss +3 -0
- data/generators/foundation5/public/stylesheets/foundation/_functions.scss +101 -0
- data/generators/foundation5/public/stylesheets/foundation/_settings.scss +1296 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +53 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +126 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +132 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +127 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +108 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +222 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +247 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +129 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +248 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +51 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +498 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +434 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +260 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +57 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +220 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +61 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +104 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +34 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +356 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +423 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +150 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +90 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +150 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +79 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +148 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_reveal-new.scss +0 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +216 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +115 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +191 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +125 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_switch.scss +294 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +129 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +109 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +68 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +140 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +659 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +513 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +408 -0
- data/generators/foundation5/public/stylesheets/foundation.css +5398 -0
- data/generators/foundation5/public/stylesheets/foundation.css.scss +45 -0
- data/generators/foundation5/public/stylesheets/normalize.css +425 -0
- data/generators/foundation5/public/stylesheets/normalize.css.scss +425 -0
- data/generators/{foundation → line_case}/Gemfile.tt +1 -3
- data/generators/line_case/app/content_types/categories.yml +56 -0
- data/generators/line_case/app/content_types/emails.yml +35 -0
- data/generators/line_case/app/content_types/projects.yml +58 -0
- data/generators/{bootstrap2 → line_case}/app/views/pages/404.liquid.haml +3 -2
- data/generators/line_case/app/views/pages/email-registered.liquid.haml +13 -0
- data/generators/line_case/app/views/pages/index.liquid.haml +110 -0
- data/generators/line_case/app/views/pages/projects/content_type_template.liquid.haml +32 -0
- data/generators/line_case/app/views/snippets/newsletter_form.liquid.haml +14 -0
- data/generators/line_case/app/views/snippets/projects.liquid.haml +17 -0
- data/generators/line_case/app/views/snippets/social_links.liquid.haml +19 -0
- data/generators/line_case/config/deploy.yml +15 -0
- data/generators/{foundation → line_case}/config/site.yml.tt +3 -3
- data/generators/{foundation → line_case}/config/translations.yml +0 -0
- data/generators/{foundation → line_case}/config.ru +0 -0
- data/generators/line_case/data/categories.yml +8 -0
- data/generators/line_case/data/emails.yml +2 -0
- data/generators/line_case/data/projects.yml +39 -0
- data/generators/line_case/icon.png +0 -0
- data/generators/line_case/public/images/banner-header.png +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.abide.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.alerts.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.clearing.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.cookie.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.dropdown.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.forms.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.interchange.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.joyride.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.magellan.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.orbit.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.placeholder.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.reveal.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.section.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.tooltips.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.topbar.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation.min.js +0 -0
- data/generators/line_case/public/javascripts/vendor/custom.modernizr.js +4 -0
- data/generators/{foundation → line_case}/public/javascripts/vendor/jquery.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/vendor/zepto.js +0 -0
- data/generators/line_case/public/samples/projects/sample.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample2.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample3.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample4.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample5.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample6.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample7.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample8.jpeg +0 -0
- data/generators/line_case/public/stylesheets/_variables.css.sass +20 -0
- data/generators/line_case/public/stylesheets/foundation/_variables.scss +1290 -0
- data/generators/line_case/public/stylesheets/foundation/components/_alert-boxes.scss +107 -0
- data/generators/line_case/public/stylesheets/foundation/components/_block-grid.scss +71 -0
- data/generators/line_case/public/stylesheets/foundation/components/_breadcrumbs.scss +124 -0
- data/generators/line_case/public/stylesheets/foundation/components/_button-groups.scss +89 -0
- data/generators/line_case/public/stylesheets/foundation/components/_buttons.scss +230 -0
- data/generators/line_case/public/stylesheets/foundation/components/_clearing.scss +227 -0
- data/generators/line_case/public/stylesheets/foundation/components/_custom-forms.scss +278 -0
- data/generators/line_case/public/stylesheets/foundation/components/_dropdown-buttons.scss +115 -0
- data/generators/line_case/public/stylesheets/foundation/components/_dropdown.scss +151 -0
- data/generators/line_case/public/stylesheets/foundation/components/_flex-video.scss +46 -0
- data/generators/line_case/public/stylesheets/foundation/components/_forms.scss +411 -0
- data/generators/line_case/public/stylesheets/foundation/components/_global.scss +366 -0
- data/generators/line_case/public/stylesheets/foundation/components/_grid-5.scss +214 -0
- data/generators/line_case/public/stylesheets/foundation/components/_grid.scss +188 -0
- data/generators/line_case/public/stylesheets/foundation/components/_inline-lists.scss +53 -0
- data/generators/line_case/public/stylesheets/foundation/components/_joyride.scss +217 -0
- data/generators/line_case/public/stylesheets/foundation/components/_keystrokes.scss +57 -0
- data/generators/line_case/public/stylesheets/foundation/components/_labels.scss +85 -0
- data/generators/line_case/public/stylesheets/foundation/components/_magellan.scss +23 -0
- data/generators/line_case/public/stylesheets/foundation/components/_orbit.scss +340 -0
- data/generators/line_case/public/stylesheets/foundation/components/_pagination.scss +140 -0
- data/generators/line_case/public/stylesheets/foundation/components/_panels.scss +83 -0
- data/generators/line_case/public/stylesheets/foundation/components/_pricing-tables.scss +131 -0
- data/generators/line_case/public/stylesheets/foundation/components/_progress-bars.scss +71 -0
- data/generators/line_case/public/stylesheets/foundation/components/_reveal.scss +136 -0
- data/generators/line_case/public/stylesheets/foundation/components/_section.scss +391 -0
- data/generators/line_case/public/stylesheets/foundation/components/_side-nav.scss +69 -0
- data/generators/line_case/public/stylesheets/foundation/components/_split-buttons.scss +167 -0
- data/generators/line_case/public/stylesheets/foundation/components/_sub-nav.scss +84 -0
- data/generators/line_case/public/stylesheets/foundation/components/_switch.scss +266 -0
- data/generators/line_case/public/stylesheets/foundation/components/_tables.scss +84 -0
- data/generators/line_case/public/stylesheets/foundation/components/_thumbs.scss +53 -0
- data/generators/line_case/public/stylesheets/foundation/components/_tooltips.scss +117 -0
- data/generators/line_case/public/stylesheets/foundation/components/_top-bar.scss +576 -0
- data/generators/line_case/public/stylesheets/foundation/components/_type.scss +435 -0
- data/generators/line_case/public/stylesheets/foundation/components/_visibility.scss +322 -0
- data/generators/line_case/public/stylesheets/foundation.css.scss +43 -0
- data/generators/{foundation → line_case}/public/stylesheets/foundation.min.css +0 -0
- data/generators/{foundation/public/stylesheets/normalize.css → line_case/public/stylesheets/normalize.css.scss} +5 -5
- data/generators/line_case/public/stylesheets/pages.css.sass +163 -0
- data/generators/page/template.liquid.haml.tt +8 -5
- data/generators/page/template.liquid.tt +6 -2
- data/lib/locomotive/wagon/cli.rb +139 -43
- data/lib/locomotive/wagon/generators/content_type.rb +26 -10
- data/lib/locomotive/wagon/generators/page.rb +41 -25
- data/lib/locomotive/wagon/generators/site/base.rb +53 -0
- data/lib/locomotive/wagon/generators/site/blank.rb +9 -2
- data/lib/locomotive/wagon/generators/site/bootstrap2.rb +8 -2
- data/lib/locomotive/wagon/generators/site/bootstrap3.rb +20 -2
- data/lib/locomotive/wagon/generators/site/cloned.rb +4 -0
- data/lib/locomotive/wagon/generators/site/{foundation.rb → foundation4.rb} +10 -4
- data/lib/locomotive/wagon/generators/site/foundation5.rb +48 -0
- data/lib/locomotive/wagon/generators/site/line_case.rb +20 -0
- data/lib/locomotive/wagon/generators/site/unzip.rb +10 -2
- data/lib/locomotive/wagon/generators/site.rb +48 -2
- data/lib/locomotive/wagon/generators/snippet.rb +2 -1
- data/lib/locomotive/wagon/liquid/drops/content_types.rb +9 -3
- data/lib/locomotive/wagon/liquid/drops/page.rb +9 -1
- data/lib/locomotive/wagon/liquid/scopeable.rb +1 -1
- data/lib/locomotive/wagon/liquid/tags/fetch_page.rb +41 -0
- data/lib/locomotive/wagon/liquid/tags/model_form.rb +67 -0
- data/lib/locomotive/wagon/liquid/tags/path_helper.rb +2 -2
- data/lib/locomotive/wagon/liquid/tags/with_scope.rb +1 -1
- data/lib/locomotive/wagon/listen.rb +18 -10
- data/lib/locomotive/wagon/logger.rb +4 -0
- data/lib/locomotive/wagon/misc/core_ext.rb +8 -0
- data/lib/locomotive/wagon/misc/deployment_connection.rb +120 -0
- data/lib/locomotive/wagon/misc/hosting_api.rb +115 -0
- data/lib/locomotive/wagon/misc/httparty.rb +2 -0
- data/lib/locomotive/wagon/misc/livereload.rb +43 -0
- data/lib/locomotive/wagon/misc/mounter.rb +1 -1
- data/lib/locomotive/wagon/misc/tcp_port.rb +42 -0
- data/lib/locomotive/wagon/misc/thor.rb +15 -0
- data/lib/locomotive/wagon/server/entry_submission.rb +69 -38
- data/lib/locomotive/wagon/server/middleware.rb +4 -2
- data/lib/locomotive/wagon/server/page.rb +2 -2
- data/lib/locomotive/wagon/server.rb +11 -7
- data/lib/locomotive/wagon/version.rb +1 -1
- data/lib/locomotive/wagon.rb +141 -30
- data/locomotivecms_wagon.gemspec +7 -6
- data/spec/fixtures/default/app/content_types/bands.yml +3 -1
- data/spec/fixtures/default/app/views/pages/all.liquid.haml +3 -0
- data/spec/fixtures/default/app/views/pages/events.liquid.haml +21 -0
- data/spec/fixtures/default/app/views/pages/filtered.liquid.haml +11 -1
- data/spec/fixtures/default/app/views/pages/index.liquid.haml +1 -1
- data/spec/fixtures/default/data/bands.yml +3 -0
- data/spec/integration/server/basic_spec.rb +1 -0
- data/spec/integration/server/contact_form_spec.rb +1 -1
- data/spec/integration/server/liquid_spec.rb +8 -1
- data/spec/integration/server/new_contact_form_spec.rb +67 -0
- data/spec/integration/server/with_scope_spec.rb +10 -0
- data/spec/spec_helper.rb +3 -0
- metadata +339 -144
- data/generators/bootstrap2/app/views/pages/404.liquid +0 -13
- data/generators/bootstrap2/app/views/pages/index.liquid +0 -98
- data/generators/bootstrap2/app/views/pages/index.liquid.haml +0 -80
- data/generators/bootstrap2/app/views/snippets/footer.liquid +0 -3
- data/generators/bootstrap2/app/views/snippets/footer.liquid.haml +0 -2
- data/generators/bootstrap2/config/deploy.yml +0 -15
- data/generators/bootstrap2/public/fonts/FontAwesome.otf +0 -0
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.eot +0 -0
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.svg +0 -399
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.ttf +0 -0
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.woff +0 -0
- data/generators/bootstrap2/public/javascripts/bootstrap.js +0 -2280
- data/generators/bootstrap2/public/javascripts/bootstrap.min.js +0 -6
- data/generators/bootstrap2/public/stylesheets/application.css.scss +0 -39
- data/generators/bootstrap2/public/stylesheets/bootstrap-responsive.css +0 -1109
- data/generators/bootstrap2/public/stylesheets/bootstrap-responsive.min.css +0 -9
- data/generators/bootstrap2/public/stylesheets/bootstrap.css +0 -5568
- data/generators/bootstrap2/public/stylesheets/bootstrap.min.css +0 -9
- data/generators/bootstrap2/public/stylesheets/fonts/awesome.css.scss +0 -3
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome-ie7.css +0 -1203
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome-ie7.min.css +0 -384
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome.css +0 -1470
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome.min.css +0 -403
- data/generators/bootstrap3/public/javascripts/bootstrap.js +0 -1999
- data/generators/bootstrap3/public/stylesheets/bootstrap-theme.css +0 -384
- data/generators/bootstrap3/public/stylesheets/bootstrap-theme.min.css +0 -1
- data/generators/bootstrap3/public/stylesheets/bootstrap.min.css +0 -9
- data/generators/content_type/app/content_types/%name%.yml.tt +0 -58
- data/generators/foundation/app/views/pages/index.liquid +0 -150
- data/generators/foundation/app/views/pages/index.liquid.haml +0 -125
- data/generators/foundation/app/views/snippets/footer.liquid +0 -16
- data/generators/foundation/app/views/snippets/footer.liquid.haml +0 -22
- data/generators/foundation/config/deploy.yml +0 -15
- data/generators/foundation/public/samples/.empty_directory +0 -1
- data/generators/foundation/public/stylesheets/foundation.css +0 -4727
@@ -0,0 +1,4161 @@
|
|
1
|
+
/*
|
2
|
+
* Foundation Responsive Library
|
3
|
+
* http://foundation.zurb.com
|
4
|
+
* Copyright 2013, ZURB
|
5
|
+
* Free to use under the MIT license.
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
*/
|
8
|
+
|
9
|
+
(function ($, window, document, undefined) {
|
10
|
+
'use strict';
|
11
|
+
|
12
|
+
// Used to retrieve Foundation media queries from CSS.
|
13
|
+
if($('head').has('.foundation-mq-small').length === 0) {
|
14
|
+
$('head').append('<meta class="foundation-mq-small">');
|
15
|
+
}
|
16
|
+
|
17
|
+
if($('head').has('.foundation-mq-medium').length === 0) {
|
18
|
+
$('head').append('<meta class="foundation-mq-medium">');
|
19
|
+
}
|
20
|
+
|
21
|
+
if($('head').has('.foundation-mq-large').length === 0) {
|
22
|
+
$('head').append('<meta class="foundation-mq-large">');
|
23
|
+
}
|
24
|
+
|
25
|
+
if($('head').has('.foundation-mq-xlarge').length === 0) {
|
26
|
+
$('head').append('<meta class="foundation-mq-xlarge">');
|
27
|
+
}
|
28
|
+
|
29
|
+
if($('head').has('.foundation-mq-xxlarge').length === 0) {
|
30
|
+
$('head').append('<meta class="foundation-mq-xxlarge">');
|
31
|
+
}
|
32
|
+
|
33
|
+
// Enable FastClick if present
|
34
|
+
|
35
|
+
$(function() {
|
36
|
+
if(typeof FastClick !== 'undefined') {
|
37
|
+
// Don't attach to body if undefined
|
38
|
+
if (typeof document.body !== 'undefined') {
|
39
|
+
FastClick.attach(document.body);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
});
|
43
|
+
|
44
|
+
// private Fast Selector wrapper,
|
45
|
+
// returns jQuery object. Only use where
|
46
|
+
// getElementById is not available.
|
47
|
+
var S = function (selector, context) {
|
48
|
+
if (typeof selector === 'string') {
|
49
|
+
if (context) {
|
50
|
+
return $(context.querySelectorAll(selector));
|
51
|
+
}
|
52
|
+
|
53
|
+
return $(document.querySelectorAll(selector));
|
54
|
+
}
|
55
|
+
|
56
|
+
return $(selector, context);
|
57
|
+
};
|
58
|
+
|
59
|
+
/*
|
60
|
+
https://github.com/paulirish/matchMedia.js
|
61
|
+
*/
|
62
|
+
|
63
|
+
window.matchMedia = window.matchMedia || (function( doc, undefined ) {
|
64
|
+
|
65
|
+
"use strict";
|
66
|
+
|
67
|
+
var bool,
|
68
|
+
docElem = doc.documentElement,
|
69
|
+
refNode = docElem.firstElementChild || docElem.firstChild,
|
70
|
+
// fakeBody required for <FF4 when executed in <head>
|
71
|
+
fakeBody = doc.createElement( "body" ),
|
72
|
+
div = doc.createElement( "div" );
|
73
|
+
|
74
|
+
div.id = "mq-test-1";
|
75
|
+
div.style.cssText = "position:absolute;top:-100em";
|
76
|
+
fakeBody.style.background = "none";
|
77
|
+
fakeBody.appendChild(div);
|
78
|
+
|
79
|
+
return function(q){
|
80
|
+
|
81
|
+
div.innerHTML = "­<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>";
|
82
|
+
|
83
|
+
docElem.insertBefore( fakeBody, refNode );
|
84
|
+
bool = div.offsetWidth === 42;
|
85
|
+
docElem.removeChild( fakeBody );
|
86
|
+
|
87
|
+
return {
|
88
|
+
matches: bool,
|
89
|
+
media: q
|
90
|
+
};
|
91
|
+
|
92
|
+
};
|
93
|
+
|
94
|
+
}( document ));
|
95
|
+
|
96
|
+
/*
|
97
|
+
* jquery.requestAnimationFrame
|
98
|
+
* https://github.com/gnarf37/jquery-requestAnimationFrame
|
99
|
+
* Requires jQuery 1.8+
|
100
|
+
*
|
101
|
+
* Copyright (c) 2012 Corey Frang
|
102
|
+
* Licensed under the MIT license.
|
103
|
+
*/
|
104
|
+
|
105
|
+
(function( $ ) {
|
106
|
+
|
107
|
+
// requestAnimationFrame polyfill adapted from Erik Möller
|
108
|
+
// fixes from Paul Irish and Tino Zijdel
|
109
|
+
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
110
|
+
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
|
111
|
+
|
112
|
+
|
113
|
+
var animating,
|
114
|
+
lastTime = 0,
|
115
|
+
vendors = ['webkit', 'moz'],
|
116
|
+
requestAnimationFrame = window.requestAnimationFrame,
|
117
|
+
cancelAnimationFrame = window.cancelAnimationFrame;
|
118
|
+
|
119
|
+
for(; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
|
120
|
+
requestAnimationFrame = window[ vendors[lastTime] + "RequestAnimationFrame" ];
|
121
|
+
cancelAnimationFrame = cancelAnimationFrame ||
|
122
|
+
window[ vendors[lastTime] + "CancelAnimationFrame" ] ||
|
123
|
+
window[ vendors[lastTime] + "CancelRequestAnimationFrame" ];
|
124
|
+
}
|
125
|
+
|
126
|
+
function raf() {
|
127
|
+
if ( animating ) {
|
128
|
+
requestAnimationFrame( raf );
|
129
|
+
jQuery.fx.tick();
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
if ( requestAnimationFrame ) {
|
134
|
+
// use rAF
|
135
|
+
window.requestAnimationFrame = requestAnimationFrame;
|
136
|
+
window.cancelAnimationFrame = cancelAnimationFrame;
|
137
|
+
jQuery.fx.timer = function( timer ) {
|
138
|
+
if ( timer() && jQuery.timers.push( timer ) && !animating ) {
|
139
|
+
animating = true;
|
140
|
+
raf();
|
141
|
+
}
|
142
|
+
};
|
143
|
+
|
144
|
+
jQuery.fx.stop = function() {
|
145
|
+
animating = false;
|
146
|
+
};
|
147
|
+
} else {
|
148
|
+
// polyfill
|
149
|
+
window.requestAnimationFrame = function( callback, element ) {
|
150
|
+
var currTime = new Date().getTime(),
|
151
|
+
timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) ),
|
152
|
+
id = window.setTimeout( function() {
|
153
|
+
callback( currTime + timeToCall );
|
154
|
+
}, timeToCall );
|
155
|
+
lastTime = currTime + timeToCall;
|
156
|
+
return id;
|
157
|
+
};
|
158
|
+
|
159
|
+
window.cancelAnimationFrame = function(id) {
|
160
|
+
clearTimeout(id);
|
161
|
+
};
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
}( jQuery ));
|
166
|
+
|
167
|
+
|
168
|
+
function removeQuotes (string) {
|
169
|
+
if (typeof string === 'string' || string instanceof String) {
|
170
|
+
string = string.replace(/^[\\/'"]+|(;\s?})+|[\\/'"]+$/g, '');
|
171
|
+
}
|
172
|
+
|
173
|
+
return string;
|
174
|
+
}
|
175
|
+
|
176
|
+
window.Foundation = {
|
177
|
+
name : 'Foundation',
|
178
|
+
|
179
|
+
version : '5.0.3',
|
180
|
+
|
181
|
+
media_queries : {
|
182
|
+
small : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
183
|
+
medium : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
184
|
+
large : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
185
|
+
xlarge: S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
186
|
+
xxlarge: S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
|
187
|
+
},
|
188
|
+
|
189
|
+
stylesheet : $('<style></style>').appendTo('head')[0].sheet,
|
190
|
+
|
191
|
+
init : function (scope, libraries, method, options, response) {
|
192
|
+
var library_arr,
|
193
|
+
args = [scope, method, options, response],
|
194
|
+
responses = [];
|
195
|
+
|
196
|
+
// check RTL
|
197
|
+
this.rtl = /rtl/i.test(S('html').attr('dir'));
|
198
|
+
|
199
|
+
// set foundation global scope
|
200
|
+
this.scope = scope || this.scope;
|
201
|
+
|
202
|
+
if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) {
|
203
|
+
if (this.libs.hasOwnProperty(libraries)) {
|
204
|
+
responses.push(this.init_lib(libraries, args));
|
205
|
+
}
|
206
|
+
} else {
|
207
|
+
for (var lib in this.libs) {
|
208
|
+
responses.push(this.init_lib(lib, libraries));
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
return scope;
|
213
|
+
},
|
214
|
+
|
215
|
+
init_lib : function (lib, args) {
|
216
|
+
if (this.libs.hasOwnProperty(lib)) {
|
217
|
+
this.patch(this.libs[lib]);
|
218
|
+
|
219
|
+
if (args && args.hasOwnProperty(lib)) {
|
220
|
+
return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
|
221
|
+
}
|
222
|
+
|
223
|
+
args = args instanceof Array ? args : Array(args); // PATCH: added this line
|
224
|
+
return this.libs[lib].init.apply(this.libs[lib], args);
|
225
|
+
}
|
226
|
+
|
227
|
+
return function () {};
|
228
|
+
},
|
229
|
+
|
230
|
+
patch : function (lib) {
|
231
|
+
lib.scope = this.scope;
|
232
|
+
lib['data_options'] = this.lib_methods.data_options;
|
233
|
+
lib['bindings'] = this.lib_methods.bindings;
|
234
|
+
lib['S'] = S;
|
235
|
+
lib.rtl = this.rtl;
|
236
|
+
},
|
237
|
+
|
238
|
+
inherit : function (scope, methods) {
|
239
|
+
var methods_arr = methods.split(' ');
|
240
|
+
|
241
|
+
for (var i = methods_arr.length - 1; i >= 0; i--) {
|
242
|
+
if (this.lib_methods.hasOwnProperty(methods_arr[i])) {
|
243
|
+
this.libs[scope.name][methods_arr[i]] = this.lib_methods[methods_arr[i]];
|
244
|
+
}
|
245
|
+
}
|
246
|
+
},
|
247
|
+
|
248
|
+
random_str : function (length) {
|
249
|
+
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
250
|
+
|
251
|
+
if (!length) {
|
252
|
+
length = Math.floor(Math.random() * chars.length);
|
253
|
+
}
|
254
|
+
|
255
|
+
var str = '';
|
256
|
+
for (var i = 0; i < length; i++) {
|
257
|
+
str += chars[Math.floor(Math.random() * chars.length)];
|
258
|
+
}
|
259
|
+
return str;
|
260
|
+
},
|
261
|
+
|
262
|
+
libs : {},
|
263
|
+
|
264
|
+
// methods that can be inherited in libraries
|
265
|
+
lib_methods : {
|
266
|
+
throttle : function(fun, delay) {
|
267
|
+
var timer = null;
|
268
|
+
|
269
|
+
return function () {
|
270
|
+
var context = this, args = arguments;
|
271
|
+
|
272
|
+
clearTimeout(timer);
|
273
|
+
timer = setTimeout(function () {
|
274
|
+
fun.apply(context, args);
|
275
|
+
}, delay);
|
276
|
+
};
|
277
|
+
},
|
278
|
+
|
279
|
+
// parses data-options attribute
|
280
|
+
data_options : function (el) {
|
281
|
+
var opts = {}, ii, p, opts_arr, opts_len,
|
282
|
+
data_options = el.data('options');
|
283
|
+
|
284
|
+
if (typeof data_options === 'object') {
|
285
|
+
return data_options;
|
286
|
+
}
|
287
|
+
|
288
|
+
opts_arr = (data_options || ':').split(';'),
|
289
|
+
opts_len = opts_arr.length;
|
290
|
+
|
291
|
+
function isNumber (o) {
|
292
|
+
return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true;
|
293
|
+
}
|
294
|
+
|
295
|
+
function trim(str) {
|
296
|
+
if (typeof str === 'string') return $.trim(str);
|
297
|
+
return str;
|
298
|
+
}
|
299
|
+
|
300
|
+
// parse options
|
301
|
+
for (ii = opts_len - 1; ii >= 0; ii--) {
|
302
|
+
p = opts_arr[ii].split(':');
|
303
|
+
|
304
|
+
if (/true/i.test(p[1])) p[1] = true;
|
305
|
+
if (/false/i.test(p[1])) p[1] = false;
|
306
|
+
if (isNumber(p[1])) p[1] = parseInt(p[1], 10);
|
307
|
+
|
308
|
+
if (p.length === 2 && p[0].length > 0) {
|
309
|
+
opts[trim(p[0])] = trim(p[1]);
|
310
|
+
}
|
311
|
+
}
|
312
|
+
|
313
|
+
return opts;
|
314
|
+
},
|
315
|
+
|
316
|
+
delay : function (fun, delay) {
|
317
|
+
return setTimeout(fun, delay);
|
318
|
+
},
|
319
|
+
|
320
|
+
// test for empty object or array
|
321
|
+
empty : function (obj) {
|
322
|
+
if (obj.length && obj.length > 0) return false;
|
323
|
+
if (obj.length && obj.length === 0) return true;
|
324
|
+
|
325
|
+
for (var key in obj) {
|
326
|
+
if (hasOwnProperty.call(obj, key)) return false;
|
327
|
+
}
|
328
|
+
|
329
|
+
return true;
|
330
|
+
},
|
331
|
+
|
332
|
+
register_media : function(media, media_class) {
|
333
|
+
if(Foundation.media_queries[media] === undefined) {
|
334
|
+
$('head').append('<meta class="' + media_class + '">');
|
335
|
+
Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
|
336
|
+
}
|
337
|
+
},
|
338
|
+
|
339
|
+
addCustomRule : function(rule, media) {
|
340
|
+
if(media === undefined) {
|
341
|
+
Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length);
|
342
|
+
} else {
|
343
|
+
var query = Foundation.media_queries[media];
|
344
|
+
if(query !== undefined) {
|
345
|
+
Foundation.stylesheet.insertRule('@media ' +
|
346
|
+
Foundation.media_queries[media] + '{ ' + rule + ' }');
|
347
|
+
}
|
348
|
+
}
|
349
|
+
},
|
350
|
+
|
351
|
+
loaded : function (image, callback) {
|
352
|
+
function loaded () {
|
353
|
+
callback(image[0]);
|
354
|
+
}
|
355
|
+
|
356
|
+
function bindLoad () {
|
357
|
+
this.one('load', loaded);
|
358
|
+
|
359
|
+
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
|
360
|
+
var src = this.attr( 'src' ),
|
361
|
+
param = src.match( /\?/ ) ? '&' : '?';
|
362
|
+
|
363
|
+
param += 'random=' + (new Date()).getTime();
|
364
|
+
this.attr('src', src + param);
|
365
|
+
}
|
366
|
+
}
|
367
|
+
|
368
|
+
if (!image.attr('src')) {
|
369
|
+
loaded();
|
370
|
+
return;
|
371
|
+
}
|
372
|
+
|
373
|
+
if (image[0].complete || image[0].readyState === 4) {
|
374
|
+
loaded();
|
375
|
+
} else {
|
376
|
+
bindLoad.call(image);
|
377
|
+
}
|
378
|
+
},
|
379
|
+
|
380
|
+
bindings : function (method, options) {
|
381
|
+
var self = this,
|
382
|
+
should_bind_events = !S(this).data(this.name + '-init');
|
383
|
+
|
384
|
+
if (typeof method === 'string') {
|
385
|
+
return this[method].call(this, options);
|
386
|
+
}
|
387
|
+
|
388
|
+
if (S(this.scope).is('[data-' + this.name +']')) {
|
389
|
+
S(this.scope).data(this.name + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope))));
|
390
|
+
|
391
|
+
if (should_bind_events) {
|
392
|
+
this.events(this.scope);
|
393
|
+
}
|
394
|
+
|
395
|
+
} else {
|
396
|
+
S('[data-' + this.name + ']', this.scope).each(function () {
|
397
|
+
var should_bind_events = !S(this).data(self.name + '-init');
|
398
|
+
|
399
|
+
S(this).data(self.name + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this))));
|
400
|
+
|
401
|
+
if (should_bind_events) {
|
402
|
+
self.events(this);
|
403
|
+
}
|
404
|
+
});
|
405
|
+
}
|
406
|
+
}
|
407
|
+
}
|
408
|
+
};
|
409
|
+
|
410
|
+
$.fn.foundation = function () {
|
411
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
412
|
+
|
413
|
+
return this.each(function () {
|
414
|
+
Foundation.init.apply(Foundation, [this].concat(args));
|
415
|
+
return this;
|
416
|
+
});
|
417
|
+
};
|
418
|
+
|
419
|
+
}(jQuery, this, this.document));
|
420
|
+
|
421
|
+
|
422
|
+
/*
|
423
|
+
* You should really comment out any of the following not being used
|
424
|
+
* Mixture will then output a new combined and minified file
|
425
|
+
*/
|
426
|
+
;(function ($, window, document, undefined) {
|
427
|
+
'use strict';
|
428
|
+
|
429
|
+
Foundation.libs.alert = {
|
430
|
+
name : 'alert',
|
431
|
+
|
432
|
+
version : '5.0.0',
|
433
|
+
|
434
|
+
settings : {
|
435
|
+
animation: 'fadeOut',
|
436
|
+
speed: 300, // fade out speed
|
437
|
+
callback: function (){}
|
438
|
+
},
|
439
|
+
|
440
|
+
init : function (scope, method, options) {
|
441
|
+
this.bindings(method, options);
|
442
|
+
},
|
443
|
+
|
444
|
+
events : function () {
|
445
|
+
$(this.scope).off('.alert').on('click.fndtn.alert', '[data-alert] a.close', function (e) {
|
446
|
+
var alertBox = $(this).closest("[data-alert]"),
|
447
|
+
settings = alertBox.data('alert-init') || Foundation.libs.alert.settings;
|
448
|
+
|
449
|
+
e.preventDefault();
|
450
|
+
alertBox[settings.animation](settings.speed, function () {
|
451
|
+
$(this).trigger('closed').remove();
|
452
|
+
settings.callback();
|
453
|
+
});
|
454
|
+
});
|
455
|
+
},
|
456
|
+
|
457
|
+
reflow : function () {}
|
458
|
+
};
|
459
|
+
}(jQuery, this, this.document));
|
460
|
+
|
461
|
+
;(function ($, window, document, undefined) {
|
462
|
+
'use strict';
|
463
|
+
|
464
|
+
Foundation.libs.accordion = {
|
465
|
+
name : 'accordion',
|
466
|
+
|
467
|
+
version : '5.0.1',
|
468
|
+
|
469
|
+
settings : {
|
470
|
+
active_class: 'active',
|
471
|
+
toggleable: true
|
472
|
+
},
|
473
|
+
|
474
|
+
init : function (scope, method, options) {
|
475
|
+
this.bindings(method, options);
|
476
|
+
},
|
477
|
+
|
478
|
+
events : function () {
|
479
|
+
$(this.scope).off('.accordion').on('click.fndtn.accordion', '[data-accordion] > dd > a', function (e) {
|
480
|
+
var accordion = $(this).parent(),
|
481
|
+
target = $('#' + this.href.split('#')[1]),
|
482
|
+
siblings = $('> dd > .content', target.closest('[data-accordion]')),
|
483
|
+
settings = accordion.parent().data('accordion-init'),
|
484
|
+
active = $('> dd > .content.' + settings.active_class, accordion.parent());
|
485
|
+
|
486
|
+
e.preventDefault();
|
487
|
+
|
488
|
+
if (active[0] == target[0] && settings.toggleable) {
|
489
|
+
return target.toggleClass(settings.active_class);
|
490
|
+
}
|
491
|
+
|
492
|
+
siblings.removeClass(settings.active_class);
|
493
|
+
target.addClass(settings.active_class);
|
494
|
+
});
|
495
|
+
},
|
496
|
+
|
497
|
+
off : function () {},
|
498
|
+
|
499
|
+
reflow : function () {}
|
500
|
+
};
|
501
|
+
}(jQuery, this, this.document));
|
502
|
+
|
503
|
+
;(function ($, window, document, undefined) {
|
504
|
+
'use strict';
|
505
|
+
|
506
|
+
Foundation.libs.clearing = {
|
507
|
+
name : 'clearing',
|
508
|
+
|
509
|
+
version: '5.0.3',
|
510
|
+
|
511
|
+
settings : {
|
512
|
+
templates : {
|
513
|
+
viewing : '<a href="#" class="clearing-close">×</a>' +
|
514
|
+
'<div class="visible-img" style="display: none"><img src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />' +
|
515
|
+
'<p class="clearing-caption"></p><a href="#" class="clearing-main-prev"><span></span></a>' +
|
516
|
+
'<a href="#" class="clearing-main-next"><span></span></a></div>'
|
517
|
+
},
|
518
|
+
|
519
|
+
// comma delimited list of selectors that, on click, will close clearing,
|
520
|
+
// add 'div.clearing-blackout, div.visible-img' to close on background click
|
521
|
+
close_selectors : '.clearing-close',
|
522
|
+
|
523
|
+
// event initializers and locks
|
524
|
+
init : false,
|
525
|
+
locked : false
|
526
|
+
},
|
527
|
+
|
528
|
+
init : function (scope, method, options) {
|
529
|
+
var self = this;
|
530
|
+
Foundation.inherit(this, 'throttle loaded');
|
531
|
+
|
532
|
+
this.bindings(method, options);
|
533
|
+
|
534
|
+
if ($(this.scope).is('[data-clearing]')) {
|
535
|
+
this.assemble($('li', this.scope));
|
536
|
+
} else {
|
537
|
+
$('[data-clearing]', this.scope).each(function () {
|
538
|
+
self.assemble($('li', this));
|
539
|
+
});
|
540
|
+
}
|
541
|
+
},
|
542
|
+
|
543
|
+
events : function (scope) {
|
544
|
+
var self = this;
|
545
|
+
|
546
|
+
$(this.scope)
|
547
|
+
.off('.clearing')
|
548
|
+
.on('click.fndtn.clearing', 'ul[data-clearing] li',
|
549
|
+
function (e, current, target) {
|
550
|
+
var current = current || $(this),
|
551
|
+
target = target || current,
|
552
|
+
next = current.next('li'),
|
553
|
+
settings = current.closest('[data-clearing]').data('clearing-init'),
|
554
|
+
image = $(e.target);
|
555
|
+
|
556
|
+
e.preventDefault();
|
557
|
+
|
558
|
+
if (!settings) {
|
559
|
+
self.init();
|
560
|
+
settings = current.closest('[data-clearing]').data('clearing-init');
|
561
|
+
}
|
562
|
+
|
563
|
+
// if clearing is open and the current image is
|
564
|
+
// clicked, go to the next image in sequence
|
565
|
+
if (target.hasClass('visible') &&
|
566
|
+
current[0] === target[0] &&
|
567
|
+
next.length > 0 && self.is_open(current)) {
|
568
|
+
target = next;
|
569
|
+
image = $('img', target);
|
570
|
+
}
|
571
|
+
|
572
|
+
// set current and target to the clicked li if not otherwise defined.
|
573
|
+
self.open(image, current, target);
|
574
|
+
self.update_paddles(target);
|
575
|
+
})
|
576
|
+
|
577
|
+
.on('click.fndtn.clearing', '.clearing-main-next',
|
578
|
+
function (e) { self.nav(e, 'next') })
|
579
|
+
.on('click.fndtn.clearing', '.clearing-main-prev',
|
580
|
+
function (e) { self.nav(e, 'prev') })
|
581
|
+
.on('click.fndtn.clearing', this.settings.close_selectors,
|
582
|
+
function (e) { Foundation.libs.clearing.close(e, this) })
|
583
|
+
.on('keydown.fndtn.clearing',
|
584
|
+
function (e) { self.keydown(e) });
|
585
|
+
|
586
|
+
$(window).off('.clearing').on('resize.fndtn.clearing',
|
587
|
+
function () { self.resize() });
|
588
|
+
|
589
|
+
this.swipe_events(scope);
|
590
|
+
},
|
591
|
+
|
592
|
+
swipe_events : function (scope) {
|
593
|
+
var self = this;
|
594
|
+
|
595
|
+
$(this.scope)
|
596
|
+
.on('touchstart.fndtn.clearing', '.visible-img', function(e) {
|
597
|
+
if (!e.touches) { e = e.originalEvent; }
|
598
|
+
var data = {
|
599
|
+
start_page_x: e.touches[0].pageX,
|
600
|
+
start_page_y: e.touches[0].pageY,
|
601
|
+
start_time: (new Date()).getTime(),
|
602
|
+
delta_x: 0,
|
603
|
+
is_scrolling: undefined
|
604
|
+
};
|
605
|
+
|
606
|
+
$(this).data('swipe-transition', data);
|
607
|
+
e.stopPropagation();
|
608
|
+
})
|
609
|
+
.on('touchmove.fndtn.clearing', '.visible-img', function(e) {
|
610
|
+
if (!e.touches) { e = e.originalEvent; }
|
611
|
+
// Ignore pinch/zoom events
|
612
|
+
if(e.touches.length > 1 || e.scale && e.scale !== 1) return;
|
613
|
+
|
614
|
+
var data = $(this).data('swipe-transition');
|
615
|
+
|
616
|
+
if (typeof data === 'undefined') {
|
617
|
+
data = {};
|
618
|
+
}
|
619
|
+
|
620
|
+
data.delta_x = e.touches[0].pageX - data.start_page_x;
|
621
|
+
|
622
|
+
if ( typeof data.is_scrolling === 'undefined') {
|
623
|
+
data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );
|
624
|
+
}
|
625
|
+
|
626
|
+
if (!data.is_scrolling && !data.active) {
|
627
|
+
e.preventDefault();
|
628
|
+
var direction = (data.delta_x < 0) ? 'next' : 'prev';
|
629
|
+
data.active = true;
|
630
|
+
self.nav(e, direction);
|
631
|
+
}
|
632
|
+
})
|
633
|
+
.on('touchend.fndtn.clearing', '.visible-img', function(e) {
|
634
|
+
$(this).data('swipe-transition', {});
|
635
|
+
e.stopPropagation();
|
636
|
+
});
|
637
|
+
},
|
638
|
+
|
639
|
+
assemble : function ($li) {
|
640
|
+
var $el = $li.parent();
|
641
|
+
|
642
|
+
if ($el.parent().hasClass('carousel')) return;
|
643
|
+
$el.after('<div id="foundationClearingHolder"></div>');
|
644
|
+
|
645
|
+
var holder = $('#foundationClearingHolder'),
|
646
|
+
settings = $el.data('clearing-init'),
|
647
|
+
grid = $el.detach(),
|
648
|
+
data = {
|
649
|
+
grid: '<div class="carousel">' + grid[0].outerHTML + '</div>',
|
650
|
+
viewing: settings.templates.viewing
|
651
|
+
},
|
652
|
+
wrapper = '<div class="clearing-assembled"><div>' + data.viewing +
|
653
|
+
data.grid + '</div></div>';
|
654
|
+
|
655
|
+
return holder.after(wrapper).remove();
|
656
|
+
},
|
657
|
+
|
658
|
+
open : function ($image, current, target) {
|
659
|
+
var root = target.closest('.clearing-assembled'),
|
660
|
+
container = $('div', root).first(),
|
661
|
+
visible_image = $('.visible-img', container),
|
662
|
+
image = $('img', visible_image).not($image);
|
663
|
+
|
664
|
+
if (!this.locked()) {
|
665
|
+
// set the image to the selected thumbnail
|
666
|
+
image
|
667
|
+
.attr('src', this.load($image))
|
668
|
+
.css('visibility', 'hidden');
|
669
|
+
|
670
|
+
this.loaded(image, function () {
|
671
|
+
image.css('visibility', 'visible');
|
672
|
+
// toggle the gallery
|
673
|
+
root.addClass('clearing-blackout');
|
674
|
+
container.addClass('clearing-container');
|
675
|
+
visible_image.show();
|
676
|
+
this.fix_height(target)
|
677
|
+
.caption($('.clearing-caption', visible_image), $image)
|
678
|
+
.center(image)
|
679
|
+
.shift(current, target, function () {
|
680
|
+
target.siblings().removeClass('visible');
|
681
|
+
target.addClass('visible');
|
682
|
+
});
|
683
|
+
}.bind(this));
|
684
|
+
}
|
685
|
+
},
|
686
|
+
|
687
|
+
close : function (e, el) {
|
688
|
+
e.preventDefault();
|
689
|
+
|
690
|
+
var root = (function (target) {
|
691
|
+
if (/blackout/.test(target.selector)) {
|
692
|
+
return target;
|
693
|
+
} else {
|
694
|
+
return target.closest('.clearing-blackout');
|
695
|
+
}
|
696
|
+
}($(el))), container, visible_image;
|
697
|
+
|
698
|
+
if (el === e.target && root) {
|
699
|
+
container = $('div', root).first();
|
700
|
+
visible_image = $('.visible-img', container);
|
701
|
+
this.settings.prev_index = 0;
|
702
|
+
$('ul[data-clearing]', root)
|
703
|
+
.attr('style', '').closest('.clearing-blackout')
|
704
|
+
.removeClass('clearing-blackout');
|
705
|
+
container.removeClass('clearing-container');
|
706
|
+
visible_image.hide();
|
707
|
+
}
|
708
|
+
|
709
|
+
return false;
|
710
|
+
},
|
711
|
+
|
712
|
+
is_open : function (current) {
|
713
|
+
return current.parent().prop('style').length > 0;
|
714
|
+
},
|
715
|
+
|
716
|
+
keydown : function (e) {
|
717
|
+
var clearing = $('ul[data-clearing]', '.clearing-blackout');
|
718
|
+
|
719
|
+
if (e.which === 39) this.go(clearing, 'next');
|
720
|
+
if (e.which === 37) this.go(clearing, 'prev');
|
721
|
+
if (e.which === 27) $('a.clearing-close').trigger('click');
|
722
|
+
},
|
723
|
+
|
724
|
+
nav : function (e, direction) {
|
725
|
+
var clearing = $('ul[data-clearing]', '.clearing-blackout');
|
726
|
+
|
727
|
+
e.preventDefault();
|
728
|
+
this.go(clearing, direction);
|
729
|
+
},
|
730
|
+
|
731
|
+
resize : function () {
|
732
|
+
var image = $('img', '.clearing-blackout .visible-img');
|
733
|
+
|
734
|
+
if (image.length) {
|
735
|
+
this.center(image);
|
736
|
+
}
|
737
|
+
},
|
738
|
+
|
739
|
+
// visual adjustments
|
740
|
+
fix_height : function (target) {
|
741
|
+
var lis = target.parent().children(),
|
742
|
+
self = this;
|
743
|
+
|
744
|
+
lis.each(function () {
|
745
|
+
var li = $(this),
|
746
|
+
image = li.find('img');
|
747
|
+
|
748
|
+
if (li.height() > image.outerHeight()) {
|
749
|
+
li.addClass('fix-height');
|
750
|
+
}
|
751
|
+
})
|
752
|
+
.closest('ul')
|
753
|
+
.width(lis.length * 100 + '%');
|
754
|
+
|
755
|
+
return this;
|
756
|
+
},
|
757
|
+
|
758
|
+
update_paddles : function (target) {
|
759
|
+
var visible_image = target
|
760
|
+
.closest('.carousel')
|
761
|
+
.siblings('.visible-img');
|
762
|
+
|
763
|
+
if (target.next().length > 0) {
|
764
|
+
$('.clearing-main-next', visible_image)
|
765
|
+
.removeClass('disabled');
|
766
|
+
} else {
|
767
|
+
$('.clearing-main-next', visible_image)
|
768
|
+
.addClass('disabled');
|
769
|
+
}
|
770
|
+
|
771
|
+
if (target.prev().length > 0) {
|
772
|
+
$('.clearing-main-prev', visible_image)
|
773
|
+
.removeClass('disabled');
|
774
|
+
} else {
|
775
|
+
$('.clearing-main-prev', visible_image)
|
776
|
+
.addClass('disabled');
|
777
|
+
}
|
778
|
+
},
|
779
|
+
|
780
|
+
center : function (target) {
|
781
|
+
if (!this.rtl) {
|
782
|
+
target.css({
|
783
|
+
marginLeft : -(target.outerWidth() / 2),
|
784
|
+
marginTop : -(target.outerHeight() / 2)
|
785
|
+
});
|
786
|
+
} else {
|
787
|
+
target.css({
|
788
|
+
marginRight : -(target.outerWidth() / 2),
|
789
|
+
marginTop : -(target.outerHeight() / 2),
|
790
|
+
left: 'auto',
|
791
|
+
right: '50%'
|
792
|
+
});
|
793
|
+
}
|
794
|
+
return this;
|
795
|
+
},
|
796
|
+
|
797
|
+
// image loading and preloading
|
798
|
+
|
799
|
+
load : function ($image) {
|
800
|
+
if ($image[0].nodeName === "A") {
|
801
|
+
var href = $image.attr('href');
|
802
|
+
} else {
|
803
|
+
var href = $image.parent().attr('href');
|
804
|
+
}
|
805
|
+
|
806
|
+
this.preload($image);
|
807
|
+
|
808
|
+
if (href) return href;
|
809
|
+
return $image.attr('src');
|
810
|
+
},
|
811
|
+
|
812
|
+
preload : function ($image) {
|
813
|
+
this
|
814
|
+
.img($image.closest('li').next())
|
815
|
+
.img($image.closest('li').prev());
|
816
|
+
},
|
817
|
+
|
818
|
+
img : function (img) {
|
819
|
+
if (img.length) {
|
820
|
+
var new_img = new Image(),
|
821
|
+
new_a = $('a', img);
|
822
|
+
|
823
|
+
if (new_a.length) {
|
824
|
+
new_img.src = new_a.attr('href');
|
825
|
+
} else {
|
826
|
+
new_img.src = $('img', img).attr('src');
|
827
|
+
}
|
828
|
+
}
|
829
|
+
return this;
|
830
|
+
},
|
831
|
+
|
832
|
+
// image caption
|
833
|
+
|
834
|
+
caption : function (container, $image) {
|
835
|
+
var caption = $image.data('caption');
|
836
|
+
|
837
|
+
if (caption) {
|
838
|
+
container
|
839
|
+
.html(caption)
|
840
|
+
.show();
|
841
|
+
} else {
|
842
|
+
container
|
843
|
+
.text('')
|
844
|
+
.hide();
|
845
|
+
}
|
846
|
+
return this;
|
847
|
+
},
|
848
|
+
|
849
|
+
// directional methods
|
850
|
+
|
851
|
+
go : function ($ul, direction) {
|
852
|
+
var current = $('.visible', $ul),
|
853
|
+
target = current[direction]();
|
854
|
+
|
855
|
+
if (target.length) {
|
856
|
+
$('img', target)
|
857
|
+
.trigger('click', [current, target]);
|
858
|
+
}
|
859
|
+
},
|
860
|
+
|
861
|
+
shift : function (current, target, callback) {
|
862
|
+
var clearing = target.parent(),
|
863
|
+
old_index = this.settings.prev_index || target.index(),
|
864
|
+
direction = this.direction(clearing, current, target),
|
865
|
+
dir = this.rtl ? 'right' : 'left',
|
866
|
+
left = parseInt(clearing.css('left'), 10),
|
867
|
+
width = target.outerWidth(),
|
868
|
+
skip_shift;
|
869
|
+
|
870
|
+
var dir_obj = {};
|
871
|
+
|
872
|
+
// we use jQuery animate instead of CSS transitions because we
|
873
|
+
// need a callback to unlock the next animation
|
874
|
+
// needs support for RTL **
|
875
|
+
if (target.index() !== old_index && !/skip/.test(direction)){
|
876
|
+
if (/left/.test(direction)) {
|
877
|
+
this.lock();
|
878
|
+
dir_obj[dir] = left + width;
|
879
|
+
clearing.animate(dir_obj, 300, this.unlock());
|
880
|
+
} else if (/right/.test(direction)) {
|
881
|
+
this.lock();
|
882
|
+
dir_obj[dir] = left - width;
|
883
|
+
clearing.animate(dir_obj, 300, this.unlock());
|
884
|
+
}
|
885
|
+
} else if (/skip/.test(direction)) {
|
886
|
+
// the target image is not adjacent to the current image, so
|
887
|
+
// do we scroll right or not
|
888
|
+
skip_shift = target.index() - this.settings.up_count;
|
889
|
+
this.lock();
|
890
|
+
|
891
|
+
if (skip_shift > 0) {
|
892
|
+
dir_obj[dir] = -(skip_shift * width);
|
893
|
+
clearing.animate(dir_obj, 300, this.unlock());
|
894
|
+
} else {
|
895
|
+
dir_obj[dir] = 0;
|
896
|
+
clearing.animate(dir_obj, 300, this.unlock());
|
897
|
+
}
|
898
|
+
}
|
899
|
+
|
900
|
+
callback();
|
901
|
+
},
|
902
|
+
|
903
|
+
direction : function ($el, current, target) {
|
904
|
+
var lis = $('li', $el),
|
905
|
+
li_width = lis.outerWidth() + (lis.outerWidth() / 4),
|
906
|
+
up_count = Math.floor($('.clearing-container').outerWidth() / li_width) - 1,
|
907
|
+
target_index = lis.index(target),
|
908
|
+
response;
|
909
|
+
|
910
|
+
this.settings.up_count = up_count;
|
911
|
+
|
912
|
+
if (this.adjacent(this.settings.prev_index, target_index)) {
|
913
|
+
if ((target_index > up_count)
|
914
|
+
&& target_index > this.settings.prev_index) {
|
915
|
+
response = 'right';
|
916
|
+
} else if ((target_index > up_count - 1)
|
917
|
+
&& target_index <= this.settings.prev_index) {
|
918
|
+
response = 'left';
|
919
|
+
} else {
|
920
|
+
response = false;
|
921
|
+
}
|
922
|
+
} else {
|
923
|
+
response = 'skip';
|
924
|
+
}
|
925
|
+
|
926
|
+
this.settings.prev_index = target_index;
|
927
|
+
|
928
|
+
return response;
|
929
|
+
},
|
930
|
+
|
931
|
+
adjacent : function (current_index, target_index) {
|
932
|
+
for (var i = target_index + 1; i >= target_index - 1; i--) {
|
933
|
+
if (i === current_index) return true;
|
934
|
+
}
|
935
|
+
return false;
|
936
|
+
},
|
937
|
+
|
938
|
+
// lock management
|
939
|
+
|
940
|
+
lock : function () {
|
941
|
+
this.settings.locked = true;
|
942
|
+
},
|
943
|
+
|
944
|
+
unlock : function () {
|
945
|
+
this.settings.locked = false;
|
946
|
+
},
|
947
|
+
|
948
|
+
locked : function () {
|
949
|
+
return this.settings.locked;
|
950
|
+
},
|
951
|
+
|
952
|
+
off : function () {
|
953
|
+
$(this.scope).off('.fndtn.clearing');
|
954
|
+
$(window).off('.fndtn.clearing');
|
955
|
+
},
|
956
|
+
|
957
|
+
reflow : function () {
|
958
|
+
this.init();
|
959
|
+
}
|
960
|
+
};
|
961
|
+
|
962
|
+
}(jQuery, this, this.document));
|
963
|
+
|
964
|
+
;(function ($, window, document, undefined) {
|
965
|
+
'use strict';
|
966
|
+
|
967
|
+
Foundation.libs.abide = {
|
968
|
+
name : 'abide',
|
969
|
+
|
970
|
+
version : '5.0.3',
|
971
|
+
|
972
|
+
settings : {
|
973
|
+
focus_on_invalid : true,
|
974
|
+
error_labels: true, // labels with a for="inputId" will recieve an `error` class
|
975
|
+
timeout : 1000,
|
976
|
+
patterns : {
|
977
|
+
alpha: /[a-zA-Z]+/,
|
978
|
+
alpha_numeric : /[a-zA-Z0-9]+/,
|
979
|
+
integer: /-?\d+/,
|
980
|
+
number: /-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?/,
|
981
|
+
|
982
|
+
// generic password: upper-case, lower-case, number/special character, and min 8 characters
|
983
|
+
password : /(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,
|
984
|
+
|
985
|
+
// amex, visa, diners
|
986
|
+
card : /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
|
987
|
+
cvv : /^([0-9]){3,4}$/,
|
988
|
+
|
989
|
+
// http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
|
990
|
+
email : /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,
|
991
|
+
|
992
|
+
url: /(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?/,
|
993
|
+
// abc.de
|
994
|
+
domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/,
|
995
|
+
|
996
|
+
datetime: /([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))/,
|
997
|
+
// YYYY-MM-DD
|
998
|
+
date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/,
|
999
|
+
// HH:MM:SS
|
1000
|
+
time : /(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}/,
|
1001
|
+
dateISO: /\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,
|
1002
|
+
// MM/DD/YYYY
|
1003
|
+
month_day_year : /(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d/,
|
1004
|
+
|
1005
|
+
// #FFF or #FFFFFF
|
1006
|
+
color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
|
1007
|
+
}
|
1008
|
+
},
|
1009
|
+
|
1010
|
+
timer : null,
|
1011
|
+
|
1012
|
+
init : function (scope, method, options) {
|
1013
|
+
this.bindings(method, options);
|
1014
|
+
},
|
1015
|
+
|
1016
|
+
events : function (scope) {
|
1017
|
+
var self = this,
|
1018
|
+
form = $(scope).attr('novalidate', 'novalidate'),
|
1019
|
+
settings = form.data('abide-init');
|
1020
|
+
|
1021
|
+
form
|
1022
|
+
.off('.abide')
|
1023
|
+
.on('submit.fndtn.abide validate.fndtn.abide', function (e) {
|
1024
|
+
var is_ajax = /ajax/i.test($(this).attr('data-abide'));
|
1025
|
+
return self.validate($(this).find('input, textarea, select').get(), e, is_ajax);
|
1026
|
+
})
|
1027
|
+
.find('input, textarea, select')
|
1028
|
+
.off('.abide')
|
1029
|
+
.on('blur.fndtn.abide change.fndtn.abide', function (e) {
|
1030
|
+
self.validate([this], e);
|
1031
|
+
})
|
1032
|
+
.on('keydown.fndtn.abide', function (e) {
|
1033
|
+
var settings = $(this).closest('form').data('abide-init');
|
1034
|
+
clearTimeout(self.timer);
|
1035
|
+
self.timer = setTimeout(function () {
|
1036
|
+
self.validate([this], e);
|
1037
|
+
}.bind(this), settings.timeout);
|
1038
|
+
});
|
1039
|
+
},
|
1040
|
+
|
1041
|
+
validate : function (els, e, is_ajax) {
|
1042
|
+
var validations = this.parse_patterns(els),
|
1043
|
+
validation_count = validations.length,
|
1044
|
+
form = $(els[0]).closest('form'),
|
1045
|
+
submit_event = /submit/.test(e.type);
|
1046
|
+
|
1047
|
+
for (var i=0; i < validation_count; i++) {
|
1048
|
+
if (!validations[i] && (submit_event || is_ajax)) {
|
1049
|
+
if (this.settings.focus_on_invalid) els[i].focus();
|
1050
|
+
form.trigger('invalid');
|
1051
|
+
$(els[i]).closest('form').attr('data-invalid', '');
|
1052
|
+
return false;
|
1053
|
+
}
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
if (submit_event || is_ajax) {
|
1057
|
+
form.trigger('valid');
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
form.removeAttr('data-invalid');
|
1061
|
+
|
1062
|
+
if (is_ajax) return false;
|
1063
|
+
|
1064
|
+
return true;
|
1065
|
+
},
|
1066
|
+
|
1067
|
+
parse_patterns : function (els) {
|
1068
|
+
var count = els.length,
|
1069
|
+
el_patterns = [];
|
1070
|
+
|
1071
|
+
for (var i = count - 1; i >= 0; i--) {
|
1072
|
+
el_patterns.push(this.pattern(els[i]));
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
return this.check_validation_and_apply_styles(el_patterns);
|
1076
|
+
},
|
1077
|
+
|
1078
|
+
pattern : function (el) {
|
1079
|
+
var type = el.getAttribute('type'),
|
1080
|
+
required = typeof el.getAttribute('required') === 'string';
|
1081
|
+
|
1082
|
+
var pattern = el.getAttribute('pattern') || '';
|
1083
|
+
|
1084
|
+
if (this.settings.patterns.hasOwnProperty(pattern) && pattern.length > 0) {
|
1085
|
+
return [el, this.settings.patterns[pattern], required];
|
1086
|
+
} else if (pattern.length > 0) {
|
1087
|
+
return [el, new RegExp(pattern), required];
|
1088
|
+
}
|
1089
|
+
|
1090
|
+
if (this.settings.patterns.hasOwnProperty(type)) {
|
1091
|
+
return [el, this.settings.patterns[type], required];
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
pattern = /.*/;
|
1095
|
+
|
1096
|
+
return [el, pattern, required];
|
1097
|
+
},
|
1098
|
+
|
1099
|
+
check_validation_and_apply_styles : function (el_patterns) {
|
1100
|
+
var count = el_patterns.length,
|
1101
|
+
validations = [];
|
1102
|
+
|
1103
|
+
for (var i = count - 1; i >= 0; i--) {
|
1104
|
+
var el = el_patterns[i][0],
|
1105
|
+
required = el_patterns[i][2],
|
1106
|
+
value = el.value,
|
1107
|
+
is_equal = el.getAttribute('data-equalto'),
|
1108
|
+
is_radio = el.type === "radio",
|
1109
|
+
is_checkbox = el.type === "checkbox",
|
1110
|
+
label = $('label[for="' + el.getAttribute('id') + '"]'),
|
1111
|
+
valid_length = (required) ? (el.value.length > 0) : true;
|
1112
|
+
|
1113
|
+
if (is_radio && required) {
|
1114
|
+
validations.push(this.valid_radio(el, required));
|
1115
|
+
} else if (is_checkbox && required) {
|
1116
|
+
validations.push(this.valid_checkbox(el, required));
|
1117
|
+
} else if (is_equal && required) {
|
1118
|
+
validations.push(this.valid_equal(el, required));
|
1119
|
+
} else {
|
1120
|
+
if (el_patterns[i][1].test(value) && valid_length ||
|
1121
|
+
!required && el.value.length < 1) {
|
1122
|
+
$(el).removeAttr('data-invalid').parent().removeClass('error');
|
1123
|
+
if (label.length > 0 && this.settings.error_labels) label.removeClass('error');
|
1124
|
+
|
1125
|
+
validations.push(true);
|
1126
|
+
} else {
|
1127
|
+
$(el).attr('data-invalid', '').parent().addClass('error');
|
1128
|
+
if (label.length > 0 && this.settings.error_labels) label.addClass('error');
|
1129
|
+
|
1130
|
+
validations.push(false);
|
1131
|
+
}
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
|
1135
|
+
return validations;
|
1136
|
+
},
|
1137
|
+
|
1138
|
+
valid_checkbox : function(el, required) {
|
1139
|
+
var el = $(el),
|
1140
|
+
valid = (el.is(':checked') || !required);
|
1141
|
+
if (valid) {
|
1142
|
+
el.removeAttr('data-invalid').parent().removeClass('error');
|
1143
|
+
} else {
|
1144
|
+
el.attr('data-invalid', '').parent().addClass('error');
|
1145
|
+
}
|
1146
|
+
|
1147
|
+
return valid;
|
1148
|
+
},
|
1149
|
+
|
1150
|
+
valid_radio : function (el, required) {
|
1151
|
+
var name = el.getAttribute('name'),
|
1152
|
+
group = document.getElementsByName(name),
|
1153
|
+
count = group.length,
|
1154
|
+
valid = false;
|
1155
|
+
|
1156
|
+
for (var i=0; i < count; i++) {
|
1157
|
+
if (group[i].checked) valid = true;
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
for (var i=0; i < count; i++) {
|
1161
|
+
if (valid) {
|
1162
|
+
$(group[i]).removeAttr('data-invalid').parent().removeClass('error');
|
1163
|
+
} else {
|
1164
|
+
$(group[i]).attr('data-invalid', '').parent().addClass('error');
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
|
1168
|
+
return valid;
|
1169
|
+
},
|
1170
|
+
|
1171
|
+
valid_equal: function(el, required) {
|
1172
|
+
var from = document.getElementById(el.getAttribute('data-equalto')).value,
|
1173
|
+
to = el.value,
|
1174
|
+
valid = (from === to);
|
1175
|
+
|
1176
|
+
if (valid) {
|
1177
|
+
$(el).removeAttr('data-invalid').parent().removeClass('error');
|
1178
|
+
} else {
|
1179
|
+
$(el).attr('data-invalid', '').parent().addClass('error');
|
1180
|
+
}
|
1181
|
+
|
1182
|
+
return valid;
|
1183
|
+
}
|
1184
|
+
};
|
1185
|
+
}(jQuery, this, this.document));
|
1186
|
+
|
1187
|
+
;(function ($, window, document, undefined) {
|
1188
|
+
'use strict';
|
1189
|
+
|
1190
|
+
Foundation.libs.dropdown = {
|
1191
|
+
name : 'dropdown',
|
1192
|
+
|
1193
|
+
version : '5.0.0',
|
1194
|
+
|
1195
|
+
settings : {
|
1196
|
+
active_class: 'open',
|
1197
|
+
is_hover: false,
|
1198
|
+
opened: function(){},
|
1199
|
+
closed: function(){}
|
1200
|
+
},
|
1201
|
+
|
1202
|
+
init : function (scope, method, options) {
|
1203
|
+
Foundation.inherit(this, 'throttle');
|
1204
|
+
|
1205
|
+
this.bindings(method, options);
|
1206
|
+
},
|
1207
|
+
|
1208
|
+
events : function (scope) {
|
1209
|
+
var self = this;
|
1210
|
+
|
1211
|
+
$(this.scope)
|
1212
|
+
.off('.dropdown')
|
1213
|
+
.on('click.fndtn.dropdown', '[data-dropdown]', function (e) {
|
1214
|
+
var settings = $(this).data('dropdown-init') || self.settings;
|
1215
|
+
e.preventDefault();
|
1216
|
+
|
1217
|
+
self.closeall.call(self);
|
1218
|
+
|
1219
|
+
if (!settings.is_hover || Modernizr.touch) self.toggle($(this));
|
1220
|
+
})
|
1221
|
+
.on('mouseenter.fndtn.dropdown', '[data-dropdown], [data-dropdown-content]', function (e) {
|
1222
|
+
var $this = $(this);
|
1223
|
+
clearTimeout(self.timeout);
|
1224
|
+
|
1225
|
+
if ($this.data('dropdown')) {
|
1226
|
+
var dropdown = $('#' + $this.data('dropdown')),
|
1227
|
+
target = $this;
|
1228
|
+
} else {
|
1229
|
+
var dropdown = $this;
|
1230
|
+
target = $("[data-dropdown='" + dropdown.attr('id') + "']");
|
1231
|
+
}
|
1232
|
+
|
1233
|
+
var settings = target.data('dropdown-init') || self.settings;
|
1234
|
+
|
1235
|
+
if($(e.target).data('dropdown') && settings.is_hover) {
|
1236
|
+
self.closeall.call(self);
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
if (settings.is_hover) self.open.apply(self, [dropdown, target]);
|
1240
|
+
})
|
1241
|
+
.on('mouseleave.fndtn.dropdown', '[data-dropdown], [data-dropdown-content]', function (e) {
|
1242
|
+
var $this = $(this);
|
1243
|
+
self.timeout = setTimeout(function () {
|
1244
|
+
if ($this.data('dropdown')) {
|
1245
|
+
var settings = $this.data('dropdown-init') || self.settings;
|
1246
|
+
if (settings.is_hover) self.close.call(self, $('#' + $this.data('dropdown')));
|
1247
|
+
} else {
|
1248
|
+
var target = $('[data-dropdown="' + $(this).attr('id') + '"]'),
|
1249
|
+
settings = target.data('dropdown-init') || self.settings;
|
1250
|
+
if (settings.is_hover) self.close.call(self, $this);
|
1251
|
+
}
|
1252
|
+
}.bind(this), 150);
|
1253
|
+
})
|
1254
|
+
.on('click.fndtn.dropdown', function (e) {
|
1255
|
+
var parent = $(e.target).closest('[data-dropdown-content]');
|
1256
|
+
|
1257
|
+
if ($(e.target).data('dropdown') || $(e.target).parent().data('dropdown')) {
|
1258
|
+
return;
|
1259
|
+
}
|
1260
|
+
if (!($(e.target).data('revealId')) &&
|
1261
|
+
(parent.length > 0 && ($(e.target).is('[data-dropdown-content]') ||
|
1262
|
+
$.contains(parent.first()[0], e.target)))) {
|
1263
|
+
e.stopPropagation();
|
1264
|
+
return;
|
1265
|
+
}
|
1266
|
+
|
1267
|
+
self.close.call(self, $('[data-dropdown-content]'));
|
1268
|
+
})
|
1269
|
+
.on('opened.fndtn.dropdown', '[data-dropdown-content]', function () {
|
1270
|
+
self.settings.opened.call(this);
|
1271
|
+
})
|
1272
|
+
.on('closed.fndtn.dropdown', '[data-dropdown-content]', function () {
|
1273
|
+
self.settings.closed.call(this);
|
1274
|
+
});
|
1275
|
+
|
1276
|
+
$(window)
|
1277
|
+
.off('.dropdown')
|
1278
|
+
.on('resize.fndtn.dropdown', self.throttle(function () {
|
1279
|
+
self.resize.call(self);
|
1280
|
+
}, 50)).trigger('resize');
|
1281
|
+
},
|
1282
|
+
|
1283
|
+
close: function (dropdown) {
|
1284
|
+
var self = this;
|
1285
|
+
dropdown.each(function () {
|
1286
|
+
if ($(this).hasClass(self.settings.active_class)) {
|
1287
|
+
$(this)
|
1288
|
+
.css(Foundation.rtl ? 'right':'left', '-99999px')
|
1289
|
+
.removeClass(self.settings.active_class);
|
1290
|
+
$(this).trigger('closed');
|
1291
|
+
}
|
1292
|
+
});
|
1293
|
+
},
|
1294
|
+
|
1295
|
+
closeall: function() {
|
1296
|
+
var self = this;
|
1297
|
+
$.each($('[data-dropdown-content]'), function() {
|
1298
|
+
self.close.call(self, $(this))
|
1299
|
+
});
|
1300
|
+
},
|
1301
|
+
|
1302
|
+
open: function (dropdown, target) {
|
1303
|
+
this
|
1304
|
+
.css(dropdown
|
1305
|
+
.addClass(this.settings.active_class), target);
|
1306
|
+
dropdown.trigger('opened');
|
1307
|
+
},
|
1308
|
+
|
1309
|
+
toggle : function (target) {
|
1310
|
+
var dropdown = $('#' + target.data('dropdown'));
|
1311
|
+
if (dropdown.length === 0) {
|
1312
|
+
// No dropdown found, not continuing
|
1313
|
+
return;
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
this.close.call(this, $('[data-dropdown-content]').not(dropdown));
|
1317
|
+
|
1318
|
+
if (dropdown.hasClass(this.settings.active_class)) {
|
1319
|
+
this.close.call(this, dropdown);
|
1320
|
+
} else {
|
1321
|
+
this.close.call(this, $('[data-dropdown-content]'))
|
1322
|
+
this.open.call(this, dropdown, target);
|
1323
|
+
}
|
1324
|
+
},
|
1325
|
+
|
1326
|
+
resize : function () {
|
1327
|
+
var dropdown = $('[data-dropdown-content].open'),
|
1328
|
+
target = $("[data-dropdown='" + dropdown.attr('id') + "']");
|
1329
|
+
|
1330
|
+
if (dropdown.length && target.length) {
|
1331
|
+
this.css(dropdown, target);
|
1332
|
+
}
|
1333
|
+
},
|
1334
|
+
|
1335
|
+
css : function (dropdown, target) {
|
1336
|
+
var offset_parent = dropdown.offsetParent(),
|
1337
|
+
position = target.offset();
|
1338
|
+
|
1339
|
+
position.top -= offset_parent.offset().top;
|
1340
|
+
position.left -= offset_parent.offset().left;
|
1341
|
+
|
1342
|
+
if (this.small()) {
|
1343
|
+
dropdown.css({
|
1344
|
+
position : 'absolute',
|
1345
|
+
width: '95%',
|
1346
|
+
'max-width': 'none',
|
1347
|
+
top: position.top + target.outerHeight()
|
1348
|
+
});
|
1349
|
+
dropdown.css(Foundation.rtl ? 'right':'left', '2.5%');
|
1350
|
+
} else {
|
1351
|
+
if (!Foundation.rtl && $(window).width() > dropdown.outerWidth() + target.offset().left) {
|
1352
|
+
var left = position.left;
|
1353
|
+
if (dropdown.hasClass('right')) {
|
1354
|
+
dropdown.removeClass('right');
|
1355
|
+
}
|
1356
|
+
} else {
|
1357
|
+
if (!dropdown.hasClass('right')) {
|
1358
|
+
dropdown.addClass('right');
|
1359
|
+
}
|
1360
|
+
var left = position.left - (dropdown.outerWidth() - target.outerWidth());
|
1361
|
+
}
|
1362
|
+
|
1363
|
+
dropdown.attr('style', '').css({
|
1364
|
+
position : 'absolute',
|
1365
|
+
top: position.top + target.outerHeight(),
|
1366
|
+
left: left
|
1367
|
+
});
|
1368
|
+
}
|
1369
|
+
|
1370
|
+
return dropdown;
|
1371
|
+
},
|
1372
|
+
|
1373
|
+
small : function () {
|
1374
|
+
return matchMedia(Foundation.media_queries.small).matches &&
|
1375
|
+
!matchMedia(Foundation.media_queries.medium).matches;
|
1376
|
+
},
|
1377
|
+
|
1378
|
+
off: function () {
|
1379
|
+
$(this.scope).off('.fndtn.dropdown');
|
1380
|
+
$('html, body').off('.fndtn.dropdown');
|
1381
|
+
$(window).off('.fndtn.dropdown');
|
1382
|
+
$('[data-dropdown-content]').off('.fndtn.dropdown');
|
1383
|
+
this.settings.init = false;
|
1384
|
+
},
|
1385
|
+
|
1386
|
+
reflow : function () {}
|
1387
|
+
};
|
1388
|
+
}(jQuery, this, this.document));
|
1389
|
+
|
1390
|
+
;(function ($, window, document, undefined) {
|
1391
|
+
'use strict';
|
1392
|
+
|
1393
|
+
Foundation.libs.interchange = {
|
1394
|
+
name : 'interchange',
|
1395
|
+
|
1396
|
+
version : '5.0.3',
|
1397
|
+
|
1398
|
+
cache : {},
|
1399
|
+
|
1400
|
+
images_loaded : false,
|
1401
|
+
nodes_loaded : false,
|
1402
|
+
|
1403
|
+
settings : {
|
1404
|
+
load_attr : 'interchange',
|
1405
|
+
|
1406
|
+
named_queries : {
|
1407
|
+
'default' : 'only screen',
|
1408
|
+
small : Foundation.media_queries.small,
|
1409
|
+
medium : Foundation.media_queries.medium,
|
1410
|
+
large : Foundation.media_queries.large,
|
1411
|
+
xlarge : Foundation.media_queries.xlarge,
|
1412
|
+
xxlarge: Foundation.media_queries.xxlarge,
|
1413
|
+
landscape : 'only screen and (orientation: landscape)',
|
1414
|
+
portrait : 'only screen and (orientation: portrait)',
|
1415
|
+
retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
|
1416
|
+
'only screen and (min--moz-device-pixel-ratio: 2),' +
|
1417
|
+
'only screen and (-o-min-device-pixel-ratio: 2/1),' +
|
1418
|
+
'only screen and (min-device-pixel-ratio: 2),' +
|
1419
|
+
'only screen and (min-resolution: 192dpi),' +
|
1420
|
+
'only screen and (min-resolution: 2dppx)'
|
1421
|
+
},
|
1422
|
+
|
1423
|
+
directives : {
|
1424
|
+
replace: function (el, path, trigger) {
|
1425
|
+
// The trigger argument, if called within the directive, fires
|
1426
|
+
// an event named after the directive on the element, passing
|
1427
|
+
// any parameters along to the event that you pass to trigger.
|
1428
|
+
//
|
1429
|
+
// ex. trigger(), trigger([a, b, c]), or trigger(a, b, c)
|
1430
|
+
//
|
1431
|
+
// This allows you to bind a callback like so:
|
1432
|
+
// $('#interchangeContainer').on('replace', function (e, a, b, c) {
|
1433
|
+
// console.log($(this).html(), a, b, c);
|
1434
|
+
// });
|
1435
|
+
|
1436
|
+
if (/IMG/.test(el[0].nodeName)) {
|
1437
|
+
var orig_path = el[0].src;
|
1438
|
+
|
1439
|
+
if (new RegExp(path, 'i').test(orig_path)) return;
|
1440
|
+
|
1441
|
+
el[0].src = path;
|
1442
|
+
|
1443
|
+
return trigger(el[0].src);
|
1444
|
+
}
|
1445
|
+
var last_path = el.data('interchange-last-path');
|
1446
|
+
|
1447
|
+
if (last_path == path) return;
|
1448
|
+
|
1449
|
+
return $.get(path, function (response) {
|
1450
|
+
el.html(response);
|
1451
|
+
el.data('interchange-last-path', path);
|
1452
|
+
trigger();
|
1453
|
+
});
|
1454
|
+
|
1455
|
+
}
|
1456
|
+
}
|
1457
|
+
},
|
1458
|
+
|
1459
|
+
init : function (scope, method, options) {
|
1460
|
+
Foundation.inherit(this, 'throttle');
|
1461
|
+
|
1462
|
+
this.data_attr = 'data-' + this.settings.load_attr;
|
1463
|
+
$.extend(true, this.settings, method, options);
|
1464
|
+
|
1465
|
+
this.bindings(method, options);
|
1466
|
+
this.load('images');
|
1467
|
+
this.load('nodes');
|
1468
|
+
},
|
1469
|
+
|
1470
|
+
events : function () {
|
1471
|
+
var self = this;
|
1472
|
+
|
1473
|
+
$(window)
|
1474
|
+
.off('.interchange')
|
1475
|
+
.on('resize.fndtn.interchange', self.throttle(function () {
|
1476
|
+
self.resize.call(self);
|
1477
|
+
}, 50));
|
1478
|
+
|
1479
|
+
return this;
|
1480
|
+
},
|
1481
|
+
|
1482
|
+
resize : function () {
|
1483
|
+
var cache = this.cache;
|
1484
|
+
|
1485
|
+
if(!this.images_loaded || !this.nodes_loaded) {
|
1486
|
+
setTimeout($.proxy(this.resize, this), 50);
|
1487
|
+
return;
|
1488
|
+
}
|
1489
|
+
|
1490
|
+
for (var uuid in cache) {
|
1491
|
+
if (cache.hasOwnProperty(uuid)) {
|
1492
|
+
var passed = this.results(uuid, cache[uuid]);
|
1493
|
+
|
1494
|
+
if (passed) {
|
1495
|
+
this.settings.directives[passed
|
1496
|
+
.scenario[1]](passed.el, passed.scenario[0], function () {
|
1497
|
+
if (arguments[0] instanceof Array) {
|
1498
|
+
var args = arguments[0];
|
1499
|
+
} else {
|
1500
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
passed.el.trigger(passed.scenario[1], args);
|
1504
|
+
});
|
1505
|
+
}
|
1506
|
+
}
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
},
|
1510
|
+
|
1511
|
+
results : function (uuid, scenarios) {
|
1512
|
+
var count = scenarios.length;
|
1513
|
+
|
1514
|
+
if (count > 0) {
|
1515
|
+
var el = this.S('[data-uuid="' + uuid + '"]');
|
1516
|
+
|
1517
|
+
for (var i = count - 1; i >= 0; i--) {
|
1518
|
+
var mq, rule = scenarios[i][2];
|
1519
|
+
if (this.settings.named_queries.hasOwnProperty(rule)) {
|
1520
|
+
mq = matchMedia(this.settings.named_queries[rule]);
|
1521
|
+
} else {
|
1522
|
+
mq = matchMedia(rule);
|
1523
|
+
}
|
1524
|
+
if (mq.matches) {
|
1525
|
+
return {el: el, scenario: scenarios[i]};
|
1526
|
+
}
|
1527
|
+
}
|
1528
|
+
}
|
1529
|
+
|
1530
|
+
return false;
|
1531
|
+
},
|
1532
|
+
|
1533
|
+
load : function (type, force_update) {
|
1534
|
+
if (typeof this['cached_' + type] === 'undefined' || force_update) {
|
1535
|
+
this['update_' + type]();
|
1536
|
+
}
|
1537
|
+
|
1538
|
+
return this['cached_' + type];
|
1539
|
+
},
|
1540
|
+
|
1541
|
+
update_images : function () {
|
1542
|
+
var images = this.S('img[' + this.data_attr + ']'),
|
1543
|
+
count = images.length,
|
1544
|
+
loaded_count = 0,
|
1545
|
+
data_attr = this.data_attr;
|
1546
|
+
|
1547
|
+
this.cache = {};
|
1548
|
+
this.cached_images = [];
|
1549
|
+
this.images_loaded = (count === 0);
|
1550
|
+
|
1551
|
+
for (var i = count - 1; i >= 0; i--) {
|
1552
|
+
loaded_count++;
|
1553
|
+
if (images[i]) {
|
1554
|
+
var str = images[i].getAttribute(data_attr) || '';
|
1555
|
+
|
1556
|
+
if (str.length > 0) {
|
1557
|
+
this.cached_images.push(images[i]);
|
1558
|
+
}
|
1559
|
+
}
|
1560
|
+
|
1561
|
+
if(loaded_count === count) {
|
1562
|
+
this.images_loaded = true;
|
1563
|
+
this.enhance('images');
|
1564
|
+
}
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
return this;
|
1568
|
+
},
|
1569
|
+
|
1570
|
+
update_nodes : function () {
|
1571
|
+
var nodes = this.S('[' + this.data_attr + ']:not(img)'),
|
1572
|
+
count = nodes.length,
|
1573
|
+
loaded_count = 0,
|
1574
|
+
data_attr = this.data_attr;
|
1575
|
+
|
1576
|
+
this.cached_nodes = [];
|
1577
|
+
// Set nodes_loaded to true if there are no nodes
|
1578
|
+
// this.nodes_loaded = false;
|
1579
|
+
this.nodes_loaded = (count === 0);
|
1580
|
+
|
1581
|
+
|
1582
|
+
for (var i = count - 1; i >= 0; i--) {
|
1583
|
+
loaded_count++;
|
1584
|
+
var str = nodes[i].getAttribute(data_attr) || '';
|
1585
|
+
|
1586
|
+
if (str.length > 0) {
|
1587
|
+
this.cached_nodes.push(nodes[i]);
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
if(loaded_count === count) {
|
1591
|
+
this.nodes_loaded = true;
|
1592
|
+
this.enhance('nodes');
|
1593
|
+
}
|
1594
|
+
}
|
1595
|
+
|
1596
|
+
return this;
|
1597
|
+
},
|
1598
|
+
|
1599
|
+
enhance : function (type) {
|
1600
|
+
var count = this['cached_' + type].length;
|
1601
|
+
|
1602
|
+
for (var i = count - 1; i >= 0; i--) {
|
1603
|
+
this.object($(this['cached_' + type][i]));
|
1604
|
+
}
|
1605
|
+
|
1606
|
+
return $(window).trigger('resize');
|
1607
|
+
},
|
1608
|
+
|
1609
|
+
parse_params : function (path, directive, mq) {
|
1610
|
+
return [this.trim(path), this.convert_directive(directive), this.trim(mq)];
|
1611
|
+
},
|
1612
|
+
|
1613
|
+
convert_directive : function (directive) {
|
1614
|
+
var trimmed = this.trim(directive);
|
1615
|
+
|
1616
|
+
if (trimmed.length > 0) {
|
1617
|
+
return trimmed;
|
1618
|
+
}
|
1619
|
+
|
1620
|
+
return 'replace';
|
1621
|
+
},
|
1622
|
+
|
1623
|
+
object : function(el) {
|
1624
|
+
var raw_arr = this.parse_data_attr(el),
|
1625
|
+
scenarios = [], count = raw_arr.length;
|
1626
|
+
|
1627
|
+
if (count > 0) {
|
1628
|
+
for (var i = count - 1; i >= 0; i--) {
|
1629
|
+
var split = raw_arr[i].split(/\((.*?)(\))$/);
|
1630
|
+
|
1631
|
+
if (split.length > 1) {
|
1632
|
+
var cached_split = split[0].split(','),
|
1633
|
+
params = this.parse_params(cached_split[0],
|
1634
|
+
cached_split[1], split[1]);
|
1635
|
+
|
1636
|
+
scenarios.push(params);
|
1637
|
+
}
|
1638
|
+
}
|
1639
|
+
}
|
1640
|
+
|
1641
|
+
return this.store(el, scenarios);
|
1642
|
+
},
|
1643
|
+
|
1644
|
+
uuid : function (separator) {
|
1645
|
+
var delim = separator || "-";
|
1646
|
+
|
1647
|
+
function S4() {
|
1648
|
+
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
return (S4() + S4() + delim + S4() + delim + S4()
|
1652
|
+
+ delim + S4() + delim + S4() + S4() + S4());
|
1653
|
+
},
|
1654
|
+
|
1655
|
+
store : function (el, scenarios) {
|
1656
|
+
var uuid = this.uuid(),
|
1657
|
+
current_uuid = el.data('uuid');
|
1658
|
+
|
1659
|
+
if (current_uuid) return this.cache[current_uuid];
|
1660
|
+
|
1661
|
+
el.attr('data-uuid', uuid);
|
1662
|
+
|
1663
|
+
return this.cache[uuid] = scenarios;
|
1664
|
+
},
|
1665
|
+
|
1666
|
+
trim : function(str) {
|
1667
|
+
if (typeof str === 'string') {
|
1668
|
+
return $.trim(str);
|
1669
|
+
}
|
1670
|
+
|
1671
|
+
return str;
|
1672
|
+
},
|
1673
|
+
|
1674
|
+
parse_data_attr : function (el) {
|
1675
|
+
var raw = el.data(this.settings.load_attr).split(/\[(.*?)\]/),
|
1676
|
+
count = raw.length, output = [];
|
1677
|
+
|
1678
|
+
for (var i = count - 1; i >= 0; i--) {
|
1679
|
+
if (raw[i].replace(/[\W\d]+/, '').length > 4) {
|
1680
|
+
output.push(raw[i]);
|
1681
|
+
}
|
1682
|
+
}
|
1683
|
+
|
1684
|
+
return output;
|
1685
|
+
},
|
1686
|
+
|
1687
|
+
reflow : function () {
|
1688
|
+
this.load('images', true);
|
1689
|
+
this.load('nodes', true);
|
1690
|
+
}
|
1691
|
+
|
1692
|
+
};
|
1693
|
+
|
1694
|
+
}(jQuery, this, this.document));
|
1695
|
+
;(function ($, window, document, undefined) {
|
1696
|
+
'use strict';
|
1697
|
+
|
1698
|
+
var Modernizr = Modernizr || false;
|
1699
|
+
|
1700
|
+
Foundation.libs.joyride = {
|
1701
|
+
name : 'joyride',
|
1702
|
+
|
1703
|
+
version : '5.0.0',
|
1704
|
+
|
1705
|
+
defaults : {
|
1706
|
+
expose : false, // turn on or off the expose feature
|
1707
|
+
modal : true, // Whether to cover page with modal during the tour
|
1708
|
+
tip_location : 'bottom', // 'top' or 'bottom' in relation to parent
|
1709
|
+
nub_position : 'auto', // override on a per tooltip bases
|
1710
|
+
scroll_speed : 1500, // Page scrolling speed in milliseconds, 0 = no scroll animation
|
1711
|
+
scroll_animation : 'linear', // supports 'swing' and 'linear', extend with jQuery UI.
|
1712
|
+
timer : 0, // 0 = no timer , all other numbers = timer in milliseconds
|
1713
|
+
start_timer_on_click : true, // true or false - true requires clicking the first button start the timer
|
1714
|
+
start_offset : 0, // the index of the tooltip you want to start on (index of the li)
|
1715
|
+
next_button : true, // true or false to control whether a next button is used
|
1716
|
+
tip_animation : 'fade', // 'pop' or 'fade' in each tip
|
1717
|
+
pause_after : [], // array of indexes where to pause the tour after
|
1718
|
+
exposed : [], // array of expose elements
|
1719
|
+
tip_animation_fade_speed: 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
|
1720
|
+
cookie_monster : false, // true or false to control whether cookies are used
|
1721
|
+
cookie_name : 'joyride', // Name the cookie you'll use
|
1722
|
+
cookie_domain : false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
|
1723
|
+
cookie_expires : 365, // set when you would like the cookie to expire.
|
1724
|
+
tip_container : 'body', // Where will the tip be attached
|
1725
|
+
tip_location_patterns : {
|
1726
|
+
top: ['bottom'],
|
1727
|
+
bottom: [], // bottom should not need to be repositioned
|
1728
|
+
left: ['right', 'top', 'bottom'],
|
1729
|
+
right: ['left', 'top', 'bottom']
|
1730
|
+
},
|
1731
|
+
post_ride_callback : function (){}, // A method to call once the tour closes (canceled or complete)
|
1732
|
+
post_step_callback : function (){}, // A method to call after each step
|
1733
|
+
pre_step_callback : function (){}, // A method to call before each step
|
1734
|
+
pre_ride_callback : function (){}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
|
1735
|
+
post_expose_callback : function (){}, // A method to call after an element has been exposed
|
1736
|
+
template : { // HTML segments for tip layout
|
1737
|
+
link : '<a href="#close" class="joyride-close-tip">×</a>',
|
1738
|
+
timer : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
|
1739
|
+
tip : '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',
|
1740
|
+
wrapper : '<div class="joyride-content-wrapper"></div>',
|
1741
|
+
button : '<a href="#" class="small button joyride-next-tip"></a>',
|
1742
|
+
modal : '<div class="joyride-modal-bg"></div>',
|
1743
|
+
expose : '<div class="joyride-expose-wrapper"></div>',
|
1744
|
+
expose_cover: '<div class="joyride-expose-cover"></div>'
|
1745
|
+
},
|
1746
|
+
expose_add_class : '' // One or more space-separated class names to be added to exposed element
|
1747
|
+
},
|
1748
|
+
|
1749
|
+
init : function (scope, method, options) {
|
1750
|
+
Foundation.inherit(this, 'throttle delay');
|
1751
|
+
|
1752
|
+
this.settings = this.defaults;
|
1753
|
+
|
1754
|
+
this.bindings(method, options)
|
1755
|
+
},
|
1756
|
+
|
1757
|
+
events : function () {
|
1758
|
+
var self = this;
|
1759
|
+
|
1760
|
+
$(this.scope)
|
1761
|
+
.off('.joyride')
|
1762
|
+
.on('click.fndtn.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
|
1763
|
+
e.preventDefault();
|
1764
|
+
|
1765
|
+
if (this.settings.$li.next().length < 1) {
|
1766
|
+
this.end();
|
1767
|
+
} else if (this.settings.timer > 0) {
|
1768
|
+
clearTimeout(this.settings.automate);
|
1769
|
+
this.hide();
|
1770
|
+
this.show();
|
1771
|
+
this.startTimer();
|
1772
|
+
} else {
|
1773
|
+
this.hide();
|
1774
|
+
this.show();
|
1775
|
+
}
|
1776
|
+
|
1777
|
+
}.bind(this))
|
1778
|
+
|
1779
|
+
.on('click.fndtn.joyride', '.joyride-close-tip', function (e) {
|
1780
|
+
e.preventDefault();
|
1781
|
+
this.end();
|
1782
|
+
}.bind(this));
|
1783
|
+
|
1784
|
+
$(window)
|
1785
|
+
.off('.joyride')
|
1786
|
+
.on('resize.fndtn.joyride', self.throttle(function () {
|
1787
|
+
if ($('[data-joyride]').length > 0 && self.settings.$next_tip) {
|
1788
|
+
if (self.settings.exposed.length > 0) {
|
1789
|
+
var $els = $(self.settings.exposed);
|
1790
|
+
|
1791
|
+
$els.each(function () {
|
1792
|
+
var $this = $(this);
|
1793
|
+
self.un_expose($this);
|
1794
|
+
self.expose($this);
|
1795
|
+
});
|
1796
|
+
}
|
1797
|
+
|
1798
|
+
if (self.is_phone()) {
|
1799
|
+
self.pos_phone();
|
1800
|
+
} else {
|
1801
|
+
self.pos_default(false, true);
|
1802
|
+
}
|
1803
|
+
}
|
1804
|
+
}, 100));
|
1805
|
+
},
|
1806
|
+
|
1807
|
+
start : function () {
|
1808
|
+
var self = this,
|
1809
|
+
$this = $('[data-joyride]', this.scope),
|
1810
|
+
integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
|
1811
|
+
int_settings_count = integer_settings.length;
|
1812
|
+
|
1813
|
+
if (!$this.length > 0) return;
|
1814
|
+
|
1815
|
+
if (!this.settings.init) this.events();
|
1816
|
+
|
1817
|
+
this.settings = $this.data('joyride-init');
|
1818
|
+
|
1819
|
+
// non configureable settings
|
1820
|
+
this.settings.$content_el = $this;
|
1821
|
+
this.settings.$body = $(this.settings.tip_container);
|
1822
|
+
this.settings.body_offset = $(this.settings.tip_container).position();
|
1823
|
+
this.settings.$tip_content = this.settings.$content_el.find('> li');
|
1824
|
+
this.settings.paused = false;
|
1825
|
+
this.settings.attempts = 0;
|
1826
|
+
|
1827
|
+
// can we create cookies?
|
1828
|
+
if (typeof $.cookie !== 'function') {
|
1829
|
+
this.settings.cookie_monster = false;
|
1830
|
+
}
|
1831
|
+
|
1832
|
+
// generate the tips and insert into dom.
|
1833
|
+
if (!this.settings.cookie_monster || this.settings.cookie_monster && $.cookie(this.settings.cookie_name) === null) {
|
1834
|
+
this.settings.$tip_content.each(function (index) {
|
1835
|
+
var $this = $(this);
|
1836
|
+
this.settings = $.extend({}, self.defaults, self.data_options($this))
|
1837
|
+
|
1838
|
+
// Make sure that settings parsed from data_options are integers where necessary
|
1839
|
+
for (var i = int_settings_count - 1; i >= 0; i--) {
|
1840
|
+
self.settings[integer_settings[i]] = parseInt(self.settings[integer_settings[i]], 10);
|
1841
|
+
}
|
1842
|
+
self.create({$li : $this, index : index});
|
1843
|
+
});
|
1844
|
+
|
1845
|
+
// show first tip
|
1846
|
+
if (!this.settings.start_timer_on_click && this.settings.timer > 0) {
|
1847
|
+
this.show('init');
|
1848
|
+
this.startTimer();
|
1849
|
+
} else {
|
1850
|
+
this.show('init');
|
1851
|
+
}
|
1852
|
+
|
1853
|
+
}
|
1854
|
+
},
|
1855
|
+
|
1856
|
+
resume : function () {
|
1857
|
+
this.set_li();
|
1858
|
+
this.show();
|
1859
|
+
},
|
1860
|
+
|
1861
|
+
tip_template : function (opts) {
|
1862
|
+
var $blank, content;
|
1863
|
+
|
1864
|
+
opts.tip_class = opts.tip_class || '';
|
1865
|
+
|
1866
|
+
$blank = $(this.settings.template.tip).addClass(opts.tip_class);
|
1867
|
+
content = $.trim($(opts.li).html()) +
|
1868
|
+
this.button_text(opts.button_text) +
|
1869
|
+
this.settings.template.link +
|
1870
|
+
this.timer_instance(opts.index);
|
1871
|
+
|
1872
|
+
$blank.append($(this.settings.template.wrapper));
|
1873
|
+
$blank.first().attr('data-index', opts.index);
|
1874
|
+
$('.joyride-content-wrapper', $blank).append(content);
|
1875
|
+
|
1876
|
+
return $blank[0];
|
1877
|
+
},
|
1878
|
+
|
1879
|
+
timer_instance : function (index) {
|
1880
|
+
var txt;
|
1881
|
+
|
1882
|
+
if ((index === 0 && this.settings.start_timer_on_click && this.settings.timer > 0) || this.settings.timer === 0) {
|
1883
|
+
txt = '';
|
1884
|
+
} else {
|
1885
|
+
txt = $(this.settings.template.timer)[0].outerHTML;
|
1886
|
+
}
|
1887
|
+
return txt;
|
1888
|
+
},
|
1889
|
+
|
1890
|
+
button_text : function (txt) {
|
1891
|
+
if (this.settings.next_button) {
|
1892
|
+
txt = $.trim(txt) || 'Next';
|
1893
|
+
txt = $(this.settings.template.button).append(txt)[0].outerHTML;
|
1894
|
+
} else {
|
1895
|
+
txt = '';
|
1896
|
+
}
|
1897
|
+
return txt;
|
1898
|
+
},
|
1899
|
+
|
1900
|
+
create : function (opts) {
|
1901
|
+
var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
|
1902
|
+
tipClass = opts.$li.attr('class'),
|
1903
|
+
$tip_content = $(this.tip_template({
|
1904
|
+
tip_class : tipClass,
|
1905
|
+
index : opts.index,
|
1906
|
+
button_text : buttonText,
|
1907
|
+
li : opts.$li
|
1908
|
+
}));
|
1909
|
+
|
1910
|
+
$(this.settings.tip_container).append($tip_content);
|
1911
|
+
},
|
1912
|
+
|
1913
|
+
show : function (init) {
|
1914
|
+
var $timer = null;
|
1915
|
+
|
1916
|
+
// are we paused?
|
1917
|
+
if (this.settings.$li === undefined
|
1918
|
+
|| ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
|
1919
|
+
|
1920
|
+
// don't go to the next li if the tour was paused
|
1921
|
+
if (this.settings.paused) {
|
1922
|
+
this.settings.paused = false;
|
1923
|
+
} else {
|
1924
|
+
this.set_li(init);
|
1925
|
+
}
|
1926
|
+
|
1927
|
+
this.settings.attempts = 0;
|
1928
|
+
|
1929
|
+
if (this.settings.$li.length && this.settings.$target.length > 0) {
|
1930
|
+
if (init) { //run when we first start
|
1931
|
+
this.settings.pre_ride_callback(this.settings.$li.index(), this.settings.$next_tip);
|
1932
|
+
if (this.settings.modal) {
|
1933
|
+
this.show_modal();
|
1934
|
+
}
|
1935
|
+
}
|
1936
|
+
|
1937
|
+
this.settings.pre_step_callback(this.settings.$li.index(), this.settings.$next_tip);
|
1938
|
+
|
1939
|
+
if (this.settings.modal && this.settings.expose) {
|
1940
|
+
this.expose();
|
1941
|
+
}
|
1942
|
+
|
1943
|
+
this.settings.tip_settings = $.extend({}, this.settings, this.data_options(this.settings.$li));
|
1944
|
+
|
1945
|
+
this.settings.timer = parseInt(this.settings.timer, 10);
|
1946
|
+
|
1947
|
+
this.settings.tip_settings.tip_location_pattern = this.settings.tip_location_patterns[this.settings.tip_settings.tip_location];
|
1948
|
+
|
1949
|
+
// scroll if not modal
|
1950
|
+
if (!/body/i.test(this.settings.$target.selector)) {
|
1951
|
+
this.scroll_to();
|
1952
|
+
}
|
1953
|
+
|
1954
|
+
if (this.is_phone()) {
|
1955
|
+
this.pos_phone(true);
|
1956
|
+
} else {
|
1957
|
+
this.pos_default(true);
|
1958
|
+
}
|
1959
|
+
|
1960
|
+
$timer = this.settings.$next_tip.find('.joyride-timer-indicator');
|
1961
|
+
|
1962
|
+
if (/pop/i.test(this.settings.tip_animation)) {
|
1963
|
+
|
1964
|
+
$timer.width(0);
|
1965
|
+
|
1966
|
+
if (this.settings.timer > 0) {
|
1967
|
+
|
1968
|
+
this.settings.$next_tip.show();
|
1969
|
+
|
1970
|
+
this.delay(function () {
|
1971
|
+
$timer.animate({
|
1972
|
+
width: $timer.parent().width()
|
1973
|
+
}, this.settings.timer, 'linear');
|
1974
|
+
}.bind(this), this.settings.tip_animation_fade_speed);
|
1975
|
+
|
1976
|
+
} else {
|
1977
|
+
this.settings.$next_tip.show();
|
1978
|
+
|
1979
|
+
}
|
1980
|
+
|
1981
|
+
|
1982
|
+
} else if (/fade/i.test(this.settings.tip_animation)) {
|
1983
|
+
|
1984
|
+
$timer.width(0);
|
1985
|
+
|
1986
|
+
if (this.settings.timer > 0) {
|
1987
|
+
|
1988
|
+
this.settings.$next_tip
|
1989
|
+
.fadeIn(this.settings.tip_animation_fade_speed)
|
1990
|
+
.show();
|
1991
|
+
|
1992
|
+
this.delay(function () {
|
1993
|
+
$timer.animate({
|
1994
|
+
width: $timer.parent().width()
|
1995
|
+
}, this.settings.timer, 'linear');
|
1996
|
+
}.bind(this), this.settings.tip_animation_fadeSpeed);
|
1997
|
+
|
1998
|
+
} else {
|
1999
|
+
this.settings.$next_tip.fadeIn(this.settings.tip_animation_fade_speed);
|
2000
|
+
}
|
2001
|
+
}
|
2002
|
+
|
2003
|
+
this.settings.$current_tip = this.settings.$next_tip;
|
2004
|
+
|
2005
|
+
// skip non-existant targets
|
2006
|
+
} else if (this.settings.$li && this.settings.$target.length < 1) {
|
2007
|
+
|
2008
|
+
this.show();
|
2009
|
+
|
2010
|
+
} else {
|
2011
|
+
|
2012
|
+
this.end();
|
2013
|
+
|
2014
|
+
}
|
2015
|
+
} else {
|
2016
|
+
|
2017
|
+
this.settings.paused = true;
|
2018
|
+
|
2019
|
+
}
|
2020
|
+
|
2021
|
+
},
|
2022
|
+
|
2023
|
+
is_phone : function () {
|
2024
|
+
return matchMedia(Foundation.media_queries.small).matches &&
|
2025
|
+
!matchMedia(Foundation.media_queries.medium).matches;
|
2026
|
+
},
|
2027
|
+
|
2028
|
+
hide : function () {
|
2029
|
+
if (this.settings.modal && this.settings.expose) {
|
2030
|
+
this.un_expose();
|
2031
|
+
}
|
2032
|
+
|
2033
|
+
if (!this.settings.modal) {
|
2034
|
+
$('.joyride-modal-bg').hide();
|
2035
|
+
}
|
2036
|
+
|
2037
|
+
// Prevent scroll bouncing...wait to remove from layout
|
2038
|
+
this.settings.$current_tip.css('visibility', 'hidden');
|
2039
|
+
setTimeout($.proxy(function() {
|
2040
|
+
this.hide();
|
2041
|
+
this.css('visibility', 'visible');
|
2042
|
+
}, this.settings.$current_tip), 0);
|
2043
|
+
this.settings.post_step_callback(this.settings.$li.index(),
|
2044
|
+
this.settings.$current_tip);
|
2045
|
+
},
|
2046
|
+
|
2047
|
+
set_li : function (init) {
|
2048
|
+
if (init) {
|
2049
|
+
this.settings.$li = this.settings.$tip_content.eq(this.settings.start_offset);
|
2050
|
+
this.set_next_tip();
|
2051
|
+
this.settings.$current_tip = this.settings.$next_tip;
|
2052
|
+
} else {
|
2053
|
+
this.settings.$li = this.settings.$li.next();
|
2054
|
+
this.set_next_tip();
|
2055
|
+
}
|
2056
|
+
|
2057
|
+
this.set_target();
|
2058
|
+
},
|
2059
|
+
|
2060
|
+
set_next_tip : function () {
|
2061
|
+
this.settings.$next_tip = $(".joyride-tip-guide").eq(this.settings.$li.index());
|
2062
|
+
this.settings.$next_tip.data('closed', '');
|
2063
|
+
},
|
2064
|
+
|
2065
|
+
set_target : function () {
|
2066
|
+
var cl = this.settings.$li.attr('data-class'),
|
2067
|
+
id = this.settings.$li.attr('data-id'),
|
2068
|
+
$sel = function () {
|
2069
|
+
if (id) {
|
2070
|
+
return $(document.getElementById(id));
|
2071
|
+
} else if (cl) {
|
2072
|
+
return $('.' + cl).first();
|
2073
|
+
} else {
|
2074
|
+
return $('body');
|
2075
|
+
}
|
2076
|
+
};
|
2077
|
+
|
2078
|
+
this.settings.$target = $sel();
|
2079
|
+
},
|
2080
|
+
|
2081
|
+
scroll_to : function () {
|
2082
|
+
var window_half, tipOffset;
|
2083
|
+
|
2084
|
+
window_half = $(window).height() / 2;
|
2085
|
+
tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight());
|
2086
|
+
|
2087
|
+
if (tipOffset != 0) {
|
2088
|
+
$('html, body').animate({
|
2089
|
+
scrollTop: tipOffset
|
2090
|
+
}, this.settings.scroll_speed, 'swing');
|
2091
|
+
}
|
2092
|
+
},
|
2093
|
+
|
2094
|
+
paused : function () {
|
2095
|
+
return ($.inArray((this.settings.$li.index() + 1), this.settings.pause_after) === -1);
|
2096
|
+
},
|
2097
|
+
|
2098
|
+
restart : function () {
|
2099
|
+
this.hide();
|
2100
|
+
this.settings.$li = undefined;
|
2101
|
+
this.show('init');
|
2102
|
+
},
|
2103
|
+
|
2104
|
+
pos_default : function (init, resizing) {
|
2105
|
+
var half_fold = Math.ceil($(window).height() / 2),
|
2106
|
+
tip_position = this.settings.$next_tip.offset(),
|
2107
|
+
$nub = this.settings.$next_tip.find('.joyride-nub'),
|
2108
|
+
nub_width = Math.ceil($nub.outerWidth() / 2),
|
2109
|
+
nub_height = Math.ceil($nub.outerHeight() / 2),
|
2110
|
+
toggle = init || false;
|
2111
|
+
|
2112
|
+
// tip must not be "display: none" to calculate position
|
2113
|
+
if (toggle) {
|
2114
|
+
this.settings.$next_tip.css('visibility', 'hidden');
|
2115
|
+
this.settings.$next_tip.show();
|
2116
|
+
}
|
2117
|
+
|
2118
|
+
if (typeof resizing === 'undefined') {
|
2119
|
+
resizing = false;
|
2120
|
+
}
|
2121
|
+
|
2122
|
+
if (!/body/i.test(this.settings.$target.selector)) {
|
2123
|
+
if (this.bottom()) {
|
2124
|
+
if (this.rtl) {
|
2125
|
+
this.settings.$next_tip.css({
|
2126
|
+
top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight()),
|
2127
|
+
left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
|
2128
|
+
} else {
|
2129
|
+
this.settings.$next_tip.css({
|
2130
|
+
top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight()),
|
2131
|
+
left: this.settings.$target.offset().left});
|
2132
|
+
}
|
2133
|
+
|
2134
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'top');
|
2135
|
+
|
2136
|
+
} else if (this.top()) {
|
2137
|
+
if (this.rtl) {
|
2138
|
+
this.settings.$next_tip.css({
|
2139
|
+
top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
|
2140
|
+
left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
|
2141
|
+
} else {
|
2142
|
+
this.settings.$next_tip.css({
|
2143
|
+
top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height),
|
2144
|
+
left: this.settings.$target.offset().left});
|
2145
|
+
}
|
2146
|
+
|
2147
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'bottom');
|
2148
|
+
|
2149
|
+
} else if (this.right()) {
|
2150
|
+
|
2151
|
+
this.settings.$next_tip.css({
|
2152
|
+
top: this.settings.$target.offset().top,
|
2153
|
+
left: (this.outerWidth(this.settings.$target) + this.settings.$target.offset().left + nub_width)});
|
2154
|
+
|
2155
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'left');
|
2156
|
+
|
2157
|
+
} else if (this.left()) {
|
2158
|
+
|
2159
|
+
this.settings.$next_tip.css({
|
2160
|
+
top: this.settings.$target.offset().top,
|
2161
|
+
left: (this.settings.$target.offset().left - this.outerWidth(this.settings.$next_tip) - nub_width)});
|
2162
|
+
|
2163
|
+
this.nub_position($nub, this.settings.tip_settings.nub_position, 'right');
|
2164
|
+
|
2165
|
+
}
|
2166
|
+
|
2167
|
+
if (!this.visible(this.corners(this.settings.$next_tip)) && this.settings.attempts < this.settings.tip_settings.tip_location_pattern.length) {
|
2168
|
+
|
2169
|
+
$nub.removeClass('bottom')
|
2170
|
+
.removeClass('top')
|
2171
|
+
.removeClass('right')
|
2172
|
+
.removeClass('left');
|
2173
|
+
|
2174
|
+
this.settings.tip_settings.tip_location = this.settings.tip_settings.tip_location_pattern[this.settings.attempts];
|
2175
|
+
|
2176
|
+
this.settings.attempts++;
|
2177
|
+
|
2178
|
+
this.pos_default();
|
2179
|
+
|
2180
|
+
}
|
2181
|
+
|
2182
|
+
} else if (this.settings.$li.length) {
|
2183
|
+
|
2184
|
+
this.pos_modal($nub);
|
2185
|
+
|
2186
|
+
}
|
2187
|
+
|
2188
|
+
if (toggle) {
|
2189
|
+
this.settings.$next_tip.hide();
|
2190
|
+
this.settings.$next_tip.css('visibility', 'visible');
|
2191
|
+
}
|
2192
|
+
|
2193
|
+
},
|
2194
|
+
|
2195
|
+
pos_phone : function (init) {
|
2196
|
+
var tip_height = this.settings.$next_tip.outerHeight(),
|
2197
|
+
tip_offset = this.settings.$next_tip.offset(),
|
2198
|
+
target_height = this.settings.$target.outerHeight(),
|
2199
|
+
$nub = $('.joyride-nub', this.settings.$next_tip),
|
2200
|
+
nub_height = Math.ceil($nub.outerHeight() / 2),
|
2201
|
+
toggle = init || false;
|
2202
|
+
|
2203
|
+
$nub.removeClass('bottom')
|
2204
|
+
.removeClass('top')
|
2205
|
+
.removeClass('right')
|
2206
|
+
.removeClass('left');
|
2207
|
+
|
2208
|
+
if (toggle) {
|
2209
|
+
this.settings.$next_tip.css('visibility', 'hidden');
|
2210
|
+
this.settings.$next_tip.show();
|
2211
|
+
}
|
2212
|
+
|
2213
|
+
if (!/body/i.test(this.settings.$target.selector)) {
|
2214
|
+
|
2215
|
+
if (this.top()) {
|
2216
|
+
|
2217
|
+
this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height});
|
2218
|
+
$nub.addClass('bottom');
|
2219
|
+
|
2220
|
+
} else {
|
2221
|
+
|
2222
|
+
this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height});
|
2223
|
+
$nub.addClass('top');
|
2224
|
+
|
2225
|
+
}
|
2226
|
+
|
2227
|
+
} else if (this.settings.$li.length) {
|
2228
|
+
this.pos_modal($nub);
|
2229
|
+
}
|
2230
|
+
|
2231
|
+
if (toggle) {
|
2232
|
+
this.settings.$next_tip.hide();
|
2233
|
+
this.settings.$next_tip.css('visibility', 'visible');
|
2234
|
+
}
|
2235
|
+
},
|
2236
|
+
|
2237
|
+
pos_modal : function ($nub) {
|
2238
|
+
this.center();
|
2239
|
+
$nub.hide();
|
2240
|
+
|
2241
|
+
this.show_modal();
|
2242
|
+
},
|
2243
|
+
|
2244
|
+
show_modal : function () {
|
2245
|
+
if (!this.settings.$next_tip.data('closed')) {
|
2246
|
+
var joyridemodalbg = $('.joyride-modal-bg');
|
2247
|
+
if (joyridemodalbg.length < 1) {
|
2248
|
+
$('body').append(this.settings.template.modal).show();
|
2249
|
+
}
|
2250
|
+
|
2251
|
+
if (/pop/i.test(this.settings.tip_animation)) {
|
2252
|
+
joyridemodalbg.show();
|
2253
|
+
} else {
|
2254
|
+
joyridemodalbg.fadeIn(this.settings.tip_animation_fade_speed);
|
2255
|
+
}
|
2256
|
+
}
|
2257
|
+
},
|
2258
|
+
|
2259
|
+
expose : function () {
|
2260
|
+
var expose,
|
2261
|
+
exposeCover,
|
2262
|
+
el,
|
2263
|
+
origCSS,
|
2264
|
+
origClasses,
|
2265
|
+
randId = 'expose-'+Math.floor(Math.random()*10000);
|
2266
|
+
|
2267
|
+
if (arguments.length > 0 && arguments[0] instanceof $) {
|
2268
|
+
el = arguments[0];
|
2269
|
+
} else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
|
2270
|
+
el = this.settings.$target;
|
2271
|
+
} else {
|
2272
|
+
return false;
|
2273
|
+
}
|
2274
|
+
|
2275
|
+
if(el.length < 1){
|
2276
|
+
if(window.console){
|
2277
|
+
console.error('element not valid', el);
|
2278
|
+
}
|
2279
|
+
return false;
|
2280
|
+
}
|
2281
|
+
|
2282
|
+
expose = $(this.settings.template.expose);
|
2283
|
+
this.settings.$body.append(expose);
|
2284
|
+
expose.css({
|
2285
|
+
top: el.offset().top,
|
2286
|
+
left: el.offset().left,
|
2287
|
+
width: el.outerWidth(true),
|
2288
|
+
height: el.outerHeight(true)
|
2289
|
+
});
|
2290
|
+
|
2291
|
+
exposeCover = $(this.settings.template.expose_cover);
|
2292
|
+
|
2293
|
+
origCSS = {
|
2294
|
+
zIndex: el.css('z-index'),
|
2295
|
+
position: el.css('position')
|
2296
|
+
};
|
2297
|
+
|
2298
|
+
origClasses = el.attr('class') == null ? '' : el.attr('class');
|
2299
|
+
|
2300
|
+
el.css('z-index',parseInt(expose.css('z-index'))+1);
|
2301
|
+
|
2302
|
+
if (origCSS.position == 'static') {
|
2303
|
+
el.css('position','relative');
|
2304
|
+
}
|
2305
|
+
|
2306
|
+
el.data('expose-css',origCSS);
|
2307
|
+
el.data('orig-class', origClasses);
|
2308
|
+
el.attr('class', origClasses + ' ' + this.settings.expose_add_class);
|
2309
|
+
|
2310
|
+
exposeCover.css({
|
2311
|
+
top: el.offset().top,
|
2312
|
+
left: el.offset().left,
|
2313
|
+
width: el.outerWidth(true),
|
2314
|
+
height: el.outerHeight(true)
|
2315
|
+
});
|
2316
|
+
|
2317
|
+
if (this.settings.modal) this.show_modal();
|
2318
|
+
|
2319
|
+
this.settings.$body.append(exposeCover);
|
2320
|
+
expose.addClass(randId);
|
2321
|
+
exposeCover.addClass(randId);
|
2322
|
+
el.data('expose', randId);
|
2323
|
+
this.settings.post_expose_callback(this.settings.$li.index(), this.settings.$next_tip, el);
|
2324
|
+
this.add_exposed(el);
|
2325
|
+
},
|
2326
|
+
|
2327
|
+
un_expose : function () {
|
2328
|
+
var exposeId,
|
2329
|
+
el,
|
2330
|
+
expose ,
|
2331
|
+
origCSS,
|
2332
|
+
origClasses,
|
2333
|
+
clearAll = false;
|
2334
|
+
|
2335
|
+
if (arguments.length > 0 && arguments[0] instanceof $) {
|
2336
|
+
el = arguments[0];
|
2337
|
+
} else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
|
2338
|
+
el = this.settings.$target;
|
2339
|
+
} else {
|
2340
|
+
return false;
|
2341
|
+
}
|
2342
|
+
|
2343
|
+
if(el.length < 1){
|
2344
|
+
if (window.console) {
|
2345
|
+
console.error('element not valid', el);
|
2346
|
+
}
|
2347
|
+
return false;
|
2348
|
+
}
|
2349
|
+
|
2350
|
+
exposeId = el.data('expose');
|
2351
|
+
expose = $('.' + exposeId);
|
2352
|
+
|
2353
|
+
if (arguments.length > 1) {
|
2354
|
+
clearAll = arguments[1];
|
2355
|
+
}
|
2356
|
+
|
2357
|
+
if (clearAll === true) {
|
2358
|
+
$('.joyride-expose-wrapper,.joyride-expose-cover').remove();
|
2359
|
+
} else {
|
2360
|
+
expose.remove();
|
2361
|
+
}
|
2362
|
+
|
2363
|
+
origCSS = el.data('expose-css');
|
2364
|
+
|
2365
|
+
if (origCSS.zIndex == 'auto') {
|
2366
|
+
el.css('z-index', '');
|
2367
|
+
} else {
|
2368
|
+
el.css('z-index', origCSS.zIndex);
|
2369
|
+
}
|
2370
|
+
|
2371
|
+
if (origCSS.position != el.css('position')) {
|
2372
|
+
if(origCSS.position == 'static') {// this is default, no need to set it.
|
2373
|
+
el.css('position', '');
|
2374
|
+
} else {
|
2375
|
+
el.css('position', origCSS.position);
|
2376
|
+
}
|
2377
|
+
}
|
2378
|
+
|
2379
|
+
origClasses = el.data('orig-class');
|
2380
|
+
el.attr('class', origClasses);
|
2381
|
+
el.removeData('orig-classes');
|
2382
|
+
|
2383
|
+
el.removeData('expose');
|
2384
|
+
el.removeData('expose-z-index');
|
2385
|
+
this.remove_exposed(el);
|
2386
|
+
},
|
2387
|
+
|
2388
|
+
add_exposed: function(el){
|
2389
|
+
this.settings.exposed = this.settings.exposed || [];
|
2390
|
+
if (el instanceof $ || typeof el === 'object') {
|
2391
|
+
this.settings.exposed.push(el[0]);
|
2392
|
+
} else if (typeof el == 'string') {
|
2393
|
+
this.settings.exposed.push(el);
|
2394
|
+
}
|
2395
|
+
},
|
2396
|
+
|
2397
|
+
remove_exposed: function(el){
|
2398
|
+
var search, count;
|
2399
|
+
if (el instanceof $) {
|
2400
|
+
search = el[0]
|
2401
|
+
} else if (typeof el == 'string'){
|
2402
|
+
search = el;
|
2403
|
+
}
|
2404
|
+
|
2405
|
+
this.settings.exposed = this.settings.exposed || [];
|
2406
|
+
count = this.settings.exposed.length;
|
2407
|
+
|
2408
|
+
for (var i=0; i < count; i++) {
|
2409
|
+
if (this.settings.exposed[i] == search) {
|
2410
|
+
this.settings.exposed.splice(i, 1);
|
2411
|
+
return;
|
2412
|
+
}
|
2413
|
+
}
|
2414
|
+
},
|
2415
|
+
|
2416
|
+
center : function () {
|
2417
|
+
var $w = $(window);
|
2418
|
+
|
2419
|
+
this.settings.$next_tip.css({
|
2420
|
+
top : ((($w.height() - this.settings.$next_tip.outerHeight()) / 2) + $w.scrollTop()),
|
2421
|
+
left : ((($w.width() - this.settings.$next_tip.outerWidth()) / 2) + $w.scrollLeft())
|
2422
|
+
});
|
2423
|
+
|
2424
|
+
return true;
|
2425
|
+
},
|
2426
|
+
|
2427
|
+
bottom : function () {
|
2428
|
+
return /bottom/i.test(this.settings.tip_settings.tip_location);
|
2429
|
+
},
|
2430
|
+
|
2431
|
+
top : function () {
|
2432
|
+
return /top/i.test(this.settings.tip_settings.tip_location);
|
2433
|
+
},
|
2434
|
+
|
2435
|
+
right : function () {
|
2436
|
+
return /right/i.test(this.settings.tip_settings.tip_location);
|
2437
|
+
},
|
2438
|
+
|
2439
|
+
left : function () {
|
2440
|
+
return /left/i.test(this.settings.tip_settings.tip_location);
|
2441
|
+
},
|
2442
|
+
|
2443
|
+
corners : function (el) {
|
2444
|
+
var w = $(window),
|
2445
|
+
window_half = w.height() / 2,
|
2446
|
+
//using this to calculate since scroll may not have finished yet.
|
2447
|
+
tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight()),
|
2448
|
+
right = w.width() + w.scrollLeft(),
|
2449
|
+
offsetBottom = w.height() + tipOffset,
|
2450
|
+
bottom = w.height() + w.scrollTop(),
|
2451
|
+
top = w.scrollTop();
|
2452
|
+
|
2453
|
+
if (tipOffset < top) {
|
2454
|
+
if (tipOffset < 0) {
|
2455
|
+
top = 0;
|
2456
|
+
} else {
|
2457
|
+
top = tipOffset;
|
2458
|
+
}
|
2459
|
+
}
|
2460
|
+
|
2461
|
+
if (offsetBottom > bottom) {
|
2462
|
+
bottom = offsetBottom;
|
2463
|
+
}
|
2464
|
+
|
2465
|
+
return [
|
2466
|
+
el.offset().top < top,
|
2467
|
+
right < el.offset().left + el.outerWidth(),
|
2468
|
+
bottom < el.offset().top + el.outerHeight(),
|
2469
|
+
w.scrollLeft() > el.offset().left
|
2470
|
+
];
|
2471
|
+
},
|
2472
|
+
|
2473
|
+
visible : function (hidden_corners) {
|
2474
|
+
var i = hidden_corners.length;
|
2475
|
+
|
2476
|
+
while (i--) {
|
2477
|
+
if (hidden_corners[i]) return false;
|
2478
|
+
}
|
2479
|
+
|
2480
|
+
return true;
|
2481
|
+
},
|
2482
|
+
|
2483
|
+
nub_position : function (nub, pos, def) {
|
2484
|
+
if (pos === 'auto') {
|
2485
|
+
nub.addClass(def);
|
2486
|
+
} else {
|
2487
|
+
nub.addClass(pos);
|
2488
|
+
}
|
2489
|
+
},
|
2490
|
+
|
2491
|
+
startTimer : function () {
|
2492
|
+
if (this.settings.$li.length) {
|
2493
|
+
this.settings.automate = setTimeout(function () {
|
2494
|
+
this.hide();
|
2495
|
+
this.show();
|
2496
|
+
this.startTimer();
|
2497
|
+
}.bind(this), this.settings.timer);
|
2498
|
+
} else {
|
2499
|
+
clearTimeout(this.settings.automate);
|
2500
|
+
}
|
2501
|
+
},
|
2502
|
+
|
2503
|
+
end : function () {
|
2504
|
+
if (this.settings.cookie_monster) {
|
2505
|
+
$.cookie(this.settings.cookie_name, 'ridden', { expires: this.settings.cookie_expires, domain: this.settings.cookie_domain });
|
2506
|
+
}
|
2507
|
+
|
2508
|
+
if (this.settings.timer > 0) {
|
2509
|
+
clearTimeout(this.settings.automate);
|
2510
|
+
}
|
2511
|
+
|
2512
|
+
if (this.settings.modal && this.settings.expose) {
|
2513
|
+
this.un_expose();
|
2514
|
+
}
|
2515
|
+
|
2516
|
+
this.settings.$next_tip.data('closed', true);
|
2517
|
+
|
2518
|
+
$('.joyride-modal-bg').hide();
|
2519
|
+
this.settings.$current_tip.hide();
|
2520
|
+
this.settings.post_step_callback(this.settings.$li.index(), this.settings.$current_tip);
|
2521
|
+
this.settings.post_ride_callback(this.settings.$li.index(), this.settings.$current_tip);
|
2522
|
+
$('.joyride-tip-guide').remove();
|
2523
|
+
},
|
2524
|
+
|
2525
|
+
off : function () {
|
2526
|
+
$(this.scope).off('.joyride');
|
2527
|
+
$(window).off('.joyride');
|
2528
|
+
$('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
|
2529
|
+
$('.joyride-tip-guide, .joyride-modal-bg').remove();
|
2530
|
+
clearTimeout(this.settings.automate);
|
2531
|
+
this.settings = {};
|
2532
|
+
},
|
2533
|
+
|
2534
|
+
reflow : function () {}
|
2535
|
+
};
|
2536
|
+
}(jQuery, this, this.document));
|
2537
|
+
|
2538
|
+
;(function ($, window, document, undefined) {
|
2539
|
+
'use strict';
|
2540
|
+
|
2541
|
+
Foundation.libs.magellan = {
|
2542
|
+
name : 'magellan',
|
2543
|
+
|
2544
|
+
version : '5.0.0',
|
2545
|
+
|
2546
|
+
settings : {
|
2547
|
+
active_class: 'active',
|
2548
|
+
threshold: 0
|
2549
|
+
},
|
2550
|
+
|
2551
|
+
init : function (scope, method, options) {
|
2552
|
+
this.fixed_magellan = $("[data-magellan-expedition]");
|
2553
|
+
this.magellan_placeholder = $('<div></div>').css({
|
2554
|
+
height: this.fixed_magellan.outerHeight(true)
|
2555
|
+
}).hide().insertAfter(this.fixed_magellan);
|
2556
|
+
this.set_threshold();
|
2557
|
+
this.set_active_class(method);
|
2558
|
+
this.last_destination = $('[data-magellan-destination]').last();
|
2559
|
+
this.events();
|
2560
|
+
},
|
2561
|
+
|
2562
|
+
events : function () {
|
2563
|
+
var self = this;
|
2564
|
+
|
2565
|
+
$(this.scope)
|
2566
|
+
.off('.magellan')
|
2567
|
+
.on('arrival.fndtn.magellan', '[data-magellan-arrival]', function (e) {
|
2568
|
+
var $destination = $(this),
|
2569
|
+
$expedition = $destination.closest('[data-magellan-expedition]'),
|
2570
|
+
active_class = $expedition.attr('data-magellan-active-class')
|
2571
|
+
|| self.settings.active_class;
|
2572
|
+
|
2573
|
+
$destination
|
2574
|
+
.closest('[data-magellan-expedition]')
|
2575
|
+
.find('[data-magellan-arrival]')
|
2576
|
+
.not($destination)
|
2577
|
+
.removeClass(active_class);
|
2578
|
+
$destination.addClass(active_class);
|
2579
|
+
});
|
2580
|
+
|
2581
|
+
this.fixed_magellan
|
2582
|
+
.off('.magellan')
|
2583
|
+
.on('update-position.fndtn.magellan', function() {
|
2584
|
+
var $el = $(this);
|
2585
|
+
})
|
2586
|
+
.trigger('update-position');
|
2587
|
+
|
2588
|
+
$(window)
|
2589
|
+
.off('.magellan')
|
2590
|
+
.on('resize.fndtn.magellan', function() {
|
2591
|
+
this.fixed_magellan.trigger('update-position');
|
2592
|
+
}.bind(this))
|
2593
|
+
.on('scroll.fndtn.magellan', function() {
|
2594
|
+
var windowScrollTop = $(window).scrollTop();
|
2595
|
+
self.fixed_magellan.each(function() {
|
2596
|
+
var $expedition = $(this);
|
2597
|
+
if (typeof $expedition.data('magellan-top-offset') === 'undefined') {
|
2598
|
+
$expedition.data('magellan-top-offset', $expedition.offset().top);
|
2599
|
+
}
|
2600
|
+
if (typeof $expedition.data('magellan-fixed-position') === 'undefined') {
|
2601
|
+
$expedition.data('magellan-fixed-position', false);
|
2602
|
+
}
|
2603
|
+
var fixed_position = (windowScrollTop + self.settings.threshold) > $expedition.data("magellan-top-offset");
|
2604
|
+
var attr = $expedition.attr('data-magellan-top-offset');
|
2605
|
+
|
2606
|
+
if ($expedition.data("magellan-fixed-position") != fixed_position) {
|
2607
|
+
$expedition.data("magellan-fixed-position", fixed_position);
|
2608
|
+
if (fixed_position) {
|
2609
|
+
$expedition.addClass('fixed');
|
2610
|
+
$expedition.css({position:"fixed", top:0});
|
2611
|
+
self.magellan_placeholder.show();
|
2612
|
+
} else {
|
2613
|
+
$expedition.removeClass('fixed');
|
2614
|
+
$expedition.css({position:"", top:""});
|
2615
|
+
self.magellan_placeholder.hide();
|
2616
|
+
}
|
2617
|
+
if (fixed_position && typeof attr != 'undefined' && attr != false) {
|
2618
|
+
$expedition.css({position:"fixed", top:attr + "px"});
|
2619
|
+
}
|
2620
|
+
}
|
2621
|
+
});
|
2622
|
+
});
|
2623
|
+
|
2624
|
+
|
2625
|
+
if (this.last_destination.length > 0) {
|
2626
|
+
$(window).on('scroll.fndtn.magellan', function (e) {
|
2627
|
+
var windowScrollTop = $(window).scrollTop(),
|
2628
|
+
scrolltopPlusHeight = windowScrollTop + $(window).height(),
|
2629
|
+
lastDestinationTop = Math.ceil(self.last_destination.offset().top);
|
2630
|
+
|
2631
|
+
$('[data-magellan-destination]').each(function () {
|
2632
|
+
var $destination = $(this),
|
2633
|
+
destination_name = $destination.attr('data-magellan-destination'),
|
2634
|
+
topOffset = $destination.offset().top - $destination.outerHeight(true) - windowScrollTop;
|
2635
|
+
if (topOffset <= self.settings.threshold) {
|
2636
|
+
$("[data-magellan-arrival='" + destination_name + "']").trigger('arrival');
|
2637
|
+
}
|
2638
|
+
// In large screens we may hit the bottom of the page and dont reach the top of the last magellan-destination, so lets force it
|
2639
|
+
if (scrolltopPlusHeight >= $(self.scope).height() && lastDestinationTop > windowScrollTop && lastDestinationTop < scrolltopPlusHeight) {
|
2640
|
+
$('[data-magellan-arrival]').last().trigger('arrival');
|
2641
|
+
}
|
2642
|
+
});
|
2643
|
+
});
|
2644
|
+
}
|
2645
|
+
},
|
2646
|
+
|
2647
|
+
set_threshold : function () {
|
2648
|
+
if (typeof this.settings.threshold !== 'number') {
|
2649
|
+
this.settings.threshold = (this.fixed_magellan.length > 0) ?
|
2650
|
+
this.fixed_magellan.outerHeight(true) : 0;
|
2651
|
+
}
|
2652
|
+
},
|
2653
|
+
|
2654
|
+
set_active_class : function (options) {
|
2655
|
+
if (options && options.active_class && typeof options.active_class === 'string') {
|
2656
|
+
this.settings.active_class = options.active_class;
|
2657
|
+
}
|
2658
|
+
},
|
2659
|
+
|
2660
|
+
off : function () {
|
2661
|
+
$(this.scope).off('.fndtn.magellan');
|
2662
|
+
$(window).off('.fndtn.magellan');
|
2663
|
+
},
|
2664
|
+
|
2665
|
+
reflow : function () {}
|
2666
|
+
};
|
2667
|
+
}(jQuery, this, this.document));
|
2668
|
+
|
2669
|
+
;(function ($, window, document, undefined) {
|
2670
|
+
'use strict';
|
2671
|
+
|
2672
|
+
Foundation.libs.offcanvas = {
|
2673
|
+
name : 'offcanvas',
|
2674
|
+
|
2675
|
+
version : '5.0.0',
|
2676
|
+
|
2677
|
+
settings : {},
|
2678
|
+
|
2679
|
+
init : function (scope, method, options) {
|
2680
|
+
this.events();
|
2681
|
+
},
|
2682
|
+
|
2683
|
+
events : function () {
|
2684
|
+
$(this.scope).off('.offcanvas')
|
2685
|
+
.on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
|
2686
|
+
e.preventDefault();
|
2687
|
+
$(this).closest('.off-canvas-wrap').toggleClass('move-right');
|
2688
|
+
})
|
2689
|
+
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
2690
|
+
e.preventDefault();
|
2691
|
+
$(".off-canvas-wrap").removeClass("move-right");
|
2692
|
+
})
|
2693
|
+
.on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
|
2694
|
+
e.preventDefault();
|
2695
|
+
$(this).closest(".off-canvas-wrap").toggleClass("move-left");
|
2696
|
+
})
|
2697
|
+
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
|
2698
|
+
e.preventDefault();
|
2699
|
+
$(".off-canvas-wrap").removeClass("move-left");
|
2700
|
+
});
|
2701
|
+
},
|
2702
|
+
|
2703
|
+
reflow : function () {}
|
2704
|
+
};
|
2705
|
+
}(jQuery, this, this.document));
|
2706
|
+
;(function ($, window, document, undefined) {
|
2707
|
+
'use strict';
|
2708
|
+
|
2709
|
+
var noop = function() {};
|
2710
|
+
|
2711
|
+
var Orbit = function(el, settings) {
|
2712
|
+
// Don't reinitialize plugin
|
2713
|
+
if (el.hasClass(settings.slides_container_class)) {
|
2714
|
+
return this;
|
2715
|
+
}
|
2716
|
+
|
2717
|
+
var self = this,
|
2718
|
+
container,
|
2719
|
+
slides_container = el,
|
2720
|
+
number_container,
|
2721
|
+
bullets_container,
|
2722
|
+
timer_container,
|
2723
|
+
idx = 0,
|
2724
|
+
animate,
|
2725
|
+
timer,
|
2726
|
+
locked = false,
|
2727
|
+
adjust_height_after = false;
|
2728
|
+
|
2729
|
+
slides_container.children().first().addClass(settings.active_slide_class);
|
2730
|
+
|
2731
|
+
self.update_slide_number = function(index) {
|
2732
|
+
if (settings.slide_number) {
|
2733
|
+
number_container.find('span:first').text(parseInt(index)+1);
|
2734
|
+
number_container.find('span:last').text(slides_container.children().length);
|
2735
|
+
}
|
2736
|
+
if (settings.bullets) {
|
2737
|
+
bullets_container.children().removeClass(settings.bullets_active_class);
|
2738
|
+
$(bullets_container.children().get(index)).addClass(settings.bullets_active_class);
|
2739
|
+
}
|
2740
|
+
};
|
2741
|
+
|
2742
|
+
self.update_active_link = function(index) {
|
2743
|
+
var link = $('a[data-orbit-link="'+slides_container.children().eq(index).attr('data-orbit-slide')+'"]');
|
2744
|
+
link.siblings().removeClass(settings.bullets_active_class);
|
2745
|
+
link.addClass(settings.bullets_active_class);
|
2746
|
+
};
|
2747
|
+
|
2748
|
+
self.build_markup = function() {
|
2749
|
+
slides_container.wrap('<div class="'+settings.container_class+'"></div>');
|
2750
|
+
container = slides_container.parent();
|
2751
|
+
slides_container.addClass(settings.slides_container_class);
|
2752
|
+
|
2753
|
+
if (settings.navigation_arrows) {
|
2754
|
+
container.append($('<a href="#"><span></span></a>').addClass(settings.prev_class));
|
2755
|
+
container.append($('<a href="#"><span></span></a>').addClass(settings.next_class));
|
2756
|
+
}
|
2757
|
+
|
2758
|
+
if (settings.timer) {
|
2759
|
+
timer_container = $('<div>').addClass(settings.timer_container_class);
|
2760
|
+
timer_container.append('<span>');
|
2761
|
+
timer_container.append($('<div>').addClass(settings.timer_progress_class));
|
2762
|
+
timer_container.addClass(settings.timer_paused_class);
|
2763
|
+
container.append(timer_container);
|
2764
|
+
}
|
2765
|
+
|
2766
|
+
if (settings.slide_number) {
|
2767
|
+
number_container = $('<div>').addClass(settings.slide_number_class);
|
2768
|
+
number_container.append('<span></span> ' + settings.slide_number_text + ' <span></span>');
|
2769
|
+
container.append(number_container);
|
2770
|
+
}
|
2771
|
+
|
2772
|
+
if (settings.bullets) {
|
2773
|
+
bullets_container = $('<ol>').addClass(settings.bullets_container_class);
|
2774
|
+
container.append(bullets_container);
|
2775
|
+
bullets_container.wrap('<div class="orbit-bullets-container"></div>');
|
2776
|
+
slides_container.children().each(function(idx, el) {
|
2777
|
+
var bullet = $('<li>').attr('data-orbit-slide', idx);
|
2778
|
+
bullets_container.append(bullet);
|
2779
|
+
});
|
2780
|
+
}
|
2781
|
+
|
2782
|
+
if (settings.stack_on_small) {
|
2783
|
+
container.addClass(settings.stack_on_small_class);
|
2784
|
+
}
|
2785
|
+
|
2786
|
+
self.update_slide_number(0);
|
2787
|
+
self.update_active_link(0);
|
2788
|
+
};
|
2789
|
+
|
2790
|
+
self._goto = function(next_idx, start_timer) {
|
2791
|
+
// if (locked) {return false;}
|
2792
|
+
if (next_idx === idx) {return false;}
|
2793
|
+
if (typeof timer === 'object') {timer.restart();}
|
2794
|
+
var slides = slides_container.children();
|
2795
|
+
|
2796
|
+
var dir = 'next';
|
2797
|
+
locked = true;
|
2798
|
+
if (next_idx < idx) {dir = 'prev';}
|
2799
|
+
if (next_idx >= slides.length) {
|
2800
|
+
if (!settings.circular) return false;
|
2801
|
+
next_idx = 0;
|
2802
|
+
} else if (next_idx < 0) {
|
2803
|
+
if (!settings.circular) return false;
|
2804
|
+
next_idx = slides.length - 1;
|
2805
|
+
}
|
2806
|
+
|
2807
|
+
var current = $(slides.get(idx));
|
2808
|
+
var next = $(slides.get(next_idx));
|
2809
|
+
|
2810
|
+
current.css('zIndex', 2);
|
2811
|
+
current.removeClass(settings.active_slide_class);
|
2812
|
+
next.css('zIndex', 4).addClass(settings.active_slide_class);
|
2813
|
+
|
2814
|
+
slides_container.trigger('before-slide-change.fndtn.orbit');
|
2815
|
+
settings.before_slide_change();
|
2816
|
+
self.update_active_link(next_idx);
|
2817
|
+
|
2818
|
+
var callback = function() {
|
2819
|
+
var unlock = function() {
|
2820
|
+
idx = next_idx;
|
2821
|
+
locked = false;
|
2822
|
+
if (start_timer === true) {timer = self.create_timer(); timer.start();}
|
2823
|
+
self.update_slide_number(idx);
|
2824
|
+
slides_container.trigger('after-slide-change.fndtn.orbit',[{slide_number: idx, total_slides: slides.length}]);
|
2825
|
+
settings.after_slide_change(idx, slides.length);
|
2826
|
+
};
|
2827
|
+
if (slides_container.height() != next.height() && settings.variable_height) {
|
2828
|
+
slides_container.animate({'height': next.height()}, 250, 'linear', unlock);
|
2829
|
+
} else {
|
2830
|
+
unlock();
|
2831
|
+
}
|
2832
|
+
};
|
2833
|
+
|
2834
|
+
if (slides.length === 1) {callback(); return false;}
|
2835
|
+
|
2836
|
+
var start_animation = function() {
|
2837
|
+
if (dir === 'next') {animate.next(current, next, callback);}
|
2838
|
+
if (dir === 'prev') {animate.prev(current, next, callback);}
|
2839
|
+
};
|
2840
|
+
|
2841
|
+
if (next.height() > slides_container.height() && settings.variable_height) {
|
2842
|
+
slides_container.animate({'height': next.height()}, 250, 'linear', start_animation);
|
2843
|
+
} else {
|
2844
|
+
start_animation();
|
2845
|
+
}
|
2846
|
+
};
|
2847
|
+
|
2848
|
+
self.next = function(e) {
|
2849
|
+
e.stopImmediatePropagation();
|
2850
|
+
e.preventDefault();
|
2851
|
+
self._goto(idx + 1);
|
2852
|
+
};
|
2853
|
+
|
2854
|
+
self.prev = function(e) {
|
2855
|
+
e.stopImmediatePropagation();
|
2856
|
+
e.preventDefault();
|
2857
|
+
self._goto(idx - 1);
|
2858
|
+
};
|
2859
|
+
|
2860
|
+
self.link_custom = function(e) {
|
2861
|
+
e.preventDefault();
|
2862
|
+
var link = $(this).attr('data-orbit-link');
|
2863
|
+
if ((typeof link === 'string') && (link = $.trim(link)) != "") {
|
2864
|
+
var slide = container.find('[data-orbit-slide='+link+']');
|
2865
|
+
if (slide.index() != -1) {self._goto(slide.index());}
|
2866
|
+
}
|
2867
|
+
};
|
2868
|
+
|
2869
|
+
self.link_bullet = function(e) {
|
2870
|
+
var index = $(this).attr('data-orbit-slide');
|
2871
|
+
if ((typeof index === 'string') && (index = $.trim(index)) != "") {
|
2872
|
+
if(isNaN(parseInt(index)))
|
2873
|
+
{
|
2874
|
+
var slide = container.find('[data-orbit-slide='+index+']');
|
2875
|
+
if (slide.index() != -1) {self._goto(slide.index() + 1);}
|
2876
|
+
}
|
2877
|
+
else
|
2878
|
+
{
|
2879
|
+
self._goto(parseInt(index));
|
2880
|
+
}
|
2881
|
+
}
|
2882
|
+
|
2883
|
+
}
|
2884
|
+
|
2885
|
+
self.timer_callback = function() {
|
2886
|
+
self._goto(idx + 1, true);
|
2887
|
+
}
|
2888
|
+
|
2889
|
+
self.compute_dimensions = function() {
|
2890
|
+
var current = $(slides_container.children().get(idx));
|
2891
|
+
var h = current.height();
|
2892
|
+
if (!settings.variable_height) {
|
2893
|
+
slides_container.children().each(function(){
|
2894
|
+
if ($(this).height() > h) { h = $(this).height(); }
|
2895
|
+
});
|
2896
|
+
}
|
2897
|
+
slides_container.height(h);
|
2898
|
+
};
|
2899
|
+
|
2900
|
+
self.create_timer = function() {
|
2901
|
+
var t = new Timer(
|
2902
|
+
container.find('.'+settings.timer_container_class),
|
2903
|
+
settings,
|
2904
|
+
self.timer_callback
|
2905
|
+
);
|
2906
|
+
return t;
|
2907
|
+
};
|
2908
|
+
|
2909
|
+
self.stop_timer = function() {
|
2910
|
+
if (typeof timer === 'object') timer.stop();
|
2911
|
+
};
|
2912
|
+
|
2913
|
+
self.toggle_timer = function() {
|
2914
|
+
var t = container.find('.'+settings.timer_container_class);
|
2915
|
+
if (t.hasClass(settings.timer_paused_class)) {
|
2916
|
+
if (typeof timer === 'undefined') {timer = self.create_timer();}
|
2917
|
+
timer.start();
|
2918
|
+
}
|
2919
|
+
else {
|
2920
|
+
if (typeof timer === 'object') {timer.stop();}
|
2921
|
+
}
|
2922
|
+
};
|
2923
|
+
|
2924
|
+
self.init = function() {
|
2925
|
+
self.build_markup();
|
2926
|
+
if (settings.timer) {timer = self.create_timer(); timer.start();}
|
2927
|
+
animate = new FadeAnimation(settings, slides_container);
|
2928
|
+
if (settings.animation === 'slide')
|
2929
|
+
animate = new SlideAnimation(settings, slides_container);
|
2930
|
+
container.on('click', '.'+settings.next_class, self.next);
|
2931
|
+
container.on('click', '.'+settings.prev_class, self.prev);
|
2932
|
+
container.on('click', '[data-orbit-slide]', self.link_bullet);
|
2933
|
+
container.on('click', self.toggle_timer);
|
2934
|
+
if (settings.swipe) {
|
2935
|
+
container.on('touchstart.fndtn.orbit', function(e) {
|
2936
|
+
if (!e.touches) {e = e.originalEvent;}
|
2937
|
+
var data = {
|
2938
|
+
start_page_x: e.touches[0].pageX,
|
2939
|
+
start_page_y: e.touches[0].pageY,
|
2940
|
+
start_time: (new Date()).getTime(),
|
2941
|
+
delta_x: 0,
|
2942
|
+
is_scrolling: undefined
|
2943
|
+
};
|
2944
|
+
container.data('swipe-transition', data);
|
2945
|
+
e.stopPropagation();
|
2946
|
+
})
|
2947
|
+
.on('touchmove.fndtn.orbit', function(e) {
|
2948
|
+
if (!e.touches) { e = e.originalEvent; }
|
2949
|
+
// Ignore pinch/zoom events
|
2950
|
+
if(e.touches.length > 1 || e.scale && e.scale !== 1) return;
|
2951
|
+
|
2952
|
+
var data = container.data('swipe-transition');
|
2953
|
+
if (typeof data === 'undefined') {data = {};}
|
2954
|
+
|
2955
|
+
data.delta_x = e.touches[0].pageX - data.start_page_x;
|
2956
|
+
|
2957
|
+
if ( typeof data.is_scrolling === 'undefined') {
|
2958
|
+
data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );
|
2959
|
+
}
|
2960
|
+
|
2961
|
+
if (!data.is_scrolling && !data.active) {
|
2962
|
+
e.preventDefault();
|
2963
|
+
var direction = (data.delta_x < 0) ? (idx+1) : (idx-1);
|
2964
|
+
data.active = true;
|
2965
|
+
self._goto(direction);
|
2966
|
+
}
|
2967
|
+
})
|
2968
|
+
.on('touchend.fndtn.orbit', function(e) {
|
2969
|
+
container.data('swipe-transition', {});
|
2970
|
+
e.stopPropagation();
|
2971
|
+
})
|
2972
|
+
}
|
2973
|
+
container.on('mouseenter.fndtn.orbit', function(e) {
|
2974
|
+
if (settings.timer && settings.pause_on_hover) {
|
2975
|
+
self.stop_timer();
|
2976
|
+
}
|
2977
|
+
})
|
2978
|
+
.on('mouseleave.fndtn.orbit', function(e) {
|
2979
|
+
if (settings.timer && settings.resume_on_mouseout) {
|
2980
|
+
timer.start();
|
2981
|
+
}
|
2982
|
+
});
|
2983
|
+
|
2984
|
+
$(document).on('click', '[data-orbit-link]', self.link_custom);
|
2985
|
+
$(window).on('resize', self.compute_dimensions);
|
2986
|
+
$(window).on('load', self.compute_dimensions);
|
2987
|
+
$(window).on('load', function(){
|
2988
|
+
container.prev('.preloader').css('display', 'none');
|
2989
|
+
});
|
2990
|
+
slides_container.trigger('ready.fndtn.orbit');
|
2991
|
+
};
|
2992
|
+
|
2993
|
+
self.init();
|
2994
|
+
};
|
2995
|
+
|
2996
|
+
var Timer = function(el, settings, callback) {
|
2997
|
+
var self = this,
|
2998
|
+
duration = settings.timer_speed,
|
2999
|
+
progress = el.find('.'+settings.timer_progress_class),
|
3000
|
+
start,
|
3001
|
+
timeout,
|
3002
|
+
left = -1;
|
3003
|
+
|
3004
|
+
this.update_progress = function(w) {
|
3005
|
+
var new_progress = progress.clone();
|
3006
|
+
new_progress.attr('style', '');
|
3007
|
+
new_progress.css('width', w+'%');
|
3008
|
+
progress.replaceWith(new_progress);
|
3009
|
+
progress = new_progress;
|
3010
|
+
};
|
3011
|
+
|
3012
|
+
this.restart = function() {
|
3013
|
+
clearTimeout(timeout);
|
3014
|
+
el.addClass(settings.timer_paused_class);
|
3015
|
+
left = -1;
|
3016
|
+
self.update_progress(0);
|
3017
|
+
};
|
3018
|
+
|
3019
|
+
this.start = function() {
|
3020
|
+
if (!el.hasClass(settings.timer_paused_class)) {return true;}
|
3021
|
+
left = (left === -1) ? duration : left;
|
3022
|
+
el.removeClass(settings.timer_paused_class);
|
3023
|
+
start = new Date().getTime();
|
3024
|
+
progress.animate({'width': '100%'}, left, 'linear');
|
3025
|
+
timeout = setTimeout(function() {
|
3026
|
+
self.restart();
|
3027
|
+
callback();
|
3028
|
+
}, left);
|
3029
|
+
el.trigger('timer-started.fndtn.orbit')
|
3030
|
+
};
|
3031
|
+
|
3032
|
+
this.stop = function() {
|
3033
|
+
if (el.hasClass(settings.timer_paused_class)) {return true;}
|
3034
|
+
clearTimeout(timeout);
|
3035
|
+
el.addClass(settings.timer_paused_class);
|
3036
|
+
var end = new Date().getTime();
|
3037
|
+
left = left - (end - start);
|
3038
|
+
var w = 100 - ((left / duration) * 100);
|
3039
|
+
self.update_progress(w);
|
3040
|
+
el.trigger('timer-stopped.fndtn.orbit');
|
3041
|
+
};
|
3042
|
+
};
|
3043
|
+
|
3044
|
+
var SlideAnimation = function(settings, container) {
|
3045
|
+
var duration = settings.animation_speed;
|
3046
|
+
var is_rtl = ($('html[dir=rtl]').length === 1);
|
3047
|
+
var margin = is_rtl ? 'marginRight' : 'marginLeft';
|
3048
|
+
var animMargin = {};
|
3049
|
+
animMargin[margin] = '0%';
|
3050
|
+
|
3051
|
+
this.next = function(current, next, callback) {
|
3052
|
+
current.animate({marginLeft:'-100%'}, duration);
|
3053
|
+
next.animate(animMargin, duration, function() {
|
3054
|
+
current.css(margin, '100%');
|
3055
|
+
callback();
|
3056
|
+
});
|
3057
|
+
};
|
3058
|
+
|
3059
|
+
this.prev = function(current, prev, callback) {
|
3060
|
+
current.animate({marginLeft:'100%'}, duration);
|
3061
|
+
prev.css(margin, '-100%');
|
3062
|
+
prev.animate(animMargin, duration, function() {
|
3063
|
+
current.css(margin, '100%');
|
3064
|
+
callback();
|
3065
|
+
});
|
3066
|
+
};
|
3067
|
+
};
|
3068
|
+
|
3069
|
+
var FadeAnimation = function(settings, container) {
|
3070
|
+
var duration = settings.animation_speed;
|
3071
|
+
var is_rtl = ($('html[dir=rtl]').length === 1);
|
3072
|
+
var margin = is_rtl ? 'marginRight' : 'marginLeft';
|
3073
|
+
|
3074
|
+
this.next = function(current, next, callback) {
|
3075
|
+
next.css({'margin':'0%', 'opacity':'0.01'});
|
3076
|
+
next.animate({'opacity':'1'}, duration, 'linear', function() {
|
3077
|
+
current.css('margin', '100%');
|
3078
|
+
callback();
|
3079
|
+
});
|
3080
|
+
};
|
3081
|
+
|
3082
|
+
this.prev = function(current, prev, callback) {
|
3083
|
+
prev.css({'margin':'0%', 'opacity':'0.01'});
|
3084
|
+
prev.animate({'opacity':'1'}, duration, 'linear', function() {
|
3085
|
+
current.css('margin', '100%');
|
3086
|
+
callback();
|
3087
|
+
});
|
3088
|
+
};
|
3089
|
+
};
|
3090
|
+
|
3091
|
+
|
3092
|
+
Foundation.libs = Foundation.libs || {};
|
3093
|
+
|
3094
|
+
Foundation.libs.orbit = {
|
3095
|
+
name: 'orbit',
|
3096
|
+
|
3097
|
+
version: '5.0.3',
|
3098
|
+
|
3099
|
+
settings: {
|
3100
|
+
animation: 'slide',
|
3101
|
+
timer_speed: 10000,
|
3102
|
+
pause_on_hover: true,
|
3103
|
+
resume_on_mouseout: false,
|
3104
|
+
animation_speed: 500,
|
3105
|
+
stack_on_small: false,
|
3106
|
+
navigation_arrows: true,
|
3107
|
+
slide_number: true,
|
3108
|
+
slide_number_text: 'of',
|
3109
|
+
container_class: 'orbit-container',
|
3110
|
+
stack_on_small_class: 'orbit-stack-on-small',
|
3111
|
+
next_class: 'orbit-next',
|
3112
|
+
prev_class: 'orbit-prev',
|
3113
|
+
timer_container_class: 'orbit-timer',
|
3114
|
+
timer_paused_class: 'paused',
|
3115
|
+
timer_progress_class: 'orbit-progress',
|
3116
|
+
slides_container_class: 'orbit-slides-container',
|
3117
|
+
bullets_container_class: 'orbit-bullets',
|
3118
|
+
bullets_active_class: 'active',
|
3119
|
+
slide_number_class: 'orbit-slide-number',
|
3120
|
+
caption_class: 'orbit-caption',
|
3121
|
+
active_slide_class: 'active',
|
3122
|
+
orbit_transition_class: 'orbit-transitioning',
|
3123
|
+
bullets: true,
|
3124
|
+
circular: true,
|
3125
|
+
timer: true,
|
3126
|
+
variable_height: false,
|
3127
|
+
swipe: true,
|
3128
|
+
before_slide_change: noop,
|
3129
|
+
after_slide_change: noop
|
3130
|
+
},
|
3131
|
+
|
3132
|
+
init: function (scope, method, options) {
|
3133
|
+
var self = this;
|
3134
|
+
|
3135
|
+
if (typeof method === 'object') {
|
3136
|
+
$.extend(true, self.settings, method);
|
3137
|
+
}
|
3138
|
+
|
3139
|
+
if ($(scope).is('[data-orbit]')) {
|
3140
|
+
var $el = $(scope);
|
3141
|
+
var opts = self.data_options($el);
|
3142
|
+
new Orbit($el, $.extend({},self.settings, opts));
|
3143
|
+
}
|
3144
|
+
|
3145
|
+
$('[data-orbit]', scope).each(function(idx, el) {
|
3146
|
+
var $el = $(el);
|
3147
|
+
var opts = self.data_options($el);
|
3148
|
+
new Orbit($el, $.extend({},self.settings, opts));
|
3149
|
+
});
|
3150
|
+
}
|
3151
|
+
};
|
3152
|
+
|
3153
|
+
|
3154
|
+
}(jQuery, this, this.document));
|
3155
|
+
|
3156
|
+
;(function ($, window, document, undefined) {
|
3157
|
+
'use strict';
|
3158
|
+
|
3159
|
+
Foundation.libs.reveal = {
|
3160
|
+
name : 'reveal',
|
3161
|
+
|
3162
|
+
version : '5.0.3',
|
3163
|
+
|
3164
|
+
locked : false,
|
3165
|
+
|
3166
|
+
settings : {
|
3167
|
+
animation: 'fadeAndPop',
|
3168
|
+
animation_speed: 250,
|
3169
|
+
close_on_background_click: true,
|
3170
|
+
close_on_esc: true,
|
3171
|
+
dismiss_modal_class: 'close-reveal-modal',
|
3172
|
+
bg_class: 'reveal-modal-bg',
|
3173
|
+
open: function(){},
|
3174
|
+
opened: function(){},
|
3175
|
+
close: function(){},
|
3176
|
+
closed: function(){},
|
3177
|
+
bg : $('.reveal-modal-bg'),
|
3178
|
+
css : {
|
3179
|
+
open : {
|
3180
|
+
'opacity': 0,
|
3181
|
+
'visibility': 'visible',
|
3182
|
+
'display' : 'block'
|
3183
|
+
},
|
3184
|
+
close : {
|
3185
|
+
'opacity': 1,
|
3186
|
+
'visibility': 'hidden',
|
3187
|
+
'display': 'none'
|
3188
|
+
}
|
3189
|
+
}
|
3190
|
+
},
|
3191
|
+
|
3192
|
+
init : function (scope, method, options) {
|
3193
|
+
Foundation.inherit(this, 'delay');
|
3194
|
+
$.extend(true, this.settings, method, options);
|
3195
|
+
this.bindings(method, options);
|
3196
|
+
},
|
3197
|
+
|
3198
|
+
events : function (scope) {
|
3199
|
+
var self = this;
|
3200
|
+
|
3201
|
+
$('[data-reveal-id]', this.scope)
|
3202
|
+
.off('.reveal')
|
3203
|
+
.on('click.fndtn.reveal', function (e) {
|
3204
|
+
e.preventDefault();
|
3205
|
+
|
3206
|
+
if (!self.locked) {
|
3207
|
+
var element = $(this),
|
3208
|
+
ajax = element.data('reveal-ajax');
|
3209
|
+
|
3210
|
+
self.locked = true;
|
3211
|
+
|
3212
|
+
if (typeof ajax === 'undefined') {
|
3213
|
+
self.open.call(self, element);
|
3214
|
+
} else {
|
3215
|
+
var url = ajax === true ? element.attr('href') : ajax;
|
3216
|
+
|
3217
|
+
self.open.call(self, element, {url: url});
|
3218
|
+
}
|
3219
|
+
}
|
3220
|
+
});
|
3221
|
+
|
3222
|
+
$(this.scope)
|
3223
|
+
.off('.reveal');
|
3224
|
+
|
3225
|
+
$(document)
|
3226
|
+
.on('click.fndtn.reveal', this.close_targets(), function (e) {
|
3227
|
+
|
3228
|
+
e.preventDefault();
|
3229
|
+
|
3230
|
+
if (!self.locked) {
|
3231
|
+
var settings = $('[data-reveal].open').data('reveal-init'),
|
3232
|
+
bg_clicked = $(e.target)[0] === $('.' + settings.bg_class)[0];
|
3233
|
+
|
3234
|
+
if (bg_clicked && !settings.close_on_background_click) {
|
3235
|
+
return;
|
3236
|
+
}
|
3237
|
+
|
3238
|
+
self.locked = true;
|
3239
|
+
self.close.call(self, bg_clicked ? $('[data-reveal].open') : $(this).closest('[data-reveal]'));
|
3240
|
+
}
|
3241
|
+
});
|
3242
|
+
|
3243
|
+
if($('[data-reveal]', this.scope).length > 0) {
|
3244
|
+
$(this.scope)
|
3245
|
+
// .off('.reveal')
|
3246
|
+
.on('open.fndtn.reveal', this.settings.open)
|
3247
|
+
.on('opened.fndtn.reveal', this.settings.opened)
|
3248
|
+
.on('opened.fndtn.reveal', this.open_video)
|
3249
|
+
.on('close.fndtn.reveal', this.settings.close)
|
3250
|
+
.on('closed.fndtn.reveal', this.settings.closed)
|
3251
|
+
.on('closed.fndtn.reveal', this.close_video);
|
3252
|
+
} else {
|
3253
|
+
$(this.scope)
|
3254
|
+
// .off('.reveal')
|
3255
|
+
.on('open.fndtn.reveal', '[data-reveal]', this.settings.open)
|
3256
|
+
.on('opened.fndtn.reveal', '[data-reveal]', this.settings.opened)
|
3257
|
+
.on('opened.fndtn.reveal', '[data-reveal]', this.open_video)
|
3258
|
+
.on('close.fndtn.reveal', '[data-reveal]', this.settings.close)
|
3259
|
+
.on('closed.fndtn.reveal', '[data-reveal]', this.settings.closed)
|
3260
|
+
.on('closed.fndtn.reveal', '[data-reveal]', this.close_video);
|
3261
|
+
}
|
3262
|
+
|
3263
|
+
$('body').on('keyup.fndtn.reveal', function ( event ) {
|
3264
|
+
var open_modal = $('[data-reveal].open'),
|
3265
|
+
settings = open_modal.data('reveal-init');
|
3266
|
+
if ( settings && event.which === 27 && settings.close_on_esc) { // 27 is the keycode for the Escape key
|
3267
|
+
open_modal.foundation('reveal', 'close');
|
3268
|
+
}
|
3269
|
+
});
|
3270
|
+
|
3271
|
+
return true;
|
3272
|
+
},
|
3273
|
+
|
3274
|
+
open : function (target, ajax_settings) {
|
3275
|
+
var self = this;
|
3276
|
+
if (target) {
|
3277
|
+
if (typeof target.selector !== 'undefined') {
|
3278
|
+
var modal = $('#' + target.data('reveal-id'));
|
3279
|
+
} else {
|
3280
|
+
var modal = $(this.scope);
|
3281
|
+
|
3282
|
+
ajax_settings = target;
|
3283
|
+
}
|
3284
|
+
} else {
|
3285
|
+
var modal = $(this.scope);
|
3286
|
+
}
|
3287
|
+
|
3288
|
+
var settings = modal.data('reveal-init');
|
3289
|
+
|
3290
|
+
if (!modal.hasClass('open')) {
|
3291
|
+
var open_modal = $('[data-reveal].open');
|
3292
|
+
|
3293
|
+
if (typeof modal.data('css-top') === 'undefined') {
|
3294
|
+
modal.data('css-top', parseInt(modal.css('top'), 10))
|
3295
|
+
.data('offset', this.cache_offset(modal));
|
3296
|
+
}
|
3297
|
+
|
3298
|
+
modal.trigger('open');
|
3299
|
+
|
3300
|
+
if (open_modal.length < 1) {
|
3301
|
+
this.toggle_bg(modal);
|
3302
|
+
}
|
3303
|
+
|
3304
|
+
if (typeof ajax_settings === 'string') {
|
3305
|
+
ajax_settings = {
|
3306
|
+
url: ajax_settings
|
3307
|
+
};
|
3308
|
+
}
|
3309
|
+
|
3310
|
+
if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
|
3311
|
+
if (open_modal.length > 0) {
|
3312
|
+
var open_modal_settings = open_modal.data('reveal-init');
|
3313
|
+
this.hide(open_modal, open_modal_settings.css.close);
|
3314
|
+
}
|
3315
|
+
|
3316
|
+
this.show(modal, settings.css.open);
|
3317
|
+
} else {
|
3318
|
+
var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
|
3319
|
+
|
3320
|
+
$.extend(ajax_settings, {
|
3321
|
+
success: function (data, textStatus, jqXHR) {
|
3322
|
+
if ( $.isFunction(old_success) ) {
|
3323
|
+
old_success(data, textStatus, jqXHR);
|
3324
|
+
}
|
3325
|
+
|
3326
|
+
modal.html(data);
|
3327
|
+
$(modal).foundation('section', 'reflow');
|
3328
|
+
|
3329
|
+
if (open_modal.length > 0) {
|
3330
|
+
var open_modal_settings = open_modal.data('reveal-init');
|
3331
|
+
self.hide(open_modal, open_modal_settings.css.close);
|
3332
|
+
}
|
3333
|
+
self.show(modal, settings.css.open);
|
3334
|
+
}
|
3335
|
+
});
|
3336
|
+
|
3337
|
+
$.ajax(ajax_settings);
|
3338
|
+
}
|
3339
|
+
}
|
3340
|
+
},
|
3341
|
+
|
3342
|
+
close : function (modal) {
|
3343
|
+
var modal = modal && modal.length ? modal : $(this.scope),
|
3344
|
+
open_modals = $('[data-reveal].open'),
|
3345
|
+
settings = modal.data('reveal-init');
|
3346
|
+
|
3347
|
+
if (open_modals.length > 0) {
|
3348
|
+
this.locked = true;
|
3349
|
+
modal.trigger('close');
|
3350
|
+
this.toggle_bg(modal);
|
3351
|
+
this.hide(open_modals, settings.css.close, settings);
|
3352
|
+
}
|
3353
|
+
},
|
3354
|
+
|
3355
|
+
close_targets : function () {
|
3356
|
+
var base = '.' + this.settings.dismiss_modal_class;
|
3357
|
+
|
3358
|
+
if (this.settings.close_on_background_click) {
|
3359
|
+
return base + ', .' + this.settings.bg_class;
|
3360
|
+
}
|
3361
|
+
|
3362
|
+
return base;
|
3363
|
+
},
|
3364
|
+
|
3365
|
+
toggle_bg : function (modal) {
|
3366
|
+
var settings = modal.data('reveal-init');
|
3367
|
+
|
3368
|
+
if ($('.' + this.settings.bg_class).length === 0) {
|
3369
|
+
this.settings.bg = $('<div />', {'class': this.settings.bg_class})
|
3370
|
+
.appendTo('body');
|
3371
|
+
}
|
3372
|
+
|
3373
|
+
if (this.settings.bg.filter(':visible').length > 0) {
|
3374
|
+
this.hide(this.settings.bg);
|
3375
|
+
} else {
|
3376
|
+
this.show(this.settings.bg);
|
3377
|
+
}
|
3378
|
+
},
|
3379
|
+
|
3380
|
+
show : function (el, css) {
|
3381
|
+
// is modal
|
3382
|
+
if (css) {
|
3383
|
+
var settings = el.data('reveal-init');
|
3384
|
+
if (el.parent('body').length === 0) {
|
3385
|
+
var placeholder = el.wrap('<div style="display: none;" />').parent(),
|
3386
|
+
rootElement = this.settings.rootElement || 'body';;
|
3387
|
+
el.on('closed.fndtn.reveal.wrapped', function() {
|
3388
|
+
el.detach().appendTo(placeholder);
|
3389
|
+
el.unwrap().unbind('closed.fndtn.reveal.wrapped');
|
3390
|
+
});
|
3391
|
+
|
3392
|
+
el.detach().appendTo(rootElement);
|
3393
|
+
}
|
3394
|
+
|
3395
|
+
if (/pop/i.test(settings.animation)) {
|
3396
|
+
css.top = $(window).scrollTop() - el.data('offset') + 'px';
|
3397
|
+
var end_css = {
|
3398
|
+
top: $(window).scrollTop() + el.data('css-top') + 'px',
|
3399
|
+
opacity: 1
|
3400
|
+
};
|
3401
|
+
|
3402
|
+
return this.delay(function () {
|
3403
|
+
return el
|
3404
|
+
.css(css)
|
3405
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
3406
|
+
this.locked = false;
|
3407
|
+
el.trigger('opened');
|
3408
|
+
}.bind(this))
|
3409
|
+
.addClass('open');
|
3410
|
+
}.bind(this), settings.animation_speed / 2);
|
3411
|
+
}
|
3412
|
+
|
3413
|
+
if (/fade/i.test(settings.animation)) {
|
3414
|
+
var end_css = {opacity: 1};
|
3415
|
+
|
3416
|
+
return this.delay(function () {
|
3417
|
+
return el
|
3418
|
+
.css(css)
|
3419
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
3420
|
+
this.locked = false;
|
3421
|
+
el.trigger('opened');
|
3422
|
+
}.bind(this))
|
3423
|
+
.addClass('open');
|
3424
|
+
}.bind(this), settings.animation_speed / 2);
|
3425
|
+
}
|
3426
|
+
|
3427
|
+
return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened');
|
3428
|
+
}
|
3429
|
+
|
3430
|
+
var settings = this.settings;
|
3431
|
+
|
3432
|
+
// should we animate the background?
|
3433
|
+
if (/fade/i.test(settings.animation)) {
|
3434
|
+
return el.fadeIn(settings.animation_speed / 2);
|
3435
|
+
}
|
3436
|
+
|
3437
|
+
return el.show();
|
3438
|
+
},
|
3439
|
+
|
3440
|
+
hide : function (el, css) {
|
3441
|
+
// is modal
|
3442
|
+
if (css) {
|
3443
|
+
var settings = el.data('reveal-init');
|
3444
|
+
if (/pop/i.test(settings.animation)) {
|
3445
|
+
var end_css = {
|
3446
|
+
top: - $(window).scrollTop() - el.data('offset') + 'px',
|
3447
|
+
opacity: 0
|
3448
|
+
};
|
3449
|
+
|
3450
|
+
return this.delay(function () {
|
3451
|
+
return el
|
3452
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
3453
|
+
this.locked = false;
|
3454
|
+
el.css(css).trigger('closed');
|
3455
|
+
}.bind(this))
|
3456
|
+
.removeClass('open');
|
3457
|
+
}.bind(this), settings.animation_speed / 2);
|
3458
|
+
}
|
3459
|
+
|
3460
|
+
if (/fade/i.test(settings.animation)) {
|
3461
|
+
var end_css = {opacity: 0};
|
3462
|
+
|
3463
|
+
return this.delay(function () {
|
3464
|
+
return el
|
3465
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
3466
|
+
this.locked = false;
|
3467
|
+
el.css(css).trigger('closed');
|
3468
|
+
}.bind(this))
|
3469
|
+
.removeClass('open');
|
3470
|
+
}.bind(this), settings.animation_speed / 2);
|
3471
|
+
}
|
3472
|
+
|
3473
|
+
return el.hide().css(css).removeClass('open').trigger('closed');
|
3474
|
+
}
|
3475
|
+
|
3476
|
+
var settings = this.settings;
|
3477
|
+
|
3478
|
+
// should we animate the background?
|
3479
|
+
if (/fade/i.test(settings.animation)) {
|
3480
|
+
return el.fadeOut(settings.animation_speed / 2);
|
3481
|
+
}
|
3482
|
+
|
3483
|
+
return el.hide();
|
3484
|
+
},
|
3485
|
+
|
3486
|
+
close_video : function (e) {
|
3487
|
+
var video = $(this).find('.flex-video'),
|
3488
|
+
iframe = video.find('iframe');
|
3489
|
+
|
3490
|
+
if (iframe.length > 0) {
|
3491
|
+
iframe.attr('data-src', iframe[0].src);
|
3492
|
+
iframe.attr('src', 'about:blank');
|
3493
|
+
video.hide();
|
3494
|
+
}
|
3495
|
+
},
|
3496
|
+
|
3497
|
+
open_video : function (e) {
|
3498
|
+
var video = $(this).find('.flex-video'),
|
3499
|
+
iframe = video.find('iframe');
|
3500
|
+
|
3501
|
+
if (iframe.length > 0) {
|
3502
|
+
var data_src = iframe.attr('data-src');
|
3503
|
+
if (typeof data_src === 'string') {
|
3504
|
+
iframe[0].src = iframe.attr('data-src');
|
3505
|
+
} else {
|
3506
|
+
var src = iframe[0].src;
|
3507
|
+
iframe[0].src = undefined;
|
3508
|
+
iframe[0].src = src;
|
3509
|
+
}
|
3510
|
+
video.show();
|
3511
|
+
}
|
3512
|
+
},
|
3513
|
+
|
3514
|
+
cache_offset : function (modal) {
|
3515
|
+
var offset = modal.show().height() + parseInt(modal.css('top'), 10);
|
3516
|
+
|
3517
|
+
modal.hide();
|
3518
|
+
|
3519
|
+
return offset;
|
3520
|
+
},
|
3521
|
+
|
3522
|
+
off : function () {
|
3523
|
+
$(this.scope).off('.fndtn.reveal');
|
3524
|
+
},
|
3525
|
+
|
3526
|
+
reflow : function () {}
|
3527
|
+
};
|
3528
|
+
}(jQuery, this, this.document));
|
3529
|
+
|
3530
|
+
/*jslint unparam: true, browser: true, indent: 2 */
|
3531
|
+
;(function ($, window, document, undefined) {
|
3532
|
+
'use strict';
|
3533
|
+
|
3534
|
+
Foundation.libs.tab = {
|
3535
|
+
name : 'tab',
|
3536
|
+
|
3537
|
+
version : '5.0.3',
|
3538
|
+
|
3539
|
+
settings : {
|
3540
|
+
active_class: 'active',
|
3541
|
+
callback : function () {}
|
3542
|
+
},
|
3543
|
+
|
3544
|
+
init : function (scope, method, options) {
|
3545
|
+
this.bindings(method, options);
|
3546
|
+
},
|
3547
|
+
|
3548
|
+
events : function () {
|
3549
|
+
$(this.scope).off('.tab').on('click.fndtn.tab', '[data-tab] > dd > a', function (e) {
|
3550
|
+
e.preventDefault();
|
3551
|
+
|
3552
|
+
var tab = $(this).parent(),
|
3553
|
+
tabs = tab.closest('[data-tab]'),
|
3554
|
+
target = $('#' + this.href.split('#')[1]),
|
3555
|
+
siblings = tab.siblings(),
|
3556
|
+
settings = tabs.data('tab-init');
|
3557
|
+
|
3558
|
+
// allow usage of data-tab-content attribute instead of href
|
3559
|
+
if ($(this).data('tab-content')) {
|
3560
|
+
target = $('#' + $(this).data('tab-content').split('#')[1]);
|
3561
|
+
}
|
3562
|
+
|
3563
|
+
tab.addClass(settings.active_class).trigger('opened');
|
3564
|
+
siblings.removeClass(settings.active_class);
|
3565
|
+
target.siblings().removeClass(settings.active_class).end().addClass(settings.active_class);
|
3566
|
+
settings.callback(tab);
|
3567
|
+
tabs.trigger('toggled', [tab]);
|
3568
|
+
});
|
3569
|
+
},
|
3570
|
+
|
3571
|
+
off : function () {},
|
3572
|
+
|
3573
|
+
reflow : function () {}
|
3574
|
+
};
|
3575
|
+
}(jQuery, this, this.document));
|
3576
|
+
|
3577
|
+
;(function ($, window, document, undefined) {
|
3578
|
+
'use strict';
|
3579
|
+
|
3580
|
+
Foundation.libs.tooltip = {
|
3581
|
+
name : 'tooltip',
|
3582
|
+
|
3583
|
+
version : '5.0.0',
|
3584
|
+
|
3585
|
+
settings : {
|
3586
|
+
additional_inheritable_classes : [],
|
3587
|
+
tooltip_class : '.tooltip',
|
3588
|
+
append_to: 'body',
|
3589
|
+
touch_close_text: 'Tap To Close',
|
3590
|
+
disable_for_touch: false,
|
3591
|
+
tip_template : function (selector, content) {
|
3592
|
+
return '<span data-selector="' + selector + '" class="'
|
3593
|
+
+ Foundation.libs.tooltip.settings.tooltip_class.substring(1)
|
3594
|
+
+ '">' + content + '<span class="nub"></span></span>';
|
3595
|
+
}
|
3596
|
+
},
|
3597
|
+
|
3598
|
+
cache : {},
|
3599
|
+
|
3600
|
+
init : function (scope, method, options) {
|
3601
|
+
this.bindings(method, options);
|
3602
|
+
},
|
3603
|
+
|
3604
|
+
events : function () {
|
3605
|
+
var self = this;
|
3606
|
+
|
3607
|
+
if (Modernizr.touch) {
|
3608
|
+
$(this.scope)
|
3609
|
+
.off('.tooltip')
|
3610
|
+
.on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
|
3611
|
+
'[data-tooltip]', function (e) {
|
3612
|
+
var settings = $.extend({}, self.settings, self.data_options($(this)));
|
3613
|
+
if (!settings.disable_for_touch) {
|
3614
|
+
e.preventDefault();
|
3615
|
+
$(settings.tooltip_class).hide();
|
3616
|
+
self.showOrCreateTip($(this));
|
3617
|
+
}
|
3618
|
+
})
|
3619
|
+
.on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip',
|
3620
|
+
this.settings.tooltip_class, function (e) {
|
3621
|
+
e.preventDefault();
|
3622
|
+
$(this).fadeOut(150);
|
3623
|
+
});
|
3624
|
+
} else {
|
3625
|
+
$(this.scope)
|
3626
|
+
.off('.tooltip')
|
3627
|
+
.on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip',
|
3628
|
+
'[data-tooltip]', function (e) {
|
3629
|
+
var $this = $(this);
|
3630
|
+
|
3631
|
+
if (/enter|over/i.test(e.type)) {
|
3632
|
+
self.showOrCreateTip($this);
|
3633
|
+
} else if (e.type === 'mouseout' || e.type === 'mouseleave') {
|
3634
|
+
self.hide($this);
|
3635
|
+
}
|
3636
|
+
});
|
3637
|
+
}
|
3638
|
+
},
|
3639
|
+
|
3640
|
+
showOrCreateTip : function ($target) {
|
3641
|
+
var $tip = this.getTip($target);
|
3642
|
+
|
3643
|
+
if ($tip && $tip.length > 0) {
|
3644
|
+
return this.show($target);
|
3645
|
+
}
|
3646
|
+
|
3647
|
+
return this.create($target);
|
3648
|
+
},
|
3649
|
+
|
3650
|
+
getTip : function ($target) {
|
3651
|
+
var selector = this.selector($target),
|
3652
|
+
tip = null;
|
3653
|
+
|
3654
|
+
if (selector) {
|
3655
|
+
tip = $('span[data-selector="' + selector + '"]' + this.settings.tooltip_class);
|
3656
|
+
}
|
3657
|
+
|
3658
|
+
return (typeof tip === 'object') ? tip : false;
|
3659
|
+
},
|
3660
|
+
|
3661
|
+
selector : function ($target) {
|
3662
|
+
var id = $target.attr('id'),
|
3663
|
+
dataSelector = $target.attr('data-tooltip') || $target.attr('data-selector');
|
3664
|
+
|
3665
|
+
if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') {
|
3666
|
+
dataSelector = 'tooltip' + Math.random().toString(36).substring(7);
|
3667
|
+
$target.attr('data-selector', dataSelector);
|
3668
|
+
}
|
3669
|
+
|
3670
|
+
return (id && id.length > 0) ? id : dataSelector;
|
3671
|
+
},
|
3672
|
+
|
3673
|
+
create : function ($target) {
|
3674
|
+
var $tip = $(this.settings.tip_template(this.selector($target), $('<div></div>').html($target.attr('title')).html())),
|
3675
|
+
classes = this.inheritable_classes($target);
|
3676
|
+
|
3677
|
+
$tip.addClass(classes).appendTo(this.settings.append_to);
|
3678
|
+
if (Modernizr.touch) {
|
3679
|
+
$tip.append('<span class="tap-to-close">'+this.settings.touch_close_text+'</span>');
|
3680
|
+
}
|
3681
|
+
$target.removeAttr('title').attr('title','');
|
3682
|
+
this.show($target);
|
3683
|
+
},
|
3684
|
+
|
3685
|
+
reposition : function (target, tip, classes) {
|
3686
|
+
var width, nub, nubHeight, nubWidth, column, objPos;
|
3687
|
+
|
3688
|
+
tip.css('visibility', 'hidden').show();
|
3689
|
+
|
3690
|
+
width = target.data('width');
|
3691
|
+
nub = tip.children('.nub');
|
3692
|
+
nubHeight = nub.outerHeight();
|
3693
|
+
nubWidth = nub.outerHeight();
|
3694
|
+
|
3695
|
+
tip.css({'width' : (width) ? width : 'auto'});
|
3696
|
+
|
3697
|
+
objPos = function (obj, top, right, bottom, left, width) {
|
3698
|
+
return obj.css({
|
3699
|
+
'top' : (top) ? top : 'auto',
|
3700
|
+
'bottom' : (bottom) ? bottom : 'auto',
|
3701
|
+
'left' : (left) ? left : 'auto',
|
3702
|
+
'right' : (right) ? right : 'auto',
|
3703
|
+
}).end();
|
3704
|
+
};
|
3705
|
+
|
3706
|
+
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', target.offset().left);
|
3707
|
+
|
3708
|
+
if (this.small()) {
|
3709
|
+
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', 12.5, $(this.scope).width());
|
3710
|
+
tip.addClass('tip-override');
|
3711
|
+
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
|
3712
|
+
} else {
|
3713
|
+
var left = target.offset().left;
|
3714
|
+
if (Foundation.rtl) {
|
3715
|
+
left = target.offset().left + target.offset().width - tip.outerWidth();
|
3716
|
+
}
|
3717
|
+
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', left);
|
3718
|
+
tip.removeClass('tip-override');
|
3719
|
+
if (classes && classes.indexOf('tip-top') > -1) {
|
3720
|
+
objPos(tip, (target.offset().top - tip.outerHeight()), 'auto', 'auto', left)
|
3721
|
+
.removeClass('tip-override');
|
3722
|
+
} else if (classes && classes.indexOf('tip-left') > -1) {
|
3723
|
+
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left - tip.outerWidth() - nubHeight))
|
3724
|
+
.removeClass('tip-override');
|
3725
|
+
} else if (classes && classes.indexOf('tip-right') > -1) {
|
3726
|
+
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left + target.outerWidth() + nubHeight))
|
3727
|
+
.removeClass('tip-override');
|
3728
|
+
}
|
3729
|
+
}
|
3730
|
+
|
3731
|
+
tip.css('visibility', 'visible').hide();
|
3732
|
+
},
|
3733
|
+
|
3734
|
+
small : function () {
|
3735
|
+
return matchMedia(Foundation.media_queries.small).matches;
|
3736
|
+
},
|
3737
|
+
|
3738
|
+
inheritable_classes : function (target) {
|
3739
|
+
var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'].concat(this.settings.additional_inheritable_classes),
|
3740
|
+
classes = target.attr('class'),
|
3741
|
+
filtered = classes ? $.map(classes.split(' '), function (el, i) {
|
3742
|
+
if ($.inArray(el, inheritables) !== -1) {
|
3743
|
+
return el;
|
3744
|
+
}
|
3745
|
+
}).join(' ') : '';
|
3746
|
+
|
3747
|
+
return $.trim(filtered);
|
3748
|
+
},
|
3749
|
+
|
3750
|
+
show : function ($target) {
|
3751
|
+
var $tip = this.getTip($target);
|
3752
|
+
|
3753
|
+
this.reposition($target, $tip, $target.attr('class'));
|
3754
|
+
$tip.fadeIn(150);
|
3755
|
+
},
|
3756
|
+
|
3757
|
+
hide : function ($target) {
|
3758
|
+
var $tip = this.getTip($target);
|
3759
|
+
|
3760
|
+
$tip.fadeOut(150);
|
3761
|
+
},
|
3762
|
+
|
3763
|
+
// deprecate reload
|
3764
|
+
reload : function () {
|
3765
|
+
var $self = $(this);
|
3766
|
+
|
3767
|
+
return ($self.data('fndtn-tooltips')) ? $self.foundationTooltips('destroy').foundationTooltips('init') : $self.foundationTooltips('init');
|
3768
|
+
},
|
3769
|
+
|
3770
|
+
off : function () {
|
3771
|
+
$(this.scope).off('.fndtn.tooltip');
|
3772
|
+
$(this.settings.tooltip_class).each(function (i) {
|
3773
|
+
$('[data-tooltip]').get(i).attr('title', $(this).text());
|
3774
|
+
}).remove();
|
3775
|
+
},
|
3776
|
+
|
3777
|
+
reflow : function () {}
|
3778
|
+
};
|
3779
|
+
}(jQuery, this, this.document));
|
3780
|
+
|
3781
|
+
;(function ($, window, document, undefined) {
|
3782
|
+
'use strict';
|
3783
|
+
|
3784
|
+
Foundation.libs.topbar = {
|
3785
|
+
name : 'topbar',
|
3786
|
+
|
3787
|
+
version: '5.0.3',
|
3788
|
+
|
3789
|
+
settings : {
|
3790
|
+
index : 0,
|
3791
|
+
sticky_class : 'sticky',
|
3792
|
+
custom_back_text: true,
|
3793
|
+
back_text: 'Back',
|
3794
|
+
is_hover: true,
|
3795
|
+
mobile_show_parent_link: false,
|
3796
|
+
scrolltop : true // jump to top when sticky nav menu toggle is clicked
|
3797
|
+
},
|
3798
|
+
|
3799
|
+
init : function (section, method, options) {
|
3800
|
+
Foundation.inherit(this, 'addCustomRule register_media throttle');
|
3801
|
+
var self = this;
|
3802
|
+
|
3803
|
+
self.register_media('topbar', 'foundation-mq-topbar');
|
3804
|
+
|
3805
|
+
this.bindings(method, options);
|
3806
|
+
|
3807
|
+
$('[data-topbar]', this.scope).each(function () {
|
3808
|
+
var topbar = $(this),
|
3809
|
+
settings = topbar.data('topbar-init'),
|
3810
|
+
section = $('section', this),
|
3811
|
+
titlebar = $('> ul', this).first();
|
3812
|
+
|
3813
|
+
topbar.data('index', 0);
|
3814
|
+
|
3815
|
+
var topbarContainer = topbar.parent();
|
3816
|
+
if(topbarContainer.hasClass('fixed') || topbarContainer.hasClass(settings.sticky_class)) {
|
3817
|
+
self.settings.sticky_class = settings.sticky_class;
|
3818
|
+
self.settings.sticky_topbar = topbar;
|
3819
|
+
topbar.data('height', topbarContainer.outerHeight());
|
3820
|
+
topbar.data('stickyoffset', topbarContainer.offset().top);
|
3821
|
+
} else {
|
3822
|
+
topbar.data('height', topbar.outerHeight());
|
3823
|
+
}
|
3824
|
+
|
3825
|
+
if (!settings.assembled) self.assemble(topbar);
|
3826
|
+
|
3827
|
+
if (settings.is_hover) {
|
3828
|
+
$('.has-dropdown', topbar).addClass('not-click');
|
3829
|
+
} else {
|
3830
|
+
$('.has-dropdown', topbar).removeClass('not-click');
|
3831
|
+
}
|
3832
|
+
|
3833
|
+
// Pad body when sticky (scrolled) or fixed.
|
3834
|
+
self.addCustomRule('.f-topbar-fixed { padding-top: ' + topbar.data('height') + 'px }');
|
3835
|
+
|
3836
|
+
if (topbarContainer.hasClass('fixed')) {
|
3837
|
+
$('body').addClass('f-topbar-fixed');
|
3838
|
+
}
|
3839
|
+
});
|
3840
|
+
|
3841
|
+
},
|
3842
|
+
|
3843
|
+
toggle: function (toggleEl) {
|
3844
|
+
var self = this;
|
3845
|
+
|
3846
|
+
if (toggleEl) {
|
3847
|
+
var topbar = $(toggleEl).closest('[data-topbar]');
|
3848
|
+
} else {
|
3849
|
+
var topbar = $('[data-topbar]');
|
3850
|
+
}
|
3851
|
+
|
3852
|
+
var settings = topbar.data('topbar-init');
|
3853
|
+
|
3854
|
+
var section = $('section, .section', topbar);
|
3855
|
+
|
3856
|
+
if (self.breakpoint()) {
|
3857
|
+
if (!self.rtl) {
|
3858
|
+
section.css({left: '0%'});
|
3859
|
+
$('>.name', section).css({left: '100%'});
|
3860
|
+
} else {
|
3861
|
+
section.css({right: '0%'});
|
3862
|
+
$('>.name', section).css({right: '100%'});
|
3863
|
+
}
|
3864
|
+
|
3865
|
+
$('li.moved', section).removeClass('moved');
|
3866
|
+
topbar.data('index', 0);
|
3867
|
+
|
3868
|
+
topbar
|
3869
|
+
.toggleClass('expanded')
|
3870
|
+
.css('height', '');
|
3871
|
+
}
|
3872
|
+
|
3873
|
+
if (settings.scrolltop) {
|
3874
|
+
if (!topbar.hasClass('expanded')) {
|
3875
|
+
if (topbar.hasClass('fixed')) {
|
3876
|
+
topbar.parent().addClass('fixed');
|
3877
|
+
topbar.removeClass('fixed');
|
3878
|
+
$('body').addClass('f-topbar-fixed');
|
3879
|
+
}
|
3880
|
+
} else if (topbar.parent().hasClass('fixed')) {
|
3881
|
+
if (settings.scrolltop) {
|
3882
|
+
topbar.parent().removeClass('fixed');
|
3883
|
+
topbar.addClass('fixed');
|
3884
|
+
$('body').removeClass('f-topbar-fixed');
|
3885
|
+
|
3886
|
+
window.scrollTo(0,0);
|
3887
|
+
} else {
|
3888
|
+
topbar.parent().removeClass('expanded');
|
3889
|
+
}
|
3890
|
+
}
|
3891
|
+
} else {
|
3892
|
+
if(topbar.parent().hasClass(self.settings.sticky_class)) {
|
3893
|
+
topbar.parent().addClass('fixed');
|
3894
|
+
}
|
3895
|
+
|
3896
|
+
if(topbar.parent().hasClass('fixed')) {
|
3897
|
+
if (!topbar.hasClass('expanded')) {
|
3898
|
+
topbar.removeClass('fixed');
|
3899
|
+
topbar.parent().removeClass('expanded');
|
3900
|
+
self.update_sticky_positioning();
|
3901
|
+
} else {
|
3902
|
+
topbar.addClass('fixed');
|
3903
|
+
topbar.parent().addClass('expanded');
|
3904
|
+
$('body').addClass('f-topbar-fixed');
|
3905
|
+
}
|
3906
|
+
}
|
3907
|
+
}
|
3908
|
+
},
|
3909
|
+
|
3910
|
+
timer : null,
|
3911
|
+
|
3912
|
+
events : function (bar) {
|
3913
|
+
var self = this;
|
3914
|
+
$(this.scope)
|
3915
|
+
.off('.topbar')
|
3916
|
+
.on('click.fndtn.topbar', '[data-topbar] .toggle-topbar', function (e) {
|
3917
|
+
e.preventDefault();
|
3918
|
+
self.toggle(this);
|
3919
|
+
})
|
3920
|
+
.on('click.fndtn.topbar', '[data-topbar] li.has-dropdown', function (e) {
|
3921
|
+
var li = $(this),
|
3922
|
+
target = $(e.target),
|
3923
|
+
topbar = li.closest('[data-topbar]'),
|
3924
|
+
settings = topbar.data('topbar-init');
|
3925
|
+
|
3926
|
+
if(target.data('revealId')) {
|
3927
|
+
self.toggle();
|
3928
|
+
return;
|
3929
|
+
}
|
3930
|
+
|
3931
|
+
if (self.breakpoint()) return;
|
3932
|
+
if (settings.is_hover && !Modernizr.touch) return;
|
3933
|
+
|
3934
|
+
e.stopImmediatePropagation();
|
3935
|
+
|
3936
|
+
if (li.hasClass('hover')) {
|
3937
|
+
li
|
3938
|
+
.removeClass('hover')
|
3939
|
+
.find('li')
|
3940
|
+
.removeClass('hover');
|
3941
|
+
|
3942
|
+
li.parents('li.hover')
|
3943
|
+
.removeClass('hover');
|
3944
|
+
} else {
|
3945
|
+
li.addClass('hover');
|
3946
|
+
|
3947
|
+
if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) {
|
3948
|
+
e.preventDefault();
|
3949
|
+
}
|
3950
|
+
}
|
3951
|
+
})
|
3952
|
+
.on('click.fndtn.topbar', '[data-topbar] .has-dropdown>a', function (e) {
|
3953
|
+
if (self.breakpoint()) {
|
3954
|
+
|
3955
|
+
e.preventDefault();
|
3956
|
+
|
3957
|
+
var $this = $(this),
|
3958
|
+
topbar = $this.closest('[data-topbar]'),
|
3959
|
+
section = topbar.find('section, .section'),
|
3960
|
+
dropdownHeight = $this.next('.dropdown').outerHeight(),
|
3961
|
+
$selectedLi = $this.closest('li');
|
3962
|
+
|
3963
|
+
topbar.data('index', topbar.data('index') + 1);
|
3964
|
+
$selectedLi.addClass('moved');
|
3965
|
+
|
3966
|
+
if (!self.rtl) {
|
3967
|
+
section.css({left: -(100 * topbar.data('index')) + '%'});
|
3968
|
+
section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
|
3969
|
+
} else {
|
3970
|
+
section.css({right: -(100 * topbar.data('index')) + '%'});
|
3971
|
+
section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
|
3972
|
+
}
|
3973
|
+
|
3974
|
+
topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height'));
|
3975
|
+
}
|
3976
|
+
});
|
3977
|
+
|
3978
|
+
$(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
|
3979
|
+
self.resize.call(self);
|
3980
|
+
}, 50)).trigger('resize');
|
3981
|
+
|
3982
|
+
$('body').off('.topbar').on('click.fndtn.topbar touchstart.fndtn.topbar', function (e) {
|
3983
|
+
var parent = $(e.target).closest('li').closest('li.hover');
|
3984
|
+
|
3985
|
+
if (parent.length > 0) {
|
3986
|
+
return;
|
3987
|
+
}
|
3988
|
+
|
3989
|
+
$('[data-topbar] li').removeClass('hover');
|
3990
|
+
});
|
3991
|
+
|
3992
|
+
// Go up a level on Click
|
3993
|
+
$(this.scope).on('click.fndtn.topbar', '[data-topbar] .has-dropdown .back', function (e) {
|
3994
|
+
e.preventDefault();
|
3995
|
+
|
3996
|
+
var $this = $(this),
|
3997
|
+
topbar = $this.closest('[data-topbar]'),
|
3998
|
+
section = topbar.find('section, .section'),
|
3999
|
+
settings = topbar.data('topbar-init'),
|
4000
|
+
$movedLi = $this.closest('li.moved'),
|
4001
|
+
$previousLevelUl = $movedLi.parent();
|
4002
|
+
|
4003
|
+
topbar.data('index', topbar.data('index') - 1);
|
4004
|
+
|
4005
|
+
if (!self.rtl) {
|
4006
|
+
section.css({left: -(100 * topbar.data('index')) + '%'});
|
4007
|
+
section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
|
4008
|
+
} else {
|
4009
|
+
section.css({right: -(100 * topbar.data('index')) + '%'});
|
4010
|
+
section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
|
4011
|
+
}
|
4012
|
+
|
4013
|
+
if (topbar.data('index') === 0) {
|
4014
|
+
topbar.css('height', '');
|
4015
|
+
} else {
|
4016
|
+
topbar.css('height', $previousLevelUl.outerHeight(true) + topbar.data('height'));
|
4017
|
+
}
|
4018
|
+
|
4019
|
+
setTimeout(function () {
|
4020
|
+
$movedLi.removeClass('moved');
|
4021
|
+
}, 300);
|
4022
|
+
});
|
4023
|
+
},
|
4024
|
+
|
4025
|
+
resize : function () {
|
4026
|
+
var self = this;
|
4027
|
+
$('[data-topbar]').each(function () {
|
4028
|
+
var topbar = $(this),
|
4029
|
+
settings = topbar.data('topbar-init');
|
4030
|
+
|
4031
|
+
var stickyContainer = topbar.parent('.' + self.settings.sticky_class);
|
4032
|
+
var stickyOffset;
|
4033
|
+
|
4034
|
+
if (!self.breakpoint()) {
|
4035
|
+
var doToggle = topbar.hasClass('expanded');
|
4036
|
+
topbar
|
4037
|
+
.css('height', '')
|
4038
|
+
.removeClass('expanded')
|
4039
|
+
.find('li')
|
4040
|
+
.removeClass('hover');
|
4041
|
+
|
4042
|
+
if(doToggle) {
|
4043
|
+
self.toggle(topbar);
|
4044
|
+
}
|
4045
|
+
}
|
4046
|
+
|
4047
|
+
if(stickyContainer.length > 0) {
|
4048
|
+
if(stickyContainer.hasClass('fixed')) {
|
4049
|
+
// Remove the fixed to allow for correct calculation of the offset.
|
4050
|
+
stickyContainer.removeClass('fixed');
|
4051
|
+
|
4052
|
+
stickyOffset = stickyContainer.offset().top;
|
4053
|
+
if($(document.body).hasClass('f-topbar-fixed')) {
|
4054
|
+
stickyOffset -= topbar.data('height');
|
4055
|
+
}
|
4056
|
+
|
4057
|
+
topbar.data('stickyoffset', stickyOffset);
|
4058
|
+
stickyContainer.addClass('fixed');
|
4059
|
+
} else {
|
4060
|
+
stickyOffset = stickyContainer.offset().top;
|
4061
|
+
topbar.data('stickyoffset', stickyOffset);
|
4062
|
+
}
|
4063
|
+
}
|
4064
|
+
|
4065
|
+
});
|
4066
|
+
},
|
4067
|
+
|
4068
|
+
breakpoint : function () {
|
4069
|
+
return !matchMedia(Foundation.media_queries['topbar']).matches;
|
4070
|
+
},
|
4071
|
+
|
4072
|
+
assemble : function (topbar) {
|
4073
|
+
var self = this,
|
4074
|
+
settings = topbar.data('topbar-init'),
|
4075
|
+
section = $('section', topbar),
|
4076
|
+
titlebar = $('> ul', topbar).first();
|
4077
|
+
|
4078
|
+
// Pull element out of the DOM for manipulation
|
4079
|
+
section.detach();
|
4080
|
+
|
4081
|
+
$('.has-dropdown>a', section).each(function () {
|
4082
|
+
var $link = $(this),
|
4083
|
+
$dropdown = $link.siblings('.dropdown'),
|
4084
|
+
url = $link.attr('href');
|
4085
|
+
|
4086
|
+
if (settings.mobile_show_parent_link && url && url.length > 1) {
|
4087
|
+
var $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li><a class="parent-link js-generated" href="' + url + '">' + $link.text() +'</a></li>');
|
4088
|
+
} else {
|
4089
|
+
var $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li>');
|
4090
|
+
}
|
4091
|
+
|
4092
|
+
// Copy link to subnav
|
4093
|
+
if (settings.custom_back_text == true) {
|
4094
|
+
$('h5>a', $titleLi).html(settings.back_text);
|
4095
|
+
} else {
|
4096
|
+
$('h5>a', $titleLi).html('« ' + $link.html());
|
4097
|
+
}
|
4098
|
+
$dropdown.prepend($titleLi);
|
4099
|
+
});
|
4100
|
+
|
4101
|
+
// Put element back in the DOM
|
4102
|
+
section.appendTo(topbar);
|
4103
|
+
|
4104
|
+
// check for sticky
|
4105
|
+
this.sticky();
|
4106
|
+
|
4107
|
+
this.assembled(topbar);
|
4108
|
+
},
|
4109
|
+
|
4110
|
+
assembled : function (topbar) {
|
4111
|
+
topbar.data('topbar-init', $.extend({}, topbar.data('topbar-init'), {assembled: true}));
|
4112
|
+
},
|
4113
|
+
|
4114
|
+
height : function (ul) {
|
4115
|
+
var total = 0,
|
4116
|
+
self = this;
|
4117
|
+
|
4118
|
+
$('> li', ul).each(function () { total += $(this).outerHeight(true); });
|
4119
|
+
|
4120
|
+
return total;
|
4121
|
+
},
|
4122
|
+
|
4123
|
+
sticky : function () {
|
4124
|
+
var $window = $(window),
|
4125
|
+
self = this;
|
4126
|
+
|
4127
|
+
$(window).on('scroll', function() {
|
4128
|
+
self.update_sticky_positioning();
|
4129
|
+
});
|
4130
|
+
},
|
4131
|
+
|
4132
|
+
update_sticky_positioning: function() {
|
4133
|
+
var klass = '.' + this.settings.sticky_class;
|
4134
|
+
var $window = $(window);
|
4135
|
+
|
4136
|
+
if ($(klass).length > 0) {
|
4137
|
+
var distance = this.settings.sticky_topbar.data('stickyoffset');
|
4138
|
+
if (!$(klass).hasClass('expanded')) {
|
4139
|
+
if ($window.scrollTop() > (distance)) {
|
4140
|
+
if (!$(klass).hasClass('fixed')) {
|
4141
|
+
$(klass).addClass('fixed');
|
4142
|
+
$('body').addClass('f-topbar-fixed');
|
4143
|
+
}
|
4144
|
+
} else if ($window.scrollTop() <= distance) {
|
4145
|
+
if ($(klass).hasClass('fixed')) {
|
4146
|
+
$(klass).removeClass('fixed');
|
4147
|
+
$('body').removeClass('f-topbar-fixed');
|
4148
|
+
}
|
4149
|
+
}
|
4150
|
+
}
|
4151
|
+
}
|
4152
|
+
},
|
4153
|
+
|
4154
|
+
off : function () {
|
4155
|
+
$(this.scope).off('.fndtn.topbar');
|
4156
|
+
$(window).off('.fndtn.topbar');
|
4157
|
+
},
|
4158
|
+
|
4159
|
+
reflow : function () {}
|
4160
|
+
};
|
4161
|
+
}(jQuery, this, this.document));
|