@@ -8,7 +8,7 @@ const versionChecker = new VersionChecker()
88let eventsAttached = false
99
1010window . onload = async ( e ) => {
11- const bounds = await window . electronAPI . getWindowBounds ( )
11+ const bounds = await window . stretchly . getWindowBounds ( )
1212 const settings = await window . settings . currentSettings ( )
1313
1414 new HtmlTranslate ( document ) . translate ( )
@@ -50,7 +50,7 @@ window.onload = async (e) => {
5050 const [
5151 reference , timeleft , breaknumber ,
5252 postponesnumber , settingsfile , logsfile , doNotDisturb
53- ] = await window . electronAPI . showDebug ( )
53+ ] = await window . stretchly . showDebug ( )
5454 const debugInfo = document . querySelector ( '.debug > :first-child' )
5555 if ( debugInfo . style . display === 'block' ) {
5656 debugInfo . style . display = 'none'
@@ -73,7 +73,7 @@ window.onload = async (e) => {
7373 }
7474 }
7575
76- window . electronAPI . onTranslate ( async ( ) => {
76+ window . stretchly . onTranslate ( async ( ) => {
7777 new HtmlTranslate ( document ) . translate ( )
7878 document . querySelectorAll ( 'input[type="range"]' ) . forEach ( async range => {
7979 const settings = await window . settings . currentSettings ( )
@@ -88,7 +88,7 @@ window.onload = async (e) => {
8888 setWindowHeight ( )
8989 } )
9090
91- window . electronAPI . onEnableContributorPreferences ( ( ) => {
91+ window . stretchly . onEnableContributorPreferences ( ( ) => {
9292 showContributorPreferencesButton ( )
9393 } )
9494
@@ -111,12 +111,12 @@ window.onload = async (e) => {
111111
112112 document . querySelector ( '[name="contributorPreferences"]' ) . onclick = ( event ) => {
113113 event . preventDefault ( )
114- window . electronAPI . openContributorPreferences ( )
114+ window . stretchly . openContributorPreferences ( )
115115 }
116116
117117 document . querySelector ( '[name="syncPreferences"]' ) . onclick = ( event ) => {
118118 event . preventDefault ( )
119- window . electronAPI . openSyncPreferences ( )
119+ window . stretchly . openSyncPreferences ( )
120120 }
121121
122122 // TODO refactor out?
@@ -226,7 +226,7 @@ window.onload = async (e) => {
226226 document . querySelectorAll ( '.sounds img' ) . forEach ( preview => {
227227 if ( ! eventsAttached ) {
228228 preview . onclick = ( event ) =>
229- window . electronAPI . playSound ( preview . closest ( 'div' ) . querySelector ( 'input' ) . value )
229+ window . stretchly . playSound ( preview . closest ( 'div' ) . querySelector ( 'input' ) . value )
230230 }
231231 } )
232232
@@ -248,22 +248,22 @@ window.onload = async (e) => {
248248 } )
249249
250250 document . querySelector ( '.settings > div > button' ) . onclick = ( event ) => {
251- window . electronAPI . restoreDefaults ( )
251+ window . stretchly . restoreDefaults ( )
252252 }
253253
254254 document . querySelectorAll ( '.about a' ) . forEach ( ( item ) => {
255255 item . onclick = ( event ) => {
256256 event . preventDefault ( )
257257 if ( event . target . classList . contains ( 'file' ) ) {
258- window . electronAPI . openPath ( event . target . innerHTML )
258+ window . electronApi . openPath ( event . target . innerHTML )
259259 } else {
260- window . electronAPI . openExternal ( event . target . href )
260+ window . electronApi . openExternal ( event . target . href )
261261 }
262262 }
263263 } )
264264
265265 document . querySelector ( '[name="becomePatron"]' ) . onclick = ( ) => {
266- window . electronAPI . openExternal ( 'https://hovancik.net/stretchly/sponsor' )
266+ window . electronApi . openExternal ( 'https://hovancik.net/stretchly/sponsor' )
267267 }
268268
269269 document . querySelector ( '[name="alreadyContributor"]' ) . onclick = ( ) => {
@@ -279,11 +279,11 @@ window.onload = async (e) => {
279279 document . querySelectorAll ( '.authenticate a' ) . forEach ( ( button ) => {
280280 button . onclick = ( event ) => {
281281 event . preventDefault ( )
282- window . electronAPI . openContributorAuth ( button . dataset . provider )
282+ window . stretchly . openContributorAuth ( button . dataset . provider )
283283 }
284284 } )
285285
286- document . querySelector ( '.version' ) . innerHTML = await window . electronAPI . getVersion ( )
286+ document . querySelector ( '.version' ) . innerHTML = await window . stretchly . getVersion ( )
287287 versionChecker . latest ( )
288288 . then ( version => {
289289 document . querySelector ( '.latestVersion' ) . innerHTML = version . replace ( 'v' , '' )
@@ -312,7 +312,7 @@ window.onload = async (e) => {
312312 }
313313 }
314314 if ( height ) {
315- window . electronAPI . setWindowSize ( bounds . width , height )
315+ window . stretchly . setWindowSize ( bounds . width , height )
316316 }
317317 }
318318
0 commit comments