class UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField

Create a MarkdownEditorField

This element is an extend of UiBibz::Ui::Core::Component.

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Signatures

UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new(content, options = {}, html_options = {}).render

UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new(options = {}, html_options = {}) do
  content
end.render

Examples

UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new('search', prepend: 'Prepend content', append: 'Append content', class: 'test')

UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new(prepend: glyph('pencil'), append: glyph('camera-retro')) do
  #content
end

Helper

markdown_editor_field(options = {}, html_options = {}) do
 # content
end

Public Instance Methods

pre_render() click to toggle source

Render html tag

# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 52
def pre_render
  text_area_tag content, options[:value] || html_options[:value], html_options
end

Private Instance Methods

autofocus() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 73
def autofocus
  add_html_data('autofocus') if options[:autofocus]
end
component_html_data() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 58
def component_html_data
  super
  provide
  autofocus
  savable
  hideable
  icon_library
  hidden_buttons
  disabled_buttons
end
component_html_options() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 101
def component_html_options
  options[:state] == :disabled ? { disabled: 'disabled' } : {}
end
disabled_buttons() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 93
def disabled_buttons
  add_html_data('disabledButtons', value: options[:disabled_buttons]) if options[:disabled_buttons]
end
hidden_buttons() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 89
def hidden_buttons
  add_html_data('hiddenButtons', value: options[:hidden_buttons]) if options[:hidden_buttons]
end
hideable() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 81
def hideable
  add_html_data('hideable') if options[:hideable]
end
icon_library() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 85
def icon_library
  add_html_data('iconlibrary', value: 'fa')
end
provide() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 69
def provide
  add_html_data('provide', value: 'markdown')
end
savable() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 77
def savable
  add_html_data('savable') if options[:savable]
end
status() click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 97
def status
  "has-#{options[:status]}" if options[:status]
end