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,437 @@
|
|
1
|
+
;(function ($, window, document, undefined) {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
Foundation.libs.reveal = {
|
5
|
+
name : 'reveal',
|
6
|
+
|
7
|
+
version : '5.2.3',
|
8
|
+
|
9
|
+
locked : false,
|
10
|
+
|
11
|
+
settings : {
|
12
|
+
animation: 'fadeAndPop',
|
13
|
+
animation_speed: 250,
|
14
|
+
close_on_background_click: true,
|
15
|
+
close_on_esc: true,
|
16
|
+
dismiss_modal_class: 'close-reveal-modal',
|
17
|
+
bg_class: 'reveal-modal-bg',
|
18
|
+
open: function(){},
|
19
|
+
opened: function(){},
|
20
|
+
close: function(){},
|
21
|
+
closed: function(){},
|
22
|
+
bg : $('.reveal-modal-bg'),
|
23
|
+
css : {
|
24
|
+
open : {
|
25
|
+
'opacity': 0,
|
26
|
+
'visibility': 'visible',
|
27
|
+
'display' : 'block'
|
28
|
+
},
|
29
|
+
close : {
|
30
|
+
'opacity': 1,
|
31
|
+
'visibility': 'hidden',
|
32
|
+
'display': 'none'
|
33
|
+
}
|
34
|
+
}
|
35
|
+
},
|
36
|
+
|
37
|
+
init : function (scope, method, options) {
|
38
|
+
$.extend(true, this.settings, method, options);
|
39
|
+
this.bindings(method, options);
|
40
|
+
},
|
41
|
+
|
42
|
+
events : function (scope) {
|
43
|
+
var self = this,
|
44
|
+
S = self.S;
|
45
|
+
|
46
|
+
S(this.scope)
|
47
|
+
.off('.reveal')
|
48
|
+
.on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']', function (e) {
|
49
|
+
e.preventDefault();
|
50
|
+
|
51
|
+
if (!self.locked) {
|
52
|
+
var element = S(this),
|
53
|
+
ajax = element.data(self.data_attr('reveal-ajax'));
|
54
|
+
|
55
|
+
self.locked = true;
|
56
|
+
|
57
|
+
if (typeof ajax === 'undefined') {
|
58
|
+
self.open.call(self, element);
|
59
|
+
} else {
|
60
|
+
var url = ajax === true ? element.attr('href') : ajax;
|
61
|
+
|
62
|
+
self.open.call(self, element, {url: url});
|
63
|
+
}
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
S(document)
|
68
|
+
.on('touchend.fndtn.reveal click.fndtn.reveal', this.close_targets(), function (e) {
|
69
|
+
|
70
|
+
e.preventDefault();
|
71
|
+
|
72
|
+
if (!self.locked) {
|
73
|
+
var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init'),
|
74
|
+
bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];
|
75
|
+
|
76
|
+
if (bg_clicked) {
|
77
|
+
if (settings.close_on_background_click) {
|
78
|
+
e.stopPropagation();
|
79
|
+
} else {
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
self.locked = true;
|
85
|
+
self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open') : S(this).closest('[' + self.attr_name() + ']'));
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
if(S('[' + self.attr_name() + ']', this.scope).length > 0) {
|
90
|
+
S(this.scope)
|
91
|
+
// .off('.reveal')
|
92
|
+
.on('open.fndtn.reveal', this.settings.open)
|
93
|
+
.on('opened.fndtn.reveal', this.settings.opened)
|
94
|
+
.on('opened.fndtn.reveal', this.open_video)
|
95
|
+
.on('close.fndtn.reveal', this.settings.close)
|
96
|
+
.on('closed.fndtn.reveal', this.settings.closed)
|
97
|
+
.on('closed.fndtn.reveal', this.close_video);
|
98
|
+
} else {
|
99
|
+
S(this.scope)
|
100
|
+
// .off('.reveal')
|
101
|
+
.on('open.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.open)
|
102
|
+
.on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.opened)
|
103
|
+
.on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.open_video)
|
104
|
+
.on('close.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.close)
|
105
|
+
.on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.closed)
|
106
|
+
.on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.close_video);
|
107
|
+
}
|
108
|
+
|
109
|
+
return true;
|
110
|
+
},
|
111
|
+
|
112
|
+
// PATCH #3: turning on key up capture only when a reveal window is open
|
113
|
+
key_up_on : function (scope) {
|
114
|
+
var self = this;
|
115
|
+
|
116
|
+
// PATCH #1: fixing multiple keyup event trigger from single key press
|
117
|
+
self.S('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) {
|
118
|
+
var open_modal = self.S('[' + self.attr_name() + '].open'),
|
119
|
+
settings = open_modal.data(self.attr_name(true) + '-init');
|
120
|
+
// PATCH #2: making sure that the close event can be called only while unlocked,
|
121
|
+
// so that multiple keyup.fndtn.reveal events don't prevent clean closing of the reveal window.
|
122
|
+
if ( settings && event.which === 27 && settings.close_on_esc && !self.locked) { // 27 is the keycode for the Escape key
|
123
|
+
self.close.call(self, open_modal);
|
124
|
+
}
|
125
|
+
});
|
126
|
+
|
127
|
+
return true;
|
128
|
+
},
|
129
|
+
|
130
|
+
// PATCH #3: turning on key up capture only when a reveal window is open
|
131
|
+
key_up_off : function (scope) {
|
132
|
+
this.S('body').off('keyup.fndtn.reveal');
|
133
|
+
return true;
|
134
|
+
},
|
135
|
+
|
136
|
+
open : function (target, ajax_settings) {
|
137
|
+
var self = this,
|
138
|
+
modal;
|
139
|
+
|
140
|
+
if (target) {
|
141
|
+
if (typeof target.selector !== 'undefined') {
|
142
|
+
// Find the named node; only use the first one found, since the rest of the code assumes there's only one node
|
143
|
+
modal = self.S('#' + target.data(self.data_attr('reveal-id'))).first();
|
144
|
+
} else {
|
145
|
+
modal = self.S(this.scope);
|
146
|
+
|
147
|
+
ajax_settings = target;
|
148
|
+
}
|
149
|
+
} else {
|
150
|
+
modal = self.S(this.scope);
|
151
|
+
}
|
152
|
+
|
153
|
+
var settings = modal.data(self.attr_name(true) + '-init');
|
154
|
+
settings = settings || this.settings;
|
155
|
+
|
156
|
+
if (!modal.hasClass('open')) {
|
157
|
+
var open_modal = self.S('[' + self.attr_name() + '].open');
|
158
|
+
|
159
|
+
if (typeof modal.data('css-top') === 'undefined') {
|
160
|
+
modal.data('css-top', parseInt(modal.css('top'), 10))
|
161
|
+
.data('offset', this.cache_offset(modal));
|
162
|
+
}
|
163
|
+
|
164
|
+
this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
|
165
|
+
modal.trigger('open');
|
166
|
+
|
167
|
+
if (open_modal.length < 1) {
|
168
|
+
this.toggle_bg(modal, true);
|
169
|
+
}
|
170
|
+
|
171
|
+
if (typeof ajax_settings === 'string') {
|
172
|
+
ajax_settings = {
|
173
|
+
url: ajax_settings
|
174
|
+
};
|
175
|
+
}
|
176
|
+
|
177
|
+
if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
|
178
|
+
if (open_modal.length > 0) {
|
179
|
+
this.hide(open_modal, settings.css.close);
|
180
|
+
}
|
181
|
+
|
182
|
+
this.show(modal, settings.css.open);
|
183
|
+
} else {
|
184
|
+
var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
|
185
|
+
|
186
|
+
$.extend(ajax_settings, {
|
187
|
+
success: function (data, textStatus, jqXHR) {
|
188
|
+
if ( $.isFunction(old_success) ) {
|
189
|
+
old_success(data, textStatus, jqXHR);
|
190
|
+
}
|
191
|
+
|
192
|
+
modal.html(data);
|
193
|
+
self.S(modal).foundation('section', 'reflow');
|
194
|
+
self.S(modal).children().foundation();
|
195
|
+
|
196
|
+
if (open_modal.length > 0) {
|
197
|
+
self.hide(open_modal, settings.css.close);
|
198
|
+
}
|
199
|
+
self.show(modal, settings.css.open);
|
200
|
+
}
|
201
|
+
});
|
202
|
+
|
203
|
+
$.ajax(ajax_settings);
|
204
|
+
}
|
205
|
+
}
|
206
|
+
},
|
207
|
+
|
208
|
+
close : function (modal) {
|
209
|
+
var modal = modal && modal.length ? modal : this.S(this.scope),
|
210
|
+
open_modals = this.S('[' + this.attr_name() + '].open'),
|
211
|
+
settings = modal.data(this.attr_name(true) + '-init') || this.settings;
|
212
|
+
|
213
|
+
if (open_modals.length > 0) {
|
214
|
+
this.locked = true;
|
215
|
+
this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open
|
216
|
+
modal.trigger('close');
|
217
|
+
this.toggle_bg(modal, false);
|
218
|
+
this.hide(open_modals, settings.css.close, settings);
|
219
|
+
}
|
220
|
+
},
|
221
|
+
|
222
|
+
close_targets : function () {
|
223
|
+
var base = '.' + this.settings.dismiss_modal_class;
|
224
|
+
|
225
|
+
if (this.settings.close_on_background_click) {
|
226
|
+
return base + ', .' + this.settings.bg_class;
|
227
|
+
}
|
228
|
+
|
229
|
+
return base;
|
230
|
+
},
|
231
|
+
|
232
|
+
toggle_bg : function (modal, state) {
|
233
|
+
if (this.S('.' + this.settings.bg_class).length === 0) {
|
234
|
+
this.settings.bg = $('<div />', {'class': this.settings.bg_class})
|
235
|
+
.appendTo('body').hide();
|
236
|
+
}
|
237
|
+
|
238
|
+
var visible = this.settings.bg.filter(':visible').length > 0;
|
239
|
+
if ( state != visible ) {
|
240
|
+
if ( state == undefined ? visible : !state ) {
|
241
|
+
this.hide(this.settings.bg);
|
242
|
+
} else {
|
243
|
+
this.show(this.settings.bg);
|
244
|
+
}
|
245
|
+
}
|
246
|
+
},
|
247
|
+
|
248
|
+
show : function (el, css) {
|
249
|
+
// is modal
|
250
|
+
if (css) {
|
251
|
+
var settings = el.data(this.attr_name(true) + '-init');
|
252
|
+
settings = settings || this.settings;
|
253
|
+
|
254
|
+
if (el.parent('body').length === 0) {
|
255
|
+
var placeholder = el.wrap('<div style="display: none;" />').parent(),
|
256
|
+
rootElement = this.settings.rootElement || 'body';
|
257
|
+
|
258
|
+
el.on('closed.fndtn.reveal.wrapped', function() {
|
259
|
+
el.detach().appendTo(placeholder);
|
260
|
+
el.unwrap().unbind('closed.fndtn.reveal.wrapped');
|
261
|
+
});
|
262
|
+
|
263
|
+
el.detach().appendTo(rootElement);
|
264
|
+
}
|
265
|
+
|
266
|
+
var animData = getAnimationData(settings.animation);
|
267
|
+
if (!animData.animate) {
|
268
|
+
this.locked = false;
|
269
|
+
}
|
270
|
+
if (animData.pop) {
|
271
|
+
css.top = $(window).scrollTop() - el.data('offset') + 'px';
|
272
|
+
var end_css = {
|
273
|
+
top: $(window).scrollTop() + el.data('css-top') + 'px',
|
274
|
+
opacity: 1
|
275
|
+
};
|
276
|
+
|
277
|
+
return setTimeout(function () {
|
278
|
+
return el
|
279
|
+
.css(css)
|
280
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
281
|
+
this.locked = false;
|
282
|
+
el.trigger('opened');
|
283
|
+
}.bind(this))
|
284
|
+
.addClass('open');
|
285
|
+
}.bind(this), settings.animation_speed / 2);
|
286
|
+
}
|
287
|
+
|
288
|
+
if (animData.fade) {
|
289
|
+
css.top = $(window).scrollTop() + el.data('css-top') + 'px';
|
290
|
+
var end_css = {opacity: 1};
|
291
|
+
|
292
|
+
return setTimeout(function () {
|
293
|
+
return el
|
294
|
+
.css(css)
|
295
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
296
|
+
this.locked = false;
|
297
|
+
el.trigger('opened');
|
298
|
+
}.bind(this))
|
299
|
+
.addClass('open');
|
300
|
+
}.bind(this), settings.animation_speed / 2);
|
301
|
+
}
|
302
|
+
|
303
|
+
return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened');
|
304
|
+
}
|
305
|
+
|
306
|
+
var settings = this.settings;
|
307
|
+
|
308
|
+
// should we animate the background?
|
309
|
+
if (getAnimationData(settings.animation).fade) {
|
310
|
+
return el.fadeIn(settings.animation_speed / 2);
|
311
|
+
}
|
312
|
+
|
313
|
+
this.locked = false;
|
314
|
+
|
315
|
+
return el.show();
|
316
|
+
},
|
317
|
+
|
318
|
+
hide : function (el, css) {
|
319
|
+
// is modal
|
320
|
+
if (css) {
|
321
|
+
var settings = el.data(this.attr_name(true) + '-init');
|
322
|
+
settings = settings || this.settings;
|
323
|
+
|
324
|
+
var animData = getAnimationData(settings.animation);
|
325
|
+
if (!animData.animate) {
|
326
|
+
this.locked = false;
|
327
|
+
}
|
328
|
+
if (animData.pop) {
|
329
|
+
var end_css = {
|
330
|
+
top: - $(window).scrollTop() - el.data('offset') + 'px',
|
331
|
+
opacity: 0
|
332
|
+
};
|
333
|
+
|
334
|
+
return setTimeout(function () {
|
335
|
+
return el
|
336
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
337
|
+
this.locked = false;
|
338
|
+
el.css(css).trigger('closed');
|
339
|
+
}.bind(this))
|
340
|
+
.removeClass('open');
|
341
|
+
}.bind(this), settings.animation_speed / 2);
|
342
|
+
}
|
343
|
+
|
344
|
+
if (animData.fade) {
|
345
|
+
var end_css = {opacity: 0};
|
346
|
+
|
347
|
+
return setTimeout(function () {
|
348
|
+
return el
|
349
|
+
.animate(end_css, settings.animation_speed, 'linear', function () {
|
350
|
+
this.locked = false;
|
351
|
+
el.css(css).trigger('closed');
|
352
|
+
}.bind(this))
|
353
|
+
.removeClass('open');
|
354
|
+
}.bind(this), settings.animation_speed / 2);
|
355
|
+
}
|
356
|
+
|
357
|
+
return el.hide().css(css).removeClass('open').trigger('closed');
|
358
|
+
}
|
359
|
+
|
360
|
+
var settings = this.settings;
|
361
|
+
|
362
|
+
// should we animate the background?
|
363
|
+
if (getAnimationData(settings.animation).fade) {
|
364
|
+
return el.fadeOut(settings.animation_speed / 2);
|
365
|
+
}
|
366
|
+
|
367
|
+
return el.hide();
|
368
|
+
},
|
369
|
+
|
370
|
+
close_video : function (e) {
|
371
|
+
var video = $('.flex-video', e.target),
|
372
|
+
iframe = $('iframe', video);
|
373
|
+
|
374
|
+
if (iframe.length > 0) {
|
375
|
+
iframe.attr('data-src', iframe[0].src);
|
376
|
+
iframe.attr('src', 'about:blank');
|
377
|
+
video.hide();
|
378
|
+
}
|
379
|
+
},
|
380
|
+
|
381
|
+
open_video : function (e) {
|
382
|
+
var video = $('.flex-video', e.target),
|
383
|
+
iframe = video.find('iframe');
|
384
|
+
|
385
|
+
if (iframe.length > 0) {
|
386
|
+
var data_src = iframe.attr('data-src');
|
387
|
+
if (typeof data_src === 'string') {
|
388
|
+
iframe[0].src = iframe.attr('data-src');
|
389
|
+
} else {
|
390
|
+
var src = iframe[0].src;
|
391
|
+
iframe[0].src = undefined;
|
392
|
+
iframe[0].src = src;
|
393
|
+
}
|
394
|
+
video.show();
|
395
|
+
}
|
396
|
+
},
|
397
|
+
|
398
|
+
data_attr: function (str) {
|
399
|
+
if (this.namespace.length > 0) {
|
400
|
+
return this.namespace + '-' + str;
|
401
|
+
}
|
402
|
+
|
403
|
+
return str;
|
404
|
+
},
|
405
|
+
|
406
|
+
cache_offset : function (modal) {
|
407
|
+
var offset = modal.show().height() + parseInt(modal.css('top'), 10);
|
408
|
+
|
409
|
+
modal.hide();
|
410
|
+
|
411
|
+
return offset;
|
412
|
+
},
|
413
|
+
|
414
|
+
off : function () {
|
415
|
+
$(this.scope).off('.fndtn.reveal');
|
416
|
+
},
|
417
|
+
|
418
|
+
reflow : function () {}
|
419
|
+
};
|
420
|
+
|
421
|
+
/*
|
422
|
+
* getAnimationData('popAndFade') // {animate: true, pop: true, fade: true}
|
423
|
+
* getAnimationData('fade') // {animate: true, pop: false, fade: true}
|
424
|
+
* getAnimationData('pop') // {animate: true, pop: true, fade: false}
|
425
|
+
* getAnimationData('foo') // {animate: false, pop: false, fade: false}
|
426
|
+
* getAnimationData(null) // {animate: false, pop: false, fade: false}
|
427
|
+
*/
|
428
|
+
function getAnimationData(str) {
|
429
|
+
var fade = /fade/i.test(str);
|
430
|
+
var pop = /pop/i.test(str);
|
431
|
+
return {
|
432
|
+
animate: fade || pop,
|
433
|
+
pop: pop,
|
434
|
+
fade: fade
|
435
|
+
};
|
436
|
+
}
|
437
|
+
}(jQuery, window, window.document));
|
@@ -0,0 +1,199 @@
|
|
1
|
+
;(function ($, window, document, undefined) {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
Foundation.libs.slider = {
|
5
|
+
name : 'slider',
|
6
|
+
|
7
|
+
version : '5.2.3',
|
8
|
+
|
9
|
+
settings: {
|
10
|
+
start: 0,
|
11
|
+
end: 100,
|
12
|
+
step: 1,
|
13
|
+
initial: null,
|
14
|
+
display_selector: '',
|
15
|
+
on_change: function(){}
|
16
|
+
},
|
17
|
+
|
18
|
+
cache : {},
|
19
|
+
|
20
|
+
init : function (scope, method, options) {
|
21
|
+
Foundation.inherit(this,'throttle');
|
22
|
+
this.bindings(method, options);
|
23
|
+
this.reflow();
|
24
|
+
},
|
25
|
+
|
26
|
+
events : function() {
|
27
|
+
var self = this;
|
28
|
+
|
29
|
+
$(this.scope)
|
30
|
+
.off('.slider')
|
31
|
+
.on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider',
|
32
|
+
'[' + self.attr_name() + '] .range-slider-handle', function(e) {
|
33
|
+
if (!self.cache.active) {
|
34
|
+
e.preventDefault();
|
35
|
+
self.set_active_slider($(e.target));
|
36
|
+
}
|
37
|
+
})
|
38
|
+
.on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function(e) {
|
39
|
+
if (!!self.cache.active) {
|
40
|
+
e.preventDefault();
|
41
|
+
self.calculate_position(self.cache.active, e.pageX || e.originalEvent.clientX || e.originalEvent.touches[0].clientX || e.currentPoint.x);
|
42
|
+
}
|
43
|
+
})
|
44
|
+
.on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function(e) {
|
45
|
+
self.remove_active_slider();
|
46
|
+
})
|
47
|
+
.on('change.fndtn.slider', function(e) {
|
48
|
+
self.settings.on_change();
|
49
|
+
});
|
50
|
+
|
51
|
+
self.S(window)
|
52
|
+
.on('resize.fndtn.slider', self.throttle(function(e) {
|
53
|
+
self.reflow();
|
54
|
+
}, 300));
|
55
|
+
},
|
56
|
+
|
57
|
+
set_active_slider : function($handle) {
|
58
|
+
this.cache.active = $handle;
|
59
|
+
},
|
60
|
+
|
61
|
+
remove_active_slider : function() {
|
62
|
+
this.cache.active = null;
|
63
|
+
},
|
64
|
+
|
65
|
+
calculate_position : function($handle, cursor_x) {
|
66
|
+
var self = this,
|
67
|
+
settings = $.extend({}, self.settings, self.data_options($handle.parent())),
|
68
|
+
handle_w = $.data($handle[0], 'handle_w'),
|
69
|
+
handle_o = $.data($handle[0], 'handle_o'),
|
70
|
+
bar_w = $.data($handle[0], 'bar_w'),
|
71
|
+
bar_o = $.data($handle[0], 'bar_o');
|
72
|
+
|
73
|
+
requestAnimationFrame(function(){
|
74
|
+
var pct;
|
75
|
+
|
76
|
+
if (Foundation.rtl) {
|
77
|
+
pct = self.limit_to(((bar_o+bar_w-cursor_x)/bar_w),0,1);
|
78
|
+
} else {
|
79
|
+
pct = self.limit_to(((cursor_x-bar_o)/bar_w),0,1);
|
80
|
+
}
|
81
|
+
|
82
|
+
var norm = self.normalized_value(pct, settings.start, settings.end, settings.step);
|
83
|
+
|
84
|
+
self.set_ui($handle, norm);
|
85
|
+
});
|
86
|
+
},
|
87
|
+
|
88
|
+
set_ui : function($handle, value) {
|
89
|
+
var settings = $.extend({}, this.settings, this.data_options($handle.parent())),
|
90
|
+
handle_w = $.data($handle[0], 'handle_w'),
|
91
|
+
bar_w = $.data($handle[0], 'bar_w'),
|
92
|
+
norm_pct = this.normalized_percentage(value, settings.start, settings.end),
|
93
|
+
handle_offset = norm_pct*(bar_w-handle_w)-1,
|
94
|
+
progress_bar_width = norm_pct*100;
|
95
|
+
|
96
|
+
if (Foundation.rtl) {
|
97
|
+
handle_offset = -handle_offset;
|
98
|
+
}
|
99
|
+
|
100
|
+
this.set_translate($handle, handle_offset);
|
101
|
+
$handle.siblings('.range-slider-active-segment').css('width', progress_bar_width+'%');
|
102
|
+
|
103
|
+
$handle.parent().attr(this.attr_name(), value);
|
104
|
+
$handle.parent().trigger('change');
|
105
|
+
|
106
|
+
$handle.parent().children('input[type=hidden]').val(value);
|
107
|
+
|
108
|
+
if (settings.input_id != '') {
|
109
|
+
$(settings.display_selector).each(function(){
|
110
|
+
if (this.hasOwnProperty('value')) {
|
111
|
+
$(this).val(value);
|
112
|
+
} else {
|
113
|
+
$(this).text(value);
|
114
|
+
}
|
115
|
+
});
|
116
|
+
}
|
117
|
+
|
118
|
+
},
|
119
|
+
|
120
|
+
normalized_percentage : function(val, start, end) {
|
121
|
+
return (val - start)/(end - start);
|
122
|
+
},
|
123
|
+
|
124
|
+
normalized_value : function(val, start, end, step) {
|
125
|
+
var range = end - start,
|
126
|
+
point = val*range,
|
127
|
+
mod = (point-(point%step)) / step,
|
128
|
+
rem = point % step,
|
129
|
+
round = ( rem >= step*0.5 ? step : 0);
|
130
|
+
return (mod*step + round) + start;
|
131
|
+
},
|
132
|
+
|
133
|
+
set_translate : function(ele, offset, vertical) {
|
134
|
+
if (vertical) {
|
135
|
+
$(ele)
|
136
|
+
.css('-webkit-transform', 'translateY('+offset+'px)')
|
137
|
+
.css('-moz-transform', 'translateY('+offset+'px)')
|
138
|
+
.css('-ms-transform', 'translateY('+offset+'px)')
|
139
|
+
.css('-o-transform', 'translateY('+offset+'px)')
|
140
|
+
.css('transform', 'translateY('+offset+'px)');
|
141
|
+
} else {
|
142
|
+
$(ele)
|
143
|
+
.css('-webkit-transform', 'translateX('+offset+'px)')
|
144
|
+
.css('-moz-transform', 'translateX('+offset+'px)')
|
145
|
+
.css('-ms-transform', 'translateX('+offset+'px)')
|
146
|
+
.css('-o-transform', 'translateX('+offset+'px)')
|
147
|
+
.css('transform', 'translateX('+offset+'px)');
|
148
|
+
}
|
149
|
+
},
|
150
|
+
|
151
|
+
limit_to : function(val, min, max) {
|
152
|
+
return Math.min(Math.max(val, min), max);
|
153
|
+
},
|
154
|
+
|
155
|
+
initialize_settings : function(handle) {
|
156
|
+
$.data(handle, 'bar', $(handle).parent());
|
157
|
+
$.data(handle, 'bar_o', $(handle).parent().offset().left);
|
158
|
+
$.data(handle, 'bar_w', $(handle).parent().outerWidth());
|
159
|
+
$.data(handle, 'handle_o', $(handle).offset().left);
|
160
|
+
$.data(handle, 'handle_w', $(handle).outerWidth());
|
161
|
+
$.data(handle, 'settings', $.extend({}, this.settings, this.data_options($(handle).parent())));
|
162
|
+
},
|
163
|
+
|
164
|
+
set_initial_position : function($ele) {
|
165
|
+
var settings = $.data($ele.children('.range-slider-handle')[0], 'settings'),
|
166
|
+
initial = (!!settings.initial ? settings.initial : Math.floor((settings.end-settings.start)*0.5/settings.step)*settings.step+settings.start),
|
167
|
+
$handle = $ele.children('.range-slider-handle');
|
168
|
+
this.set_ui($handle, initial);
|
169
|
+
},
|
170
|
+
|
171
|
+
set_value : function(value) {
|
172
|
+
var self = this;
|
173
|
+
$('[' + self.attr_name() + ']', this.scope).each(function(){
|
174
|
+
$(this).attr(self.attr_name(), value);
|
175
|
+
});
|
176
|
+
if (!!$(this.scope).attr(self.attr_name())) {
|
177
|
+
$(this.scope).attr(self.attr_name(), value);
|
178
|
+
}
|
179
|
+
self.reflow();
|
180
|
+
},
|
181
|
+
|
182
|
+
reflow : function() {
|
183
|
+
var self = this;
|
184
|
+
self.S('[' + this.attr_name() + ']').each(function() {
|
185
|
+
var handle = $(this).children('.range-slider-handle')[0],
|
186
|
+
val = $(this).attr(self.attr_name());
|
187
|
+
self.initialize_settings(handle);
|
188
|
+
|
189
|
+
if (val) {
|
190
|
+
self.set_ui($(handle), parseFloat(val));
|
191
|
+
} else {
|
192
|
+
self.set_initial_position($(this));
|
193
|
+
}
|
194
|
+
});
|
195
|
+
}
|
196
|
+
|
197
|
+
};
|
198
|
+
|
199
|
+
}(jQuery, window, window.document));
|