# Define whether a user password is required to complete patron authentication
password_required: 'false' # or 'true'
+ # Base URL/FQDN(s) for hyperlinks to OverDrive products
+ productbaseURLs: [ 'elm.lib.overdrive.com' ]
+
# Define a blacklist based on hostname component, eg, abc.domain1 or xyz.domain2
blacklisted: ( hn = window.location.hostname, bl = ['abc', 'xyz'] ) ->
return unless hn = hn.match(/^(.+?)\./)?[1] # no proper hostname found
'jquery'
'lodash'
'od_api'
+ 'od_config'
'jquery-ui'
], (
$
_
od
+ config
) ->
$.fn.extend
# Return an Overdrive product ID or null from a given DOM context.
# The context can be represented as a jQuery object or as a selector string
_productID: ->
- href = $('a[href*="downloads.bclibrary.ca"], a[href*="elm.lib.overdrive.com"]', @).attr('href')
+ hrefs = []
+ hrefs.push('a[href*="' + productbaseURL + '"]') for productbaseURL in config.productbaseURLs
+ href = $(hrefs.join(','), @).attr('href')
/ID=(.+)/.exec(href)?[1]
# Modify search result row to show e-holdings (available formats and
# List of hrefs which correspond to Overdrive e-items
# TODO this list is duplicated in module od_pages_opac
- hrefs = [
- 'a[href*="downloads.bclibrary.ca"]' # Used in OPAC
- 'a[href*="elm.lib.overdrive.com"]' # Used in XUL staff client
- ]
+ hrefs = []
+ hrefs.push('a[href*="' + productbaseURL + '"]') for productbaseURL in config.productbaseURLs
# Prepare each row of the results table which has an embedded
# Overdrive product ID. A list of Overdrive product IDs is