Sha256: afb788b63e9f327705ecfccf4f9acf903c3b984caafe8bdf30b670affac8de86

Contents?: true

Size: 1003 Bytes

Versions: 3

Compression:

Stored size: 1003 Bytes

Contents

module Workarea
  should_append_video_api_modules = proc do
    if Plugin.javascripts_appends["storefront.modules"].nil?
      true
    else
      Plugin.javascripts_appends["storefront.modules"].none? { |append| %r{/modules/youtube_api} =~ append }
    end
  end

  Plugin.append_partials(
    "admin.catalog_product_cards",
    "workarea/admin/catalog_products/product_videos_card"
  )

  Plugin.append_partials(
    "storefront.product_description",
    "workarea/storefront/products/video_link"
  )

  Plugin.append_partials(
    "storefront.product_details_alt_images",
    "workarea/storefront/products/video_thumbnail"
  )

  if should_append_video_api_modules.call
    Plugin.append_javascripts(
      "storefront.modules",
      "workarea/storefront/product_videos/modules/youtube_api",
      "workarea/storefront/product_videos/modules/vimeo_api"
    )
  end

  Plugin.append_stylesheets(
    "storefront.components",
    "workarea/storefront/product_videos/components/product_video",
  )
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-product_videos-1.3.0 config/initializers/appends.rb
workarea-product_videos-1.2.3 config/initializers/appends.rb
workarea-product_videos-1.2.2 config/initializers/appends.rb