Sha256: edd91c88e92ff4564f42ac2a4fe22c0edf0cca65d358f3e0acceed9ed2bdaa57

Contents?: true

Size: 808 Bytes

Versions: 8

Compression:

Stored size: 808 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 = ScrapedSite.find_by_id(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

8 entries across 8 versions & 1 rubygems

Version Path
pageflow-chart-2.1.0 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-2.0.0 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-1.2.0 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-1.1.0 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-1.0.1 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-1.0.0 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-0.2.2 app/helpers/pageflow/chart/scraped_sites_helper.rb
pageflow-chart-0.2.1 app/helpers/pageflow/chart/scraped_sites_helper.rb