sitka/overdrive-evergreen-opac.git
2 years agoGive ebook dashboard row a distinct id, and hide it until/unless we have totals to... master
Jeff Davis [Thu, 8 Jun 2017 16:28:40 +0000 (09:28 -0700)]
Give ebook dashboard row a distinct id, and hide it until/unless we have totals to display there

3 years agoFix account summary display in Evergreen 2.9+
Jeff Davis [Wed, 11 May 2016 21:19:39 +0000 (14:19 -0700)]
Fix account summary display in Evergreen 2.9+

As of Evergreen 2.9, the account summary table on the main My Account
page includes an additional "Account Expiration Date" row.  This broke
the OverDrive API integration layer.  This commit takes the extra row
into account when rewriting the account summary table.

(As a side effect, when OverDrive API integration is enabled, the
Account Expiration Date row will not be displayed on the main My Account
page, but it's still visible in the Account Preferences tab.)

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
3 years agoChange button label from "editHold" to "Edit Hold"
Jeff Davis [Tue, 10 May 2016 17:06:43 +0000 (10:06 -0700)]
Change button label from "editHold" to "Edit Hold"

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
3 years agoAvoid potential runtime error on My Account main page
Jeff Davis [Tue, 10 May 2016 17:06:09 +0000 (10:06 -0700)]
Avoid potential runtime error on My Account main page

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
3 years agoRemove some unused code
Jeff Davis [Thu, 1 Oct 2015 16:40:55 +0000 (09:40 -0700)]
Remove some unused code

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
3 years agoFlesh out install instructions
Jeff Davis [Wed, 30 Sep 2015 21:44:19 +0000 (14:44 -0700)]
Flesh out install instructions

Thanks to Michael Peters for testing and providing README revisions!

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoCheck for session token before accessing Library Account API
Jeff Davis [Wed, 29 Jul 2015 22:07:57 +0000 (15:07 -0700)]
Check for session token before accessing Library Account API

This prevents a 404 error which can cause an "Authentication Required"
popup to appear in Chrome.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoFix insertion of title identifier in availability URL
Jeff Davis [Thu, 23 Jul 2015 20:39:25 +0000 (13:39 -0700)]
Fix insertion of title identifier in availability URL

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoTruncated totals on account summary due to bad regex
Jeff Davis [Tue, 28 Apr 2015 16:33:52 +0000 (09:33 -0700)]
Truncated totals on account summary due to bad regex

On the account summary page, OD API was using /\d+?/ to scrape item
totals.  In Javascript, this regular expression matches the minimum
possible match, i.e. one digit, even when the total had more than one
digit.  So, for example, if a patron had 10 items out, the checked out
totals on the account summary page in OD API would show 1 item out.
(The totals at the top right of the page are correct.)

This commit fixes the regex.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoLP#1434728: make password_required configurable per library
Jeff Davis [Fri, 20 Mar 2015 22:17:47 +0000 (15:17 -0700)]
LP#1434728: make password_required configurable per library

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agocheckout formats may be undefined, avoid error in that scenario
Jeff Davis [Wed, 25 Feb 2015 22:28:25 +0000 (14:28 -0800)]
checkout formats may be undefined, avoid error in that scenario

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoUse jQuery.noConflict to avoid conflict with other libraries
Jeff Davis [Wed, 7 Jan 2015 21:12:06 +0000 (13:12 -0800)]
Use jQuery.noConflict to avoid conflict with other libraries

jQuery's use of '$' as an alias was conflicting with Dojo's use of '$'
as a function name on the TPAC advanced search page.  We can resolve
this by making OD API depend on a wrapper function that invokes
jquery.noConflict().  There's an "official" way to do this using the
require.js map config, but the approach we're using here is simpler (and
actually works!).

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoRT26522: Don't treat non-available items as a special case
Jeff Davis [Mon, 8 Dec 2014 18:36:35 +0000 (10:36 -0800)]
RT26522: Don't treat non-available items as a special case

Previously, when the 'available' element of a Library Availability API
response was undefined, we assumed that the title itself was no longer
part of the library's current Overdrive collection.  Thus, the Place
Hold link was removed and a "No longer available" message was displayed
in the Status column.  In fact, however, it may just be the case that
the item is currently in the collection, but all copies are checked out.
So it's preferable to retain the Place Hold link and show "0 of X
available" in the Status column -- in other words, don't treat undefined
availability as a special case.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoRT24863: Suppress OD API on grouped records (metarecords) in search results
Jeff Davis [Thu, 4 Dec 2014 20:16:06 +0000 (12:16 -0800)]
RT24863: Suppress OD API on grouped records (metarecords) in search results

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoRT26084: Hide Suspend button on suspended holds
Jeff Davis [Fri, 14 Nov 2014 20:42:41 +0000 (12:42 -0800)]
RT26084: Hide Suspend button on suspended holds

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoremove hard-coded URLs for JS libraries
Jeff Davis [Thu, 6 Nov 2014 20:36:13 +0000 (12:36 -0800)]
remove hard-coded URLs for JS libraries

