Sha256: 7cf43380a1a1cb07e5b9476edd4e892d1c42337343883d5eb29f17f9abc35be6

Contents?: true

Size: 1.54 KB

Versions: 36

Compression:

Stored size: 1.54 KB

Contents

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

def ckeditor_show(object, attribute)
    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(  'inline_forms/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
end

def ckeditor_edit(object, attribute)
    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
end

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

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
inline_forms-6.2.14 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.12 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.11 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.10 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.9 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.7 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.6 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.5 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.4 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.3 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.2 app/helpers/form_elements/ckeditor.rb
inline_forms-6.2.1 app/helpers/form_elements/ckeditor.rb
inline_forms-6.1.1 app/helpers/form_elements/ckeditor.rb
inline_forms-6.1.0 app/helpers/form_elements/ckeditor.rb
inline_forms-6.0.8 app/helpers/form_elements/ckeditor.rb
inline_forms-6.0.7 app/helpers/form_elements/ckeditor.rb
inline_forms-6.0.6 app/helpers/form_elements/ckeditor.rb
inline_forms-6.0.5 app/helpers/form_elements/ckeditor.rb
inline_forms-6.0.4 app/helpers/form_elements/ckeditor.rb
inline_forms-6.0.3 app/helpers/form_elements/ckeditor.rb