@@ -86,6 +86,7 @@ function checkIfCorrectState() {
86
86
}
87
87
88
88
function setupUI ( ) {
89
+ console . log ( '[setupUI] appending intros...' )
89
90
const identity = getSearchEngine ( )
90
91
// redirect to Google Images search (if needed)
91
92
if ( window . location . host == 'www.google.com' &&
@@ -94,7 +95,7 @@ function setupUI() {
94
95
// Google homepage => Google image search homepage
95
96
window . location = 'https://www.google.com/imghp' ;
96
97
if ( state !== states . WAITING ) setState ( states . WAITING )
97
- } else if ( window . location . hash == "#intro" ) {
98
+ } else if ( window . location . hash == "#intro" ) {
98
99
$ ( document . body ) . addClass ( "firewall-intro" ) ;
99
100
}
100
101
@@ -117,7 +118,9 @@ function setupUI() {
117
118
// add 'Firewall' button to bottom of page that lets user edit their name & toggle autocomplete
118
119
// TODO: figure out why the autocomplete toggle isn't working
119
120
const suggestChecked = autocompleteEnabled ? ' checked' : '' ;
120
- $ ( '#fsr, #lh, #ft, .wrapper_imgfrom_box' ) . append (
121
+ const $foo = $ ( '#fsr, #lh, #ft, .wrapper_imgfrom_box' )
122
+ console . log ( '[$foo]' , $foo ) ;
123
+ $foo . append (
121
124
'<div id="firewall">' +
122
125
'<a href="#firewall" id="firewall-show" class="skin_from_link">Firewall</a>' +
123
126
'<form action="#" id="firewall-form" autocomplete="off">' +
@@ -198,6 +201,7 @@ function setupUI() {
198
201
$ ( "#firewall-intro" ) . addClass ( "inverted" ) ;
199
202
}
200
203
function hide_intro ( e ) {
204
+ console . log ( '[hide_intro]' , e )
201
205
e . preventDefault ( ) ;
202
206
var name = $ ( "#firewall-intro-name" ) . val ( ) ;
203
207
if ( name == "" ) {
@@ -287,6 +291,7 @@ function setupMessageListener() {
287
291
} else if ( e . type == "images_loading" ) {
288
292
$ ( document . body ) . addClass ( "firewall-loading" ) ;
289
293
} else if ( e . type == "close_intro" ) {
294
+ console . log ( '[close_intro]' , e )
290
295
$ ( document . body ) . removeClass ( "firewall-intro" ) ;
291
296
$ ( "#firewall-client-id" ) . val ( e . name ) ;
292
297
} else if ( e . type == "user_activity" ) {
@@ -399,11 +404,11 @@ function main() {
399
404
submitImagesToWordpress ( ( ) => {
400
405
console . log ( "[main] submitImagesToWordpress callback, unlocking search boxes" ) ;
401
406
} )
407
+ submitImages ( ( ) => {
408
+ console . log ( "[main] submitImages callback" )
409
+ setState ( states . DONE )
410
+ } )
402
411
}
403
- submitImages ( ( ) => {
404
- console . log ( "[main] submitImages callback" )
405
- setState ( states . DONE )
406
- } )
407
412
} else {
408
413
console . log ( "waiting for submitImages to finish" )
409
414
}
0 commit comments