Module: Card::Set::All::ReferenceEditor::NestEditor::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb
Instance Method Summary collapse
-
#default_nest_editor_item_options ⇒ Object
-
#demo ⇒ Object
-
#empty_nest_name_alert(show) ⇒ Object
-
#known_nest_content ⇒ Object
-
#modal_nest_editor ⇒ Object
-
#name_dependent_slot ⇒ Object
-
#nest_apply_opts ⇒ Object
-
#nest_editor(editor_mode, ref_type = :nest, title = "Nest", editor = nil) ⇒ Object
-
#nest_snippet ⇒ Object
-
#set_name_for_nest_rules ⇒ Object
-
#unknown_nest_content ⇒ Object
-
#view: modal_nest_editor ⇒ Object
-
#view: nest_content ⇒ Object
-
#view: nest_editor ⇒ Object
Card::View::Options.shark_keys - %i[nest_syntax nest_name items cache] TODO: connect to Card::View::Options (that way a mod can add an option that becomes available to nests).
Instance Method Details
#default_nest_editor_item_options ⇒ Object
86 87 88 89 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 86 def [] # [[:view, default_item_view]] end |
#demo ⇒ Object
91 92 93 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 91 def demo _render_demo end |
#empty_nest_name_alert(show) ⇒ Object
59 60 61 62 63 64 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 59 def empty_nest_name_alert show alert :warning, false, false, class: "mb-0 _empty-nest-name-alert #{'d-none' unless show}" do "nest name required" # LOCALIZE end end |
#known_nest_content ⇒ Object
99 100 101 102 103 104 105 106 107 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 99 def known_nest_content voo.hide! :cancel_button add_name_context with_nest_mode :edit do wrap true do render_edit_inline end end end |
#modal_nest_editor ⇒ Object
66 67 68 69 70 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 66 def modal_nest_editor wrap_with :modal do nest_editor :modal end end |
#name_dependent_slot ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 48 def name_dependent_slot result = [empty_nest_name_alert(nest_snippet.name.blank?)] result << if nest_snippet.name.blank? content_tag :div, "", class: "card-slot" # placeholder else yield end result end |
#nest_apply_opts ⇒ Object
95 96 97 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 95 def nest_apply_opts apply_tm_snippet_data nest_snippet end |
#nest_editor(editor_mode, ref_type = :nest, title = "Nest", editor = nil) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 37 def nest_editor editor_mode, ref_type=:nest, title="Nest", editor=nil @tm_snippet_editor_mode = editor_mode voo.hide :content_tab unless show_content_tab? haml :reference_editor, title: title, editor: editor || ref_type, ref_type: ref_type, editor_mode: @tm_snippet_editor_mode, apply_opts: nest_apply_opts, snippet: nest_snippet end |
#nest_snippet ⇒ Object
72 73 74 75 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 72 def nest_snippet @nest_snippet ||= Card::Reference::NestParser.new params[:tm_snippet_raw] end |
#set_name_for_nest_rules ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 77 def set_name_for_nest_rules nest_name = nest_snippet.name if (type_name = card.left_type_for_nest_editor_set_selection) [type_name, nest_name, :type_plus_right] else [nest_name, :right] end end |
#unknown_nest_content ⇒ Object
109 110 111 112 113 114 115 116 117 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 109 def unknown_nest_content voo.hide! :guide voo.show! :new_type_formgroup voo. = :new_image_buttons wrap true do create_form success: { tinymce_id: Env.params[:tinymce_id] } end # framed_create_form end |
#view: modal_nest_editor ⇒ Object
24 25 26 27 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 24 view :modal_nest_editor, cache: :never, unknown: true, wrap: { slot: { class: "nodblclick" } } do modal_nest_editor end |
#view: nest_content ⇒ Object
29 30 31 32 33 34 35 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 29 view :nest_content, perms: :create, cache: :never, unknown: true, wrap: :slot do if card.known? known_nest_content else unknown_nest_content end end |
#view: nest_editor ⇒ Object
Card::View::Options.shark_keys - %i[nest_syntax nest_name items cache] TODO: connect to Card::View::Options (that way a mod can add an option that becomes available to nests)
17 18 19 20 21 22 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_editor.rb', line 17 view :nest_editor, cache: :never, unknown: true, wrap: { slot: { class: "_overlay d0-card-overlay card nodblclick" } } do nest_editor :overlay end |