Module: Card::Set::All::ReferenceEditor::NestEditor::NestEditorOptions::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb
Instance Method Summary collapse
-
#image_size_select ⇒ Object
-
#image_view_select(selected) ⇒ Object
-
#nest_option_classes ⇒ Object
-
#nest_option_name_disabled(selected, level) ⇒ Object
-
#nest_option_name_disabled_options(level) ⇒ Object
-
#nest_option_name_select(selected = nil, level = 0, include_view_option = true, template = false) ⇒ Object
-
#nest_option_name_select_options(selected, level, include_view_option = true) ⇒ Object
-
#nest_option_value_default_template ⇒ Object
-
#nest_option_value_select(value = nil) ⇒ Object
-
#nest_option_value_select_tag(option_names, options) ⇒ Object
-
#nest_show_and_hide_select_template ⇒ Object
-
#nest_size_select_template ⇒ Object
-
#nest_view_select(selected) ⇒ Object
-
#nest_view_select_template ⇒ Object
-
#size_select_options(selected = :medium) ⇒ Object
Instance Method Details
#image_size_select ⇒ Object
61 62 63 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 61 def image_size_select select_tag :size, (:medium), class: "_image-size-select" end |
#image_view_select(selected) ⇒ Object
55 56 57 58 59 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 55 def image_view_select selected select_tag :view, (view_list.unshift(nil), selected: selected), class: "tags _image-view-select", "data-placeholder": "Select view" end |
#nest_option_classes ⇒ Object
9 10 11 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 9 def nest_option_classes "form-control" end |
#nest_option_name_disabled(selected, level) ⇒ Object
34 35 36 37 38 39 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 34 def nest_option_name_disabled selected, level disabled = level disabled = disabled&.map(&:first) disabled&.delete selected if selected disabled end |
#nest_option_name_disabled_options(level) ⇒ Object
41 42 43 44 45 46 47 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 41 def level if level.zero? nest_snippet. else nest_snippet.[level - 1] || end end |
#nest_option_name_select(selected = nil, level = 0, include_view_option = true, template = false) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 13 def nest_option_name_select selected=nil, level=0, include_view_option=true, template=false classes = "#{nest_option_classes} _nest-option-name" classes += " _new-row" unless selected classes += " _no-select2" if template select_tag "nest_option_name_#{unique_id}", (selected, level, include_view_option), class: classes, id: nil, "data-placeholder": "Select option" # id: nil ensures that select2 generates its own unique identifier # that ensures that we can clone this tag without breaking select2 end |
#nest_option_name_select_options(selected, level, include_view_option = true) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 25 def selected, level, include_view_option=true = [""] + Card::Reference::NestParser::NEST_OPTIONS.dup .delete :view unless include_view_option ( , disabled: nest_option_name_disabled(selected, level), selected: selected ) end |
#nest_option_value_default_template ⇒ Object
71 72 73 74 75 76 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 71 def nest_option_value_default_template text_field_tag "value", nil, class: "_nest-option-template-default _nest-option-value "\ "#{nest_option_classes}", id: nil end |
#nest_option_value_select(value = nil) ⇒ Object
65 66 67 68 69 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 65 def nest_option_value_select value=nil text_field_tag "value", value, class: "_nest-option-value #{nest_option_classes}", disabled: !value, id: nil end |
#nest_option_value_select_tag(option_names, options) ⇒ Object
94 95 96 97 98 99 100 101 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 94 def nest_option_value_select_tag option_names, wrap_classes = Array.wrap(option_names).map { |name| "_nest-option-template-#{name}" }.join " " wrap_with :div, class: wrap_classes do select_tag :size, , class: "_no-select2 _nest-option-value #{nest_option_classes}" end end |
#nest_show_and_hide_select_template ⇒ Object
90 91 92 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 90 def nest_show_and_hide_select_template nest_option_value_select_tag %i[show hide], (all_views) end |
#nest_size_select_template ⇒ Object
82 83 84 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 82 def nest_size_select_template nest_option_value_select_tag :size, end |
#nest_view_select(selected) ⇒ Object
49 50 51 52 53 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 49 def nest_view_select selected select_tag :view, (view_list.unshift(nil), selected: selected), class: "tags _view-select _nest-option-value", "data-placeholder": "Select view" end |
#nest_view_select_template ⇒ Object
86 87 88 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 86 def nest_view_select_template nest_option_value_select_tag :view, (view_list) end |
#size_select_options(selected = :medium) ⇒ Object
78 79 80 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor/nest_editor_options.rb', line 78 def selected=:medium (%w[icon small medium large original], selected: selected) end |