@internetarchive/bookreader 5.0.0-53-alpha2 → 5.0.0-53-alpha3

Sign up to get free protection for your applications and to get access to all the features.
@@ -128,11 +128,11 @@
128
128
  });
129
129
 
130
130
  // analytics stub
131
- // window.archive_analytics = {
132
- // send_event_no_sampling: (category, action, label) => console.log('~~~ NO SAMPLE EVENT CALLED: ', { category, action, label }),
133
- // send_event: (category, action, label) => console.log('~~~ send_event SAMPLE EVENT CALLED: ', { category, action, label }),
134
- // send_ping: (category, action, label) => console.log('~~~ send_ping SAMPLE EVENT CALLED: ', { category, action, label }),
135
- // }
131
+ window.archive_analytics = {
132
+ send_event_no_sampling: (category, action, label) => console.log('~~~ NO SAMPLE EVENT CALLED: ', { category, action, label }),
133
+ send_event: (category, action, label) => console.log('~~~ send_event SAMPLE EVENT CALLED: ', { category, action, label }),
134
+ send_ping: (category, action, label) => console.log('~~~ send_ping SAMPLE EVENT CALLED: ', { category, action, label }),
135
+ }
136
136
  </script>
137
137
 
138
138
  <!-- IA fetch demo -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/bookreader",
3
- "version": "5.0.0-53-alpha2",
3
+ "version": "5.0.0-53-alpha3",
4
4
  "description": "The Internet Archive BookReader.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -7,7 +7,7 @@ export const EVENTS = {
7
7
  PostInit: 'PostInit',
8
8
  stop: 'stop',
9
9
  resize: 'resize',
10
- userAction: 'userAction',
10
+ userAction: 'userAction', // event to know if user is actively reading
11
11
  // nav events:
12
12
  navToggled: 'navToggled',
13
13
  // menu click events
package/src/BookReader.js CHANGED
@@ -1282,8 +1282,8 @@ BookReader.prototype.updateFirstIndex = function(
1282
1282
 
1283
1283
  this.trigger(BookReader.eventNames.pageChanged);
1284
1284
 
1285
- // - specific event to know if user is reading book
1286
- this.trigger(BookReader.eventNames.userAction)
1285
+ // event to know if user is actively reading
1286
+ this.trigger(BookReader.eventNames.userAction);
1287
1287
  this._components.navbar.updateNavIndexThrottled(index);
1288
1288
  };
1289
1289
 
@@ -1544,7 +1544,8 @@ BookReader.prototype.bindNavigationHandlers = function() {
1544
1544
  },
1545
1545
  };
1546
1546
 
1547
- // custom event for auto-loan-renew in ia-book-actions to know if user is active
1547
+ // custom event for auto-loan-renew in ia-book-actions
1548
+ // - to know if user is actively reading
1548
1549
  this.$('nav.BRcontrols li button').on('click', () => {
1549
1550
  this.trigger(BookReader.eventNames.userAction);
1550
1551
  });