Module: Card::Set::All::Editor::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod023-edit/all/editor.rb

Instance Method Summary collapse

Instance Method Details

#default_editorObject



36
37
38
# File 'tmpsets/set/mod023-edit/all/editor.rb', line 36

def default_editor
  :rich_text
end

#editorObject



16
17
18
# File 'tmpsets/set/mod023-edit/all/editor.rb', line 16

def editor
  (c = card.rule(:input)) && c.gsub(/[\[\]]/, "").tr(" ", "_")
end

#editor_defined_by_cardObject



24
25
26
27
28
# File 'tmpsets/set/mod023-edit/all/editor.rb', line 24

def editor_defined_by_card
  return unless (editor_card = Card[editor])

  nest editor_card, view: :core
end

#editor_method(editor_type) ⇒ Object



20
21
22
# File 'tmpsets/set/mod023-edit/all/editor.rb', line 20

def editor_method editor_type
  "#{editor_type}_input"
end

#rich_text_inputObject

overridden by mods that provide rich text editors



41
42
43
44
# File 'tmpsets/set/mod023-edit/all/editor.rb', line 41

def rich_text_input
  default_editor = Cardio.config.rich_text_editor || :tinymce
  send "#{default_editor}_editor_input"
end

#text_area_inputObject



46
47
48
49
# File 'tmpsets/set/mod023-edit/all/editor.rb', line 46

def text_area_input
  text_area :content, rows: 5, class: "d0-card-content",
                      "data-card-type-code" => card.type_code
end

#text_field_inputObject



51
52
53
# File 'tmpsets/set/mod023-edit/all/editor.rb', line 51

def text_field_input
  text_field :content, class: "d0-card-content"
end