File tree Expand file tree Collapse file tree 2 files changed +31
-28
lines changed
Expand file tree Collapse file tree 2 files changed +31
-28
lines changed Original file line number Diff line number Diff line change 106106 }
107107 </ script >
108108
109- < script type =module >
110-
111- ( ( ) => {
112- // Bail out if SpeedCurve is not available.
113- if ( ! window . LUX || typeof window . LUX . addData !== 'function' ) return ;
114-
115- const obs = window . obs || Object . create ( null ) ;
116-
117- // Keys we intend to send. Keep in sync with obs.js
118- const keys = [
119- 'dataSaver' ,
120- 'rttBucket' ,
121- 'rttCategory' ,
122- 'downlinkBucket' ,
123- 'downlinkMax' ,
124- 'batteryCritical' ,
125- 'batteryLow' ,
126- 'batteryCharging' ,
127- ] ;
128-
129- for ( const key of keys ) {
130- if ( Object . prototype . hasOwnProperty . call ( obs , key ) ) {
131- window . LUX . addData ( key , obs [ key ] ) ;
132- }
133- }
134- } ) ( ) ;
135-
136- </ script >
109+ < script src =/js/speedcurve.js type =module > </ script >
Original file line number Diff line number Diff line change 1+ /**
2+ * All the data previously captured by Obs.js is now sent to SpeedCurve!
3+ *
4+ * I ❤️ SpeedCurve!
5+ */
6+
7+ ( ( ) => {
8+ // Bail out if SpeedCurve is not available.
9+ if ( ! window . LUX || typeof window . LUX . addData !== 'function' ) return ;
10+
11+ const obs = window . obs || Object . create ( null ) ;
12+
13+ // Keys we intend to send. Keep in sync with obs.js
14+ const keys = [
15+ 'dataSaver' ,
16+ 'rttBucket' ,
17+ 'rttCategory' ,
18+ 'downlinkBucket' ,
19+ 'downlinkMax' ,
20+ 'batteryCritical' ,
21+ 'batteryLow' ,
22+ 'batteryCharging' ,
23+ ] ;
24+
25+ for ( const key of keys ) {
26+ if ( Object . prototype . hasOwnProperty . call ( obs , key ) ) {
27+ window . LUX . addData ( key , obs [ key ] ) ;
28+ }
29+ }
30+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments