Support source fetching and translated tags while editing posts

(manual only)
This commit is contained in:
Toks
2014-06-07 14:10:02 -04:00
parent f6eb27d3c8
commit 9d47d7f7dd
4 changed files with 40 additions and 3 deletions

View File

@@ -4,11 +4,12 @@
Danbooru.Upload.initialize_all = function() {
if ($("#c-uploads,#c-posts").length) {
this.initialize_enter_on_tags();
this.initialize_info_manual();
}
if ($("#c-uploads").length) {
this.initialize_image();
this.initialize_info();
this.initialize_info_bookmarklet();
this.initialize_similar();
$("#related-tags-button").trigger("click");
$("#find-artist-button").trigger("click");
@@ -55,16 +56,20 @@
});
}
Danbooru.Upload.initialize_info = function() {
Danbooru.Upload.initialize_info_bookmarklet = function() {
$("#source-info ul").hide();
$("#fetch-data-bookmarklet").click(function(e) {
$.get(e.target.href).success(Danbooru.Upload.fill_source_info);
e.preventDefault();
});
$("#fetch-data-bookmarklet").trigger("click");
}
Danbooru.Upload.initialize_info_manual = function() {
$("#source-info ul").hide();
$("#fetch-data-manual").click(function(e) {
var source = $("#upload_source").val();
var source = $("#upload_source,#post_source").val();
if (!/\S/.test(source)) {
Danbooru.error("Error: You must enter a URL into the source field to get its data");
} else if (!/^https?:\/\//.test(source)) {

View File

@@ -373,6 +373,22 @@ div#c-posts {
color: gray;
}
}
div#source-info {
margin: 1em 0;
padding: 1em;
border: 1px solid gray;
p {
margin: 0;
}
ul {
a {
margin-right: 1em;
}
}
}
}
div#quick-edit-div {