Option to set category when first creating a saved search

This commit is contained in:
Toks
2014-11-26 19:41:54 -05:00
parent 82b3754d3b
commit e53970d6f6
5 changed files with 18 additions and 7 deletions

View File

@@ -14,6 +14,7 @@
if ($("#c-posts").length && $("#a-index").length) {
this.initialize_excerpt();
this.initialize_saved_searches();
}
if ($("#c-posts").length && $("#a-show").length) {
@@ -513,11 +514,19 @@
});
}
Danbooru.Post.save_search = function() {
$.post(
"/saved_searches.js",
{"saved_search[tag_query]": $("#tags").val()}
);
Danbooru.Post.initialize_saved_searches = function() {
$("#save-search").click(function() {
var input = window.prompt("Category for this saved search (optional):");
if (input !== null) {
$.post(
"/saved_searches.js",
{
"tags": $("#tags").attr("value"),
"category": input
}
);
}
});
}
})();