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,645 @@
|
|
1
|
+
/**
|
2
|
+
* Ajax Autocomplete for jQuery, version 1.2.7
|
3
|
+
* (c) 2013 Tomas Kirda
|
4
|
+
*
|
5
|
+
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
|
6
|
+
* For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
/*jslint browser: true, white: true, plusplus: true */
|
11
|
+
/*global define, window, document, jQuery */
|
12
|
+
|
13
|
+
// Expose plugin as an AMD module if AMD loader is present:
|
14
|
+
(function (factory) {
|
15
|
+
'use strict';
|
16
|
+
if (typeof define === 'function' && define.amd) {
|
17
|
+
// AMD. Register as an anonymous module.
|
18
|
+
define(['jquery'], factory);
|
19
|
+
} else {
|
20
|
+
// Browser globals
|
21
|
+
factory(jQuery);
|
22
|
+
}
|
23
|
+
}(function ($) {
|
24
|
+
'use strict';
|
25
|
+
|
26
|
+
var
|
27
|
+
utils = (function () {
|
28
|
+
return {
|
29
|
+
|
30
|
+
extend: function (target, source) {
|
31
|
+
return $.extend(target, source);
|
32
|
+
},
|
33
|
+
|
34
|
+
createNode: function (html) {
|
35
|
+
var div = document.createElement('div');
|
36
|
+
div.innerHTML = html;
|
37
|
+
return div.firstChild;
|
38
|
+
}
|
39
|
+
|
40
|
+
};
|
41
|
+
}()),
|
42
|
+
|
43
|
+
keys = {
|
44
|
+
ESC: 27,
|
45
|
+
TAB: 9,
|
46
|
+
RETURN: 13,
|
47
|
+
UP: 38,
|
48
|
+
DOWN: 40
|
49
|
+
};
|
50
|
+
|
51
|
+
function Autocomplete(el, options) {
|
52
|
+
var noop = function () { },
|
53
|
+
that = this,
|
54
|
+
defaults = {
|
55
|
+
autoSelectFirst: false,
|
56
|
+
appendTo: 'body',
|
57
|
+
serviceUrl: null,
|
58
|
+
lookup: null,
|
59
|
+
onSelect: null,
|
60
|
+
width: 'auto',
|
61
|
+
minChars: 1,
|
62
|
+
maxHeight: 300,
|
63
|
+
deferRequestBy: 0,
|
64
|
+
params: {},
|
65
|
+
formatResult: Autocomplete.formatResult,
|
66
|
+
delimiter: null,
|
67
|
+
zIndex: 9999,
|
68
|
+
type: 'GET',
|
69
|
+
noCache: false,
|
70
|
+
onSearchStart: noop,
|
71
|
+
onSearchComplete: noop,
|
72
|
+
containerClass: 'autocomplete-suggestions',
|
73
|
+
tabDisabled: false,
|
74
|
+
dataType: 'text',
|
75
|
+
lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
|
76
|
+
return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
|
77
|
+
},
|
78
|
+
paramName: 'query',
|
79
|
+
transformResult: function (response) {
|
80
|
+
return typeof response === 'string' ? $.parseJSON(response) : response;
|
81
|
+
}
|
82
|
+
};
|
83
|
+
|
84
|
+
// Shared variables:
|
85
|
+
that.element = el;
|
86
|
+
that.el = $(el);
|
87
|
+
that.suggestions = [];
|
88
|
+
that.badQueries = [];
|
89
|
+
that.selectedIndex = -1;
|
90
|
+
that.currentValue = that.element.value;
|
91
|
+
that.intervalId = 0;
|
92
|
+
that.cachedResponse = [];
|
93
|
+
that.onChangeInterval = null;
|
94
|
+
that.onChange = null;
|
95
|
+
that.ignoreValueChange = false;
|
96
|
+
that.isLocal = false;
|
97
|
+
that.suggestionsContainer = null;
|
98
|
+
that.options = $.extend({}, defaults, options);
|
99
|
+
that.classes = {
|
100
|
+
selected: 'autocomplete-selected',
|
101
|
+
suggestion: 'autocomplete-suggestion'
|
102
|
+
};
|
103
|
+
|
104
|
+
// Initialize and set options:
|
105
|
+
that.initialize();
|
106
|
+
that.setOptions(options);
|
107
|
+
}
|
108
|
+
|
109
|
+
Autocomplete.utils = utils;
|
110
|
+
|
111
|
+
$.Autocomplete = Autocomplete;
|
112
|
+
|
113
|
+
Autocomplete.formatResult = function (suggestion, currentValue) {
|
114
|
+
var reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g'),
|
115
|
+
pattern = '(' + currentValue.replace(reEscape, '\\$1') + ')';
|
116
|
+
|
117
|
+
return suggestion.value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
|
118
|
+
};
|
119
|
+
|
120
|
+
Autocomplete.prototype = {
|
121
|
+
|
122
|
+
killerFn: null,
|
123
|
+
|
124
|
+
initialize: function () {
|
125
|
+
var that = this,
|
126
|
+
suggestionSelector = '.' + that.classes.suggestion,
|
127
|
+
selected = that.classes.selected,
|
128
|
+
options = that.options,
|
129
|
+
container;
|
130
|
+
|
131
|
+
// Remove autocomplete attribute to prevent native suggestions:
|
132
|
+
that.element.setAttribute('autocomplete', 'off');
|
133
|
+
|
134
|
+
that.killerFn = function (e) {
|
135
|
+
if ($(e.target).closest('.' + that.options.containerClass).length === 0) {
|
136
|
+
that.killSuggestions();
|
137
|
+
that.disableKillerFn();
|
138
|
+
}
|
139
|
+
};
|
140
|
+
|
141
|
+
// Determine suggestions width:
|
142
|
+
if (!options.width || options.width === 'auto') {
|
143
|
+
options.width = that.el.outerWidth();
|
144
|
+
}
|
145
|
+
|
146
|
+
that.suggestionsContainer = Autocomplete.utils.createNode('<div class="' + options.containerClass + '" style="position: absolute; display: none;"></div>');
|
147
|
+
|
148
|
+
container = $(that.suggestionsContainer);
|
149
|
+
|
150
|
+
container.appendTo(options.appendTo).width(options.width);
|
151
|
+
|
152
|
+
// Listen for mouse over event on suggestions list:
|
153
|
+
container.on('mouseover.autocomplete', suggestionSelector, function () {
|
154
|
+
that.activate($(this).data('index'));
|
155
|
+
});
|
156
|
+
|
157
|
+
// Deselect active element when mouse leaves suggestions container:
|
158
|
+
container.on('mouseout.autocomplete', function () {
|
159
|
+
that.selectedIndex = -1;
|
160
|
+
container.children('.' + selected).removeClass(selected);
|
161
|
+
});
|
162
|
+
|
163
|
+
// Listen for click event on suggestions list:
|
164
|
+
container.on('click.autocomplete', suggestionSelector, function () {
|
165
|
+
that.select($(this).data('index'), false);
|
166
|
+
});
|
167
|
+
|
168
|
+
that.fixPosition();
|
169
|
+
|
170
|
+
// Opera does not like keydown:
|
171
|
+
if (window.opera) {
|
172
|
+
that.el.on('keypress.autocomplete', function (e) { that.onKeyPress(e); });
|
173
|
+
} else {
|
174
|
+
that.el.on('keydown.autocomplete', function (e) { that.onKeyPress(e); });
|
175
|
+
}
|
176
|
+
|
177
|
+
that.el.on('keyup.autocomplete', function (e) { that.onKeyUp(e); });
|
178
|
+
that.el.on('blur.autocomplete', function () { that.onBlur(); });
|
179
|
+
that.el.on('focus.autocomplete', function () { that.fixPosition(); });
|
180
|
+
},
|
181
|
+
|
182
|
+
onBlur: function () {
|
183
|
+
this.enableKillerFn();
|
184
|
+
},
|
185
|
+
|
186
|
+
setOptions: function (suppliedOptions) {
|
187
|
+
var that = this,
|
188
|
+
options = that.options;
|
189
|
+
|
190
|
+
utils.extend(options, suppliedOptions);
|
191
|
+
|
192
|
+
that.isLocal = $.isArray(options.lookup);
|
193
|
+
|
194
|
+
if (that.isLocal) {
|
195
|
+
options.lookup = that.verifySuggestionsFormat(options.lookup);
|
196
|
+
}
|
197
|
+
|
198
|
+
// Adjust height, width and z-index:
|
199
|
+
$(that.suggestionsContainer).css({
|
200
|
+
'max-height': options.maxHeight + 'px',
|
201
|
+
'width': options.width + 'px',
|
202
|
+
'z-index': options.zIndex
|
203
|
+
});
|
204
|
+
},
|
205
|
+
|
206
|
+
clearCache: function () {
|
207
|
+
this.cachedResponse = [];
|
208
|
+
this.badQueries = [];
|
209
|
+
},
|
210
|
+
|
211
|
+
clear: function () {
|
212
|
+
this.clearCache();
|
213
|
+
this.currentValue = null;
|
214
|
+
this.suggestions = [];
|
215
|
+
},
|
216
|
+
|
217
|
+
disable: function () {
|
218
|
+
this.disabled = true;
|
219
|
+
},
|
220
|
+
|
221
|
+
enable: function () {
|
222
|
+
this.disabled = false;
|
223
|
+
},
|
224
|
+
|
225
|
+
fixPosition: function () {
|
226
|
+
var that = this,
|
227
|
+
offset;
|
228
|
+
|
229
|
+
// Don't adjsut position if custom container has been specified:
|
230
|
+
if (that.options.appendTo !== 'body') {
|
231
|
+
return;
|
232
|
+
}
|
233
|
+
|
234
|
+
offset = that.el.offset();
|
235
|
+
|
236
|
+
$(that.suggestionsContainer).css({
|
237
|
+
top: (offset.top + that.el.outerHeight()) + 'px',
|
238
|
+
left: offset.left + 'px'
|
239
|
+
});
|
240
|
+
},
|
241
|
+
|
242
|
+
enableKillerFn: function () {
|
243
|
+
var that = this;
|
244
|
+
$(document).on('click.autocomplete', that.killerFn);
|
245
|
+
},
|
246
|
+
|
247
|
+
disableKillerFn: function () {
|
248
|
+
var that = this;
|
249
|
+
$(document).off('click.autocomplete', that.killerFn);
|
250
|
+
},
|
251
|
+
|
252
|
+
killSuggestions: function () {
|
253
|
+
var that = this;
|
254
|
+
that.stopKillSuggestions();
|
255
|
+
that.intervalId = window.setInterval(function () {
|
256
|
+
that.hide();
|
257
|
+
that.stopKillSuggestions();
|
258
|
+
}, 300);
|
259
|
+
},
|
260
|
+
|
261
|
+
stopKillSuggestions: function () {
|
262
|
+
window.clearInterval(this.intervalId);
|
263
|
+
},
|
264
|
+
|
265
|
+
onKeyPress: function (e) {
|
266
|
+
var that = this;
|
267
|
+
|
268
|
+
// If suggestions are hidden and user presses arrow down, display suggestions:
|
269
|
+
if (!that.disabled && !that.visible && e.keyCode === keys.DOWN && that.currentValue) {
|
270
|
+
that.suggest();
|
271
|
+
return;
|
272
|
+
}
|
273
|
+
|
274
|
+
if (that.disabled || !that.visible) {
|
275
|
+
return;
|
276
|
+
}
|
277
|
+
|
278
|
+
switch (e.keyCode) {
|
279
|
+
case keys.ESC:
|
280
|
+
that.el.val(that.currentValue);
|
281
|
+
that.hide();
|
282
|
+
break;
|
283
|
+
case keys.TAB:
|
284
|
+
case keys.RETURN:
|
285
|
+
if (that.selectedIndex === -1) {
|
286
|
+
that.hide();
|
287
|
+
return;
|
288
|
+
}
|
289
|
+
that.select(that.selectedIndex, e.keyCode === keys.RETURN);
|
290
|
+
if (e.keyCode === keys.TAB && this.options.tabDisabled === false) {
|
291
|
+
return;
|
292
|
+
}
|
293
|
+
break;
|
294
|
+
case keys.UP:
|
295
|
+
that.moveUp();
|
296
|
+
break;
|
297
|
+
case keys.DOWN:
|
298
|
+
that.moveDown();
|
299
|
+
break;
|
300
|
+
default:
|
301
|
+
return;
|
302
|
+
}
|
303
|
+
|
304
|
+
// Cancel event if function did not return:
|
305
|
+
e.stopImmediatePropagation();
|
306
|
+
e.preventDefault();
|
307
|
+
},
|
308
|
+
|
309
|
+
onKeyUp: function (e) {
|
310
|
+
var that = this;
|
311
|
+
|
312
|
+
if (that.disabled) {
|
313
|
+
return;
|
314
|
+
}
|
315
|
+
|
316
|
+
switch (e.keyCode) {
|
317
|
+
case keys.UP:
|
318
|
+
case keys.DOWN:
|
319
|
+
return;
|
320
|
+
}
|
321
|
+
|
322
|
+
clearInterval(that.onChangeInterval);
|
323
|
+
|
324
|
+
if (that.currentValue !== that.el.val()) {
|
325
|
+
if (that.options.deferRequestBy > 0) {
|
326
|
+
// Defer lookup in case when value changes very quickly:
|
327
|
+
that.onChangeInterval = setInterval(function () {
|
328
|
+
that.onValueChange();
|
329
|
+
}, that.options.deferRequestBy);
|
330
|
+
} else {
|
331
|
+
that.onValueChange();
|
332
|
+
}
|
333
|
+
}
|
334
|
+
},
|
335
|
+
|
336
|
+
onValueChange: function () {
|
337
|
+
var that = this,
|
338
|
+
q;
|
339
|
+
|
340
|
+
clearInterval(that.onChangeInterval);
|
341
|
+
that.currentValue = that.element.value;
|
342
|
+
|
343
|
+
q = that.getQuery(that.currentValue);
|
344
|
+
that.selectedIndex = -1;
|
345
|
+
|
346
|
+
if (that.ignoreValueChange) {
|
347
|
+
that.ignoreValueChange = false;
|
348
|
+
return;
|
349
|
+
}
|
350
|
+
|
351
|
+
if (q.length < that.options.minChars) {
|
352
|
+
that.hide();
|
353
|
+
} else {
|
354
|
+
that.getSuggestions(q);
|
355
|
+
}
|
356
|
+
},
|
357
|
+
|
358
|
+
getQuery: function (value) {
|
359
|
+
var delimiter = this.options.delimiter,
|
360
|
+
parts;
|
361
|
+
|
362
|
+
if (!delimiter) {
|
363
|
+
return $.trim(value);
|
364
|
+
}
|
365
|
+
parts = value.split(delimiter);
|
366
|
+
return $.trim(parts[parts.length - 1]);
|
367
|
+
},
|
368
|
+
|
369
|
+
getSuggestionsLocal: function (query) {
|
370
|
+
var that = this,
|
371
|
+
queryLowerCase = query.toLowerCase(),
|
372
|
+
filter = that.options.lookupFilter;
|
373
|
+
|
374
|
+
return {
|
375
|
+
suggestions: $.grep(that.options.lookup, function (suggestion) {
|
376
|
+
return filter(suggestion, query, queryLowerCase);
|
377
|
+
})
|
378
|
+
};
|
379
|
+
},
|
380
|
+
|
381
|
+
getSuggestions: function (q) {
|
382
|
+
var response,
|
383
|
+
that = this,
|
384
|
+
options = that.options,
|
385
|
+
serviceUrl = options.serviceUrl;
|
386
|
+
|
387
|
+
response = that.isLocal ? that.getSuggestionsLocal(q) : that.cachedResponse[q];
|
388
|
+
|
389
|
+
if (response && $.isArray(response.suggestions)) {
|
390
|
+
that.suggestions = response.suggestions;
|
391
|
+
that.suggest();
|
392
|
+
} else if (!that.isBadQuery(q)) {
|
393
|
+
options.params[options.paramName] = q;
|
394
|
+
if (options.onSearchStart.call(that.element, options.params) === false) {
|
395
|
+
return;
|
396
|
+
}
|
397
|
+
if ($.isFunction(options.serviceUrl)) {
|
398
|
+
serviceUrl = options.serviceUrl.call(that.element, q);
|
399
|
+
}
|
400
|
+
$.ajax({
|
401
|
+
url: serviceUrl,
|
402
|
+
data: options.ignoreParams ? null : options.params,
|
403
|
+
type: options.type,
|
404
|
+
dataType: options.dataType
|
405
|
+
}).done(function (data) {
|
406
|
+
that.processResponse(data, q);
|
407
|
+
options.onSearchComplete.call(that.element, q);
|
408
|
+
});
|
409
|
+
}
|
410
|
+
},
|
411
|
+
|
412
|
+
isBadQuery: function (q) {
|
413
|
+
var badQueries = this.badQueries,
|
414
|
+
i = badQueries.length;
|
415
|
+
|
416
|
+
while (i--) {
|
417
|
+
if (q.indexOf(badQueries[i]) === 0) {
|
418
|
+
return true;
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
422
|
+
return false;
|
423
|
+
},
|
424
|
+
|
425
|
+
hide: function () {
|
426
|
+
var that = this;
|
427
|
+
that.visible = false;
|
428
|
+
that.selectedIndex = -1;
|
429
|
+
$(that.suggestionsContainer).hide();
|
430
|
+
},
|
431
|
+
|
432
|
+
suggest: function () {
|
433
|
+
if (this.suggestions.length === 0) {
|
434
|
+
this.hide();
|
435
|
+
return;
|
436
|
+
}
|
437
|
+
|
438
|
+
var that = this,
|
439
|
+
formatResult = that.options.formatResult,
|
440
|
+
value = that.getQuery(that.currentValue),
|
441
|
+
className = that.classes.suggestion,
|
442
|
+
classSelected = that.classes.selected,
|
443
|
+
container = $(that.suggestionsContainer),
|
444
|
+
html = '';
|
445
|
+
|
446
|
+
// Build suggestions inner HTML:
|
447
|
+
$.each(that.suggestions, function (i, suggestion) {
|
448
|
+
html += '<div class="' + className + '" data-index="' + i + '">' + formatResult(suggestion, value) + '</div>';
|
449
|
+
});
|
450
|
+
|
451
|
+
container.html(html).show();
|
452
|
+
that.visible = true;
|
453
|
+
|
454
|
+
// Select first value by default:
|
455
|
+
if (that.options.autoSelectFirst) {
|
456
|
+
that.selectedIndex = 0;
|
457
|
+
container.children().first().addClass(classSelected);
|
458
|
+
}
|
459
|
+
},
|
460
|
+
|
461
|
+
verifySuggestionsFormat: function (suggestions) {
|
462
|
+
// If suggestions is string array, convert them to supported format:
|
463
|
+
if (suggestions.length && typeof suggestions[0] === 'string') {
|
464
|
+
return $.map(suggestions, function (value) {
|
465
|
+
return { value: value, data: null };
|
466
|
+
});
|
467
|
+
}
|
468
|
+
|
469
|
+
return suggestions;
|
470
|
+
},
|
471
|
+
|
472
|
+
processResponse: function (response, originalQuery) {
|
473
|
+
var that = this,
|
474
|
+
options = that.options,
|
475
|
+
result = options.transformResult(response, originalQuery);
|
476
|
+
|
477
|
+
result.suggestions = that.verifySuggestionsFormat(result.suggestions);
|
478
|
+
|
479
|
+
// Cache results if cache is not disabled:
|
480
|
+
if (!options.noCache) {
|
481
|
+
that.cachedResponse[result[options.paramName]] = result;
|
482
|
+
if (result.suggestions.length === 0) {
|
483
|
+
that.badQueries.push(result[options.paramName]);
|
484
|
+
}
|
485
|
+
}
|
486
|
+
|
487
|
+
// Display suggestions only if returned query matches current value:
|
488
|
+
if (originalQuery === that.getQuery(that.currentValue)) {
|
489
|
+
that.suggestions = result.suggestions;
|
490
|
+
that.suggest();
|
491
|
+
}
|
492
|
+
},
|
493
|
+
|
494
|
+
activate: function (index) {
|
495
|
+
var that = this,
|
496
|
+
activeItem,
|
497
|
+
selected = that.classes.selected,
|
498
|
+
container = $(that.suggestionsContainer),
|
499
|
+
children = container.children();
|
500
|
+
|
501
|
+
container.children('.' + selected).removeClass(selected);
|
502
|
+
|
503
|
+
that.selectedIndex = index;
|
504
|
+
|
505
|
+
if (that.selectedIndex !== -1 && children.length > that.selectedIndex) {
|
506
|
+
activeItem = children.get(that.selectedIndex);
|
507
|
+
$(activeItem).addClass(selected);
|
508
|
+
return activeItem;
|
509
|
+
}
|
510
|
+
|
511
|
+
return null;
|
512
|
+
},
|
513
|
+
|
514
|
+
select: function (i, shouldIgnoreNextValueChange) {
|
515
|
+
var that = this,
|
516
|
+
selectedValue = that.suggestions[i];
|
517
|
+
|
518
|
+
if (selectedValue) {
|
519
|
+
that.el.val(selectedValue);
|
520
|
+
that.ignoreValueChange = shouldIgnoreNextValueChange;
|
521
|
+
that.hide();
|
522
|
+
that.onSelect(i);
|
523
|
+
}
|
524
|
+
},
|
525
|
+
|
526
|
+
moveUp: function () {
|
527
|
+
var that = this;
|
528
|
+
|
529
|
+
if (that.selectedIndex === -1) {
|
530
|
+
return;
|
531
|
+
}
|
532
|
+
|
533
|
+
if (that.selectedIndex === 0) {
|
534
|
+
$(that.suggestionsContainer).children().first().removeClass(that.classes.selected);
|
535
|
+
that.selectedIndex = -1;
|
536
|
+
that.el.val(that.currentValue);
|
537
|
+
return;
|
538
|
+
}
|
539
|
+
|
540
|
+
that.adjustScroll(that.selectedIndex - 1);
|
541
|
+
},
|
542
|
+
|
543
|
+
moveDown: function () {
|
544
|
+
var that = this;
|
545
|
+
|
546
|
+
if (that.selectedIndex === (that.suggestions.length - 1)) {
|
547
|
+
return;
|
548
|
+
}
|
549
|
+
|
550
|
+
that.adjustScroll(that.selectedIndex + 1);
|
551
|
+
},
|
552
|
+
|
553
|
+
adjustScroll: function (index) {
|
554
|
+
var that = this,
|
555
|
+
activeItem = that.activate(index),
|
556
|
+
offsetTop,
|
557
|
+
upperBound,
|
558
|
+
lowerBound,
|
559
|
+
heightDelta = 25;
|
560
|
+
|
561
|
+
if (!activeItem) {
|
562
|
+
return;
|
563
|
+
}
|
564
|
+
|
565
|
+
offsetTop = activeItem.offsetTop;
|
566
|
+
upperBound = $(that.suggestionsContainer).scrollTop();
|
567
|
+
lowerBound = upperBound + that.options.maxHeight - heightDelta;
|
568
|
+
|
569
|
+
if (offsetTop < upperBound) {
|
570
|
+
$(that.suggestionsContainer).scrollTop(offsetTop);
|
571
|
+
} else if (offsetTop > lowerBound) {
|
572
|
+
$(that.suggestionsContainer).scrollTop(offsetTop - that.options.maxHeight + heightDelta);
|
573
|
+
}
|
574
|
+
|
575
|
+
that.el.val(that.getValue(that.suggestions[index].value));
|
576
|
+
},
|
577
|
+
|
578
|
+
onSelect: function (index) {
|
579
|
+
var that = this,
|
580
|
+
onSelectCallback = that.options.onSelect,
|
581
|
+
suggestion = that.suggestions[index];
|
582
|
+
|
583
|
+
that.el.val(that.getValue(suggestion.value));
|
584
|
+
|
585
|
+
if ($.isFunction(onSelectCallback)) {
|
586
|
+
onSelectCallback.call(that.element, suggestion);
|
587
|
+
}
|
588
|
+
},
|
589
|
+
|
590
|
+
getValue: function (value) {
|
591
|
+
var that = this,
|
592
|
+
delimiter = that.options.delimiter,
|
593
|
+
currentValue,
|
594
|
+
parts;
|
595
|
+
|
596
|
+
if (!delimiter) {
|
597
|
+
return value;
|
598
|
+
}
|
599
|
+
|
600
|
+
currentValue = that.currentValue;
|
601
|
+
parts = currentValue.split(delimiter);
|
602
|
+
|
603
|
+
if (parts.length === 1) {
|
604
|
+
return value;
|
605
|
+
}
|
606
|
+
|
607
|
+
return currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) + value;
|
608
|
+
},
|
609
|
+
|
610
|
+
dispose: function () {
|
611
|
+
var that = this;
|
612
|
+
that.el.off('.autocomplete').removeData('autocomplete');
|
613
|
+
that.disableKillerFn();
|
614
|
+
$(that.suggestionsContainer).remove();
|
615
|
+
}
|
616
|
+
};
|
617
|
+
|
618
|
+
// Create chainable jQuery plugin:
|
619
|
+
$.fn.autocomplete = function (options, args) {
|
620
|
+
var dataKey = 'autocomplete';
|
621
|
+
// If function invoked without argument return
|
622
|
+
// instance of the first matched element:
|
623
|
+
if (arguments.length === 0) {
|
624
|
+
return this.first().data(dataKey);
|
625
|
+
}
|
626
|
+
|
627
|
+
return this.each(function () {
|
628
|
+
var inputElement = $(this),
|
629
|
+
instance = inputElement.data(dataKey);
|
630
|
+
|
631
|
+
if (typeof options === 'string') {
|
632
|
+
if (instance && typeof instance[options] === 'function') {
|
633
|
+
instance[options](args);
|
634
|
+
}
|
635
|
+
} else {
|
636
|
+
// If instance already exists, destroy it:
|
637
|
+
if (instance && instance.dispose) {
|
638
|
+
instance.dispose();
|
639
|
+
}
|
640
|
+
instance = new Autocomplete(this, options);
|
641
|
+
inputElement.data(dataKey, instance);
|
642
|
+
}
|
643
|
+
});
|
644
|
+
};
|
645
|
+
}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){"use strict";function t(n,s){var o=function(){},i=this,a={autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:t.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:o,onSearchComplete:o,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",lookupFilter:function(e,t,n){return-1!==e.value.toLowerCase().indexOf(n)},paramName:"query",transformResult:function(t){return"string"==typeof t?e.parseJSON(t):t}};i.element=n,i.el=e(n),i.suggestions=[],i.badQueries=[],i.selectedIndex=-1,i.currentValue=i.element.value,i.intervalId=0,i.cachedResponse=[],i.onChangeInterval=null,i.onChange=null,i.ignoreValueChange=!1,i.isLocal=!1,i.suggestionsContainer=null,i.options=e.extend({},a,s),i.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},i.initialize(),i.setOptions(s)}var n=function(){return{extend:function(t,n){return e.extend(t,n)},createNode:function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstChild}}}(),s={ESC:27,TAB:9,RETURN:13,UP:38,DOWN:40};t.utils=n,e.Autocomplete=t,t.formatResult=function(e,t){var n=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g"),s="("+t.replace(n,"\\$1")+")";return e.value.replace(new RegExp(s,"gi"),"<strong>$1</strong>")},t.prototype={killerFn:null,initialize:function(){var n,s=this,o="."+s.classes.suggestion,i=s.classes.selected,a=s.options;s.element.setAttribute("autocomplete","off"),s.killerFn=function(t){0===e(t.target).closest("."+s.options.containerClass).length&&(s.killSuggestions(),s.disableKillerFn())},a.width&&"auto"!==a.width||(a.width=s.el.outerWidth()),s.suggestionsContainer=t.utils.createNode('<div class="'+a.containerClass+'" style="position: absolute; display: none;"></div>'),n=e(s.suggestionsContainer),n.appendTo(a.appendTo).width(a.width),n.on("mouseover.autocomplete",o,function(){s.activate(e(this).data("index"))}),n.on("mouseout.autocomplete",function(){s.selectedIndex=-1,n.children("."+i).removeClass(i)}),n.on("click.autocomplete",o,function(){s.select(e(this).data("index"),!1)}),s.fixPosition(),window.opera?s.el.on("keypress.autocomplete",function(e){s.onKeyPress(e)}):s.el.on("keydown.autocomplete",function(e){s.onKeyPress(e)}),s.el.on("keyup.autocomplete",function(e){s.onKeyUp(e)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.fixPosition()})},onBlur:function(){this.enableKillerFn()},setOptions:function(t){var s=this,o=s.options;n.extend(o,t),s.isLocal=e.isArray(o.lookup),s.isLocal&&(o.lookup=s.verifySuggestionsFormat(o.lookup)),e(s.suggestionsContainer).css({"max-height":o.maxHeight+"px",width:o.width+"px","z-index":o.zIndex})},clearCache:function(){this.cachedResponse=[],this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue=null,this.suggestions=[]},disable:function(){this.disabled=!0},enable:function(){this.disabled=!1},fixPosition:function(){var t,n=this;"body"===n.options.appendTo&&(t=n.el.offset(),e(n.suggestionsContainer).css({top:t.top+n.el.outerHeight()+"px",left:t.left+"px"}))},enableKillerFn:function(){var t=this;e(document).on("click.autocomplete",t.killerFn)},disableKillerFn:function(){var t=this;e(document).off("click.autocomplete",t.killerFn)},killSuggestions:function(){var e=this;e.stopKillSuggestions(),e.intervalId=window.setInterval(function(){e.hide(),e.stopKillSuggestions()},300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(e){var t=this;if(!t.disabled&&!t.visible&&e.keyCode===s.DOWN&&t.currentValue)return t.suggest(),void 0;if(!t.disabled&&t.visible){switch(e.keyCode){case s.ESC:t.el.val(t.currentValue),t.hide();break;case s.TAB:case s.RETURN:if(-1===t.selectedIndex)return t.hide(),void 0;if(t.select(t.selectedIndex,e.keyCode===s.RETURN),e.keyCode===s.TAB&&this.options.tabDisabled===!1)return;break;case s.UP:t.moveUp();break;case s.DOWN:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.keyCode){case s.UP:case s.DOWN:return}clearInterval(t.onChangeInterval),t.currentValue!==t.el.val()&&(t.options.deferRequestBy>0?t.onChangeInterval=setInterval(function(){t.onValueChange()},t.options.deferRequestBy):t.onValueChange())}},onValueChange:function(){var e,t=this;return clearInterval(t.onChangeInterval),t.currentValue=t.element.value,e=t.getQuery(t.currentValue),t.selectedIndex=-1,t.ignoreValueChange?(t.ignoreValueChange=!1,void 0):(e.length<t.options.minChars?t.hide():t.getSuggestions(e),void 0)},getQuery:function(t){var n,s=this.options.delimiter;return s?(n=t.split(s),e.trim(n[n.length-1])):e.trim(t)},getSuggestionsLocal:function(t){var n=this,s=t.toLowerCase(),o=n.options.lookupFilter;return{suggestions:e.grep(n.options.lookup,function(e){return o(e,t,s)})}},getSuggestions:function(t){var n,s=this,o=s.options,i=o.serviceUrl;if(n=s.isLocal?s.getSuggestionsLocal(t):s.cachedResponse[t],n&&e.isArray(n.suggestions))s.suggestions=n.suggestions,s.suggest();else if(!s.isBadQuery(t)){if(o.params[o.paramName]=t,o.onSearchStart.call(s.element,o.params)===!1)return;e.isFunction(o.serviceUrl)&&(i=o.serviceUrl.call(s.element,t)),e.ajax({url:i,data:o.ignoreParams?null:o.params,type:o.type,dataType:o.dataType}).done(function(e){s.processResponse(e,t),o.onSearchComplete.call(s.element,t)})}},isBadQuery:function(e){for(var t=this.badQueries,n=t.length;n--;)if(0===e.indexOf(t[n]))return!0;return!1},hide:function(){var t=this;t.visible=!1,t.selectedIndex=-1,e(t.suggestionsContainer).hide()},suggest:function(){if(0===this.suggestions.length)return this.hide(),void 0;var t=this,n=t.options.formatResult,s=t.getQuery(t.currentValue),o=t.classes.suggestion,i=t.classes.selected,a=e(t.suggestionsContainer),l="";e.each(t.suggestions,function(e,t){l+='<div class="'+o+'" data-index="'+e+'">'+n(t,s)+"</div>"}),a.html(l).show(),t.visible=!0,t.options.autoSelectFirst&&(t.selectedIndex=0,a.children().first().addClass(i))},verifySuggestionsFormat:function(t){return t.length&&"string"==typeof t[0]?e.map(t,function(e){return{value:e,data:null}}):t},processResponse:function(e,t){var n=this,s=n.options,o=s.transformResult(e,t);o.suggestions=n.verifySuggestionsFormat(o.suggestions),s.noCache||(n.cachedResponse[o[s.paramName]]=o,0===o.suggestions.length&&n.badQueries.push(o[s.paramName])),t===n.getQuery(n.currentValue)&&(n.suggestions=o.suggestions,n.suggest())},activate:function(t){var n,s=this,o=s.classes.selected,i=e(s.suggestionsContainer),a=i.children();return i.children("."+o).removeClass(o),s.selectedIndex=t,-1!==s.selectedIndex&&a.length>s.selectedIndex?(n=a.get(s.selectedIndex),e(n).addClass(o),n):null},select:function(e,t){var n=this,s=n.suggestions[e];s&&(n.el.val(s),n.ignoreValueChange=t,n.hide(),n.onSelect(e))},moveUp:function(){var t=this;if(-1!==t.selectedIndex)return 0===t.selectedIndex?(e(t.suggestionsContainer).children().first().removeClass(t.classes.selected),t.selectedIndex=-1,t.el.val(t.currentValue),void 0):(t.adjustScroll(t.selectedIndex-1),void 0)},moveDown:function(){var e=this;e.selectedIndex!==e.suggestions.length-1&&e.adjustScroll(e.selectedIndex+1)},adjustScroll:function(t){var n,s,o,i=this,a=i.activate(t),l=25;a&&(n=a.offsetTop,s=e(i.suggestionsContainer).scrollTop(),o=s+i.options.maxHeight-l,s>n?e(i.suggestionsContainer).scrollTop(n):n>o&&e(i.suggestionsContainer).scrollTop(n-i.options.maxHeight+l),i.el.val(i.getValue(i.suggestions[t].value)))},onSelect:function(t){var n=this,s=n.options.onSelect,o=n.suggestions[t];n.el.val(n.getValue(o.value)),e.isFunction(s)&&s.call(n.element,o)},getValue:function(e){var t,n,s=this,o=s.options.delimiter;return o?(t=s.currentValue,n=t.split(o),1===n.length?e:t.substr(0,t.length-n[n.length-1].length)+e):e},dispose:function(){var t=this;t.el.off(".autocomplete").removeData("autocomplete"),t.disableKillerFn(),e(t.suggestionsContainer).remove()}},e.fn.autocomplete=function(n,s){var o="autocomplete";return 0===arguments.length?this.first().data(o):this.each(function(){var i=e(this),a=i.data(o);"string"==typeof n?a&&"function"==typeof a[n]&&a[n](s):(a&&a.dispose&&a.dispose(),a=new t(this,n),i.data(o,a))})}});
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Cookie Plugin v1.4.1
|
3
|
+
* https://github.com/carhartl/jquery-cookie
|
4
|
+
*
|
5
|
+
* Copyright 2013 Klaus Hartl
|
6
|
+
* Released under the MIT license
|
7
|
+
*/
|
8
|
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Cookie Plugin v1.3.1
|
3
|
+
* https://github.com/carhartl/jquery-cookie
|
4
|
+
*
|
5
|
+
* Copyright 2013 Klaus Hartl
|
6
|
+
* Released under the MIT license
|
7
|
+
*/
|
8
|
+
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){function n(e){if(t.raw)return e;try{return decodeURIComponent(e.replace(i," "))}catch(n){}}function o(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")),e=n(e);try{return t.json?JSON.parse(e):e}catch(o){}}var i=/\+/g,t=e.cookie=function(i,r,c){if(void 0!==r){if(c=e.extend({},t.defaults,c),"number"==typeof c.expires){var a=c.expires,d=c.expires=new Date;d.setDate(d.getDate()+a)}return r=t.json?JSON.stringify(r):String(r),document.cookie=[t.raw?i:encodeURIComponent(i),"=",t.raw?r:encodeURIComponent(r),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}for(var u=i?void 0:{},f=document.cookie?document.cookie.split("; "):[],p=0,s=f.length;s>p;p++){var m=f[p].split("="),x=n(m.shift()),l=m.join("=");if(i&&i===x){u=o(l);break}i||void 0===(l=o(l))||(u[x]=l)}return u};t.defaults={},e.removeCookie=function(n,o){return void 0!==e.cookie(n)?(e.cookie(n,"",e.extend({},o,{expires:-1})),!0):!1}});
|