@@ -117,14 +117,13 @@ function log(text = "", type = mStat, socket = null, direction = 0) {
117
117
//Send to Launcher log view
118
118
let logView = $ ( 'log' ) ;
119
119
//Note scroll position (to see if user has scrolled up), append message, then auto-scroll (down) if bottom was previously in view
120
- console . log ( logView . scrollTop ) ;
120
+ // console.log(logView.scrollTop);
121
121
let scrollTop = logView . scrollTop ;
122
122
let scroll = ( scrollTop + 1 >= logView . scrollHeight - logView . clientHeight ) ;
123
123
logLines . push ( stamp ( verboseLogging ) + text + '<br>' ) ;
124
- if ( logLines . length > 40 ) { logLines . shift ( ) }
124
+ if ( logLines . length > 250 ) { logLines . shift ( ) }
125
125
logView . innerHTML = logLines . join ( '' ) ;
126
- if ( scroll ) { logView . scrollTo ( 0 , logView . scrollHeight ) } else { if ( scrollTop !== logView . ScrollTop ) { logView . scrollTo ( 0 , scrollTop - ( logView . scrollTop - scrollTop ) ) } }
127
- logView . style .
126
+ if ( scroll ) { logView . scrollTo ( 0 , logView . scrollHeight ) } //else {if (scrollTop !== logView.ScrollTop) {logView.scrollTo(0, scrollTop-(logView.scrollTop-scrollTop))}}
128
127
}
129
128
//Send to Launcher console window
130
129
if ( type & mdConsole ) { console . log ( stamp ( true ) + text ) }
@@ -234,13 +233,12 @@ document.addEventListener('DOMContentLoaded', function() {
234
233
235
234
// TODO: re-write this to use onblur and/or onchange to auto-save.
236
235
$ ( 'refresh-connection' ) . onclick = function ( ) {
237
- $ ( 'log' ) . innerHTML = '' ;
238
- // disconnect();
239
- // closeServer();
240
- // if(chrome.storage) {
241
- // chrome.storage.sync.set({'s_port':$('bpc-port').value, 's_url':$('bpc-url').value}, function() {if (chrome.runtime.lastError) {storageError()}});
242
- // }
243
- // connect();
236
+ disconnect ( ) ;
237
+ closeServer ( ) ;
238
+ if ( chrome . storage ) {
239
+ chrome . storage . sync . set ( { 's_port' :$ ( 'bpc-port' ) . value , 's_url' :$ ( 'bpc-url' ) . value } , function ( ) { if ( chrome . runtime . lastError ) { storageError ( ) } } ) ;
240
+ }
241
+ connect ( ) ;
244
242
} ;
245
243
246
244
$ ( 'netmask' ) . addEventListener ( "blur" , function ( ) {
0 commit comments