@internetarchive/ia-book-actions 0.0.30-alpha2 → 0.0.30-alpha3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-book-actions",
3
- "version": "0.0.30-alpha2",
3
+ "version": "0.0.30-alpha3",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -99,13 +99,11 @@ export default class ActionsHandler extends LitElement {
99
99
  this.sendEvent(category, action);
100
100
  });
101
101
 
102
- document.addEventListener('stickyAdminAccessToggled', ({ detail }) => {
102
+ document.addEventListener('stickyAdminAccess', ({ detail }) => {
103
103
  ActionsHandlerService({
104
- action: 'toggleAdminStickyAccess',
104
+ action: 'toggle_sticky_admin_access', // toggle_sticky_admin_access
105
105
  stickyAccess: detail.hasStickyAdminAccess,
106
106
  identifier: this.identifier,
107
- success: () => {},
108
- error: () => {},
109
107
  });
110
108
  });
111
109
  }
@@ -12,7 +12,7 @@ import './components/info-icon.js';
12
12
  import { GetLendingActions } from './core/services/get-lending-actions.js';
13
13
  import { mobileContainerWidth } from './core/config/constants.js';
14
14
  import { LoanTokenPoller } from './core/services/loan-token-poller.js';
15
- import { setItem } from './core/services/doc-cookies.js';
15
+ import { getItem, setItem } from './core/services/doc-cookies.js';
16
16
 
17
17
  export const events = {
18
18
  browseExpired: 'IABookReader:BrowsingHasExpired',
@@ -50,7 +50,7 @@ export default class IABookActions extends LitElement {
50
50
  this.lendingStatus = {};
51
51
  this.width = 0;
52
52
  this.bwbPurchaseUrl = '';
53
- this.lendingBarPostInit = () => {};
53
+ this.lendingBarPostInit = () => { };
54
54
  this.barType = 'action'; // 'title'|'action'
55
55
  this.sharedObserver = undefined;
56
56
  this.disableActionGroup = false;
@@ -81,7 +81,7 @@ export default class IABookActions extends LitElement {
81
81
  }
82
82
 
83
83
  // manage sticky-admin-acces by cookie
84
- // this.hasStickyAdminAccess = getItem('sticky-admin-access') === 'true';
84
+ this.hasStickyAdminAccess = getItem('sticky-admin-access') === 'true';
85
85
  }
86
86
 
87
87
  updated(changed) {
@@ -359,7 +359,7 @@ export default class IABookActions extends LitElement {
359
359
  Please ${refreshButton} to try again or send us an email to
360
360
  <a
361
361
  href="mailto:info@archive.org?subject=Help: cannot access my borrowed book: ${this
362
- .identifier}"
362
+ .identifier}"
363
363
  >info@archive.org</a
364
364
  >`;
365
365
  }
@@ -377,7 +377,7 @@ export default class IABookActions extends LitElement {
377
377
  setItem('sticky-admin-access', this.hasStickyAdminAccess);
378
378
 
379
379
  document.dispatchEvent(
380
- new CustomEvent('stickyAdminAccessToggled', {
380
+ new CustomEvent('stickyAdminAccess', {
381
381
  detail: {
382
382
  hasStickyAdminAccess: this.hasStickyAdminAccess,
383
383
  },