Module: Card::Set::All::ReferenceEditor::NestImage::JsFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod037-card-mod-tinymce_editor/all/reference_editor/nest_image.rb,
card/tmpsets/set/mod038-card-mod-tinymce_editor/all/reference_editor/nest_image.rb

Instance Method Summary collapse

Instance Method Details

#view: change_create_to_updateObject



55
56
57
58
59
60
61
62
63
64
# File 'card/tmpsets/set/mod037-card-mod-tinymce_editor/all/reference_editor/nest_image.rb', line 55

view :change_create_to_update, unknown: true do
  tm_id = if Env.params[:tinymce_id].present?
            "\"#{Env.params[:tinymce_id]}\""
          else
            '$(".tinymce-textarea").attr("id")'
          end
  <<-JAVASCRIPT.strip_heredoc
    nest.changeCreateToUpdate(#{tm_id});
  JAVASCRIPT
end

#view: open_nest_editorObject



66
67
68
69
70
71
72
73
74
75
76
# File 'card/tmpsets/set/mod037-card-mod-tinymce_editor/all/reference_editor/nest_image.rb', line 66

view :open_nest_editor, unknown: true do
  tm_id = if Env.params[:tinymce_id].present?
            "\"#{Env.params[:tinymce_id]}\""
          else
            '$(".tinymce-textarea").attr("id")'
          end
  <<-JAVASCRIPT.strip_heredoc
    tm = tinymce.get(#{tm_id});
    nest.insertNest(tm, "{{+#{card.name.tag}|view: content; size: medium}}");
  JAVASCRIPT
end