File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ function addFilterSuggestionDiv(setFocusOnAdd = false) {
7979
8080function setInitialState ( ) {
8181 chrome . storage . sync . get ( {
82+ baseUrl : "https://www.stackoverflow.com/search?q=" ,
8283 shouldOpenInSameTab : true ,
8384 questionsWithCodeFilter : false ,
8485 communityWikisFilter : false ,
@@ -125,6 +126,26 @@ function setInitialState() {
125126 }
126127 }
127128 saveFilterSuggestions ( false ) ;
129+
130+ $ ( "#default_url" ) . val ( items . baseUrl ) ;
131+ $ ( "#default_url_button" ) . click ( function ( ) {
132+ if ( $ ( this ) . html ( ) == "Edit" ) {
133+ $ ( "#default_url" ) . attr ( 'disabled' , false ) ;
134+ $ ( "#default_url" ) . focus ( ) ;
135+ $ ( "#default_url_button" ) . html ( "Save" ) ;
136+ } else {
137+ $ ( "#default_url" ) . attr ( 'disabled' , true ) ;
138+ $ ( "#default_url_button" ) . html ( "Edit" ) ;
139+ chrome . storage . sync . set ( {
140+ baseUrl : $ ( "#default_url" ) . val ( )
141+ } , function ( ) {
142+ showSavedAlert ( ) ;
143+ } ) ;
144+ }
145+ setTimeout ( ( ) => {
146+ $ ( this ) . blur ( ) ;
147+ } , 250 ) ;
148+ } ) ;
128149 } ) ;
129150}
130151
You can’t perform that action at this time.
0 commit comments