Sha256: 082b22a53d435f8d2a02e7d79ea6ce5e6d396f148a6448f308bb828f034d9e27

Contents?: true

Size: 1.64 KB

Versions: 28

Compression:

Stored size: 1.64 KB

Contents

# -*- encoding : utf-8 -*-
InlineForms::SPECIAL_COLUMN_TYPES[:text_area]=:text

def text_area_show(object, attribute)
  if defined? Ckeditor
    link_to_inline_edit object,
      attribute,
      '<div class="ckeditor_area">'.html_safe +
      cktext_area_tag(
      attribute,
      object[attribute],
      :id => "textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}",
      :ckeditor => {  :width => '100%',
                      :height => '200px',
                      :toolbar => "None",
                      :readOnly => "true",
                      :resize_enabled => "false",
                      :toolbarCanCollapse => "false"
                    }
    ) +
      image_tag(  'glass_plate.gif',
      :class => "glass_plate",
      :title => '' ) +
      "<script>delete CKEDITOR.instances['textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}']</script>".html_safe +
      '</div>'.html_safe
  else
    link_to_inline_edit object, attribute, object[attribute]
  end
end

def text_area_edit(object, attribute)
  if defined? Ckeditor
    cktext_area_tag(
      attribute,
      object[attribute],
      :id => "textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}",
      :ckeditor => {  :width => '100%',
                      :height => '200px'
                    }
    )  +
    "<script>delete CKEDITOR.instances['textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}']</script>".html_safe 
  else
    text_area_tag attribute, object[attribute], :class => 'attribute_text_area'
  end
end

def text_area_update(object, attribute)
  object[attribute.to_sym] = params[attribute.to_sym]
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
inline_forms-3.2.5 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.2.4 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.2.3 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.2.2 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.2.1 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.2.0 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.9 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.8 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.7 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.6 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.5 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.4 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.3 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.2 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.1 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.1.0 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.0.58 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.0.57 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.0.56 lib/app/helpers/form_elements/text_area.rb
inline_forms-3.0.55 lib/app/helpers/form_elements/text_area.rb