function(d){
// note if d.length == 0, there is no content to display
// hide the Loading... text
- dojo.byId('novelist-loading').innerHTML = '';
+ document.getElementById('novelist-loading').innerHTML = '';
}
)}, 100);
[%- END; # Novelist -%]
// enforce removal of ebook API cookies on logout
window.addEventListener("load", () => {
- var logout_handle = dojo.connect(dojo.byId('#logout_link'), 'onclick', function() {
+ document.getElementById('logout_link').addEventListener('click', () => {
dojo.forEach(cookie_registry, function(cookie) {
dojo.cookie(cookie, '', {path: '/', expires: '-1h'});
});
- // When we switch to jQuery, use .one()
- // instead of dojo's .connect() and .disconnect()
- dojo.disconnect(logout_handle);
- });
+ }, { once: true });
});
</script>
[% END %]
window.addEventListener("load", () => {
- var handle = dojo.connect(dojo.byId('#login-form-box'), 'onclick', function(evt) {
- // disconnect this event since it's one-time-only
- // (when we switch to jQuery, we can use .one() here)
- dojo.disconnect(handle);
-
+ document.getElementById('login-form-box').addEventListener('click', () => {
// we cache the username (and password) for now, but will
// replace that with the patron's active barcode later
vendors_requiring_password.forEach(function(v) {
if (vendor_list.includes(v)) {
checkSession(v, function(v,ses) {
- var username = dojo.byId('#username_field').value;
- var password = dojo.byId('#password_field').value;
+ var username = document.getElementById('username_field').value;
+ var password = document.getElementById('password_field').value;
new OpenSRF.ClientSession('open-ils.ebook_api').request({
method: 'open-ils.ebook_api.patron.cache_password',
params: [ ses, password ],
});
}
});
- });
+ }, { once: true });
});
</script>
/* Set focus, and place the cursor at the end of the input string */
window.addEventListener("load", () => {
/* Don't error out if the object doesn't exist, like on advanced search pages */
- if (dojo.byId('search_box')) {
+ if (document.getElementById('search_box')) {
dijit.byId('search_box').focus();
var sb_value = dijit.byId('search_box').value;
/* Dojo won't trigger a change if the value doesn't change */
dojo.forEach(holdings.formats, function(f) {
dojo.create("li", { innerHTML: f.name }, formats_ul);
});
- var status_node = dojo.byId(ebook.rec_id + '_status');
+ var status_node = document.getElementById(ebook.rec_id + '_status');
var status_str = holdings.copies_available + ' of ' + holdings.copies_owned + ' available';
status_node.innerHTML = status_str;
document.getElementById(ebook.rec_id + '_ebook_holdings').classList.remove('hidden');
var ebook = this;
// get selected checkout format (optional, used by OverDrive)
var checkout_format;
- var format_selector = dojo.byId('checkout-format');
+ var format_selector = document.getElementById('checkout-format');
if (format_selector) {
checkout_format = format_selector.value;
}
var ses = this.ses || dojo.cookie(this.vendor);
var ebook = this;
var request_link;
- var format_selector = dojo.byId('download-format');
+ var format_selector = document.getElementById('download-format');
if (!format_selector) {
console.log('could not find a specified format for download');
return;
if(typeof(eCheckout) != 'undefined' && eCheckout != null)
{
- dojo.byId('dash_e_checked').innerHTML = total_checkouts;
+ document.getElementById('dash_e_checked').innerHTML = total_checkouts;
}
if(typeof(eHolds) != 'undefined' && eHolds != null)
{
- dojo.byId('dash_e_holds').innerHTML = total_holds_pending;
+ document.getElementById('dash_e_holds').innerHTML = total_holds_pending;
}
if(typeof(ePickup) != 'undefined' && ePickup != null)
{
- dojo.byId('dash_e_pickup').innerHTML = total_holds_ready;
+ document.getElementById('dash_e_pickup').innerHTML = total_holds_ready;
}
if(typeof(eDash) != 'undefined' && eDash != null)
{
var total_holds_pending = (typeof xacts.holds_pending === 'undefined') ? '-' : xacts.holds_pending.length;
var total_holds_ready = (typeof xacts.holds_ready === 'undefined') ? '-' : xacts.holds_ready.length;
// update totals
- dojo.byId('acct_sum_ebook_circ_total').innerHTML = total_checkouts;
- dojo.byId('acct_sum_ebook_hold_total').innerHTML = total_holds_pending;
- dojo.byId('acct_sum_ebook_hold_ready_total').innerHTML = total_holds_ready;
+ document.getElementById('acct_sum_ebook_circ_total').innerHTML = total_checkouts;
+ document.getElementById('acct_sum_ebook_hold_total').innerHTML = total_holds_pending;
+ document.getElementById('acct_sum_ebook_hold_ready_total').innerHTML = total_holds_ready;
// unhide display elements
document.getElementById('acct_sum_ebook_circs').classList.remove('hidden');
document.getElementById('acct_sum_ebook_holds').classList.remove('hidden');