add iqdb preview

This commit is contained in:
Albert Yi
2018-06-22 15:56:15 -07:00
parent bf9750c826
commit 56b40a0255
7 changed files with 44 additions and 17 deletions

View File

@@ -154,7 +154,7 @@
Danbooru.Post.initialize_similar = function() {
$("#similar-button").click(function(e) {
$.post("/iqdb_queries", {"url": $("#post_source").val()}).done(function(html) {$("#iqdb-similar").html(html).show()});
$.get("/iqdb_queries/preview", {"url": $("#post_source").val()}).done(function(html) {$("#iqdb-similar").html(html).show()});
e.preventDefault();
});
}

View File

@@ -61,7 +61,7 @@
Danbooru.Upload.initialize_iqdb_source = function() {
if (/^https?:\/\//.test($("#normalized_url").val())) {
$.post("/iqdb_queries", {"url": $("#normalized_url").val()}).done(function(html) {$("#iqdb-similar").html(html)});
$.get("/iqdb_queries/preview", {"url": $("#normalized_url").val()}).done(function(html) {$("#iqdb-similar").html(html)});
}
}
@@ -77,7 +77,7 @@
Danbooru.Upload.initialize_similar = function() {
$("#similar-button").click(function(e) {
$.post("/iqdb_queries", {"url": $("#upload_source").val()}).done(function(html) {$("#iqdb-similar").html(html).show()});
$.get("/iqdb_queries/preview", {"url": $("#upload_source").val()}).done(function(html) {$("#iqdb-similar").html(html).show()});
e.preventDefault();
});
}

View File

@@ -138,24 +138,34 @@
article.post-preview {
margin: 0.5vw;
width: 32vw;
height: 32vw;
width: 48vw;
height: 48vw;
text-align: center;
vertical-align: middle;
display: inline-block;
&.cropped {
width: 32vw;
height: 32vw;
}
a {
//width: 48.5vw;
//display: block;
margin: 0 auto;
}
img.cropped {
img {
//object-fit: contain;
width: 32vw;
height: 32vw;
margin: 0 auto;
border: none !important;
&.cropped {
width: 32vw;
height: 32vw;
}
}
&[data-tags~=animated]:before, &[data-file-ext=swf]:before, &[data-file-ext=webm]:before, &[data-file-ext=mp4]:before, &[data-file-ext=zip]:before {
@include animated-icon;
}