For ease of configuration and maintenance, paths for various required JS
libraries (require.js, jQuery, etc.) have been moved to Evergreen -- see
templates/opac/parts/js.tt2.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoconfigurable base URL for direct links to OverDrive site
Jeff Davis [Thu, 6 Nov 2014 19:28:30 +0000 (11:28 -0800)]
configurable base URL for direct links to OverDrive site

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoconfigurable base URL for product links
Jeff Davis [Wed, 5 Nov 2014 21:09:25 +0000 (13:09 -0800)]
configurable base URL for product links

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoAdded .gitignore
twirlip [Wed, 1 Oct 2014 18:48:39 +0000 (11:48 -0700)]
Added .gitignore

4 years agoAdd license and copyright
Jeff Davis [Wed, 1 Oct 2014 16:57:17 +0000 (09:57 -0700)]
Add license and copyright

This software was originally published on Google Code with an MIT
License and no copyright statment.  The present commit includes the
license within the source code (see LICENSE.txt) and assigns copyright
to the BC Libraries Cooperative.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
4 years agoComment out console.log in od_api module
Steven Chan [Sun, 21 Sep 2014 20:52:07 +0000 (13:52 -0700)]
Comment out console.log in od_api module

Signed-off-by: Steven Chan <steven3416@gmail.com>
4 years agoComplete the README file
Steven Chan [Fri, 19 Sep 2014 22:41:02 +0000 (15:41 -0700)]
Complete the README file

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFixed erroneous search links for author and title
Steven Chan [Thu, 18 Sep 2014 18:23:56 +0000 (11:23 -0700)]
Fixed erroneous search links for author and title

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoRefine the rendering of myopac account summary table and dashboard
Steven Chan [Thu, 18 Sep 2014 17:51:07 +0000 (10:51 -0700)]
Refine the rendering of myopac account summary table and dashboard

Before, the table and dashboard were built to show empty e-item entries
that would sit there while the user waits for the several API requests
to finish before the total values were available to be placed in the
entries.  Now, the entries are built and shown after values are
available.

A solid gray bar shows in the dashboard during the wait interval. We
would have shown a progress bar, but it's too hard to get it to show
because of interference from the existing style sheet.

The first column of the summary table shows totals for physical items
and was suppressed until the arrival of totals for e-items, but in fact
the totals of physical items are already available from the old table.
Now, we show them immediately, and we don't show the second column at
all until it is filled with values.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix handling of errors for downloading Overdrive Read format
Steven Chan [Mon, 15 Sep 2014 18:33:57 +0000 (11:33 -0700)]
Fix handling of errors for downloading Overdrive Read format

These sort of errors require parameters to be included with the
error-handling URL, and a different format for the notification box.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoHandle errors arising from downloading content
Steven Chan [Sun, 14 Sep 2014 22:39:09 +0000 (15:39 -0700)]
Handle errors arising from downloading content

Any such errors will be embedded in the search parameters of the
myopac/circ page URL. We decode the various components and show them
inside a floating notification box, otherwise we render the page as
normally done.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoWhen decoding search parameters, convert pluses to spaces
Steven Chan [Sun, 14 Sep 2014 22:37:28 +0000 (15:37 -0700)]
When decoding search parameters, convert pluses to spaces

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoUse action dialogue to guide download link process
Steven Chan [Sun, 14 Sep 2014 01:06:17 +0000 (18:06 -0700)]
Use action dialogue to guide download link process

1. Define and use a downloadLink action dialogue
2. Auto-close done content box after 59 seconds
3. For other actions, auto-close after 2 seconds
4. Auto-focus on close button to allow for quick manual close

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix indentation
Steven Chan [Thu, 11 Sep 2014 17:47:27 +0000 (10:47 -0700)]
Fix indentation
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoChange how download button works to allow for right-clicking to work
Steven Chan [Wed, 10 Sep 2014 20:46:56 +0000 (13:46 -0700)]
Change how download button works to allow for right-clicking to work

On user clicking a download button, we convert the download URL to a content URL,
and then convert the button to a link with a new message. This will
allow the link to be used directly, ie, right-clicking to open in a new
tab.

The interaction is not perfect, for example, the content link will be
useful for only 60 seconds. A more elaborate interaction will need to be
devised.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix regression error in checkout action button
Steven Chan [Wed, 10 Sep 2014 20:43:54 +0000 (13:43 -0700)]
Fix regression error in checkout action button

Convert checkout link URLs to reverse proxy format to make it work
again.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix format type mismatch
Steven Chan [Mon, 8 Sep 2014 00:24:24 +0000 (17:24 -0700)]
Fix format type mismatch

The format type that is listed on search results, record details, and
place hold form doesn't match what is listed in the selection option
list of the checkout dialogue.

To remove the mismatch, we need to use the format types found in the
checkout action object, which is gotten from Availability, rather than
the basic list found from Metadata.  The difference is presumably due to
Advantage accounts.

