@@ -99,9 +99,8 @@ function addReadingList() {
9999 name : "link" ,
100100 class : "btn btn-lg ' + 'buttonConfirmCompletion'" ,
101101 href : nxt_link ,
102- text : `Continue to page ${
103- position + 2
104- } of ${ num_readings } in the reading assignment.`,
102+ text : `Continue to page ${ position + 2
103+ } of ${ num_readings } in the reading assignment.`,
105104 } ) ;
106105 } else {
107106 l = $ ( "<div />" , {
@@ -196,7 +195,7 @@ class PageProgressBar {
196195 if (
197196 val == 100.0 &&
198197 $ ( "#completionButton" ) . text ( ) . toLowerCase ( ) ===
199- "mark as completed"
198+ "mark as completed"
200199 ) {
201200 $ ( "#completionButton" ) . click ( ) ;
202201 }
@@ -206,12 +205,29 @@ class PageProgressBar {
206205
207206export var pageProgressTracker = { } ;
208207
209- function handlePageSetup ( ) {
208+ async function handlePageSetup ( ) {
210209 var mess ;
211- if ( eBookConfig . useRunestoneServices ) {
212- jQuery . get ( eBookConfig . ajaxURL + "set_tz_offset" , {
213- timezoneoffset : new Date ( ) . getTimezoneOffset ( ) / 60 ,
214- } ) ;
210+ let headers = new Headers ( {
211+ "Content-type" : "application/json; charset=utf-8" ,
212+ Accept : "application/json" ,
213+ } ) ;
214+ let data = { timezoneoffset : new Date ( ) . getTimezoneOffset ( ) / 60 }
215+ let request = new Request (
216+ "/logger/set_tz_offset" ,
217+ {
218+ method : "POST" ,
219+ body : JSON . stringify ( data ) ,
220+ headers : headers ,
221+ }
222+ ) ;
223+ try {
224+ let response = await fetch ( request ) ;
225+ if ( response . status != 200 ) {
226+ console . log ( `Failed to set timezone! ${ response . statusText } ` )
227+ }
228+ data = await response . json ( ) ;
229+ } catch ( e ) {
230+
215231 }
216232
217233 if ( eBookConfig . isLoggedIn ) {
0 commit comments