Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundlesize.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
{
"path": "static/build/css/page-book.css",
"maxSize": "15.5KB"
"maxSize": "15.6KB"
},
{
"path": "static/build/css/page-edit.css",
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/i18n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ msgid "Checked Out"
msgstr ""

#: LocateButton.html
msgid "Locate"
msgid "Check Options"
msgstr ""

#: ManageLoansButtons.html admin/loans_table.html
Expand Down
12 changes: 6 additions & 6 deletions openlibrary/macros/LocateButton.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$def with(edition_key, icon=False)

$ locateUrl = "/books/XXX/-/borrow?action=locate".replace('XXX', edition_key or '')
$ locateUrl = "/books/XXX#check-options".replace('XXX', edition_key or '')

$if icon:
<a class="cta-btn cta-btn--available cta-btn--w-icon cta-btn--external" href="$locateUrl" target="_blank"
data-ol-link-track="CTAClick|Locate">
<a class="cta-btn cta-btn--available cta-btn--w-icon" href="$locateUrl"
data-ol-link-track="CTAClick|CheckOptions">

<span class="btn-icon map"></span>
<span class="btn-label">$_("Locate")</span>
<span class="btn-label">$_("Check Options")</span>
</a>
$else:
<a class="cta-btn cta-btn--available cta-btn--external" href="$locateUrl" target="_blank"
data-ol-link-track="CTAClick|Locate">$_('Locate')</a>
<a class="cta-btn cta-btn--available" href="$locateUrl"
data-ol-link-track="CTAClick|CheckOptions">$_('Check Options')</a>
2 changes: 1 addition & 1 deletion openlibrary/macros/databarWork.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h3 class="header">
</div>
</div>

<div class="panel desktop-vendor">
<div class="panel desktop-vendor" id="check-options">
<div class="btn-notice">
$:worldcat_links

Expand Down
3 changes: 0 additions & 3 deletions openlibrary/plugins/upstream/borrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ def POST(self, key): # noqa: PLR0915

from openlibrary.book_providers import get_book_provider

if action == 'locate':
raise web.seeother(edition.get_worldcat_url())

# Direct to the first web book if at least one is available.
if (
action in ["borrow", "read"]
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/templates/type/edition/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
</div>

<div class="Tools">
<div class="panel mobile-vendor">
<div class="panel mobile-vendor" id="check-options">
<div class="btn-notice">
$:worldcat_links

Expand Down
26 changes: 26 additions & 0 deletions static/css/components/read-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,29 @@ ul.ebook-download-options li {
/* stylelint-enable selector-max-specificity */
/* stylelint-enable max-nesting-depth */
}

/* Smooth scroll for Check Options anchor navigation */
html {
scroll-behavior: smooth;
}

@keyframes check-options-highlight {
0% {
box-shadow: 0 0 0 transparent;
}

30% {
box-shadow: 0 0 12px 2px var(--primary-blue);
}

100% {
box-shadow: 0 0 0 transparent;
}
}

.desktop-vendor:target,
.mobile-vendor:target {
animation: check-options-highlight 3s ease-out;
border-radius: 4px;
scroll-margin-top: 80px;
}
Loading