This commit is contained in:
Toks
2013-05-18 16:25:46 -04:00
parent f2c4312f9f
commit 17af05b2b1
6 changed files with 55 additions and 0 deletions

View File

@@ -133,6 +133,29 @@
$("#post_tag_string").trigger("focus");
e.preventDefault();
});
$("#copy-notes").click(function(e) {
var current_post_id = $("meta[name=post-id]").attr("content");
var other_post_id = prompt("Enter the ID of the post to copy all notes to:");
if (other_post_id !== null) {
$.ajax("/posts/" + current_post_id + "/copy_notes", {
type: "PUT",
data: {
other_post_id: other_post_id
},
complete: function(data) {
if (data.status === 200) {
Danbooru.notice("Successfully copied notes to <a href='" + other_post_id + "'>post #" + other_post_id + "</a>");
} else {
Danbooru.error("There was an error copying notes to <a href='" + other_post_id + "'>post #" + other_post_id + "</a>");
}
},
});
}
e.preventDefault();
});
}
Danbooru.Post.initialize_post_relationship_previews = function() {