@internetarchive/ia-book-actions 0.1.3-alpha2 → 0.1.4-alpha1
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
CHANGED
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast: 180, pageChangedInLast: 15 };
|
|
136
136
|
let loanTotalTime1Hour = { loanTotalTime: 3600, loanRenewAtLast: 600, pageChangedInLast: 900 };
|
|
137
137
|
|
|
138
|
-
iaBookActions.loanRenewTimeConfig =
|
|
138
|
+
iaBookActions.loanRenewTimeConfig = loanTotalTime2Min;
|
|
139
139
|
|
|
140
140
|
let lendingStatus1 = iaBookActions.lendingStatus;
|
|
141
141
|
let secondsLeftOnLoan = iaBookActions.loanRenewTimeConfig.loanTotalTime;
|
|
@@ -150,6 +150,23 @@
|
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
+
window.addEventListener('BookReader:userAction', () => {
|
|
154
|
+
if (this.borrowType === 'browsed') {
|
|
155
|
+
this.suppressToast = false;
|
|
156
|
+
this.autoLoanRenewChecker(true);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return nothing;
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
document.querySelector('.brControlClick').addEventListener('click', () => {
|
|
163
|
+
window.dispatchEvent(new CustomEvent('BookReader:userAction', {
|
|
164
|
+
bubbles: true,
|
|
165
|
+
composed: true,
|
|
166
|
+
detail: { props },
|
|
167
|
+
}));
|
|
168
|
+
});
|
|
169
|
+
|
|
153
170
|
document.querySelectorAll('.errorEnable input[type=checkbox]').forEach((item) => {
|
|
154
171
|
if (window.location.href.indexOf('?error=true') !== -1) {
|
|
155
172
|
item.checked = true;
|
|
@@ -311,6 +328,9 @@
|
|
|
311
328
|
<td>
|
|
312
329
|
<button class="pageChangedEvent">Page Change Event</button>
|
|
313
330
|
</td>
|
|
331
|
+
<td>
|
|
332
|
+
<button class="brControlClick">Br Controls</button>
|
|
333
|
+
</td>
|
|
314
334
|
</tr>
|
|
315
335
|
</table>
|
|
316
336
|
</fieldset>
|
package/package.json
CHANGED
|
@@ -52,7 +52,7 @@ export default class TimerCountdown extends LitElement {
|
|
|
52
52
|
|
|
53
53
|
timerCountdown() {
|
|
54
54
|
// - let just execute setInterval in every 1 minute
|
|
55
|
-
this.timerExecutionSeconds =
|
|
55
|
+
this.timerExecutionSeconds = 1;
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* set interval in window object
|
|
@@ -63,6 +63,7 @@ export default class TimerCountdown extends LitElement {
|
|
|
63
63
|
const secondsLeft = Math.round(this.secondsLeftOnLoan);
|
|
64
64
|
|
|
65
65
|
console.log(
|
|
66
|
+
new Date().toLocaleTimeString(),
|
|
66
67
|
'timeLeftInSec',
|
|
67
68
|
secondsLeft,
|
|
68
69
|
' ||| timeLeftInMin',
|
package/src/ia-book-actions.js
CHANGED
|
@@ -271,7 +271,7 @@ export default class IABookActions extends LitElement {
|
|
|
271
271
|
/**
|
|
272
272
|
* detect click-event on document to close toast-template
|
|
273
273
|
*/
|
|
274
|
-
|
|
274
|
+
window.addEventListener('click', e => {
|
|
275
275
|
if (this.loanRenewHelper && this.loanRenewResult.secondsLeft > 0) {
|
|
276
276
|
this.suppressToast = true;
|
|
277
277
|
}
|