workarea 3.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rubocop.yml +326 -0
- data/CHANGELOG.md +20501 -0
- data/README.md +163 -0
- data/docker-compose.yml +27 -0
- data/docs/Gemfile +8 -0
- data/docs/bin/middleman +29 -0
- data/docs/config.rb +87 -0
- data/docs/config.ru +7 -0
- data/docs/data/articles.yml +157 -0
- data/docs/package.json +15 -0
- data/docs/source/404.html.erb +13 -0
- data/docs/source/articles/access-routes-in-javascript.html.md +33 -0
- data/docs/source/articles/add-a-content-area.html.md +169 -0
- data/docs/source/articles/add-a-content-block-type.html.md +334 -0
- data/docs/source/articles/add-a-report.html.md +202 -0
- data/docs/source/articles/add-css-through-the-admin-ui.html.md +30 -0
- data/docs/source/articles/add-javascript-through-a-manifest.html.md +367 -0
- data/docs/source/articles/add-javascript-through-a-view.html.md +80 -0
- data/docs/source/articles/add-javascript-through-the-admin-ui.html.md +30 -0
- data/docs/source/articles/add-metrics.html.md +58 -0
- data/docs/source/articles/add-or-replace-a-pricing-calculator.html.md +150 -0
- data/docs/source/articles/add-remove-or-change-a-mongoid-validation.html.md +147 -0
- data/docs/source/articles/add-remove-or-change-a-product-template.html.md +142 -0
- data/docs/source/articles/add-remove-sort-and-group-storefront-search-filters.html.md +483 -0
- data/docs/source/articles/add-stylesheets-through-a-manifest.html.md +276 -0
- data/docs/source/articles/add-system-content.html.md +138 -0
- data/docs/source/articles/analytics-overview.html.md +51 -0
- data/docs/source/articles/analyze-storefront-search-results.html.md +261 -0
- data/docs/source/articles/api-overview.html.md +35 -0
- data/docs/source/articles/appending.html.md +506 -0
- data/docs/source/articles/application-document.html.md +88 -0
- data/docs/source/articles/automated-javascript-testing.html.md +162 -0
- data/docs/source/articles/b2b-overview.html.md +64 -0
- data/docs/source/articles/browser-and-device-support.html.md +47 -0
- data/docs/source/articles/change-product-placeholder-image.html.md +39 -0
- data/docs/source/articles/change-storefront-search-results.html.md +283 -0
- data/docs/source/articles/change-the-storefront-product-pricing-ui.html.md +348 -0
- data/docs/source/articles/change-the-storefront-search-filters-ui.html.md +103 -0
- data/docs/source/articles/checkout.html.md +479 -0
- data/docs/source/articles/commerce-model.html.md +164 -0
- data/docs/source/articles/configuration-for-hosting.html.md +106 -0
- data/docs/source/articles/configuration.html.md +406 -0
- data/docs/source/articles/configure-a-payment-gateway.html.md +58 -0
- data/docs/source/articles/configure-asset-storage.html.md +29 -0
- data/docs/source/articles/configure-asset-types.html.md +18 -0
- data/docs/source/articles/configure-contact-form-subjects-list.html.md +24 -0
- data/docs/source/articles/configure-imageoptim.html.md +23 -0
- data/docs/source/articles/configure-locales.html.md +45 -0
- data/docs/source/articles/configure-logins-and-authentication.html.md +42 -0
- data/docs/source/articles/configure-low-inventory-threshold.html.md +26 -0
- data/docs/source/articles/configure-product-image-sizes-and-processing.html.md +28 -0
- data/docs/source/articles/content.html.md +554 -0
- data/docs/source/articles/contentable.html.md +41 -0
- data/docs/source/articles/contribute-code.html.md +69 -0
- data/docs/source/articles/contribute-documentation.html.md +60 -0
- data/docs/source/articles/create-a-custom-discount.html.md +234 -0
- data/docs/source/articles/create-a-new-app.html.md +131 -0
- data/docs/source/articles/create-a-plugin.html.md +19 -0
- data/docs/source/articles/create-a-style-guide.html.md +71 -0
- data/docs/source/articles/create-a-theme.html.md +134 -0
- data/docs/source/articles/css-architectural-overview.html.md +89 -0
- data/docs/source/articles/customize-a-helper.html.md +91 -0
- data/docs/source/articles/decoration.html.md +415 -0
- data/docs/source/articles/define-and-configure-inventory-policies.html.md +107 -0
- data/docs/source/articles/documentation-style-guide.html.md +48 -0
- data/docs/source/articles/documentation.html.md +54 -0
- data/docs/source/articles/domain-modeling.html.md +82 -0
- data/docs/source/articles/error-pages.html.md.erb +95 -0
- data/docs/source/articles/extension-overview.html.md +152 -0
- data/docs/source/articles/favicon-support.html.md +112 -0
- data/docs/source/articles/feature-spec-helper-stylesheet.html.md +25 -0
- data/docs/source/articles/featurejs-and-feature-spec-helper.html.md +20 -0
- data/docs/source/articles/help-and-support.html.md +34 -0
- data/docs/source/articles/html-fragment-caching.html.md +46 -0
- data/docs/source/articles/http-caching.html.md +43 -0
- data/docs/source/articles/i18n.html.md +35 -0
- data/docs/source/articles/images-flow.html.md +10 -0
- data/docs/source/articles/index-storefront-search-documents.html.md +104 -0
- data/docs/source/articles/infrastructure.html.md +46 -0
- data/docs/source/articles/installing.html.md +61 -0
- data/docs/source/articles/integrate-a-payment-gateway.html.md +124 -0
- data/docs/source/articles/integrate-a-web-analytics-provider.html.md +35 -0
- data/docs/source/articles/integrate-an-inventory-management-system.html.md +88 -0
- data/docs/source/articles/integrating-with-other-software.html.md +59 -0
- data/docs/source/articles/inventory.html.md +352 -0
- data/docs/source/articles/javascript-coding-standards.html.md +30 -0
- data/docs/source/articles/javascript-modules.html.md +174 -0
- data/docs/source/articles/javascript-overview.html.md +62 -0
- data/docs/source/articles/javascript-reference-documentation.html.md +51 -0
- data/docs/source/articles/javascript-templates.html.md +52 -0
- data/docs/source/articles/low-level-caching.html.md +25 -0
- data/docs/source/articles/maintain-a-plugin.html.md +12 -0
- data/docs/source/articles/maintenance-policy.html.md +79 -0
- data/docs/source/articles/navigable.html.md +51 -0
- data/docs/source/articles/navigating-the-code.html.md +149 -0
- data/docs/source/articles/navigation.html.md +386 -0
- data/docs/source/articles/order-life-cycle.html.md +546 -0
- data/docs/source/articles/order-pricing.html.md +389 -0
- data/docs/source/articles/orders-and-items.html.md +210 -0
- data/docs/source/articles/orders.html.md +66 -0
- data/docs/source/articles/overriding.html.md +155 -0
- data/docs/source/articles/overview.html.md +43 -0
- data/docs/source/articles/plugins-overview.html.md +12 -0
- data/docs/source/articles/prerequisites-and-dependencies.html.md +202 -0
- data/docs/source/articles/products.html.md.erb +1270 -0
- data/docs/source/articles/progressive-web-application-support.html.md +148 -0
- data/docs/source/articles/rails-asset-manifests.html.md +33 -0
- data/docs/source/articles/rails-asset-view-helpers.html.md +25 -0
- data/docs/source/articles/reading-data.html.md +10 -0
- data/docs/source/articles/releasable.html.md +37 -0
- data/docs/source/articles/report-a-bug.html.md +75 -0
- data/docs/source/articles/ruby-coding-standards.html.md +10 -0
- data/docs/source/articles/run-sidekiq-in-a-local-environment.html.md +40 -0
- data/docs/source/articles/searching.html.md +1005 -0
- data/docs/source/articles/security-policy.html.md +42 -0
- data/docs/source/articles/seeds.html.md +345 -0
- data/docs/source/articles/shipping.html.md +756 -0
- data/docs/source/articles/sort-and-exclude-product-options.html.md +47 -0
- data/docs/source/articles/storefront-search-features.html.md +568 -0
- data/docs/source/articles/storefront-searches.html.md +126 -0
- data/docs/source/articles/style-guides.html.md +21 -0
- data/docs/source/articles/stylesheet-coding-standards.html.md +24 -0
- data/docs/source/articles/stylesheets-overview.html.md +67 -0
- data/docs/source/articles/swappable-list-data-structure.html.md +81 -0
- data/docs/source/articles/system-emails.html.md +102 -0
- data/docs/source/articles/taggable.html.md +8 -0
- data/docs/source/articles/test-a-credit-card-transaction.html.md +16 -0
- data/docs/source/articles/test-if-a-plugin-is-installed.html.md +34 -0
- data/docs/source/articles/testing.html.md +914 -0
- data/docs/source/articles/themes-overview.html.md +155 -0
- data/docs/source/articles/translate-administrable-content.html.md +14 -0
- data/docs/source/articles/translate-javascript-content.html.md +16 -0
- data/docs/source/articles/translate-or-customize-message-content.html.md +29 -0
- data/docs/source/articles/translate-or-customize-static-content.html.md +30 -0
- data/docs/source/articles/use-an-existing-workarea-app.html.md +108 -0
- data/docs/source/articles/view-models.html.md +509 -0
- data/docs/source/articles/views.html.md +14 -0
- data/docs/source/articles/workers.html.md +613 -0
- data/docs/source/articles/writing-data.html.md +10 -0
- data/docs/source/cli.html.md +163 -0
- data/docs/source/favicon.ico +0 -0
- data/docs/source/images/3-variants-1-option.png +0 -0
- data/docs/source/images/3-variants-3-options.png +0 -0
- data/docs/source/images/3-years-primary-image.png +0 -0
- data/docs/source/images/404-storefront-error-page.png +0 -0
- data/docs/source/images/404-system-content-admin.png +0 -0
- data/docs/source/images/404.jpg +0 -0
- data/docs/source/images/5-years-primary-image.png +0 -0
- data/docs/source/images/activity-dashboard.png +0 -0
- data/docs/source/images/activity-for-object.png +0 -0
- data/docs/source/images/activity-ui.png +0 -0
- data/docs/source/images/adding-captioned-image-block-custom-icon.png +0 -0
- data/docs/source/images/adding-captioned-image-block-default-icon.png +0 -0
- data/docs/source/images/admin-alerts-ui.png +0 -0
- data/docs/source/images/admin-category-range-filters.png +0 -0
- data/docs/source/images/admin-for-3-column-hero.png +0 -0
- data/docs/source/images/admin-help-index.png +0 -0
- data/docs/source/images/admin-help-ui.png +0 -0
- data/docs/source/images/admin-javascript.png +0 -0
- data/docs/source/images/admin-notification-for-deactivated-discount.png +0 -0
- data/docs/source/images/admin-notifications-ui.png +0 -0
- data/docs/source/images/admin-product-show-page.png +0 -0
- data/docs/source/images/admin-products-index-page.png +0 -0
- data/docs/source/images/admin-range-filters.png +0 -0
- data/docs/source/images/admin-style-guides-navigation.png +0 -0
- data/docs/source/images/after-re-seeding.png +0 -0
- data/docs/source/images/after-seeding-localhost-3000.png +0 -0
- data/docs/source/images/after-seeding.png +0 -0
- data/docs/source/images/arrow.svg +1 -0
- data/docs/source/images/arrow_white.svg +1 -0
- data/docs/source/images/aws-resource-map.png +0 -0
- data/docs/source/images/backordered-until-output-on-inventory-sku-card.png +0 -0
- data/docs/source/images/before-seeding-localhost-3000.png +0 -0
- data/docs/source/images/before-seeding.png +0 -0
- data/docs/source/images/browsing-workarea-versions-on-the-web.png +0 -0
- data/docs/source/images/bulk-asset-upload-on-assets-index-page.png +0 -0
- data/docs/source/images/bulk-asset-upload-while-editing-content.png +0 -0
- data/docs/source/images/bundle-show-workarea-core.png +0 -0
- data/docs/source/images/bundle-show-workarea.png +0 -0
- data/docs/source/images/calendar-for-backordered-until-field.png +0 -0
- data/docs/source/images/captioned-image-block-in-storefront.png +0 -0
- data/docs/source/images/captioned-image-content-block-storefront-component-style-guide.png +0 -0
- data/docs/source/images/cart-system-content-in-admin.png +0 -0
- data/docs/source/images/cart-system-content-in-storefront.png +0 -0
- data/docs/source/images/checkout-addresses-guest.png +0 -0
- data/docs/source/images/checkout-addresses-user.png +0 -0
- data/docs/source/images/checkout-confirmation.png +0 -0
- data/docs/source/images/checkout-flow-0.png +0 -0
- data/docs/source/images/checkout-flow-1.png +0 -0
- data/docs/source/images/checkout-flow-2.png +0 -0
- data/docs/source/images/checkout-flow-3.png +0 -0
- data/docs/source/images/checkout-flow-4.png +0 -0
- data/docs/source/images/checkout-payment-guest.png +0 -0
- data/docs/source/images/checkout-payment-user.png +0 -0
- data/docs/source/images/checkout-shipping.png +0 -0
- data/docs/source/images/color-picker-component-admin-style-guide.png +0 -0
- data/docs/source/images/color-picker-component-on-content-editing-screen.png +0 -0
- data/docs/source/images/commerce-model-carts-orders.png +0 -0
- data/docs/source/images/commerce-model-order-pricing.png +0 -0
- data/docs/source/images/commerce-model.png +0 -0
- data/docs/source/images/configuring-an-index-pattern-in-kibana.png +0 -0
- data/docs/source/images/content-block-presets.png +0 -0
- data/docs/source/images/content-search-customization.png +0 -0
- data/docs/source/images/country-with-region-data-in-address-form.png +0 -0
- data/docs/source/images/country-without-region-data-in-address-form.png +0 -0
- data/docs/source/images/create-content-block-preset-ui.png +0 -0
- data/docs/source/images/credit-card-icons.png +0 -0
- data/docs/source/images/css-added-through-admin.png +0 -0
- data/docs/source/images/css-admin-ui.png +0 -0
- data/docs/source/images/current-configuration-shown-in-admin-settings.png +0 -0
- data/docs/source/images/customer-impersonation-in-admin.png +0 -0
- data/docs/source/images/customer-impersonation-in-store-front.png +0 -0
- data/docs/source/images/date-filter-same-day.png +0 -0
- data/docs/source/images/developer-toolbar-in-store-front.png +0 -0
- data/docs/source/images/discounts-sorted-by-most-redeemed.png +0 -0
- data/docs/source/images/edit-help-article.png +0 -0
- data/docs/source/images/editing-content-for-search-customization.png +0 -0
- data/docs/source/images/editing-dynamic-captioned-image-block.png +0 -0
- data/docs/source/images/editing-product-fields-in-the-admin.png +0 -0
- data/docs/source/images/editing-search-system-content.png +0 -0
- data/docs/source/images/editing-static-captioned-image-block-custom-icon.png +0 -0
- data/docs/source/images/editing-static-captioned-image-block-default-icon.png +0 -0
- data/docs/source/images/external.svg +1 -0
- data/docs/source/images/favicon_16.png +0 -0
- data/docs/source/images/favicon_180.png +0 -0
- data/docs/source/images/favicon_32.png +0 -0
- data/docs/source/images/filters-all.png +0 -0
- data/docs/source/images/filters-control.png +0 -0
- data/docs/source/images/filters-custom.png +0 -0
- data/docs/source/images/filters-groups.png +0 -0
- data/docs/source/images/filters-material.png +0 -0
- data/docs/source/images/filters-omitted.png +0 -0
- data/docs/source/images/filters-pinned.png +0 -0
- data/docs/source/images/filters-range.png +0 -0
- data/docs/source/images/filters-sorted.png +0 -0
- data/docs/source/images/filters-wrapping-to-second-line-in-admin.png +0 -0
- data/docs/source/images/generic-product-template-images-no-options-selected.png +0 -0
- data/docs/source/images/generic-product-template-images-options-selected.png +0 -0
- data/docs/source/images/generic-template.png +0 -0
- data/docs/source/images/hosting.svg +1 -0
- data/docs/source/images/image-group-content-block-in-storefront.png +0 -0
- data/docs/source/images/images.svg +1 -0
- data/docs/source/images/import-export-screenshot.png +0 -0
- data/docs/source/images/invalid-display.png +0 -0
- data/docs/source/images/itcss.png +0 -0
- data/docs/source/images/kibana-dev-tools-console.png +0 -0
- data/docs/source/images/layout-content-admin-with-2-areas.png +0 -0
- data/docs/source/images/layout-content-admin-with-3-areas.png +0 -0
- data/docs/source/images/link-to-search-system-content.png +0 -0
- data/docs/source/images/logo.svg +1 -0
- data/docs/source/images/menu.svg +2 -0
- data/docs/source/images/mongo-replica-set.svg +1 -0
- data/docs/source/images/multi-column-hero-blocks.png +0 -0
- data/docs/source/images/option-selects-product-template-images-options-selected.png +0 -0
- data/docs/source/images/option-selects-template.png +0 -0
- data/docs/source/images/option-thumbnails-template.png +0 -0
- data/docs/source/images/order-item-total-price-diagram.png +0 -0
- data/docs/source/images/order-pricing-cart-example.png +0 -0
- data/docs/source/images/order-pricing-example-adjustments.png +0 -0
- data/docs/source/images/order-pricing-example-totals.png +0 -0
- data/docs/source/images/order-pricing-placed-order-example.png +0 -0
- data/docs/source/images/order-shipping-total-diagram.png +0 -0
- data/docs/source/images/order-show-with-multiple-tenders.png +0 -0
- data/docs/source/images/order-subtotal-price-diagram.png +0 -0
- data/docs/source/images/order-tax-total-diagram.png +0 -0
- data/docs/source/images/order-total-price-diagram.png +0 -0
- data/docs/source/images/order-total-value-diagram.png +0 -0
- data/docs/source/images/orders-dashboard-links.png +0 -0
- data/docs/source/images/oval.svg +1 -0
- data/docs/source/images/payment-icon-storefront-style-guide.png +0 -0
- data/docs/source/images/people-dashboard-links.png +0 -0
- data/docs/source/images/price-adjustments-diagram.png +0 -0
- data/docs/source/images/price-display-no-options.png +0 -0
- data/docs/source/images/price-display-options-selected.png +0 -0
- data/docs/source/images/pricing-calculators-diagram.png +0 -0
- data/docs/source/images/product-list-content-block-admin.png +0 -0
- data/docs/source/images/product-list-content-block-in-store-front.png +0 -0
- data/docs/source/images/promo-products-excluded-autocomplete-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-featured-category-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-recommendations-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-search-category-results-after.png +0 -0
- data/docs/source/images/promo-products-excluded-search-results-after.png +0 -0
- data/docs/source/images/promo-products-included-autocomplete-results-before.png +0 -0
- data/docs/source/images/promo-products-included-featured-category-results-before.png +0 -0
- data/docs/source/images/promo-products-included-recommendations-results-before.png +0 -0
- data/docs/source/images/promo-products-included-search-category-results-before.png +0 -0
- data/docs/source/images/promo-products-included-search-results-before.png +0 -0
- data/docs/source/images/rails-version-constraint.png +0 -0
- data/docs/source/images/re-enable-discount.png +0 -0
- data/docs/source/images/reading-data.svg +1 -0
- data/docs/source/images/readme-hero.png +0 -0
- data/docs/source/images/redesigned-customized-sort-for-search-results.png +0 -0
- data/docs/source/images/reviews-summary-above-share-buttons.png +0 -0
- data/docs/source/images/reviews-summary-below-product-name.png +0 -0
- data/docs/source/images/reviews-summary-below-share-buttons.png +0 -0
- data/docs/source/images/reviews-summary-removed.png +0 -0
- data/docs/source/images/rsa-fingerprint-for-stash.png +0 -0
- data/docs/source/images/ruby-version-constraint.png +0 -0
- data/docs/source/images/script-tag-added-through-admin.png +0 -0
- data/docs/source/images/search-analysis-admin-alternate-rendering.png +0 -0
- data/docs/source/images/search-analysis-admin.png +0 -0
- data/docs/source/images/search-quality-report.png +0 -0
- data/docs/source/images/search.svg +1 -0
- data/docs/source/images/searching-for-cart-system-content-in-admin.png +0 -0
- data/docs/source/images/searching-for-layout-system-content-in-admin.png +0 -0
- data/docs/source/images/seeded-admin.png +0 -0
- data/docs/source/images/seeds-from-plugins.png +0 -0
- data/docs/source/images/seo-metadata-automation-ui.png +0 -0
- data/docs/source/images/show-password-button.png +0 -0
- data/docs/source/images/storefront-autocomplete.png +0 -0
- data/docs/source/images/storefront-category-summary-content-block.png +0 -0
- data/docs/source/images/storefront-category.png +0 -0
- data/docs/source/images/storefront-product-after-overriding.png +0 -0
- data/docs/source/images/storefront-product-before-overriding.png +0 -0
- data/docs/source/images/storefront-product-browse-page.png +0 -0
- data/docs/source/images/storefront-product-recommendations.png +0 -0
- data/docs/source/images/storefront-product-show-page.png +0 -0
- data/docs/source/images/storefront-requests-and-search-requests.png +0 -0
- data/docs/source/images/storefront-search-request-handling.png +0 -0
- data/docs/source/images/storefront-search-response-creation.png +0 -0
- data/docs/source/images/storefront-search.png +0 -0
- data/docs/source/images/storefront-style-guides-navigation.png +0 -0
- data/docs/source/images/styles.css +3 -0
- data/docs/source/images/tax-categories-ui.png +0 -0
- data/docs/source/images/tax-rates-ui.png +0 -0
- data/docs/source/images/unpurchasable-product.png +0 -0
- data/docs/source/images/url-redirects-filtering.png +0 -0
- data/docs/source/images/utility-nav-area-in-admin.png +0 -0
- data/docs/source/images/utility-nav-area-in-storefront.png +0 -0
- data/docs/source/images/validation-message-in-storefront.png +0 -0
- data/docs/source/images/view-model-interface.png +0 -0
- data/docs/source/images/viewing-workarea-version-in-source.png +0 -0
- data/docs/source/images/workarea.svg +1 -0
- data/docs/source/images/worst-performing-searches-on-results-customization-page.png +0 -0
- data/docs/source/images/writing-data.svg +1 -0
- data/docs/source/index.html.erb +167 -0
- data/docs/source/javascripts/jquery.js +2 -0
- data/docs/source/javascripts/lunr.js +7 -0
- data/docs/source/javascripts/site.js +299 -0
- data/docs/source/javascripts/vendor/highlight.pack.js +2 -0
- data/docs/source/layouts/article.erb +106 -0
- data/docs/source/layouts/bare.erb +46 -0
- data/docs/source/layouts/layout.erb +43 -0
- data/docs/source/release-notes.html.md +258 -0
- data/docs/source/release-notes/workarea-3-0-0.html.md +146 -0
- data/docs/source/release-notes/workarea-3-0-1.html.md +161 -0
- data/docs/source/release-notes/workarea-3-0-10.html.md +39 -0
- data/docs/source/release-notes/workarea-3-0-11.html.md +277 -0
- data/docs/source/release-notes/workarea-3-0-12.html.md +14 -0
- data/docs/source/release-notes/workarea-3-0-13.html.md +153 -0
- data/docs/source/release-notes/workarea-3-0-14.html.md +93 -0
- data/docs/source/release-notes/workarea-3-0-15.html.md +107 -0
- data/docs/source/release-notes/workarea-3-0-16.html.md +36 -0
- data/docs/source/release-notes/workarea-3-0-17.html.md +141 -0
- data/docs/source/release-notes/workarea-3-0-18.html.md +123 -0
- data/docs/source/release-notes/workarea-3-0-19.html.md +160 -0
- data/docs/source/release-notes/workarea-3-0-2.html.md +222 -0
- data/docs/source/release-notes/workarea-3-0-20.html.md +95 -0
- data/docs/source/release-notes/workarea-3-0-21.html.md +168 -0
- data/docs/source/release-notes/workarea-3-0-22.html.md +268 -0
- data/docs/source/release-notes/workarea-3-0-23.html.md +173 -0
- data/docs/source/release-notes/workarea-3-0-24.html.md +19 -0
- data/docs/source/release-notes/workarea-3-0-25.html.md +26 -0
- data/docs/source/release-notes/workarea-3-0-26.html.md +199 -0
- data/docs/source/release-notes/workarea-3-0-27.html.md +113 -0
- data/docs/source/release-notes/workarea-3-0-28.html.md +39 -0
- data/docs/source/release-notes/workarea-3-0-29.html.md +73 -0
- data/docs/source/release-notes/workarea-3-0-3.html.md +35 -0
- data/docs/source/release-notes/workarea-3-0-30.html.md +186 -0
- data/docs/source/release-notes/workarea-3-0-31.html.md +125 -0
- data/docs/source/release-notes/workarea-3-0-32.html.md +73 -0
- data/docs/source/release-notes/workarea-3-0-33.html.md +137 -0
- data/docs/source/release-notes/workarea-3-0-34.html.md +203 -0
- data/docs/source/release-notes/workarea-3-0-35.html.md +205 -0
- data/docs/source/release-notes/workarea-3-0-36.html.md +105 -0
- data/docs/source/release-notes/workarea-3-0-37.html.md +144 -0
- data/docs/source/release-notes/workarea-3-0-38.html.md +73 -0
- data/docs/source/release-notes/workarea-3-0-39.html.md +77 -0
- data/docs/source/release-notes/workarea-3-0-4.html.md +14 -0
- data/docs/source/release-notes/workarea-3-0-40.html.md +130 -0
- data/docs/source/release-notes/workarea-3-0-41.html.md +70 -0
- data/docs/source/release-notes/workarea-3-0-42.html.md +52 -0
- data/docs/source/release-notes/workarea-3-0-43.html.md +72 -0
- data/docs/source/release-notes/workarea-3-0-44.html.md +93 -0
- data/docs/source/release-notes/workarea-3-0-45.html.md +61 -0
- data/docs/source/release-notes/workarea-3-0-46.html.md +171 -0
- data/docs/source/release-notes/workarea-3-0-47.html.md +130 -0
- data/docs/source/release-notes/workarea-3-0-48.html.md +160 -0
- data/docs/source/release-notes/workarea-3-0-49.html.md +28 -0
- data/docs/source/release-notes/workarea-3-0-5.html.md +225 -0
- data/docs/source/release-notes/workarea-3-0-50.html.md +74 -0
- data/docs/source/release-notes/workarea-3-0-51.html.md +61 -0
- data/docs/source/release-notes/workarea-3-0-52.html.md +76 -0
- data/docs/source/release-notes/workarea-3-0-53.html.md +126 -0
- data/docs/source/release-notes/workarea-3-0-54.html.md +112 -0
- data/docs/source/release-notes/workarea-3-0-55.html.md +105 -0
- data/docs/source/release-notes/workarea-3-0-56.html.md +56 -0
- data/docs/source/release-notes/workarea-3-0-57.html.md +82 -0
- data/docs/source/release-notes/workarea-3-0-58.html.md +153 -0
- data/docs/source/release-notes/workarea-3-0-59.html.md +78 -0
- data/docs/source/release-notes/workarea-3-0-6.html.md +165 -0
- data/docs/source/release-notes/workarea-3-0-60.html.md +43 -0
- data/docs/source/release-notes/workarea-3-0-61.html.md +46 -0
- data/docs/source/release-notes/workarea-3-0-62.html.md +23 -0
- data/docs/source/release-notes/workarea-3-0-63.html.md +25 -0
- data/docs/source/release-notes/workarea-3-0-64.html.md +25 -0
- data/docs/source/release-notes/workarea-3-0-65.html.md +37 -0
- data/docs/source/release-notes/workarea-3-0-7.html.md +207 -0
- data/docs/source/release-notes/workarea-3-0-8.html.md +337 -0
- data/docs/source/release-notes/workarea-3-0-9.html.md +196 -0
- data/docs/source/release-notes/workarea-3-1-0.html.md +414 -0
- data/docs/source/release-notes/workarea-3-1-1.html.md +139 -0
- data/docs/source/release-notes/workarea-3-1-10.html.md +19 -0
- data/docs/source/release-notes/workarea-3-1-11.html.md +27 -0
- data/docs/source/release-notes/workarea-3-1-12.html.md +216 -0
- data/docs/source/release-notes/workarea-3-1-13.html.md +113 -0
- data/docs/source/release-notes/workarea-3-1-14.html.md +39 -0
- data/docs/source/release-notes/workarea-3-1-15.html.md +107 -0
- data/docs/source/release-notes/workarea-3-1-16.html.md +188 -0
- data/docs/source/release-notes/workarea-3-1-17.html.md +141 -0
- data/docs/source/release-notes/workarea-3-1-18.html.md +73 -0
- data/docs/source/release-notes/workarea-3-1-19.html.md +137 -0
- data/docs/source/release-notes/workarea-3-1-2.html.md +55 -0
- data/docs/source/release-notes/workarea-3-1-20.html.md +203 -0
- data/docs/source/release-notes/workarea-3-1-21.html.md +205 -0
- data/docs/source/release-notes/workarea-3-1-22.html.md +121 -0
- data/docs/source/release-notes/workarea-3-1-23.html.md +144 -0
- data/docs/source/release-notes/workarea-3-1-24.html.md +94 -0
- data/docs/source/release-notes/workarea-3-1-25.html.md +77 -0
- data/docs/source/release-notes/workarea-3-1-26.html.md +130 -0
- data/docs/source/release-notes/workarea-3-1-27.html.md +70 -0
- data/docs/source/release-notes/workarea-3-1-28.html.md +52 -0
- data/docs/source/release-notes/workarea-3-1-29.html.md +44 -0
- data/docs/source/release-notes/workarea-3-1-3.html.md +185 -0
- data/docs/source/release-notes/workarea-3-1-30.html.md +72 -0
- data/docs/source/release-notes/workarea-3-1-31.html.md +93 -0
- data/docs/source/release-notes/workarea-3-1-32.html.md +61 -0
- data/docs/source/release-notes/workarea-3-1-33.html.md +171 -0
- data/docs/source/release-notes/workarea-3-1-34.html.md +130 -0
- data/docs/source/release-notes/workarea-3-1-35.html.md +179 -0
- data/docs/source/release-notes/workarea-3-1-36.html.md +28 -0
- data/docs/source/release-notes/workarea-3-1-37.html.md +74 -0
- data/docs/source/release-notes/workarea-3-1-38.html.md +61 -0
- data/docs/source/release-notes/workarea-3-1-39.html.md +96 -0
- data/docs/source/release-notes/workarea-3-1-4.html.md +148 -0
- data/docs/source/release-notes/workarea-3-1-40.html.md +126 -0
- data/docs/source/release-notes/workarea-3-1-41.html.md +128 -0
- data/docs/source/release-notes/workarea-3-1-42.html.md +105 -0
- data/docs/source/release-notes/workarea-3-1-43.html.md +37 -0
- data/docs/source/release-notes/workarea-3-1-44.html.md +82 -0
- data/docs/source/release-notes/workarea-3-1-45.html.md +153 -0
- data/docs/source/release-notes/workarea-3-1-46.html.md +91 -0
- data/docs/source/release-notes/workarea-3-1-47.html.md +65 -0
- data/docs/source/release-notes/workarea-3-1-48.html.md +46 -0
- data/docs/source/release-notes/workarea-3-1-49.html.md +23 -0
- data/docs/source/release-notes/workarea-3-1-5.html.md +169 -0
- data/docs/source/release-notes/workarea-3-1-50.html.md +42 -0
- data/docs/source/release-notes/workarea-3-1-51.html.md +25 -0
- data/docs/source/release-notes/workarea-3-1-52.html.md +57 -0
- data/docs/source/release-notes/workarea-3-1-6.html.md +117 -0
- data/docs/source/release-notes/workarea-3-1-7.html.md +176 -0
- data/docs/source/release-notes/workarea-3-1-8.html.md +283 -0
- data/docs/source/release-notes/workarea-3-1-9.html.md +212 -0
- data/docs/source/release-notes/workarea-3-2-0.html.md +1705 -0
- data/docs/source/release-notes/workarea-3-2-1.html.md +216 -0
- data/docs/source/release-notes/workarea-3-2-10.html.md +237 -0
- data/docs/source/release-notes/workarea-3-2-11.html.md +121 -0
- data/docs/source/release-notes/workarea-3-2-12.html.md +145 -0
- data/docs/source/release-notes/workarea-3-2-13.html.md +138 -0
- data/docs/source/release-notes/workarea-3-2-14.html.md +77 -0
- data/docs/source/release-notes/workarea-3-2-15.html.md +130 -0
- data/docs/source/release-notes/workarea-3-2-16.html.md +111 -0
- data/docs/source/release-notes/workarea-3-2-17.html.md +52 -0
- data/docs/source/release-notes/workarea-3-2-18.html.md +44 -0
- data/docs/source/release-notes/workarea-3-2-19.html.md +72 -0
- data/docs/source/release-notes/workarea-3-2-2.html.md +145 -0
- data/docs/source/release-notes/workarea-3-2-20.html.md +93 -0
- data/docs/source/release-notes/workarea-3-2-21.html.md +61 -0
- data/docs/source/release-notes/workarea-3-2-22.html.md +154 -0
- data/docs/source/release-notes/workarea-3-2-23.html.md +130 -0
- data/docs/source/release-notes/workarea-3-2-24.html.md +200 -0
- data/docs/source/release-notes/workarea-3-2-25.html.md +28 -0
- data/docs/source/release-notes/workarea-3-2-26.html.md +94 -0
- data/docs/source/release-notes/workarea-3-2-27.html.md +61 -0
- data/docs/source/release-notes/workarea-3-2-28.html.md +96 -0
- data/docs/source/release-notes/workarea-3-2-29.html.md +126 -0
- data/docs/source/release-notes/workarea-3-2-30.html.md +112 -0
- data/docs/source/release-notes/workarea-3-2-31.html.md +105 -0
- data/docs/source/release-notes/workarea-3-2-32.html.md +56 -0
- data/docs/source/release-notes/workarea-3-2-33.html.md +82 -0
- data/docs/source/release-notes/workarea-3-2-34.html.md +153 -0
- data/docs/source/release-notes/workarea-3-2-35.html.md +91 -0
- data/docs/source/release-notes/workarea-3-2-36.html.md +118 -0
- data/docs/source/release-notes/workarea-3-2-37.html.md +46 -0
- data/docs/source/release-notes/workarea-3-2-38.html.md +23 -0
- data/docs/source/release-notes/workarea-3-2-39.html.md +42 -0
- data/docs/source/release-notes/workarea-3-2-4.html.md +109 -0
- data/docs/source/release-notes/workarea-3-2-40.html.md +25 -0
- data/docs/source/release-notes/workarea-3-2-41.html.md +90 -0
- data/docs/source/release-notes/workarea-3-2-5.html.md +186 -0
- data/docs/source/release-notes/workarea-3-2-6.html.md +173 -0
- data/docs/source/release-notes/workarea-3-2-7.html.md +89 -0
- data/docs/source/release-notes/workarea-3-2-8.html.md +137 -0
- data/docs/source/release-notes/workarea-3-2-9.html.md +219 -0
- data/docs/source/release-notes/workarea-3-3-0.html.md +1272 -0
- data/docs/source/release-notes/workarea-3-3-1.html.md +324 -0
- data/docs/source/release-notes/workarea-3-3-10.html.md +69 -0
- data/docs/source/release-notes/workarea-3-3-11.html.md +72 -0
- data/docs/source/release-notes/workarea-3-3-12.html.md +136 -0
- data/docs/source/release-notes/workarea-3-3-13.html.md +61 -0
- data/docs/source/release-notes/workarea-3-3-14.html.md +196 -0
- data/docs/source/release-notes/workarea-3-3-15.html.md +167 -0
- data/docs/source/release-notes/workarea-3-3-16.html.md +234 -0
- data/docs/source/release-notes/workarea-3-3-17.html.md +82 -0
- data/docs/source/release-notes/workarea-3-3-18.html.md +165 -0
- data/docs/source/release-notes/workarea-3-3-19.html.md +106 -0
- data/docs/source/release-notes/workarea-3-3-2.html.md +72 -0
- data/docs/source/release-notes/workarea-3-3-20.html.md +116 -0
- data/docs/source/release-notes/workarea-3-3-21.html.md +228 -0
- data/docs/source/release-notes/workarea-3-3-22.html.md +125 -0
- data/docs/source/release-notes/workarea-3-3-23.html.md +154 -0
- data/docs/source/release-notes/workarea-3-3-24.html.md +70 -0
- data/docs/source/release-notes/workarea-3-3-25.html.md +114 -0
- data/docs/source/release-notes/workarea-3-3-26.html.md +260 -0
- data/docs/source/release-notes/workarea-3-3-27.html.md +138 -0
- data/docs/source/release-notes/workarea-3-3-28.html.md +147 -0
- data/docs/source/release-notes/workarea-3-3-29.html.md +63 -0
- data/docs/source/release-notes/workarea-3-3-3.html.md +153 -0
- data/docs/source/release-notes/workarea-3-3-30.html.md +102 -0
- data/docs/source/release-notes/workarea-3-3-31.html.md +57 -0
- data/docs/source/release-notes/workarea-3-3-32.html.md +44 -0
- data/docs/source/release-notes/workarea-3-3-33.html.md +114 -0
- data/docs/source/release-notes/workarea-3-3-4.html.md +332 -0
- data/docs/source/release-notes/workarea-3-3-5.html.md +242 -0
- data/docs/source/release-notes/workarea-3-3-6.html.md +100 -0
- data/docs/source/release-notes/workarea-3-3-7.html.md +148 -0
- data/docs/source/release-notes/workarea-3-3-8.html.md +163 -0
- data/docs/source/release-notes/workarea-3-3-9.html.md +93 -0
- data/docs/source/release-notes/workarea-3-4-0.html.md +580 -0
- data/docs/source/release-notes/workarea-3-4-1.html.md +150 -0
- data/docs/source/release-notes/workarea-3-4-10.html.md +72 -0
- data/docs/source/release-notes/workarea-3-4-11.html.md +60 -0
- data/docs/source/release-notes/workarea-3-4-12.html.md +155 -0
- data/docs/source/release-notes/workarea-3-4-2.html.md +188 -0
- data/docs/source/release-notes/workarea-3-4-3.html.md +136 -0
- data/docs/source/release-notes/workarea-3-4-4.html.md +114 -0
- data/docs/source/release-notes/workarea-3-4-5.html.md +275 -0
- data/docs/source/release-notes/workarea-3-4-6.html.md +169 -0
- data/docs/source/release-notes/workarea-3-4-7.html.md +162 -0
- data/docs/source/release-notes/workarea-3-4-8.html.md +95 -0
- data/docs/source/release-notes/workarea-3-4-9.html.md +135 -0
- data/docs/source/search.html.erb +34 -0
- data/docs/source/shared/_header.erb +61 -0
- data/docs/source/shared/_svgs.erb +17 -0
- data/docs/source/style_guide/index.html.erb +382 -0
- data/docs/source/stylesheets/_base.scss +125 -0
- data/docs/source/stylesheets/_components.scss +669 -0
- data/docs/source/stylesheets/_helpers.scss +10 -0
- data/docs/source/stylesheets/_opinions.scss +42 -0
- data/docs/source/stylesheets/_settings.scss +56 -0
- data/docs/source/stylesheets/_typography.scss +119 -0
- data/docs/source/stylesheets/site.css.scss +14 -0
- data/docs/source/stylesheets/vendor/_avalanche.scss +328 -0
- data/docs/source/stylesheets/vendor/_normalize.scss +341 -0
- data/docs/source/stylesheets/vendor/highlight/_tomorrow_night_blue.scss +75 -0
- data/docs/source/upgrade-guides.html.md +18 -0
- data/docs/source/upgrade-guides/workarea-3-4-0.html.md +152 -0
- data/docs/workarea_renderer.rb +8 -0
- data/docs/yarn.lock +2522 -0
- metadata +669 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
title: JavaScript Coding Standards
|
3
|
+
excerpt: In addition to using a standard module structure, modules generally follow the coding style of Douglas Crockford.
|
4
|
+
---
|
5
|
+
|
6
|
+
# JavaScript Coding Standards
|
7
|
+
|
8
|
+
In addition to using a standard module structure, modules generally follow the [coding style of Douglas Crockford](http://javascript.crockford.com/code.html).
|
9
|
+
|
10
|
+
To enforce code style rules, we use [ESLint](http://eslint.org/).
|
11
|
+
|
12
|
+
```
|
13
|
+
npm install -g eslint
|
14
|
+
```
|
15
|
+
|
16
|
+
Each Workarea gem includes a `.eslintrc` file to configure ESLint. The following rules are also observed:
|
17
|
+
|
18
|
+
- Unless unavoidable, do not use the keyword `this`. Functions passed to jQuery's `on` and `each` methods include parameters that provide access to relevent DOM elements and data, so `this` is almost never required in Workarea modules. Avoid jQuery iteration methods that do not pass the current element as an argument to the iterator, such as the function form of `.attr`. Use `.each` instead.
|
19
|
+
- When chaining methods across multiple lines, indent/outdent only when the return value changes.
|
20
|
+
```
|
21
|
+
$('.product-form')
|
22
|
+
.find('fieldset')
|
23
|
+
.first()
|
24
|
+
.attr('id', 'first')
|
25
|
+
.end()
|
26
|
+
.end()
|
27
|
+
.attr('id', 'cart-form')
|
28
|
+
.serializeArray();
|
29
|
+
```
|
30
|
+
|
@@ -0,0 +1,174 @@
|
|
1
|
+
---
|
2
|
+
title: JavaScript Modules
|
3
|
+
excerpt: Workarea JavaScript modules are used to solve the problems of code organization and asynchronous initialization. First let's look at the issue of code organization so I can explain what I mean by "module".
|
4
|
+
---
|
5
|
+
|
6
|
+
# JavaScript Modules
|
7
|
+
|
8
|
+
Workarea JavaScript modules are used to solve the problems of code organization and asynchronous initialization. First let's look at the issue of code organization so I can explain what I mean by "module".
|
9
|
+
|
10
|
+
## Organizing Code
|
11
|
+
|
12
|
+
JavaScript modules in the Workarea platform are simply named objects registered via `WORKAREA.registerModule`. Each module acts as a namespace for a collection of related functions. To create a module, start with an object. In the example below, I've assigned the object to a variable.
|
13
|
+
|
14
|
+
```
|
15
|
+
var obj = {
|
16
|
+
doSomething: function () {
|
17
|
+
// code to do something
|
18
|
+
},
|
19
|
+
doSomethingElse: function () {
|
20
|
+
// code to do somethinf else
|
21
|
+
}
|
22
|
+
};
|
23
|
+
```
|
24
|
+
|
25
|
+
To make this object a module, simply register it, giving it a name in the process. The name must be a valid JavaScript identifier.
|
26
|
+
|
27
|
+
```
|
28
|
+
WORKAREA.registerModule('demoModule', obj);
|
29
|
+
```
|
30
|
+
|
31
|
+
You can now access the module's methods using `WORKAREA.demoModule`.
|
32
|
+
|
33
|
+
```
|
34
|
+
WORKAREA.demoModule.doSomething();
|
35
|
+
WORKAREA.demoModule.doSomethingElse();
|
36
|
+
```
|
37
|
+
|
38
|
+
**Note:** Module names are guaranteed to be unique. If you try to register another module with the same name, an error will be thrown.
|
39
|
+
|
40
|
+
### Module Patterns
|
41
|
+
|
42
|
+
In practice, modules are not created using the pattern shown above. Instead, a function is created and immediatedly invoked to return the object passed to `WORKAREA.registerModule`. This allows you to program within the body of a function rather than within the body of an object but still return an object in the end.
|
43
|
+
|
44
|
+
```
|
45
|
+
WORKAREA.registerModule('demoModule', (function () {
|
46
|
+
var doSomething = function () {
|
47
|
+
// code to do something
|
48
|
+
},
|
49
|
+
|
50
|
+
doSomethingElse = function () {
|
51
|
+
// code to do something else
|
52
|
+
};
|
53
|
+
|
54
|
+
return {
|
55
|
+
doSomething: doSomething,
|
56
|
+
doSomethingElse: doSomethingElse
|
57
|
+
};
|
58
|
+
}()));
|
59
|
+
```
|
60
|
+
|
61
|
+
A secondary benefit of this pattern is private methods. The returned object includes only the methods that are considered public.
|
62
|
+
|
63
|
+
```
|
64
|
+
WORKAREA.registerModule('demoModule', (function () {
|
65
|
+
var doSomethingPrivately = function () {
|
66
|
+
// code to do something privately
|
67
|
+
},
|
68
|
+
|
69
|
+
doSomethingElsePrivately = function () {
|
70
|
+
// code to do something else privately
|
71
|
+
},
|
72
|
+
|
73
|
+
doSomething = function () {
|
74
|
+
// code to do something that may invoke
|
75
|
+
// doSomethingPrivately()
|
76
|
+
// or
|
77
|
+
// doSomethingElsePrivately()
|
78
|
+
},
|
79
|
+
|
80
|
+
doSomethingElse = function () {
|
81
|
+
// code to do something else that may invoke
|
82
|
+
// doSomethingPrivately()
|
83
|
+
// or
|
84
|
+
// doSomethingElsePrivately()
|
85
|
+
};
|
86
|
+
|
87
|
+
return {
|
88
|
+
doSomething: doSomething,
|
89
|
+
doSomethingElse: doSomethingElse
|
90
|
+
};
|
91
|
+
}()));
|
92
|
+
```
|
93
|
+
|
94
|
+
```
|
95
|
+
WORKAREA.demoModule.doSomething(); // does something
|
96
|
+
WORKAREA.demoModule.doSomethingElse(); // does something else
|
97
|
+
WORKAREA.demoModule.doSomethingPrivately(); // undefined (private)
|
98
|
+
WORKAREA.demoModule.doSomethingElsePrivately(); // undefined (private)
|
99
|
+
```
|
100
|
+
|
101
|
+
### Method Naming Conventions
|
102
|
+
|
103
|
+
Public module methods generally fall into 2 categories: utilities and DOM manipulations. Utilities are methods like `WORKAREA.url.parse` that transform input into output and generally have no interaction with the DOM. On the other hand, **modules that manipulate the DOM always include a public method named `init` which is responsible for querying the DOM for the relevant elements**. This convention is important to ensure proper module initialization, which I explain next.
|
104
|
+
|
105
|
+
## Initializing Code
|
106
|
+
|
107
|
+
The 2nd problem modules address is code initialization, specifically asynchronous initialization. But first let's look at synchronous initialization.
|
108
|
+
|
109
|
+
The [application manifest](add-javascript-through-a-manifest.html) uses `require_asset` to load each JavaScript module into memory. At that point, each method on each module is defined, but none have yet been invoked. The manifest concludes by invoking a single JavaScript method:
|
110
|
+
|
111
|
+
```
|
112
|
+
WORKAREA.initModules($(document));
|
113
|
+
```
|
114
|
+
|
115
|
+
`WORKAREA.initModules` enumerates each registered module, in the order in which they were registered (the order in which they are included in the manifest) and invokes each module's `init` method if it has one. `$(document)`, the argument passed to `WORKAREA.initModules` is passed through to each module's `init` method when it is invoked.
|
116
|
+
|
117
|
+
This is the first time in the application that `WORKAREA.initModules` is called and the only time that it is called with a reference to the entire document as its argument. It may get called many more times before the page is reloaded, so **modules must be written to run multiple times and must be aware of their current scope**. The current scope is a DOM reference passed as an argument, which is covered next.
|
118
|
+
|
119
|
+
### Module Scope
|
120
|
+
|
121
|
+
**Scope is the most important concept in the Workarea module system.** It's easiest to explain scope through an example. Consider a module that implements the following methods:
|
122
|
+
|
123
|
+
```
|
124
|
+
var updateProductDetails = function (event) {
|
125
|
+
// asynchronously request a new DOM fragment with up to date
|
126
|
+
// product details and replace the current page's product
|
127
|
+
// details fragment with the new one
|
128
|
+
},
|
129
|
+
|
130
|
+
init = function ($scope) {
|
131
|
+
$('.change-color-button', $scope).on('click', updateProductDetails);
|
132
|
+
};
|
133
|
+
```
|
134
|
+
|
135
|
+
As explained above, the application manifest will invoke this module's `init` method, passing `$(document)` as the argument named `$scope`. The `init` method queries within `$scope`, in this case the entire document, for elements matching the selector `.change-color-button` and attaches a click handler to each. When clicked, the `updateProductDetails` method, shown above, is invoked.
|
136
|
+
|
137
|
+
So every change-color button has now been wired up with a click handler to replace the product details. Now the user clicks one of them. An ajax request is made to fetch new product details HTML and that HTML replaces the old product details HTML on the current page. However, the new HTML includes some change-color buttons and they don't have the click handler attached because they weren't present when modules were initialized the first time around. Same goes for the product zoom and any other JavaScript functionality that's supposed to happen within the new product details.
|
138
|
+
|
139
|
+
To fix this, the `updateProductDetails` method must call `WORKAREA.initModules` and pass in the new HTML as the `$scope` so that **modules are initialized again, but only within the new fragment that was added to the DOM**. It is important to not re-init modules on any part of the DOM other than the new fragment to avoid bugs from double event bindings and similar issues.
|
140
|
+
|
141
|
+
```
|
142
|
+
var updateProductDetails = function (event) {
|
143
|
+
// asynchronously request a new DOM fragment with up to date
|
144
|
+
// product details and replace the current page's product
|
145
|
+
// details fragment with the new one. store the new DOM
|
146
|
+
// fragment in the variable $newProductDetails for reference
|
147
|
+
|
148
|
+
WORKAREA.initModules($newProductDetails);
|
149
|
+
},
|
150
|
+
|
151
|
+
init = function ($scope) {
|
152
|
+
$('.change-color-button', $scope).on('click', updateProductDetails);
|
153
|
+
};
|
154
|
+
```
|
155
|
+
|
156
|
+
**Every init function must therefore accept a `$scope` argument and must always limit its DOM queries to within that scope.**
|
157
|
+
|
158
|
+
**Note:** Code that should run only once (like attaching a resize handler to `window`) should generally be run outside of an init function since init functions may be invoked multiple times. If the code must be run inside an init function (to test for a specific element within `$scope`, for example), programatically restrict the function to run only once using something like `_.once`.
|
159
|
+
|
160
|
+
## Customizing a Module
|
161
|
+
|
162
|
+
To customize an existing module you must [override](overriding.html) it, essentially making a copy of it in your application.
|
163
|
+
|
164
|
+
## Creating a Module
|
165
|
+
|
166
|
+
To create a new module, run the workarea:js\_module Rails generator within your application. This will generate the file and the module boilerplate, which you can then customize to taste.
|
167
|
+
|
168
|
+
Run the generator without any arguments to display its documentation.
|
169
|
+
|
170
|
+
```
|
171
|
+
cd path/to/your_app
|
172
|
+
bin/rails g workarea:js_module
|
173
|
+
```
|
174
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
title: JavaScript Overview
|
3
|
+
excerpt: A new Workarea application includes no JavaScript of its own. Create one to see for yourself. However, the Workarea platform adds an Admin and a Storefront to the application, and each of those includes its own JavaScript files that are fully custom
|
4
|
+
---
|
5
|
+
|
6
|
+
# JavaScript Overview
|
7
|
+
|
8
|
+
A new Workarea application includes no JavaScript of its own. [Create one to see for yourself](create-a-new-app.html). However, the Workarea platform adds an Admin and a Storefront to the application, and each of those includes its own JavaScript files that are fully customizable.
|
9
|
+
|
10
|
+
This guide provides an overview of (1) how to get JavaScript on the page and (2) understanding JavaScript provided by Workarea.
|
11
|
+
|
12
|
+
## Getting JavaScript on the Page
|
13
|
+
|
14
|
+
Looking at the Storefront of a vanilla Workarea app (no customizations or plugins) in production, there are exactly 3 `script` elements, 2 in the `head` and 1 in the `body`.
|
15
|
+
|
16
|
+
The first in the head looks something like this:
|
17
|
+
|
18
|
+
```
|
19
|
+
<script type="text/javascript">window.NREUM /*...*/</script>
|
20
|
+
```
|
21
|
+
|
22
|
+
You won't see this code anywhere in the application. It's injected into the page by the New Relic APM agent to capture and report analytics back to [New Relic](http://newrelic.com/). This code is added at the middleware level and may vary based on your hosting arrangement.
|
23
|
+
|
24
|
+
The next `script` tag in the head looks something like this:
|
25
|
+
|
26
|
+
```
|
27
|
+
<script src="https://vanilla-app-production-workarea.cdn-ssl.com/assets/workarea/storefront/head-041c56bdb2104549c9bf5779d5de6892ca91d665a94417092f8233ea460689da.js"></script>
|
28
|
+
```
|
29
|
+
|
30
|
+
And the one in the body looks something like this:
|
31
|
+
|
32
|
+
```
|
33
|
+
<script src="https://vanilla-app-production-workarea.cdn-ssl.com/assets/workarea/storefront/application-2c3748f10d7452eaa5d2572fabc099650b49f8a372d0cc69c414aaeaf16ae62a.js"></script>
|
34
|
+
```
|
35
|
+
|
36
|
+
If you take the time to scroll horizontally (or look below), you'll see the file names are:
|
37
|
+
|
38
|
+
`head-041c56bdb2104549c9bf5779d5de6892ca91d665a94417092f8233ea460689da.js`
|
39
|
+
|
40
|
+
And:
|
41
|
+
|
42
|
+
`application-2c3748f10d7452eaa5d2572fabc099650b49f8a372d0cc69c414aaeaf16ae62a.js`
|
43
|
+
|
44
|
+
**These are the head and application JavaScript manifests, the primary mechanisms for adding and removing JavaScript files in your app**. Unless you have a good reason to do otherwise, **[Add and remove JavaScripts using a manifest](add-javascript-through-a-manifest.html)**. Not familiar with asset manifests? [I've got you covered](add-javascript-through-a-manifest.html).
|
45
|
+
|
46
|
+
So what if you do have a good reason to do otherwise? Then you can [add JavaScript through a view](add-javascript-through-a-view.html) or [add JavaScript through the Admin UI](add-javascript-through-the-admin-ui.html).
|
47
|
+
|
48
|
+
Plugins can add their own assets to your app as well, so check out [Appending](appending.html) to take control of that process.
|
49
|
+
|
50
|
+
## The JavaScript Universe According to Workarea
|
51
|
+
|
52
|
+
To understand the JavaScript provided by Workarea you should familiarize yourself with [Workarea modules](javascript-modules.html) and [JST/EJS templates](javascript-templates.html).
|
53
|
+
|
54
|
+
Also good to know are how to [access Rails routes in JavaScript](access-routes-in-javascript.html) and how to [configure JavaScript](configuration.html).
|
55
|
+
|
56
|
+
Regarding JavaScript dependencies, Feature.js behaves a bit differently than the others, and Workarea also has a feature test helper file that interacts with Feature.js. Those topics are covered in the cleverly named [Feature.js & Feature Test Helper](featurejs-and-feature-spec-helper.html) guide.
|
57
|
+
|
58
|
+
## Some Last Words on JavaScript
|
59
|
+
|
60
|
+
Lastly, [JavaScript reference documentation](javascript-reference-documentation.html) is available, which covers each of the public functions and their signatures.
|
61
|
+
|
62
|
+
If you'd care to [contribute](contribute-code.html) code back to the platform, or if you obsess over code style, check out the Workarea [JavaScript coding standards](javascript-coding-standards.html).
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
title: JavaScript Reference Documentation
|
3
|
+
excerpt: Workarea JavaScripts are documented with JSDoc comments. You can generate HTML documentation (among other formats) using a variety of tools designed to parse JSDoc comments, including the jsdoc tool itself.
|
4
|
+
---
|
5
|
+
|
6
|
+
# JavaScript Reference Documentation
|
7
|
+
|
8
|
+
Workarea JavaScripts are documented with [JSDoc](http://usejsdoc.org/) comments. You can generate HTML documentation (among other formats) using a variety of tools designed to parse JSDoc comments, including the `jsdoc` tool itself.
|
9
|
+
|
10
|
+
## Installing JSDoc
|
11
|
+
|
12
|
+
Install `jsdoc` or a similar tool using [npm](https://www.npmjs.com/).
|
13
|
+
|
14
|
+
```
|
15
|
+
npm install -g jsdoc
|
16
|
+
```
|
17
|
+
|
18
|
+
## Generating Documentation for Installed Gems
|
19
|
+
|
20
|
+
Create a directory for the generated documentation within your application.
|
21
|
+
|
22
|
+
```
|
23
|
+
cd path/to/your_app
|
24
|
+
mkdir docs
|
25
|
+
```
|
26
|
+
|
27
|
+
The following commands will generate the JavaScript reference documentation for workarea-core, workarea-admin, and workarea-storefront and place them within subdirectories of `/docs`, which was created above.
|
28
|
+
|
29
|
+
```
|
30
|
+
cd path/to/your_app
|
31
|
+
bundle
|
32
|
+
jsdoc `bundle show workarea-core` -r -d ./docs/workarea-core-javascript-reference
|
33
|
+
jsdoc `bundle show workarea-admin` -r -d ./docs/workarea-admin-javascript-reference
|
34
|
+
jsdoc `bundle show workarea-storefront` -r -d ./docs/workarea-store-front-javascript-reference
|
35
|
+
```
|
36
|
+
|
37
|
+
## Viewing Documentation
|
38
|
+
|
39
|
+
The commands above generate static HTML files. Open `index.html` to browser the documentation.
|
40
|
+
|
41
|
+
```
|
42
|
+
open docs/workarea-core-javascript-reference/index.html
|
43
|
+
```
|
44
|
+
|
45
|
+
**Note:** Avoid using undocumented Workarea functions and properties. They should be considered private and unstable.
|
46
|
+
|
47
|
+
Use similar commands to generate documentation for any Workarea plugins or additional gems.
|
48
|
+
|
49
|
+
**Note:** You may want to commit the documentation files into your application's code repository to save your teammates the trouble of generating their own documentation. Conversly, you may want to instruct your version control system to ignore these directories to force developers to generate fresh documentation each time.
|
50
|
+
|
51
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
title: JavaScript Templates
|
3
|
+
excerpt: Templates are client-side view files used to generate HTML strings for use within modules.
|
4
|
+
---
|
5
|
+
|
6
|
+
# JavaScript Templates
|
7
|
+
|
8
|
+
Templates are client-side view files used to generate HTML strings for use within modules.
|
9
|
+
|
10
|
+
Template files end in the extensions `.jst.ejs`. Each file is processed on the server by the [ruby-ejs gem](https://github.com/sstephenson/ruby-ejs) and delivered to the browser as a function. The following is a simple template that expects `name` and `value` to be passed in.
|
11
|
+
|
12
|
+
```
|
13
|
+
<input type="hidden" name="<%= name %>" value="<%= value %>">
|
14
|
+
```
|
15
|
+
|
16
|
+
Each template function is available via the global `JST` object in the browser. Each property of `JST` corresponds to the path of a template file. To render the HTML string, execute the template function, passing in an object of data to be used by the template.
|
17
|
+
|
18
|
+
```
|
19
|
+
JST['workarea/storefront/templates/hidden_input']({name: 'Foo', value: 'Bar'})
|
20
|
+
```
|
21
|
+
|
22
|
+
Which returns:
|
23
|
+
|
24
|
+
```
|
25
|
+
<input type="hidden" name="Foo" value="Bar">
|
26
|
+
```
|
27
|
+
|
28
|
+
## Using Rails Helpers in JST Templates
|
29
|
+
|
30
|
+
It's possible to access Rails Helpers in your templates as well. A good example of this is the `inline_svg` helper, which processes an SVG and outputs its contents into the page, rather than rendering it as an image.
|
31
|
+
|
32
|
+
To access rails helpers in your template, add a `.ruby` extension to the end of your `.jst.ejs` chain.
|
33
|
+
|
34
|
+
The Workarea platform uses the `inline_svg` Rails helper for the Admin's WYSIWYG editor's toolbar icons, loaded in `wysiwyg_toolbar.jst.ejs.ruby`:
|
35
|
+
|
36
|
+
```
|
37
|
+
%Q{
|
38
|
+
|
39
|
+
...
|
40
|
+
|
41
|
+
<a class='wysiwyg__toolbar-button' data-wysihtml-command='bold'>
|
42
|
+
#{ inline_svg('workarea/admin/icons/wysiwyg/bold.svg', class: 'wysiwyg__toolbar-button-icon svg-icon', title: I18n.t('workarea.admin.js.wysiwyg.bold')) }
|
43
|
+
</a>
|
44
|
+
|
45
|
+
...
|
46
|
+
|
47
|
+
}
|
48
|
+
```
|
49
|
+
|
50
|
+
The `%Q` command in the first line wraps the entire template, making sure that the output is stringified. Next, because of the way the Asset Pipeline works, all Ruby code is evaluated. This means that the string interpolation will be picked up next, outputting the result of `inline_svg` as a string.
|
51
|
+
|
52
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
title: Low-Level Caching
|
3
|
+
excerpt: Certain slow or frequently running queries or processing are cached from the classes defining them. The Workarea system follows the Rails convention in how this is handled.
|
4
|
+
---
|
5
|
+
|
6
|
+
# Low-Level Caching
|
7
|
+
|
8
|
+
Certain slow or frequently running queries or processing are cached from the classes defining them. The Workarea system follows the Rails convention in how this is handled.
|
9
|
+
|
10
|
+
core/app/models/workarea/shipping/service.rb:
|
11
|
+
|
12
|
+
```
|
13
|
+
def self.cache
|
14
|
+
Rails.cache.fetch('shipping_services_cache', expires_in: Workarea.config.cache_expirations.shipping_services) do
|
15
|
+
Shipping::Service.all.to_a
|
16
|
+
end
|
17
|
+
end
|
18
|
+
```
|
19
|
+
|
20
|
+
The work to be cached is placed inside a call to the `Rails.cache`. Like the fragment caching in the views, if the cache store does not have a fresh cache, the block is executed and the result is cached.
|
21
|
+
|
22
|
+
## Resources on Low-Level Caching
|
23
|
+
|
24
|
+
- [Rails Guide: Low-Level Caching](http://guides.rubyonrails.org/caching_with_rails.html#low-level-caching)
|
25
|
+
- [Heroku: Low-Level Caching](https://devcenter.heroku.com/articles/caching-strategies#low-level-caching)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
title: Maintain a Plugin
|
3
|
+
excerpt: If you've created a plugin for your team to re-use across projects or to share with other teams, you will want to maintain the plugin to respond to bug reports and keep the plugin in sync with supported versions of the Workarea platform. While how you
|
4
|
+
---
|
5
|
+
|
6
|
+
# Maintain a Plugin
|
7
|
+
|
8
|
+
If you've created a plugin for your team to re-use across projects or to share with other teams, you will want to maintain the plugin to respond to bug reports and keep the plugin in sync with supported versions of the Workarea platform. While how you do this is up to you, you may want to model your workflow after the plugins maintained by the Workarea core team.
|
9
|
+
|
10
|
+
Core team plugins generally follow [Semantic Versioning](http://semver.org/) to determine how many releases to do and the type of releases. The first public release of a plugin is 0.1.0 or 1.0.0. From there, bugs are fixed in patch releases (e.g. 0.1.1) features are added or changed in minor releases (e.g. 0.2.0). Version 1.0.0 should be released when the plugin's API is considered stable. Version 2.0.0 (and subsequent major releases) would introduce breaking API changes.
|
11
|
+
|
12
|
+
Long living git branches exist that correspond to version numbers, as explained in the [contributing guide](contribute-code.html). Work is completed in topic branches and then merged into these long living branches once approved.
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
title: Maintenance Policy
|
3
|
+
created_at: 2019/05/21
|
4
|
+
excerpt: Learn how we version our software and what to expect in each release.
|
5
|
+
---
|
6
|
+
|
7
|
+
Workarea bases its releases on a shifted version of [semver](http://semver.org/) and handles its releases very similarly to [the way Rails handles its versioning](https://guides.rubyonrails.org/maintenance_policy.html).
|
8
|
+
|
9
|
+
# Semver Overview
|
10
|
+
|
11
|
+
Support for Workarea is divided into four groups: New features, bug fixes, security issues, and severe security issues. They are handled as follows, all versions in __X.Y.Z__ format:
|
12
|
+
|
13
|
+
__Patch Z__
|
14
|
+
|
15
|
+
Only bug fixes, no API changes, no new features. Except as necessary for security fixes. Typically a patch is released every 2 weeks.
|
16
|
+
|
17
|
+
__Minor Y__
|
18
|
+
|
19
|
+
New features, may contain API changes (Serve as major versions of Semver). Breaking changes are paired with deprecation notices in the previous minor or major release where applicable. Typically a minor is released every quarter.
|
20
|
+
|
21
|
+
__Major X__
|
22
|
+
|
23
|
+
New features, will likely contain API changes. The difference between minor and major releases is the magnitude of breaking changes.
|
24
|
+
|
25
|
+
# Release Overview
|
26
|
+
|
27
|
+
## New Features
|
28
|
+
|
29
|
+
New features are only added to the `master` branch and will not be made available in point releases.
|
30
|
+
|
31
|
+
## Bug Fixes
|
32
|
+
|
33
|
+
The current major release series and its minors will recieve bug fixes. When a new major is released, the previous major release will recieve support that will eventually dwindle within a reasonable amount of time. Bugs are fixed in the oldest branch where they are found. Before a release each branch is merged downstream so that each release contains the fix.
|
34
|
+
|
35
|
+
Series currently supported and branches from which fixes are released:
|
36
|
+
|
37
|
+
* v3.0.Z from `v3.0-stable`
|
38
|
+
* v3.1.Z from `v3.1-stable`
|
39
|
+
* v3.2.Z from `v3.2-stable`
|
40
|
+
* v3.3.Z from `v3.3-stable`
|
41
|
+
* v3.4.Z from `v3.4-stable`
|
42
|
+
|
43
|
+
## Security Issues
|
44
|
+
|
45
|
+
The current major release series and its minors will recieve security fixes. When a new major is released, the previous major release will recieve support that will eventually dwindle within a reasonable amount of time. Bugs are fixed in the oldest branch where they are found. Before a release each branch is merged downstream so that each release contains the fix. Patches containing security issues are released as soon as possible.
|
46
|
+
|
47
|
+
Series currently supported and branches from which fixes are released:
|
48
|
+
|
49
|
+
* v3.0.Z from `v3.0-stable`
|
50
|
+
* v3.1.Z from `v3.1-stable`
|
51
|
+
* v3.2.Z from `v3.2-stable`
|
52
|
+
* v3.3.Z from `v3.3-stable`
|
53
|
+
* v3.4.Z from `v3.4-stable`
|
54
|
+
|
55
|
+
## Severe Security Issues
|
56
|
+
|
57
|
+
The current major release series and its minors will recieve severe security fixes. When a new major is released, the previous major release will recieve support that will eventually dwindle within a reasonable amount of time. Bugs are fixed in the oldest branch where they are found. Before a release each branch is merged downstream so that each release contains the fix. Patches containing severe security issues are released as soon as possible.
|
58
|
+
|
59
|
+
Series currently supported and branches from which fixes are released:
|
60
|
+
|
61
|
+
* v3.0.Z from `v3.0-stable`
|
62
|
+
* v3.1.Z from `v3.1-stable`
|
63
|
+
* v3.2.Z from `v3.2-stable`
|
64
|
+
* v3.3.Z from `v3.3-stable`
|
65
|
+
* v3.4.Z from `v3.4-stable`
|
66
|
+
|
67
|
+
## Unsupported Release Series
|
68
|
+
|
69
|
+
When a release series is no longer supported, it's your own responsibility to deal with bugs and security issues. We may provide backports of the fixes and publish them to git, however there will be no new versions released. If you are not comfortable maintaining your own versions, you should upgrade to a supported version.
|
70
|
+
|
71
|
+
# Feedback
|
72
|
+
|
73
|
+
You're encouraged to help improve the quality of this guide.
|
74
|
+
|
75
|
+
Please contribute if you see any typos or factual errors. To get started, you can read our [documentation contributions section](/articles/contribute-documentation.html).
|
76
|
+
|
77
|
+
Branches containing documentation fixes should originate from the latest stable branch for the current minor version.
|
78
|
+
|
79
|
+
If for whatever reason you spot something to fix but cannot patch it yourself, please open an issue.
|