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,153 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: scrollspy.js v3.1.1
|
3
|
+
* http://getbootstrap.com/javascript/#scrollspy
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// SCROLLSPY CLASS DEFINITION
|
14
|
+
// ==========================
|
15
|
+
|
16
|
+
function ScrollSpy(element, options) {
|
17
|
+
var href
|
18
|
+
var process = $.proxy(this.process, this)
|
19
|
+
|
20
|
+
this.$element = $(element).is('body') ? $(window) : $(element)
|
21
|
+
this.$body = $('body')
|
22
|
+
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
|
23
|
+
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
24
|
+
this.selector = (this.options.target
|
25
|
+
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
26
|
+
|| '') + ' .nav li > a'
|
27
|
+
this.offsets = $([])
|
28
|
+
this.targets = $([])
|
29
|
+
this.activeTarget = null
|
30
|
+
|
31
|
+
this.refresh()
|
32
|
+
this.process()
|
33
|
+
}
|
34
|
+
|
35
|
+
ScrollSpy.DEFAULTS = {
|
36
|
+
offset: 10
|
37
|
+
}
|
38
|
+
|
39
|
+
ScrollSpy.prototype.refresh = function () {
|
40
|
+
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
41
|
+
|
42
|
+
this.offsets = $([])
|
43
|
+
this.targets = $([])
|
44
|
+
|
45
|
+
var self = this
|
46
|
+
var $targets = this.$body
|
47
|
+
.find(this.selector)
|
48
|
+
.map(function () {
|
49
|
+
var $el = $(this)
|
50
|
+
var href = $el.data('target') || $el.attr('href')
|
51
|
+
var $href = /^#./.test(href) && $(href)
|
52
|
+
|
53
|
+
return ($href
|
54
|
+
&& $href.length
|
55
|
+
&& $href.is(':visible')
|
56
|
+
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
57
|
+
})
|
58
|
+
.sort(function (a, b) { return a[0] - b[0] })
|
59
|
+
.each(function () {
|
60
|
+
self.offsets.push(this[0])
|
61
|
+
self.targets.push(this[1])
|
62
|
+
})
|
63
|
+
}
|
64
|
+
|
65
|
+
ScrollSpy.prototype.process = function () {
|
66
|
+
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
67
|
+
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
68
|
+
var maxScroll = scrollHeight - this.$scrollElement.height()
|
69
|
+
var offsets = this.offsets
|
70
|
+
var targets = this.targets
|
71
|
+
var activeTarget = this.activeTarget
|
72
|
+
var i
|
73
|
+
|
74
|
+
if (scrollTop >= maxScroll) {
|
75
|
+
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
76
|
+
}
|
77
|
+
|
78
|
+
if (activeTarget && scrollTop <= offsets[0]) {
|
79
|
+
return activeTarget != (i = targets[0]) && this.activate(i)
|
80
|
+
}
|
81
|
+
|
82
|
+
for (i = offsets.length; i--;) {
|
83
|
+
activeTarget != targets[i]
|
84
|
+
&& scrollTop >= offsets[i]
|
85
|
+
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
86
|
+
&& this.activate( targets[i] )
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
ScrollSpy.prototype.activate = function (target) {
|
91
|
+
this.activeTarget = target
|
92
|
+
|
93
|
+
$(this.selector)
|
94
|
+
.parentsUntil(this.options.target, '.active')
|
95
|
+
.removeClass('active')
|
96
|
+
|
97
|
+
var selector = this.selector +
|
98
|
+
'[data-target="' + target + '"],' +
|
99
|
+
this.selector + '[href="' + target + '"]'
|
100
|
+
|
101
|
+
var active = $(selector)
|
102
|
+
.parents('li')
|
103
|
+
.addClass('active')
|
104
|
+
|
105
|
+
if (active.parent('.dropdown-menu').length) {
|
106
|
+
active = active
|
107
|
+
.closest('li.dropdown')
|
108
|
+
.addClass('active')
|
109
|
+
}
|
110
|
+
|
111
|
+
active.trigger('activate.bs.scrollspy')
|
112
|
+
}
|
113
|
+
|
114
|
+
|
115
|
+
// SCROLLSPY PLUGIN DEFINITION
|
116
|
+
// ===========================
|
117
|
+
|
118
|
+
var old = $.fn.scrollspy
|
119
|
+
|
120
|
+
$.fn.scrollspy = function (option) {
|
121
|
+
return this.each(function () {
|
122
|
+
var $this = $(this)
|
123
|
+
var data = $this.data('bs.scrollspy')
|
124
|
+
var options = typeof option == 'object' && option
|
125
|
+
|
126
|
+
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
127
|
+
if (typeof option == 'string') data[option]()
|
128
|
+
})
|
129
|
+
}
|
130
|
+
|
131
|
+
$.fn.scrollspy.Constructor = ScrollSpy
|
132
|
+
|
133
|
+
|
134
|
+
// SCROLLSPY NO CONFLICT
|
135
|
+
// =====================
|
136
|
+
|
137
|
+
$.fn.scrollspy.noConflict = function () {
|
138
|
+
$.fn.scrollspy = old
|
139
|
+
return this
|
140
|
+
}
|
141
|
+
|
142
|
+
|
143
|
+
// SCROLLSPY DATA-API
|
144
|
+
// ==================
|
145
|
+
|
146
|
+
$(window).on('load', function () {
|
147
|
+
$('[data-spy="scroll"]').each(function () {
|
148
|
+
var $spy = $(this)
|
149
|
+
$spy.scrollspy($spy.data())
|
150
|
+
})
|
151
|
+
})
|
152
|
+
|
153
|
+
}(jQuery);
|
@@ -0,0 +1,125 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: tab.js v3.1.1
|
3
|
+
* http://getbootstrap.com/javascript/#tabs
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// TAB CLASS DEFINITION
|
14
|
+
// ====================
|
15
|
+
|
16
|
+
var Tab = function (element) {
|
17
|
+
this.element = $(element)
|
18
|
+
}
|
19
|
+
|
20
|
+
Tab.prototype.show = function () {
|
21
|
+
var $this = this.element
|
22
|
+
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
23
|
+
var selector = $this.data('target')
|
24
|
+
|
25
|
+
if (!selector) {
|
26
|
+
selector = $this.attr('href')
|
27
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
28
|
+
}
|
29
|
+
|
30
|
+
if ($this.parent('li').hasClass('active')) return
|
31
|
+
|
32
|
+
var previous = $ul.find('.active:last a')[0]
|
33
|
+
var e = $.Event('show.bs.tab', {
|
34
|
+
relatedTarget: previous
|
35
|
+
})
|
36
|
+
|
37
|
+
$this.trigger(e)
|
38
|
+
|
39
|
+
if (e.isDefaultPrevented()) return
|
40
|
+
|
41
|
+
var $target = $(selector)
|
42
|
+
|
43
|
+
this.activate($this.parent('li'), $ul)
|
44
|
+
this.activate($target, $target.parent(), function () {
|
45
|
+
$this.trigger({
|
46
|
+
type: 'shown.bs.tab',
|
47
|
+
relatedTarget: previous
|
48
|
+
})
|
49
|
+
})
|
50
|
+
}
|
51
|
+
|
52
|
+
Tab.prototype.activate = function (element, container, callback) {
|
53
|
+
var $active = container.find('> .active')
|
54
|
+
var transition = callback
|
55
|
+
&& $.support.transition
|
56
|
+
&& $active.hasClass('fade')
|
57
|
+
|
58
|
+
function next() {
|
59
|
+
$active
|
60
|
+
.removeClass('active')
|
61
|
+
.find('> .dropdown-menu > .active')
|
62
|
+
.removeClass('active')
|
63
|
+
|
64
|
+
element.addClass('active')
|
65
|
+
|
66
|
+
if (transition) {
|
67
|
+
element[0].offsetWidth // reflow for transition
|
68
|
+
element.addClass('in')
|
69
|
+
} else {
|
70
|
+
element.removeClass('fade')
|
71
|
+
}
|
72
|
+
|
73
|
+
if (element.parent('.dropdown-menu')) {
|
74
|
+
element.closest('li.dropdown').addClass('active')
|
75
|
+
}
|
76
|
+
|
77
|
+
callback && callback()
|
78
|
+
}
|
79
|
+
|
80
|
+
transition ?
|
81
|
+
$active
|
82
|
+
.one($.support.transition.end, next)
|
83
|
+
.emulateTransitionEnd(150) :
|
84
|
+
next()
|
85
|
+
|
86
|
+
$active.removeClass('in')
|
87
|
+
}
|
88
|
+
|
89
|
+
|
90
|
+
// TAB PLUGIN DEFINITION
|
91
|
+
// =====================
|
92
|
+
|
93
|
+
var old = $.fn.tab
|
94
|
+
|
95
|
+
$.fn.tab = function ( option ) {
|
96
|
+
return this.each(function () {
|
97
|
+
var $this = $(this)
|
98
|
+
var data = $this.data('bs.tab')
|
99
|
+
|
100
|
+
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
101
|
+
if (typeof option == 'string') data[option]()
|
102
|
+
})
|
103
|
+
}
|
104
|
+
|
105
|
+
$.fn.tab.Constructor = Tab
|
106
|
+
|
107
|
+
|
108
|
+
// TAB NO CONFLICT
|
109
|
+
// ===============
|
110
|
+
|
111
|
+
$.fn.tab.noConflict = function () {
|
112
|
+
$.fn.tab = old
|
113
|
+
return this
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
// TAB DATA-API
|
118
|
+
// ============
|
119
|
+
|
120
|
+
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
121
|
+
e.preventDefault()
|
122
|
+
$(this).tab('show')
|
123
|
+
})
|
124
|
+
|
125
|
+
}(jQuery);
|
@@ -0,0 +1,399 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: tooltip.js v3.1.1
|
3
|
+
* http://getbootstrap.com/javascript/#tooltip
|
4
|
+
* Inspired by the original jQuery.tipsy by Jason Frame
|
5
|
+
* ========================================================================
|
6
|
+
* Copyright 2011-2014 Twitter, Inc.
|
7
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
8
|
+
* ======================================================================== */
|
9
|
+
|
10
|
+
|
11
|
+
+function ($) {
|
12
|
+
'use strict';
|
13
|
+
|
14
|
+
// TOOLTIP PUBLIC CLASS DEFINITION
|
15
|
+
// ===============================
|
16
|
+
|
17
|
+
var Tooltip = function (element, options) {
|
18
|
+
this.type =
|
19
|
+
this.options =
|
20
|
+
this.enabled =
|
21
|
+
this.timeout =
|
22
|
+
this.hoverState =
|
23
|
+
this.$element = null
|
24
|
+
|
25
|
+
this.init('tooltip', element, options)
|
26
|
+
}
|
27
|
+
|
28
|
+
Tooltip.DEFAULTS = {
|
29
|
+
animation: true,
|
30
|
+
placement: 'top',
|
31
|
+
selector: false,
|
32
|
+
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
33
|
+
trigger: 'hover focus',
|
34
|
+
title: '',
|
35
|
+
delay: 0,
|
36
|
+
html: false,
|
37
|
+
container: false
|
38
|
+
}
|
39
|
+
|
40
|
+
Tooltip.prototype.init = function (type, element, options) {
|
41
|
+
this.enabled = true
|
42
|
+
this.type = type
|
43
|
+
this.$element = $(element)
|
44
|
+
this.options = this.getOptions(options)
|
45
|
+
|
46
|
+
var triggers = this.options.trigger.split(' ')
|
47
|
+
|
48
|
+
for (var i = triggers.length; i--;) {
|
49
|
+
var trigger = triggers[i]
|
50
|
+
|
51
|
+
if (trigger == 'click') {
|
52
|
+
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
53
|
+
} else if (trigger != 'manual') {
|
54
|
+
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
55
|
+
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
56
|
+
|
57
|
+
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
58
|
+
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
this.options.selector ?
|
63
|
+
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
64
|
+
this.fixTitle()
|
65
|
+
}
|
66
|
+
|
67
|
+
Tooltip.prototype.getDefaults = function () {
|
68
|
+
return Tooltip.DEFAULTS
|
69
|
+
}
|
70
|
+
|
71
|
+
Tooltip.prototype.getOptions = function (options) {
|
72
|
+
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
73
|
+
|
74
|
+
if (options.delay && typeof options.delay == 'number') {
|
75
|
+
options.delay = {
|
76
|
+
show: options.delay,
|
77
|
+
hide: options.delay
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
return options
|
82
|
+
}
|
83
|
+
|
84
|
+
Tooltip.prototype.getDelegateOptions = function () {
|
85
|
+
var options = {}
|
86
|
+
var defaults = this.getDefaults()
|
87
|
+
|
88
|
+
this._options && $.each(this._options, function (key, value) {
|
89
|
+
if (defaults[key] != value) options[key] = value
|
90
|
+
})
|
91
|
+
|
92
|
+
return options
|
93
|
+
}
|
94
|
+
|
95
|
+
Tooltip.prototype.enter = function (obj) {
|
96
|
+
var self = obj instanceof this.constructor ?
|
97
|
+
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
98
|
+
|
99
|
+
clearTimeout(self.timeout)
|
100
|
+
|
101
|
+
self.hoverState = 'in'
|
102
|
+
|
103
|
+
if (!self.options.delay || !self.options.delay.show) return self.show()
|
104
|
+
|
105
|
+
self.timeout = setTimeout(function () {
|
106
|
+
if (self.hoverState == 'in') self.show()
|
107
|
+
}, self.options.delay.show)
|
108
|
+
}
|
109
|
+
|
110
|
+
Tooltip.prototype.leave = function (obj) {
|
111
|
+
var self = obj instanceof this.constructor ?
|
112
|
+
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
113
|
+
|
114
|
+
clearTimeout(self.timeout)
|
115
|
+
|
116
|
+
self.hoverState = 'out'
|
117
|
+
|
118
|
+
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
119
|
+
|
120
|
+
self.timeout = setTimeout(function () {
|
121
|
+
if (self.hoverState == 'out') self.hide()
|
122
|
+
}, self.options.delay.hide)
|
123
|
+
}
|
124
|
+
|
125
|
+
Tooltip.prototype.show = function () {
|
126
|
+
var e = $.Event('show.bs.' + this.type)
|
127
|
+
|
128
|
+
if (this.hasContent() && this.enabled) {
|
129
|
+
this.$element.trigger(e)
|
130
|
+
|
131
|
+
if (e.isDefaultPrevented()) return
|
132
|
+
var that = this;
|
133
|
+
|
134
|
+
var $tip = this.tip()
|
135
|
+
|
136
|
+
this.setContent()
|
137
|
+
|
138
|
+
if (this.options.animation) $tip.addClass('fade')
|
139
|
+
|
140
|
+
var placement = typeof this.options.placement == 'function' ?
|
141
|
+
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
142
|
+
this.options.placement
|
143
|
+
|
144
|
+
var autoToken = /\s?auto?\s?/i
|
145
|
+
var autoPlace = autoToken.test(placement)
|
146
|
+
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
147
|
+
|
148
|
+
$tip
|
149
|
+
.detach()
|
150
|
+
.css({ top: 0, left: 0, display: 'block' })
|
151
|
+
.addClass(placement)
|
152
|
+
|
153
|
+
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
154
|
+
|
155
|
+
var pos = this.getPosition()
|
156
|
+
var actualWidth = $tip[0].offsetWidth
|
157
|
+
var actualHeight = $tip[0].offsetHeight
|
158
|
+
|
159
|
+
if (autoPlace) {
|
160
|
+
var $parent = this.$element.parent()
|
161
|
+
|
162
|
+
var orgPlacement = placement
|
163
|
+
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
|
164
|
+
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
|
165
|
+
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
|
166
|
+
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
|
167
|
+
|
168
|
+
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
|
169
|
+
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
|
170
|
+
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
|
171
|
+
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
|
172
|
+
placement
|
173
|
+
|
174
|
+
$tip
|
175
|
+
.removeClass(orgPlacement)
|
176
|
+
.addClass(placement)
|
177
|
+
}
|
178
|
+
|
179
|
+
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
180
|
+
|
181
|
+
this.applyPlacement(calculatedOffset, placement)
|
182
|
+
this.hoverState = null
|
183
|
+
|
184
|
+
var complete = function() {
|
185
|
+
that.$element.trigger('shown.bs.' + that.type)
|
186
|
+
}
|
187
|
+
|
188
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
189
|
+
$tip
|
190
|
+
.one($.support.transition.end, complete)
|
191
|
+
.emulateTransitionEnd(150) :
|
192
|
+
complete()
|
193
|
+
}
|
194
|
+
}
|
195
|
+
|
196
|
+
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
197
|
+
var replace
|
198
|
+
var $tip = this.tip()
|
199
|
+
var width = $tip[0].offsetWidth
|
200
|
+
var height = $tip[0].offsetHeight
|
201
|
+
|
202
|
+
// manually read margins because getBoundingClientRect includes difference
|
203
|
+
var marginTop = parseInt($tip.css('margin-top'), 10)
|
204
|
+
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
205
|
+
|
206
|
+
// we must check for NaN for ie 8/9
|
207
|
+
if (isNaN(marginTop)) marginTop = 0
|
208
|
+
if (isNaN(marginLeft)) marginLeft = 0
|
209
|
+
|
210
|
+
offset.top = offset.top + marginTop
|
211
|
+
offset.left = offset.left + marginLeft
|
212
|
+
|
213
|
+
// $.fn.offset doesn't round pixel values
|
214
|
+
// so we use setOffset directly with our own function B-0
|
215
|
+
$.offset.setOffset($tip[0], $.extend({
|
216
|
+
using: function (props) {
|
217
|
+
$tip.css({
|
218
|
+
top: Math.round(props.top),
|
219
|
+
left: Math.round(props.left)
|
220
|
+
})
|
221
|
+
}
|
222
|
+
}, offset), 0)
|
223
|
+
|
224
|
+
$tip.addClass('in')
|
225
|
+
|
226
|
+
// check to see if placing tip in new offset caused the tip to resize itself
|
227
|
+
var actualWidth = $tip[0].offsetWidth
|
228
|
+
var actualHeight = $tip[0].offsetHeight
|
229
|
+
|
230
|
+
if (placement == 'top' && actualHeight != height) {
|
231
|
+
replace = true
|
232
|
+
offset.top = offset.top + height - actualHeight
|
233
|
+
}
|
234
|
+
|
235
|
+
if (/bottom|top/.test(placement)) {
|
236
|
+
var delta = 0
|
237
|
+
|
238
|
+
if (offset.left < 0) {
|
239
|
+
delta = offset.left * -2
|
240
|
+
offset.left = 0
|
241
|
+
|
242
|
+
$tip.offset(offset)
|
243
|
+
|
244
|
+
actualWidth = $tip[0].offsetWidth
|
245
|
+
actualHeight = $tip[0].offsetHeight
|
246
|
+
}
|
247
|
+
|
248
|
+
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
249
|
+
} else {
|
250
|
+
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
251
|
+
}
|
252
|
+
|
253
|
+
if (replace) $tip.offset(offset)
|
254
|
+
}
|
255
|
+
|
256
|
+
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
|
257
|
+
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
|
258
|
+
}
|
259
|
+
|
260
|
+
Tooltip.prototype.setContent = function () {
|
261
|
+
var $tip = this.tip()
|
262
|
+
var title = this.getTitle()
|
263
|
+
|
264
|
+
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
265
|
+
$tip.removeClass('fade in top bottom left right')
|
266
|
+
}
|
267
|
+
|
268
|
+
Tooltip.prototype.hide = function () {
|
269
|
+
var that = this
|
270
|
+
var $tip = this.tip()
|
271
|
+
var e = $.Event('hide.bs.' + this.type)
|
272
|
+
|
273
|
+
function complete() {
|
274
|
+
if (that.hoverState != 'in') $tip.detach()
|
275
|
+
that.$element.trigger('hidden.bs.' + that.type)
|
276
|
+
}
|
277
|
+
|
278
|
+
this.$element.trigger(e)
|
279
|
+
|
280
|
+
if (e.isDefaultPrevented()) return
|
281
|
+
|
282
|
+
$tip.removeClass('in')
|
283
|
+
|
284
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
285
|
+
$tip
|
286
|
+
.one($.support.transition.end, complete)
|
287
|
+
.emulateTransitionEnd(150) :
|
288
|
+
complete()
|
289
|
+
|
290
|
+
this.hoverState = null
|
291
|
+
|
292
|
+
return this
|
293
|
+
}
|
294
|
+
|
295
|
+
Tooltip.prototype.fixTitle = function () {
|
296
|
+
var $e = this.$element
|
297
|
+
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
298
|
+
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
Tooltip.prototype.hasContent = function () {
|
303
|
+
return this.getTitle()
|
304
|
+
}
|
305
|
+
|
306
|
+
Tooltip.prototype.getPosition = function () {
|
307
|
+
var el = this.$element[0]
|
308
|
+
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
309
|
+
width: el.offsetWidth,
|
310
|
+
height: el.offsetHeight
|
311
|
+
}, this.$element.offset())
|
312
|
+
}
|
313
|
+
|
314
|
+
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
315
|
+
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
316
|
+
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
317
|
+
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
318
|
+
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
319
|
+
}
|
320
|
+
|
321
|
+
Tooltip.prototype.getTitle = function () {
|
322
|
+
var title
|
323
|
+
var $e = this.$element
|
324
|
+
var o = this.options
|
325
|
+
|
326
|
+
title = $e.attr('data-original-title')
|
327
|
+
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
328
|
+
|
329
|
+
return title
|
330
|
+
}
|
331
|
+
|
332
|
+
Tooltip.prototype.tip = function () {
|
333
|
+
return this.$tip = this.$tip || $(this.options.template)
|
334
|
+
}
|
335
|
+
|
336
|
+
Tooltip.prototype.arrow = function () {
|
337
|
+
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
|
338
|
+
}
|
339
|
+
|
340
|
+
Tooltip.prototype.validate = function () {
|
341
|
+
if (!this.$element[0].parentNode) {
|
342
|
+
this.hide()
|
343
|
+
this.$element = null
|
344
|
+
this.options = null
|
345
|
+
}
|
346
|
+
}
|
347
|
+
|
348
|
+
Tooltip.prototype.enable = function () {
|
349
|
+
this.enabled = true
|
350
|
+
}
|
351
|
+
|
352
|
+
Tooltip.prototype.disable = function () {
|
353
|
+
this.enabled = false
|
354
|
+
}
|
355
|
+
|
356
|
+
Tooltip.prototype.toggleEnabled = function () {
|
357
|
+
this.enabled = !this.enabled
|
358
|
+
}
|
359
|
+
|
360
|
+
Tooltip.prototype.toggle = function (e) {
|
361
|
+
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
|
362
|
+
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
363
|
+
}
|
364
|
+
|
365
|
+
Tooltip.prototype.destroy = function () {
|
366
|
+
clearTimeout(this.timeout)
|
367
|
+
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
368
|
+
}
|
369
|
+
|
370
|
+
|
371
|
+
// TOOLTIP PLUGIN DEFINITION
|
372
|
+
// =========================
|
373
|
+
|
374
|
+
var old = $.fn.tooltip
|
375
|
+
|
376
|
+
$.fn.tooltip = function (option) {
|
377
|
+
return this.each(function () {
|
378
|
+
var $this = $(this)
|
379
|
+
var data = $this.data('bs.tooltip')
|
380
|
+
var options = typeof option == 'object' && option
|
381
|
+
|
382
|
+
if (!data && option == 'destroy') return
|
383
|
+
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
384
|
+
if (typeof option == 'string') data[option]()
|
385
|
+
})
|
386
|
+
}
|
387
|
+
|
388
|
+
$.fn.tooltip.Constructor = Tooltip
|
389
|
+
|
390
|
+
|
391
|
+
// TOOLTIP NO CONFLICT
|
392
|
+
// ===================
|
393
|
+
|
394
|
+
$.fn.tooltip.noConflict = function () {
|
395
|
+
$.fn.tooltip = old
|
396
|
+
return this
|
397
|
+
}
|
398
|
+
|
399
|
+
}(jQuery);
|