Sha256: cff3cc31641609015901777b7090b62aba7799b750f15ee68611f8bc24c3cd8f

Contents?: true

Size: 817 Bytes

Versions: 2

Compression:

Stored size: 817 Bytes

Contents

module Pageflow
  module Chart
    module ScrapedSitesHelper
      IFRAME_ATTRIBUTES = {
        style: 'width: 100%; height: 100%',
        scrolling: 'auto',
        frameborder: '0',
        align: 'aus',
        allowfullscreen: 'true',
        mozallowfullscreen: 'true',
        webkitallowfullscreen: 'true'
      }

      def scraped_site_iframe(scraped_site_id)
        scraped_site = find_file_in_entry(ScrapedSite, scraped_site_id)
        data_attributes = {}

        if scraped_site
          data_attributes = {
            src: scraped_site.html_file_url
          }

          if scraped_site.use_custom_theme
            data_attributes[:use_custom_theme] = true
          end
        end

        content_tag(:iframe, '', IFRAME_ATTRIBUTES.merge(data: data_attributes))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pageflow-chart-2.3.0 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-2.2.0 app/helpers/pageflow/chart/scraped_sites_helper.rb