Sha256: 9d673545050224b1252d8565cdc05c94bafbedfc012c4423f741eca9e51a45eb

Contents?: true

Size: 1.25 KB

Versions: 16

Compression:

Stored size: 1.25 KB

Contents

require "rails_admin_image_manager/rails_admin/config/fields/types/image_manager_picker"
require "rails_admin_image_manager/has_managed_file"
require "rails_admin_image_manager/engine"

module RailsAdminImageManager
  extend ActiveSupport::Autoload

  # configuration for picker
  mattr_accessor :placeholder_image
  @@placeholder_image = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" # a transparent pixel

  mattr_accessor :hidden_input
  @@hidden_input = true
  # end configuration for picker

  # Configuration defaults (these map directly to ckeditor settings)
  mattr_accessor :editor
  @@editor = {
    imageManagerBrowserUrl: '/admin/image_manager/',
  }
  # End configuration defaults

  mattr_accessor :paginates_per
  @@paginates_per = 15

  def self.options(overrides={})
    # merge in editor settings configured elsewhere

    base = {
      placeholder_image:  self.placeholder_image,
      hidden_input:       self.hidden_input,
      paginates_per:      self.paginates_per
    }
    editor_options = self.editor.merge(base)

    # merge in local overrides
    editor_options.merge!(overrides) if overrides

    editor_options
  end

end

ActiveSupport.on_load(:active_record) do
  extend RailsAdminImageManager::HasManagedFile
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rails_admin_image_manager-0.1.34 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.33 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.31 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.30 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.3 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.29 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.28 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.27 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.26 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.25 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.24 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.23 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.22 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.21 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.20 lib/rails_admin_image_manager.rb
rails_admin_image_manager-0.1.15 lib/rails_admin_image_manager.rb