@@ -131,7 +131,7 @@ const chatgpt = {
131
131
modalMessage = document . createElement ( 'p' ) ;
132
132
133
133
// Create/append/update modal style (if missing or outdated)
134
- const thisUpdated = 1735475757891 // timestamp of last edit for this file's `modalStyle`
134
+ const thisUpdated = 1735768363880 // timestamp of last edit for this file's `modalStyle`
135
135
let modalStyle = document . querySelector ( '#chatgpt-modal-style' ) ; // try to select existing style
136
136
if ( ! modalStyle || parseInt ( modalStyle . getAttribute ( 'last-updated' ) , 10 ) < thisUpdated ) { // if missing or outdated
137
137
if ( ! modalStyle ) { // outright missing, create/id/attr/append it first
@@ -305,30 +305,29 @@ const chatgpt = {
305
305
306
306
// Define alert dismisser
307
307
const dismissAlert = ( ) => {
308
- modalContainer . style . backgroundColor = 'transparent' ;
309
- modal . style . animation = 'alert-zoom-fade-out 0.135s ease-out' ;
310
- setTimeout ( ( ) => { // delay removal for fade-out
308
+ modalContainer . style . backgroundColor = 'transparent'
309
+ modal . style . animation = 'alert-zoom-fade-out 0.135s ease-out'
310
+ modal . onanimationend = ( ) => {
311
311
312
312
// Remove alert
313
- modalContainer . remove ( ) ; // ...from DOM
314
- alertQueue = JSON . parse ( localStorage . alertQueue ) ;
315
- alertQueue . shift ( ) ; // + memory
316
- localStorage . alertQueue = JSON . stringify ( alertQueue ) ; // + storage
317
- document . removeEventListener ( 'keydown' , handlers . dismiss . key ) ; // prevent memory leaks
313
+ modalContainer . remove ( ) // ...from DOM
314
+ alertQueue = JSON . parse ( localStorage . alertQueue )
315
+ alertQueue . shift ( ) // + memory
316
+ localStorage . alertQueue = JSON . stringify ( alertQueue ) // + storage
317
+ document . removeEventListener ( 'keydown' , handlers . dismiss . key ) // prevent memory leaks
318
318
319
319
// Check for pending alerts in queue
320
320
if ( alertQueue . length > 0 ) {
321
- const nextAlert = document . getElementById ( alertQueue [ 0 ] ) ;
321
+ const nextAlert = document . getElementById ( alertQueue [ 0 ] )
322
322
setTimeout ( ( ) => {
323
- nextAlert . style . display = '' ;
324
- setTimeout ( ( ) => { nextAlert . classList . add ( 'animated' ) ; } , 100 ) ;
325
- } , 500 ) ;
323
+ nextAlert . style . display = ''
324
+ setTimeout ( ( ) => nextAlert . classList . add ( 'animated' ) , 100 )
325
+ } , 500 )
326
326
}
327
+ }
328
+ }
327
329
328
- } , 155 ) ;
329
- } ;
330
-
331
- return modalContainer . id ; // if assignment used
330
+ return modalContainer . id // if assignment used
332
331
} ,
333
332
334
333
async askAndGetReply ( query ) {
0 commit comments