Skip to content

Commit

Permalink
Revert part of "Hyphenate ISBN numbers and add copy button" related t…
Browse files Browse the repository at this point in the history
…o copy button

This partially reverts commit d2c4785.
  • Loading branch information
axiomizer committed Jul 25, 2023
1 parent bd26da3 commit 2293c1c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 67 deletions.
28 changes: 0 additions & 28 deletions bookwyrm/static/css/bookwyrm/components/_copy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,3 @@
.vertical-copy button {
width: 100%;
}

.copy-tooltip {
overflow: visible;
visibility: hidden;
width: 140px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
margin-left: -30px;
margin-top: -45px;
opacity: 0;
transition: opacity 0.3s;
}

.copy-tooltip::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -60px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
Binary file modified bookwyrm/static/css/fonts/icomoon.eot
Binary file not shown.
1 change: 0 additions & 1 deletion bookwyrm/static/css/fonts/icomoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bookwyrm/static/css/fonts/icomoon.ttf
Binary file not shown.
Binary file modified bookwyrm/static/css/fonts/icomoon.woff
Binary file not shown.
13 changes: 5 additions & 8 deletions bookwyrm/static/css/vendor/icons.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {
font-family: 'icomoon';
src: url('../fonts/icomoon.eot?nr4nq7');
src: url('../fonts/icomoon.eot?nr4nq7#iefix') format('embedded-opentype'),
url('../fonts/icomoon.ttf?nr4nq7') format('truetype'),
url('../fonts/icomoon.woff?nr4nq7') format('woff'),
url('../fonts/icomoon.svg?nr4nq7#icomoon') format('svg');
src: url('../fonts/icomoon.eot?r7jc98');
src: url('../fonts/icomoon.eot?r7jc98#iefix') format('embedded-opentype'),
url('../fonts/icomoon.ttf?r7jc98') format('truetype'),
url('../fonts/icomoon.woff?r7jc98') format('woff'),
url('../fonts/icomoon.svg?r7jc98#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
Expand Down Expand Up @@ -122,9 +122,6 @@
.icon-graphic-banknote:before {
content: "\e920";
}
.icon-copy:before {
content: "\e92c";
}
.icon-search:before {
content: "\e986";
}
Expand Down
17 changes: 0 additions & 17 deletions bookwyrm/static/js/bookwyrm.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ let BookWyrm = new (class {
.querySelectorAll('input[type="file"]')
.forEach(bookwyrm.disableIfTooLarge.bind(bookwyrm));
document.querySelectorAll("[data-copytext]").forEach(bookwyrm.copyText.bind(bookwyrm));
document
.querySelectorAll("[data-copywithtooltip]")
.forEach(bookwyrm.copyWithTooltip.bind(bookwyrm));
document
.querySelectorAll(".modal.is-active")
.forEach(bookwyrm.handleActiveModal.bind(bookwyrm));
Expand Down Expand Up @@ -527,20 +524,6 @@ let BookWyrm = new (class {
textareaEl.parentNode.appendChild(copyButtonEl);
}

copyWithTooltip(copyButtonEl) {
const text = document.getElementById(copyButtonEl.dataset.contentId).innerHTML;
const tooltipEl = document.getElementById(copyButtonEl.dataset.tooltipId);
copyButtonEl.addEventListener("click", () => {
navigator.clipboard.writeText(text);
tooltipEl.style.visibility = "visible";
tooltipEl.style.opacity = 1;
setTimeout(function() {
tooltipEl.style.visibility = "hidden";
tooltipEl.style.opacity = 0;
}, 3000)
})
}

/**
* Handle the details dropdown component.
*
Expand Down
20 changes: 7 additions & 13 deletions bookwyrm/templates/book/book_identifiers.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,42 @@
{% if book.isbn_13 or book.oclc_number or book.asin or book.aasin or book.isfdb %}
<dl>
{% if book.isbn_13 %}
<div class="is-flex is-flex-wrap-wrap">
<div class="is-flex">
<dt class="mr-1">{% trans "ISBN:" %}</dt>
<dd itemprop="isbn" class="mr-1" id="isbn_content">{{ hyphenated_isbn13 }}</dd>
<div>
<button class="button is-small" data-copywithtooltip data-content-id="isbn_content" data-tooltip-id="isbn_tooltip">
<span class="icon icon-copy" title="{% trans "Copy ISBN" %}"></span>
</button>
<span class="copy-tooltip" id="isbn_tooltip">{% trans "Copied ISBN!" %}</span>
</div>
<dd itemprop="isbn">{{ hyphenated_isbn13 }}</dd>
</div>
{% endif %}

{% if book.oclc_number %}
<div class="is-flex is-flex-wrap-wrap">
<div class="is-flex">
<dt class="mr-1">{% trans "OCLC Number:" %}</dt>
<dd>{{ book.oclc_number }}</dd>
</div>
{% endif %}

{% if book.asin %}
<div class="is-flex is-flex-wrap-wrap">
<div class="is-flex">
<dt class="mr-1">{% trans "ASIN:" %}</dt>
<dd>{{ book.asin }}</dd>
</div>
{% endif %}

{% if book.aasin %}
<div class="is-flex is-flex-wrap-wrap">
<div class="is-flex">
<dt class="mr-1">{% trans "Audible ASIN:" %}</dt>
<dd>{{ book.aasin }}</dd>
</div>
{% endif %}

{% if book.isfdb %}
<div class="is-flex is-flex-wrap-wrap">
<div class="is-flex">
<dt class="mr-1">{% trans "ISFDB ID:" %}</dt>
<dd>{{ book.isfdb }}</dd>
</div>
{% endif %}

{% if book.goodreads_key %}
<div class="is-flex is-flex-wrap-wrap">
<div class="is-flex">
<dt class="mr-1">{% trans "Goodreads:" %}</dt>
<dd>{{ book.goodreads_key }}</dd>
</div>
Expand Down

0 comments on commit 2293c1c

Please sign in to comment.