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.3.0 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.9 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.8 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.7 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.6 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.5 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.4 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.3 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.2 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.1 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.2.0 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.15 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.14 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.13 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.12 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.11 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.10 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.9 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.8 app/models/inputs/effective_ckeditor_text_area/input.rb
effective_form_inputs-1.1.7 app/models/inputs/effective_ckeditor_text_area/input.rb