$(".source-data").replaceWith("<%= j render_source_data(@source) %>");

$(document).trigger("danbooru:update-source-data", {
  source: <%= raw @source.to_json %>,
  related_tags_html: "<%= j render "related_tags/source_tags", source: @source %>",
});

if ($("#c-uploads #a-new").length) {
  $("#upload_artist_commentary_title").val(<%= raw @source.dtext_artist_commentary_title.to_json %>);
  $("#upload_artist_commentary_desc").val(<%= raw @source.dtext_artist_commentary_desc.to_json %>);
  Danbooru.Upload.toggle_commentary();
}
