Sha256: d18c021f638e9d024c96a1ac4f1b54562376d6bddf0b5143d03084aee3b39889

Contents?: true

Size: 918 Bytes

Versions: 36

Compression:

Stored size: 918 Bytes

Contents

module Spotlight
  ##
  # JCrop options helpers
  module JcropHelper
    def default_masthead_jcrop_options
      {
        croppable: true,
        selector: 'masthead_image',
        bg_color: 'black',
        bg_opacity: '.4',
        aspect_ratio: 10,
        box_width: '600',
        initial_set_select: '[0, 0, 1800, 180]'
      }
    end

    def default_thumbnail_jcrop_options
      w, h = Spotlight::Engine.config.featured_image_thumb_size

      {
        croppable: true,
        selector: 'featuredimage_image',
        bg_color: 'black',
        bg_opacity: '.4',
        box_width: '600',
        aspect_ratio: w.to_f / h.to_f,
        initial_set_select: '[0, 0, 100000, 100000]'
      }
    end

    def default_site_thumbnail_jcrop_options
      w, h = Spotlight::Engine.config.featured_image_square_size

      default_thumbnail_jcrop_options.merge(aspect_ratio: w.to_f / h.to_f)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
blacklight-spotlight-0.32.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.31.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.30.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.29.1 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.29.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.28.3 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.28.2 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.28.1 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.28.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.27.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.26.1 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.26.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.25.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.24.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.23.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.22.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.21.0 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.20.3 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.20.2 app/helpers/spotlight/jcrop_helper.rb
blacklight-spotlight-0.20.1 app/helpers/spotlight/jcrop_helper.rb