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,611 @@
|
|
1
|
+
/*
|
2
|
+
* Foundation Responsive Library
|
3
|
+
* http://foundation.zurb.com
|
4
|
+
* Copyright 2014, ZURB
|
5
|
+
* Free to use under the MIT license.
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
*/
|
8
|
+
|
9
|
+
(function ($, window, document, undefined) {
|
10
|
+
'use strict';
|
11
|
+
|
12
|
+
var header_helpers = function (class_array) {
|
13
|
+
var i = class_array.length;
|
14
|
+
var head = $('head');
|
15
|
+
|
16
|
+
while (i--) {
|
17
|
+
if(head.has('.' + class_array[i]).length === 0) {
|
18
|
+
head.append('<meta class="' + class_array[i] + '" />');
|
19
|
+
}
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
header_helpers([
|
24
|
+
'foundation-mq-small',
|
25
|
+
'foundation-mq-medium',
|
26
|
+
'foundation-mq-large',
|
27
|
+
'foundation-mq-xlarge',
|
28
|
+
'foundation-mq-xxlarge',
|
29
|
+
'foundation-data-attribute-namespace']);
|
30
|
+
|
31
|
+
// Enable FastClick if present
|
32
|
+
|
33
|
+
$(function() {
|
34
|
+
if (typeof FastClick !== 'undefined') {
|
35
|
+
// Don't attach to body if undefined
|
36
|
+
if (typeof document.body !== 'undefined') {
|
37
|
+
FastClick.attach(document.body);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
});
|
41
|
+
|
42
|
+
// private Fast Selector wrapper,
|
43
|
+
// returns jQuery object. Only use where
|
44
|
+
// getElementById is not available.
|
45
|
+
var S = function (selector, context) {
|
46
|
+
if (typeof selector === 'string') {
|
47
|
+
if (context) {
|
48
|
+
var cont;
|
49
|
+
if (context.jquery) {
|
50
|
+
cont = context[0];
|
51
|
+
if (!cont) return context;
|
52
|
+
} else {
|
53
|
+
cont = context;
|
54
|
+
}
|
55
|
+
return $(cont.querySelectorAll(selector));
|
56
|
+
}
|
57
|
+
|
58
|
+
return $(document.querySelectorAll(selector));
|
59
|
+
}
|
60
|
+
|
61
|
+
return $(selector, context);
|
62
|
+
};
|
63
|
+
|
64
|
+
// Namespace functions.
|
65
|
+
|
66
|
+
var attr_name = function (init) {
|
67
|
+
var arr = [];
|
68
|
+
if (!init) arr.push('data');
|
69
|
+
if (this.namespace.length > 0) arr.push(this.namespace);
|
70
|
+
arr.push(this.name);
|
71
|
+
|
72
|
+
return arr.join('-');
|
73
|
+
};
|
74
|
+
|
75
|
+
var add_namespace = function (str) {
|
76
|
+
var parts = str.split('-'),
|
77
|
+
i = parts.length,
|
78
|
+
arr = [];
|
79
|
+
|
80
|
+
while (i--) {
|
81
|
+
if (i !== 0) {
|
82
|
+
arr.push(parts[i]);
|
83
|
+
} else {
|
84
|
+
if (this.namespace.length > 0) {
|
85
|
+
arr.push(this.namespace, parts[i]);
|
86
|
+
} else {
|
87
|
+
arr.push(parts[i]);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
return arr.reverse().join('-');
|
93
|
+
};
|
94
|
+
|
95
|
+
// Event binding and data-options updating.
|
96
|
+
|
97
|
+
var bindings = function (method, options) {
|
98
|
+
var self = this,
|
99
|
+
should_bind_events = !S(this).data(this.attr_name(true));
|
100
|
+
|
101
|
+
if (typeof method === 'string') {
|
102
|
+
return this[method].call(this, options);
|
103
|
+
}
|
104
|
+
|
105
|
+
if (S(this.scope).is('[' + this.attr_name() +']')) {
|
106
|
+
S(this.scope).data(this.attr_name(true) + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope))));
|
107
|
+
|
108
|
+
if (should_bind_events) {
|
109
|
+
this.events(this.scope);
|
110
|
+
}
|
111
|
+
|
112
|
+
} else {
|
113
|
+
S('[' + this.attr_name() +']', this.scope).each(function () {
|
114
|
+
var should_bind_events = !S(this).data(self.attr_name(true) + '-init');
|
115
|
+
S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this))));
|
116
|
+
|
117
|
+
if (should_bind_events) {
|
118
|
+
self.events(this);
|
119
|
+
}
|
120
|
+
});
|
121
|
+
}
|
122
|
+
};
|
123
|
+
|
124
|
+
var single_image_loaded = function (image, callback) {
|
125
|
+
function loaded () {
|
126
|
+
callback(image[0]);
|
127
|
+
}
|
128
|
+
|
129
|
+
function bindLoad () {
|
130
|
+
this.one('load', loaded);
|
131
|
+
|
132
|
+
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
|
133
|
+
var src = this.attr( 'src' ),
|
134
|
+
param = src.match( /\?/ ) ? '&' : '?';
|
135
|
+
|
136
|
+
param += 'random=' + (new Date()).getTime();
|
137
|
+
this.attr('src', src + param);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
if (!image.attr('src')) {
|
142
|
+
loaded();
|
143
|
+
return;
|
144
|
+
}
|
145
|
+
|
146
|
+
if (image[0].complete || image[0].readyState === 4) {
|
147
|
+
loaded();
|
148
|
+
} else {
|
149
|
+
bindLoad.call(image);
|
150
|
+
}
|
151
|
+
};
|
152
|
+
|
153
|
+
/*
|
154
|
+
https://github.com/paulirish/matchMedia.js
|
155
|
+
*/
|
156
|
+
|
157
|
+
window.matchMedia = window.matchMedia || (function( doc ) {
|
158
|
+
|
159
|
+
"use strict";
|
160
|
+
|
161
|
+
var bool,
|
162
|
+
docElem = doc.documentElement,
|
163
|
+
refNode = docElem.firstElementChild || docElem.firstChild,
|
164
|
+
// fakeBody required for <FF4 when executed in <head>
|
165
|
+
fakeBody = doc.createElement( "body" ),
|
166
|
+
div = doc.createElement( "div" );
|
167
|
+
|
168
|
+
div.id = "mq-test-1";
|
169
|
+
div.style.cssText = "position:absolute;top:-100em";
|
170
|
+
fakeBody.style.background = "none";
|
171
|
+
fakeBody.appendChild(div);
|
172
|
+
|
173
|
+
return function (q) {
|
174
|
+
|
175
|
+
div.innerHTML = "­<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>";
|
176
|
+
|
177
|
+
docElem.insertBefore( fakeBody, refNode );
|
178
|
+
bool = div.offsetWidth === 42;
|
179
|
+
docElem.removeChild( fakeBody );
|
180
|
+
|
181
|
+
return {
|
182
|
+
matches: bool,
|
183
|
+
media: q
|
184
|
+
};
|
185
|
+
|
186
|
+
};
|
187
|
+
|
188
|
+
}( document ));
|
189
|
+
|
190
|
+
/*
|
191
|
+
* jquery.requestAnimationFrame
|
192
|
+
* https://github.com/gnarf37/jquery-requestAnimationFrame
|
193
|
+
* Requires jQuery 1.8+
|
194
|
+
*
|
195
|
+
* Copyright (c) 2012 Corey Frang
|
196
|
+
* Licensed under the MIT license.
|
197
|
+
*/
|
198
|
+
|
199
|
+
(function($) {
|
200
|
+
|
201
|
+
// requestAnimationFrame polyfill adapted from Erik Möller
|
202
|
+
// fixes from Paul Irish and Tino Zijdel
|
203
|
+
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
204
|
+
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
|
205
|
+
|
206
|
+
var animating,
|
207
|
+
lastTime = 0,
|
208
|
+
vendors = ['webkit', 'moz'],
|
209
|
+
requestAnimationFrame = window.requestAnimationFrame,
|
210
|
+
cancelAnimationFrame = window.cancelAnimationFrame,
|
211
|
+
jqueryFxAvailable = 'undefined' !== typeof jQuery.fx;
|
212
|
+
|
213
|
+
for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
|
214
|
+
requestAnimationFrame = window[ vendors[lastTime] + "RequestAnimationFrame" ];
|
215
|
+
cancelAnimationFrame = cancelAnimationFrame ||
|
216
|
+
window[ vendors[lastTime] + "CancelAnimationFrame" ] ||
|
217
|
+
window[ vendors[lastTime] + "CancelRequestAnimationFrame" ];
|
218
|
+
}
|
219
|
+
|
220
|
+
function raf() {
|
221
|
+
if (animating) {
|
222
|
+
requestAnimationFrame(raf);
|
223
|
+
|
224
|
+
if (jqueryFxAvailable) {
|
225
|
+
jQuery.fx.tick();
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
if (requestAnimationFrame) {
|
231
|
+
// use rAF
|
232
|
+
window.requestAnimationFrame = requestAnimationFrame;
|
233
|
+
window.cancelAnimationFrame = cancelAnimationFrame;
|
234
|
+
|
235
|
+
if (jqueryFxAvailable) {
|
236
|
+
jQuery.fx.timer = function (timer) {
|
237
|
+
if (timer() && jQuery.timers.push(timer) && !animating) {
|
238
|
+
animating = true;
|
239
|
+
raf();
|
240
|
+
}
|
241
|
+
};
|
242
|
+
|
243
|
+
jQuery.fx.stop = function () {
|
244
|
+
animating = false;
|
245
|
+
};
|
246
|
+
}
|
247
|
+
} else {
|
248
|
+
// polyfill
|
249
|
+
window.requestAnimationFrame = function (callback) {
|
250
|
+
var currTime = new Date().getTime(),
|
251
|
+
timeToCall = Math.max(0, 16 - (currTime - lastTime)),
|
252
|
+
id = window.setTimeout(function () {
|
253
|
+
callback(currTime + timeToCall);
|
254
|
+
}, timeToCall);
|
255
|
+
lastTime = currTime + timeToCall;
|
256
|
+
return id;
|
257
|
+
};
|
258
|
+
|
259
|
+
window.cancelAnimationFrame = function (id) {
|
260
|
+
clearTimeout(id);
|
261
|
+
};
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
}( jQuery ));
|
266
|
+
|
267
|
+
|
268
|
+
function removeQuotes (string) {
|
269
|
+
if (typeof string === 'string' || string instanceof String) {
|
270
|
+
string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, '');
|
271
|
+
}
|
272
|
+
|
273
|
+
return string;
|
274
|
+
}
|
275
|
+
|
276
|
+
window.Foundation = {
|
277
|
+
name : 'Foundation',
|
278
|
+
|
279
|
+
version : '5.2.3',
|
280
|
+
|
281
|
+
media_queries : {
|
282
|
+
small : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
283
|
+
medium : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
284
|
+
large : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
285
|
+
xlarge: S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
|
286
|
+
xxlarge: S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
|
287
|
+
},
|
288
|
+
|
289
|
+
stylesheet : $('<style></style>').appendTo('head')[0].sheet,
|
290
|
+
|
291
|
+
global: {
|
292
|
+
namespace: undefined
|
293
|
+
},
|
294
|
+
|
295
|
+
init : function (scope, libraries, method, options, response) {
|
296
|
+
var args = [scope, method, options, response],
|
297
|
+
responses = [];
|
298
|
+
|
299
|
+
// check RTL
|
300
|
+
this.rtl = /rtl/i.test(S('html').attr('dir'));
|
301
|
+
|
302
|
+
// set foundation global scope
|
303
|
+
this.scope = scope || this.scope;
|
304
|
+
|
305
|
+
this.set_namespace();
|
306
|
+
|
307
|
+
if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) {
|
308
|
+
if (this.libs.hasOwnProperty(libraries)) {
|
309
|
+
responses.push(this.init_lib(libraries, args));
|
310
|
+
}
|
311
|
+
} else {
|
312
|
+
for (var lib in this.libs) {
|
313
|
+
responses.push(this.init_lib(lib, libraries));
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
return scope;
|
318
|
+
},
|
319
|
+
|
320
|
+
init_lib : function (lib, args) {
|
321
|
+
if (this.libs.hasOwnProperty(lib)) {
|
322
|
+
this.patch(this.libs[lib]);
|
323
|
+
|
324
|
+
if (args && args.hasOwnProperty(lib)) {
|
325
|
+
if (typeof this.libs[lib].settings !== 'undefined') {
|
326
|
+
$.extend(true, this.libs[lib].settings, args[lib]);
|
327
|
+
}
|
328
|
+
else if (typeof this.libs[lib].defaults !== 'undefined') {
|
329
|
+
$.extend(true, this.libs[lib].defaults, args[lib]);
|
330
|
+
}
|
331
|
+
return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
|
332
|
+
}
|
333
|
+
|
334
|
+
args = args instanceof Array ? args : new Array(args); // PATCH: added this line
|
335
|
+
return this.libs[lib].init.apply(this.libs[lib], args);
|
336
|
+
}
|
337
|
+
|
338
|
+
return function () {};
|
339
|
+
},
|
340
|
+
|
341
|
+
patch : function (lib) {
|
342
|
+
lib.scope = this.scope;
|
343
|
+
lib.namespace = this.global.namespace;
|
344
|
+
lib.rtl = this.rtl;
|
345
|
+
lib['data_options'] = this.utils.data_options;
|
346
|
+
lib['attr_name'] = attr_name;
|
347
|
+
lib['add_namespace'] = add_namespace;
|
348
|
+
lib['bindings'] = bindings;
|
349
|
+
lib['S'] = this.utils.S;
|
350
|
+
},
|
351
|
+
|
352
|
+
inherit : function (scope, methods) {
|
353
|
+
var methods_arr = methods.split(' '),
|
354
|
+
i = methods_arr.length;
|
355
|
+
|
356
|
+
while (i--) {
|
357
|
+
if (this.utils.hasOwnProperty(methods_arr[i])) {
|
358
|
+
scope[methods_arr[i]] = this.utils[methods_arr[i]];
|
359
|
+
}
|
360
|
+
}
|
361
|
+
},
|
362
|
+
|
363
|
+
set_namespace: function () {
|
364
|
+
|
365
|
+
// Description:
|
366
|
+
// Don't bother reading the namespace out of the meta tag
|
367
|
+
// if the namespace has been set globally in javascript
|
368
|
+
//
|
369
|
+
// Example:
|
370
|
+
// Foundation.global.namespace = 'my-namespace';
|
371
|
+
// or make it an empty string:
|
372
|
+
// Foundation.global.namespace = '';
|
373
|
+
//
|
374
|
+
//
|
375
|
+
|
376
|
+
// If the namespace has not been set (is undefined), try to read it out of the meta element.
|
377
|
+
// Otherwise use the globally defined namespace, even if it's empty ('')
|
378
|
+
var namespace = ( this.global.namespace === undefined ) ? $('.foundation-data-attribute-namespace').css('font-family') : this.global.namespace;
|
379
|
+
|
380
|
+
// Finally, if the namsepace is either undefined or false, set it to an empty string.
|
381
|
+
// Otherwise use the namespace value.
|
382
|
+
this.global.namespace = ( namespace === undefined || /false/i.test(namespace) ) ? '' : namespace;
|
383
|
+
},
|
384
|
+
|
385
|
+
libs : {},
|
386
|
+
|
387
|
+
// methods that can be inherited in libraries
|
388
|
+
utils : {
|
389
|
+
|
390
|
+
// Description:
|
391
|
+
// Fast Selector wrapper returns jQuery object. Only use where getElementById
|
392
|
+
// is not available.
|
393
|
+
//
|
394
|
+
// Arguments:
|
395
|
+
// Selector (String): CSS selector describing the element(s) to be
|
396
|
+
// returned as a jQuery object.
|
397
|
+
//
|
398
|
+
// Scope (String): CSS selector describing the area to be searched. Default
|
399
|
+
// is document.
|
400
|
+
//
|
401
|
+
// Returns:
|
402
|
+
// Element (jQuery Object): jQuery object containing elements matching the
|
403
|
+
// selector within the scope.
|
404
|
+
S : S,
|
405
|
+
|
406
|
+
// Description:
|
407
|
+
// Executes a function a max of once every n milliseconds
|
408
|
+
//
|
409
|
+
// Arguments:
|
410
|
+
// Func (Function): Function to be throttled.
|
411
|
+
//
|
412
|
+
// Delay (Integer): Function execution threshold in milliseconds.
|
413
|
+
//
|
414
|
+
// Returns:
|
415
|
+
// Lazy_function (Function): Function with throttling applied.
|
416
|
+
throttle : function (func, delay) {
|
417
|
+
var timer = null;
|
418
|
+
|
419
|
+
return function () {
|
420
|
+
var context = this, args = arguments;
|
421
|
+
|
422
|
+
if (timer == null) {
|
423
|
+
timer = setTimeout(function () {
|
424
|
+
func.apply(context, args);
|
425
|
+
timer = null;
|
426
|
+
}, delay);
|
427
|
+
}
|
428
|
+
};
|
429
|
+
},
|
430
|
+
|
431
|
+
// Description:
|
432
|
+
// Executes a function when it stops being invoked for n seconds
|
433
|
+
// Modified version of _.debounce() http://underscorejs.org
|
434
|
+
//
|
435
|
+
// Arguments:
|
436
|
+
// Func (Function): Function to be debounced.
|
437
|
+
//
|
438
|
+
// Delay (Integer): Function execution threshold in milliseconds.
|
439
|
+
//
|
440
|
+
// Immediate (Bool): Whether the function should be called at the beginning
|
441
|
+
// of the delay instead of the end. Default is false.
|
442
|
+
//
|
443
|
+
// Returns:
|
444
|
+
// Lazy_function (Function): Function with debouncing applied.
|
445
|
+
debounce : function (func, delay, immediate) {
|
446
|
+
var timeout, result;
|
447
|
+
return function () {
|
448
|
+
var context = this, args = arguments;
|
449
|
+
var later = function () {
|
450
|
+
timeout = null;
|
451
|
+
if (!immediate) result = func.apply(context, args);
|
452
|
+
};
|
453
|
+
var callNow = immediate && !timeout;
|
454
|
+
clearTimeout(timeout);
|
455
|
+
timeout = setTimeout(later, delay);
|
456
|
+
if (callNow) result = func.apply(context, args);
|
457
|
+
return result;
|
458
|
+
};
|
459
|
+
},
|
460
|
+
|
461
|
+
// Description:
|
462
|
+
// Parses data-options attribute
|
463
|
+
//
|
464
|
+
// Arguments:
|
465
|
+
// El (jQuery Object): Element to be parsed.
|
466
|
+
//
|
467
|
+
// Returns:
|
468
|
+
// Options (Javascript Object): Contents of the element's data-options
|
469
|
+
// attribute.
|
470
|
+
data_options : function (el, data_attr_name) {
|
471
|
+
data_attr_name = data_attr_name || 'options';
|
472
|
+
var opts = {}, ii, p, opts_arr,
|
473
|
+
data_options = function (el) {
|
474
|
+
var namespace = Foundation.global.namespace;
|
475
|
+
|
476
|
+
if (namespace.length > 0) {
|
477
|
+
return el.data(namespace + '-' + data_attr_name);
|
478
|
+
}
|
479
|
+
|
480
|
+
return el.data(data_attr_name);
|
481
|
+
};
|
482
|
+
|
483
|
+
var cached_options = data_options(el);
|
484
|
+
|
485
|
+
if (typeof cached_options === 'object') {
|
486
|
+
return cached_options;
|
487
|
+
}
|
488
|
+
|
489
|
+
opts_arr = (cached_options || ':').split(';');
|
490
|
+
ii = opts_arr.length;
|
491
|
+
|
492
|
+
function isNumber (o) {
|
493
|
+
return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true;
|
494
|
+
}
|
495
|
+
|
496
|
+
function trim (str) {
|
497
|
+
if (typeof str === 'string') return $.trim(str);
|
498
|
+
return str;
|
499
|
+
}
|
500
|
+
|
501
|
+
while (ii--) {
|
502
|
+
p = opts_arr[ii].split(':');
|
503
|
+
p = [p[0], p.slice(1).join(':')];
|
504
|
+
|
505
|
+
if (/true/i.test(p[1])) p[1] = true;
|
506
|
+
if (/false/i.test(p[1])) p[1] = false;
|
507
|
+
if (isNumber(p[1])) {
|
508
|
+
if (p[1].indexOf('.') === -1) {
|
509
|
+
p[1] = parseInt(p[1], 10);
|
510
|
+
} else {
|
511
|
+
p[1] = parseFloat(p[1]);
|
512
|
+
}
|
513
|
+
}
|
514
|
+
|
515
|
+
if (p.length === 2 && p[0].length > 0) {
|
516
|
+
opts[trim(p[0])] = trim(p[1]);
|
517
|
+
}
|
518
|
+
}
|
519
|
+
|
520
|
+
return opts;
|
521
|
+
},
|
522
|
+
|
523
|
+
// Description:
|
524
|
+
// Adds JS-recognizable media queries
|
525
|
+
//
|
526
|
+
// Arguments:
|
527
|
+
// Media (String): Key string for the media query to be stored as in
|
528
|
+
// Foundation.media_queries
|
529
|
+
//
|
530
|
+
// Class (String): Class name for the generated <meta> tag
|
531
|
+
register_media : function (media, media_class) {
|
532
|
+
if(Foundation.media_queries[media] === undefined) {
|
533
|
+
$('head').append('<meta class="' + media_class + '">');
|
534
|
+
Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
|
535
|
+
}
|
536
|
+
},
|
537
|
+
|
538
|
+
// Description:
|
539
|
+
// Add custom CSS within a JS-defined media query
|
540
|
+
//
|
541
|
+
// Arguments:
|
542
|
+
// Rule (String): CSS rule to be appended to the document.
|
543
|
+
//
|
544
|
+
// Media (String): Optional media query string for the CSS rule to be
|
545
|
+
// nested under.
|
546
|
+
add_custom_rule : function (rule, media) {
|
547
|
+
if (media === undefined && Foundation.stylesheet) {
|
548
|
+
Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length);
|
549
|
+
} else {
|
550
|
+
var query = Foundation.media_queries[media];
|
551
|
+
|
552
|
+
if (query !== undefined) {
|
553
|
+
Foundation.stylesheet.insertRule('@media ' +
|
554
|
+
Foundation.media_queries[media] + '{ ' + rule + ' }');
|
555
|
+
}
|
556
|
+
}
|
557
|
+
},
|
558
|
+
|
559
|
+
// Description:
|
560
|
+
// Performs a callback function when an image is fully loaded
|
561
|
+
//
|
562
|
+
// Arguments:
|
563
|
+
// Image (jQuery Object): Image(s) to check if loaded.
|
564
|
+
//
|
565
|
+
// Callback (Function): Function to execute when image is fully loaded.
|
566
|
+
image_loaded : function (images, callback) {
|
567
|
+
var self = this,
|
568
|
+
unloaded = images.length;
|
569
|
+
|
570
|
+
if (unloaded === 0) {
|
571
|
+
callback(images);
|
572
|
+
}
|
573
|
+
|
574
|
+
images.each(function () {
|
575
|
+
single_image_loaded(self.S(this), function () {
|
576
|
+
unloaded -= 1;
|
577
|
+
if (unloaded === 0) {
|
578
|
+
callback(images);
|
579
|
+
}
|
580
|
+
});
|
581
|
+
});
|
582
|
+
},
|
583
|
+
|
584
|
+
// Description:
|
585
|
+
// Returns a random, alphanumeric string
|
586
|
+
//
|
587
|
+
// Arguments:
|
588
|
+
// Length (Integer): Length of string to be generated. Defaults to random
|
589
|
+
// integer.
|
590
|
+
//
|
591
|
+
// Returns:
|
592
|
+
// Rand (String): Pseudo-random, alphanumeric string.
|
593
|
+
random_str : function () {
|
594
|
+
if (!this.fidx) this.fidx = 0;
|
595
|
+
this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-');
|
596
|
+
|
597
|
+
return this.prefix + (this.fidx++).toString(36);
|
598
|
+
}
|
599
|
+
}
|
600
|
+
};
|
601
|
+
|
602
|
+
$.fn.foundation = function () {
|
603
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
604
|
+
|
605
|
+
return this.each(function () {
|
606
|
+
Foundation.init.apply(Foundation, [this].concat(args));
|
607
|
+
return this;
|
608
|
+
});
|
609
|
+
};
|
610
|
+
|
611
|
+
}(jQuery, window, window.document));
|