For search results or record details, we omit the call for Metadata and
substitute the format types from checkout action. For place hold form,
we cannot omit a call to Metadata, because it supplies title details as
well as format types. Therefore, we have to reschedule the asynchronous
calls to Metadata and Availability to run in parallel, wait for both
results, and then check to see if there is a checkout action in
Availability before being able to do the right thing.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoRewording of direct link to Overdrive in holds/checkouts list
Steven Chan [Fri, 5 Sep 2014 19:52:56 +0000 (12:52 -0700)]
Rewording of direct link to Overdrive in holds/checkouts list
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoForgot to proxy the URLs in availability actions
Steven Chan [Fri, 5 Sep 2014 18:48:17 +0000 (11:48 -0700)]
Forgot to proxy the URLs in availability actions
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoAdd product ID to context of an action object
Steven Chan [Fri, 5 Sep 2014 18:17:42 +0000 (11:17 -0700)]
Add product ID to context of an action object

Potentially useful for a later refactor

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoImplement a client-side blacklist
Steven Chan [Wed, 3 Sep 2014 22:08:37 +0000 (15:08 -0700)]
Implement a client-side blacklist

Hostnames in the URL can be blacklisted from running Overdrive functions.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoImprove comments for Moment configuration clause in config module
Steven Chan [Wed, 3 Sep 2014 22:07:01 +0000 (15:07 -0700)]
Improve comments for Moment configuration clause in config module
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoRemove unused item_status() function
Steven Chan [Wed, 3 Sep 2014 22:05:07 +0000 (15:05 -0700)]
Remove unused item_status() function
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix error in decoding search parameters in URL
Steven Chan [Wed, 3 Sep 2014 21:03:43 +0000 (14:03 -0700)]
Fix error in decoding search parameters in URL

Was not using a possible delimiter; was not decoding all entities

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoTreat handle() as a method of routes object
Steven Chan [Wed, 3 Sep 2014 19:44:22 +0000 (12:44 -0700)]
Treat handle() as a method of routes object

5 years agoProxy URLs soon rather than late
Steven Chan [Tue, 2 Sep 2014 22:16:37 +0000 (15:16 -0700)]
Proxy URLs soon rather than late
This makes it easier to make the od_data module be primary over od_api.
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoAuto-focus on place hold or checkout action buttons
Steven Chan [Sun, 31 Aug 2014 18:53:16 +0000 (11:53 -0700)]
Auto-focus on place hold or checkout action buttons
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoReplace progress text with a progress bar
Steven Chan [Sun, 31 Aug 2014 17:35:28 +0000 (10:35 -0700)]
Replace progress text with a progress bar

As a way to do it, we slightly generalized the set_message method of the
action dialogue, to default to using a progress bar for the body text if
there is no text string specified as an argument nor as a body property
of the scenario. Thus, for an intent scenario, it is sufficient to use
the default body.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix progress message in action dialogues
Steven Chan [Sun, 31 Aug 2014 17:29:59 +0000 (10:29 -0700)]
Fix progress message in action dialogues

The jQuery ajax method does not implement the full promise interface; it
does not call notify and so the progress callback cannot work. As a
substitute, we pass the progress callback as the beforeSend callback,
which is executed before an ajax send.

Also, we use a progress bar instead of a progress text message.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix manual logout of EG when OD token expires
Steven Chan [Sun, 31 Aug 2014 17:24:05 +0000 (10:24 -0700)]
Fix manual logout of EG when OD token expires
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoCorrect an erroneous edit
Steven Chan [Sun, 31 Aug 2014 17:22:58 +0000 (10:22 -0700)]
Correct an erroneous edit
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoAdd direct links to Overdrive in checkout and hold list
Steven Chan [Sat, 30 Aug 2014 19:54:50 +0000 (12:54 -0700)]
Add direct links to Overdrive in checkout and hold list
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoImplement Overdrive data objects using data classes
Steven Chan [Sat, 30 Aug 2014 18:33:10 +0000 (11:33 -0700)]
Implement Overdrive data objects using data classes

A data class will make a new instance out of an OD object and endow it
with the methods to normalize the object so that it will be easier to use.
Currently, these methods are defined as ad-hoc functions within the
od_api module, making it lengthy and hard to understand.

Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoFix delete an item in checkouts list; regression error
Steven Chan [Fri, 29 Aug 2014 19:41:07 +0000 (12:41 -0700)]
Fix delete an item in checkouts list; regression error
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoUse Session class to implement a session cache
Steven Chan [Fri, 29 Aug 2014 18:47:59 +0000 (11:47 -0700)]
Use Session class to implement a session cache
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoCatchup
Steven Chan [Thu, 28 Aug 2014 01:10:22 +0000 (18:10 -0700)]
Catchup
Signed-off-by: Steven Chan <steven3416@gmail.com>
5 years agoInitial commit
Steven Chan [Wed, 27 Aug 2014 20:51:18 +0000 (13:51 -0700)]
Initial commit
Signed-off-by: Steven Chan <steven3416@gmail.com>