Skip to content

Commit

Permalink
client/posts: provide link for danbooru image search
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsunder committed Jan 8, 2021
1 parent b9451be commit 8fa84ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/css/post-main-view.styl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

>.sidebar
margin-right: 1em
min-width: 20em
max-width: 20em
min-width: 21em
max-width: 21em
line-height: 160%

a:active
Expand Down
1 change: 1 addition & 0 deletions client/html/post_readonly_sidebar.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<section class='search'>
Search on
<a href='http://iqdb.org/?url=<%- encodeURIComponent(ctx.post.fullContentUrl) %>'>IQDB</a> &middot;
<a href='https://danbooru.donmai.us/posts?tags=md5:<%- ctx.post.checksumMD5 %>'>Danbooru</a> &middot;
<a href='https://www.google.com/searchbyimage?&image_url=<%- encodeURIComponent(ctx.post.fullContentUrl) %>'>Google Images</a>
</section>

Expand Down
10 changes: 10 additions & 0 deletions client/js/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ class Post extends events.EventTarget {
return this._mimeType;
}

get checksumSHA1() {
return this._checksumSHA1;
}

get checksumMD5() {
return this._checksumMD5;
}

get creationTime() {
return this._creationTime;
}
Expand Down Expand Up @@ -459,6 +467,8 @@ class Post extends events.EventTarget {
_id: response.id,
_type: response.type,
_mimeType: response.mimeType,
_checksumSHA1: response.checksum,
_checksumMD5: response.checksumMD5,
_creationTime: response.creationTime,
_user: response.user,
_safety: response.safety,
Expand Down

0 comments on commit 8fa84ab

Please sign in to comment.