fixes #2130
This commit is contained in:
@@ -135,20 +135,8 @@
|
||||
|
||||
Danbooru.Post.initialize_similar = function() {
|
||||
$("#similar-button").click(function(e) {
|
||||
var old_source_name = $("#post_source").attr("name");
|
||||
var old_action = $("#form").attr("action");
|
||||
|
||||
$("#post_source").attr("name", "url");
|
||||
$("#form").attr("target", "_blank");
|
||||
$("#form").attr("action", "http://danbooru.iqdb.org/");
|
||||
|
||||
$("#form").trigger("submit");
|
||||
|
||||
$("#post_source").attr("name", old_source_name);
|
||||
$("#form").attr("target", "");
|
||||
$("#form").attr("action", old_action);
|
||||
|
||||
e.preventDefault();
|
||||
$.post("/iqdb_queries", {"url": $("#post_source").val()}).done(function(html) {$("#iqdb-similar").html(html).show()});
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<% if @results.any? %>
|
||||
<h3>Similar</h3>
|
||||
<% @results.each do |match| %>
|
||||
<%= PostPresenter.preview(Post.find(match.post_id)) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<h3>Similar</h3>
|
||||
<p>No matches found</p>
|
||||
<% end %>
|
||||
10
app/views/iqdb_queries/create_by_post.js.erb
Normal file
10
app/views/iqdb_queries/create_by_post.js.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
var html = '';
|
||||
<% if @results.any? %>
|
||||
<% @results.each do |match| %>
|
||||
html += '<%= j PostPresenter.preview(Post.find(match.post_id)) %>';
|
||||
<% end %>
|
||||
<% else %>
|
||||
html += '<p>No matches found</p>';
|
||||
<% end %>
|
||||
|
||||
$("<div></div>").html(html).dialog({title: "Similar Posts", modal: true, width: "600px"});
|
||||
@@ -62,6 +62,10 @@
|
||||
<%= button_tag "Artist", :id => "find-artist-button", :type => "button" %>
|
||||
</div>
|
||||
|
||||
<% if Danbooru.config.iqdb_hostname_and_port %>
|
||||
<div class="input" id="iqdb-similar" style="display: none;"></div>
|
||||
<% end %>
|
||||
|
||||
<div class="input">
|
||||
<div>
|
||||
<%= f.label :tag_string, "Tags" %>
|
||||
|
||||
Reference in New Issue
Block a user