@@ -1401,17 +1401,19 @@ <h4 class="panel-title">Options</h4>
1401
1401
}
1402
1402
1403
1403
function startConnection ( config ) {
1404
- host = $ ( '#connectionHost' ) . val ( ) . trim ( ) ;
1405
- usingSecure = $ ( "#connectionUsingSecure" ) . prop ( 'checked' ) ;
1404
+ var host = $ ( '#connectionHost' ) . val ( ) . trim ( ) ;
1405
+ var usingSecure = $ ( "#connectionUsingSecure" ) . prop ( 'checked' ) ;
1406
+
1406
1407
// Connect to a print-server instance, if specified
1407
- if ( host != "" && host != 'localhost' ) {
1408
- if ( config ) {
1408
+ if ( host != "" && host != 'localhost' ) {
1409
+ if ( config ) {
1409
1410
config . host = host ;
1410
1411
config . usingSecure = usingSecure ;
1411
1412
} else {
1412
- config = { host : host , usingSecure : usingSecure } ;
1413
+ config = { host : host , usingSecure : usingSecure } ;
1413
1414
}
1414
1415
}
1416
+
1415
1417
if ( ! qz . websocket . isActive ( ) ) {
1416
1418
updateState ( 'Waiting' , 'default' ) ;
1417
1419
@@ -1456,8 +1458,7 @@ <h4 class="panel-title">Options</h4>
1456
1458
1457
1459
qz . networking . devices ( ) . then ( function ( data ) {
1458
1460
var list = '' ;
1459
- var hostname = '' ;
1460
- var username = '' ;
1461
+
1461
1462
for ( var i = 0 ; i < data . length ; i ++ ) {
1462
1463
var info = data [ i ] ;
1463
1464
@@ -1466,8 +1467,8 @@ <h4 class="panel-title">Options</h4>
1466
1467
" <strong>Hostname:</strong> <code>" + info . hostname + "</code>" +
1467
1468
"</li>" +
1468
1469
"<li>" +
1469
- " <strong>Username:</strong> <code>" + info . username + "</code>"
1470
- "</li>" ;
1470
+ " <strong>Username:</strong> <code>" + info . username + "</code>" +
1471
+ "</li>" ;
1471
1472
}
1472
1473
list += "<li>" +
1473
1474
" <strong>Interface:</strong> <code>" + ( info . name || "UNKNOWN" ) + ( info . id ? "</code> (<code>" + info . id + "</code>)" : "</code>" ) +
@@ -2407,7 +2408,14 @@ <h4 class="panel-title">Options</h4>
2407
2408
function resetGeneralOptions ( ) {
2408
2409
//connection
2409
2410
$ ( "#connectionHost" ) . val ( 'localhost' ) ;
2410
- $ ( "#connectionUsingSecure" ) . prop ( 'disabled' , location . protocol !== 'https:' ) ;
2411
+
2412
+ var secureOpt = $ ( "#connectionUsingSecure" ) ;
2413
+ if ( location . protocol !== 'https:' ) {
2414
+ secureOpt . prop ( 'disabled' , true ) ;
2415
+ secureOpt . prop ( 'checked' , false ) ;
2416
+ } else {
2417
+ secureOpt . prop ( 'disabled' , false ) ;
2418
+ }
2411
2419
}
2412
2420
2413
2421
function resetRawOptions ( ) {
0 commit comments