Sha256: 297952536069529b7f498fb7e572670132605fcbc5c3129872fcae4ee3d152d4

Contents?: true

Size: 1.48 KB

Versions: 9

Compression:

Stored size: 1.48 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class All
# Set: All cards (Editor)
#
module Editor;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/edit/set/all/editor.rb"; end
include_set Abstract::ProsemirrorEditor
include_set Abstract::TinymceEditor
include_set Abstract::AceEditor

Self::InputOptions.add_to_basket :options, "text area"
Self::InputOptions.add_to_basket :options, "text field"

module HtmlFormat; parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  def editor
    (c = card.rule(:input)) && c.gsub(/[\[\]]/, "").tr(" ", "_")
  end

  def editor_method editor_type
    "#{editor_type}_input"
  end

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

    nest editor_card, view: :core
  end

  view :editor do
    try(editor_method(editor)) ||
      editor_defined_by_card ||
      send(editor_method(default_editor))
  end

  def default_editor
    :rich_text
  end

  # overridden by mods that provide rich text editors
  def rich_text_input
    default_editor = Cardio.config.rich_text_editor || :tinymce
    send "#{default_editor}_editor_input"
  end

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

  def text_field_input
    text_field :content, class: "d0-card-content"
  end
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card/mod/edit/set/all/editor.rb ~~

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
card-1.99.4 tmpsets/set/mod023-edit/all/editor.rb
card-1.99.3 tmpsets/set/mod023-edit/all/editor.rb
card-1.99.2 tmpsets/set/mod023-edit/all/editor.rb
card-1.99.1 tmpsets/set/mod023-edit/all/editor.rb
card-1.99.0 tmpsets/set/mod023-edit/all/editor.rb
card-1.98.3 tmpsets/set/mod023-edit/all/editor.rb
card-1.98.2 tmpsets/set/mod023-edit/all/editor.rb
card-1.98.1 tmpsets/set/mod023-edit/all/editor.rb
card-1.98.0 tmpsets/set/mod023-edit/all/editor.rb