From 552bd377f341fbbf8f2b5f6d65f77b2513c07e6f Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 11 Jun 2014 22:53:12 -0400 Subject: [PATCH] Fix bug where failed iqdb query would be made Query should only be made automatically when using bookmarklet --- app/assets/javascripts/uploads.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/uploads.js b/app/assets/javascripts/uploads.js index fd5714c0f..b5cb04be2 100644 --- a/app/assets/javascripts/uploads.js +++ b/app/assets/javascripts/uploads.js @@ -21,7 +21,9 @@ } Danbooru.Upload.initialize_iqdb_source = function() { - $.post("/iqdb_queries", {"url": $("#normalized_url").val()}).done(function(html) {$("#iqdb-similar").html(html)}); + if (/^https?:\/\//.test($("#normalized_url").val())) { + $.post("/iqdb_queries", {"url": $("#normalized_url").val()}).done(function(html) {$("#iqdb-similar").html(html)}); + } } Danbooru.Upload.initialize_enter_on_tags = function() {