@internetarchive/ia-book-actions 0.1.4-alpha7 → 0.1.5
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/demo/index.html +1 -12
- package/package.json +1 -1
- package/src/ia-book-actions.js +3 -3
package/demo/index.html
CHANGED
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
iaBookActions.localCache = localCache;
|
|
133
133
|
|
|
134
134
|
let loanTotalTime2Min = { loanTotalTime: 20, loanRenewAtLast: 15, pageChangedInLast: 5 };
|
|
135
|
-
let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast:
|
|
135
|
+
let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast: 290, pageChangedInLast: 15 };
|
|
136
136
|
let loanTotalTime1Hour = { loanTotalTime: 3600, loanRenewAtLast: 600, pageChangedInLast: 900 };
|
|
137
137
|
|
|
138
138
|
iaBookActions.loanRenewTimeConfig = loanTotalTime5Min;
|
|
@@ -298,16 +298,6 @@
|
|
|
298
298
|
})
|
|
299
299
|
);
|
|
300
300
|
})
|
|
301
|
-
|
|
302
|
-
document.querySelector('.pageChangedEventSec').addEventListener('click', () => {
|
|
303
|
-
window.dispatchEvent(
|
|
304
|
-
new CustomEvent('BookReader:userAction', {
|
|
305
|
-
detail: {},
|
|
306
|
-
bubbles: true,
|
|
307
|
-
composed: true,
|
|
308
|
-
})
|
|
309
|
-
);
|
|
310
|
-
})
|
|
311
301
|
</script>
|
|
312
302
|
|
|
313
303
|
<div>
|
|
@@ -320,7 +310,6 @@
|
|
|
320
310
|
</td>
|
|
321
311
|
<td>
|
|
322
312
|
<button class="pageChangedEvent">Page Change Event</button>
|
|
323
|
-
<button class="pageChangedEventSec">BR Controls Event</button>
|
|
324
313
|
</td>
|
|
325
314
|
</tr>
|
|
326
315
|
</table>
|
package/package.json
CHANGED
package/src/ia-book-actions.js
CHANGED
|
@@ -293,7 +293,6 @@ export default class IABookActions extends LitElement {
|
|
|
293
293
|
* @see TimerCountdown::timerCountdown
|
|
294
294
|
*/
|
|
295
295
|
this.addEventListener('IABookActions:loanRenew', async event => {
|
|
296
|
-
console.log('event::loanRenew');
|
|
297
296
|
await this.autoLoanRenewChecker(false);
|
|
298
297
|
|
|
299
298
|
// show warning message with remaining time to auto returned it.
|
|
@@ -326,7 +325,7 @@ export default class IABookActions extends LitElement {
|
|
|
326
325
|
* close/hide toast message
|
|
327
326
|
*/
|
|
328
327
|
async closeToastManager() {
|
|
329
|
-
|
|
328
|
+
const toastTemplate = this.shadowRoot.querySelector('toast-template');
|
|
330
329
|
if (toastTemplate) {
|
|
331
330
|
toastTemplate?.remove();
|
|
332
331
|
}
|
|
@@ -591,7 +590,8 @@ export default class IABookActions extends LitElement {
|
|
|
591
590
|
const errorMsg = event?.detail?.data?.error;
|
|
592
591
|
|
|
593
592
|
// template not show create_token errors
|
|
594
|
-
if (errorMsg && action !== 'create_token')
|
|
593
|
+
if (errorMsg && action !== 'create_token')
|
|
594
|
+
this.showErrorModal(errorMsg, action);
|
|
595
595
|
|
|
596
596
|
// if error related to loan token
|
|
597
597
|
// - clear tokenPoller interval
|