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

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_image.rb

Instance Method Summary collapse

Instance Method Details

#tinymce_idObject



59
60
61
62
63
64
65
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_image.rb', line 59

def tinymce_id
  if Env.params[:tinymce_id].present?
    "\"#{Env.params[:tinymce_id]}\""
  else
    '$(".tinymce-textarea").attr("id")'
  end
end

#view: change_create_to_updateObject



48
49
50
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_image.rb', line 48

view :change_create_to_update, unknown: true do
  "nest.changeCreateToUpdate(#{tinymce_id});"
end

#view: open_nest_editorObject



52
53
54
55
56
57
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/nest_image.rb', line 52

view :open_nest_editor, unknown: true do
  <<-JAVASCRIPT.strip_heredoc
    tm = tinymce.get(#{tinymce_id});
    nest.insertNest(tm, "{{+#{card.name.tag}|view: content; size: medium}}");
  JAVASCRIPT
end