Sha256: e37ee4ce0388c1b143dda465547b08ddc9157b0c7c5e239e609dbd66b0dba6a0

Contents?: true

Size: 1.06 KB

Versions: 38

Compression:

Stored size: 1.06 KB

Contents

module Inputs
  module EffectiveCkeditorTextArea
    class Input < Effective::FormInput
      delegate :content_tag, :text_area_tag, :asset_path, :to => :@template

      def default_input_js
        {
          effective_assets: defined?(EffectiveAssets).present?,
          effective_ckeditor_js_path: asset_path('effective_ckeditor.js'),
          effective_ckeditor_css_path: asset_path('effective_ckeditor.css'),
          contentsCss: (
            case options[:contentsCss]
            when :bootstrap
              'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'
            when false
              nil
            else
              options[:contentsCss] || asset_path('application.css')
            end
          ),
          toolbar: options[:toolbar],
          height: options[:height],
          width: options[:width]
        }.compact
      end

      def default_input_html
        {class: 'effective_ckeditor_text_area text'}
      end

      def to_html
        text_area_tag(field_name, value, tag_options)
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
effective_form_inputs-1.1.6 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.5 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.4 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.3 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.2 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.1 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.0 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.9 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.8 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.7 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.6 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.5 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.4 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.3 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.2 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.1 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.0.0 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-0.9.8 app/models/inputs/effective_ckeditor_text_area/input.rb