diff --git a/app/controllers/iqdb_queries_controller.rb b/app/controllers/iqdb_queries_controller.rb index ab3079ec0..1485acf00 100644 --- a/app/controllers/iqdb_queries_controller.rb +++ b/app/controllers/iqdb_queries_controller.rb @@ -1,11 +1,11 @@ class IqdbQueriesController < ApplicationController - respond_to :html, :json, :xml + respond_to :html, :json def show if params[:url] url = URI.parse(Danbooru.config.iqdbs_server) url.path = "/similar" - url.query = {callback: iqdb_queries_url, url: params[:url]}.to_query + url.query = {callback: iqdb_queries_url(format: params[:format]), url: params[:url]}.to_query redirect_to url.to_s return end @@ -14,7 +14,7 @@ class IqdbQueriesController < ApplicationController post = Post.find(params[:post_id]) url = URI.parse(Danbooru.config.iqdbs_server) url.path = "/similar" - url.query = {callback: iqdb_queries_url, url: post.preview_file_url}.to_query + url.query = {callback: iqdb_queries_url(format: params[:format]), url: post.preview_file_url}.to_query redirect_to url.to_s return end diff --git a/app/views/iqdb_queries/create_by_post.js.erb b/app/views/iqdb_queries/create_by_post.js.erb deleted file mode 100644 index 1877d32a4..000000000 --- a/app/views/iqdb_queries/create_by_post.js.erb +++ /dev/null @@ -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 += '
No matches found
'; -<% end %> - -$("").html(html).dialog({title: "Similar Posts", modal: true, width: "600px"}); diff --git a/app/views/iqdb_queries/create_by_url.html.erb b/app/views/iqdb_queries/create_by_url.html.erb deleted file mode 100644 index 91cb2ab24..000000000 --- a/app/views/iqdb_queries/create_by_url.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% if @results.any? %> -No matches found
-<% end %> diff --git a/app/views/iqdb_queries/show.json.erb b/app/views/iqdb_queries/show.json.erb new file mode 100644 index 000000000..04451bf99 --- /dev/null +++ b/app/views/iqdb_queries/show.json.erb @@ -0,0 +1,3 @@ +<% if @matches %> + <%= raw @matches.to_json %> +<% end %>