support json for iqdb query actions

This commit is contained in:
Albert Yi
2018-06-20 11:53:44 -07:00
parent 28663351d1
commit e262295cf1
4 changed files with 6 additions and 22 deletions

View File

@@ -1,10 +0,0 @@
var html = '';
<% if @results.any? %>
<% @results.each do |match| %>
html += '<%= j PostPresenter.preview(match[:post], :tags => "status:any") %>';
<% end %>
<% else %>
html += '<p>No matches found</p>';
<% end %>
$("<div></div>").html(html).dialog({title: "Similar Posts", modal: true, width: "600px"});

View File

@@ -1,9 +0,0 @@
<% if @results.any? %>
<h3>Similar</h3>
<% @results.each do |match| %>
<%= PostPresenter.preview(match[:post], :tags => "status:any", :size => true, :similarity => match[:score]) %>
<% end %>
<% else %>
<h3>Similar</h3>
<p>No matches found</p>
<% end %>

View File

@@ -0,0 +1,3 @@
<% if @matches %>
<%= raw @matches.to_json %>
<% end %>