11/*******************************************************************************
2- *
2+ *
33 * main.js: Page-level code used by the main.pug page.
4- *
5- *
4+ *
5+ *
66 * 2022-03-09 Frank Halasz
7- *
8- *
9- * Copyright: 2022 by Interlisp.org
10- *
7+ *
8+ *
9+ * Copyright: 2022 by Interlisp.org
10+ *
1111 *
1212 ******************************************************************************/
1313
2121var localStore ;
2222
2323window . addEventListener ( 'resize' , ( event ) => {
24- fillWindowOnClick ( ) ;
24+ fillWindowOnClick ( ) ;
2525} ) ;
2626
2727window . addEventListener ( 'load' , ( event ) => {
@@ -30,6 +30,14 @@ window.addEventListener('load', (event) => {
3030 const rr = urlParams . get ( 'rr' ) || false ;
3131 const fromvnc = urlParams . get ( 'fromvnc' ) || false ;
3232
33+ if ( isAutoLogin ) {
34+ document . body . style . backgroundImage = "url('images/logos/logo_red_no_border_568x385.png')" ;
35+ document . body . style . backgroundRepeat = "no-repeat" ;
36+ document . body . style . backgroundPosition = "center" ;
37+ document . body . style . position = "relative" ;
38+ }
39+ else document . getElementById ( "page-container" ) . style . visibility = "visible" ;
40+
3341 if ( targetSystem == "Notecards" ) {
3442 document . getElementById ( "fill_window_cb" ) . checked = true ;
3543 document . getElementById ( "dev-div" ) . style . display = "none" ;
@@ -50,6 +58,14 @@ window.addEventListener('load', (event) => {
5058 document . getElementById ( "custom_init_cb" ) . checked = false ;
5159 document . getElementById ( "sftp_checkbox" ) . checked = false ;
5260 document . getElementById ( "interlisp_rb" ) . checked = true ;
61+ } else if ( isAutoLogin ) {
62+ document . getElementById ( "fill_window_cb" ) . checked = true ;
63+ document . getElementById ( "dev-div" ) . style . display = "none" ;
64+ document . getElementById ( "do_not_checkbox_div" ) . style . display = "none" ;
65+ document . getElementById ( "run_notecards_cb" ) . checked = alNotecards ;
66+ document . getElementById ( "run_rooms_cb" ) . checked = alRooms ;
67+ document . getElementById ( "sftp_checkbox" ) . checked = false ;
68+ document . getElementById ( "interlisp_rb" ) . checked = true ;
5369 } else if ( isGuest ) {
5470 document . getElementById ( "fill_window_cb" ) . checked = true ;
5571 document . getElementById ( "dev-div" ) . style . display = "none" ;
@@ -85,7 +101,7 @@ window.addEventListener('load', (event) => {
85101 fillWindowOnClick ( ) ;
86102 document . getElementById ( "dev-options-checkbox" ) . checked = ( localStore . getItem ( "show_dev_options" ) == "true" ) ;
87103 showDevOptionsOnClick ( ) ;
88- if ( ! fromvnc ) {
104+ if ( ! ( isAutoLogin || fromvnc ) ) {
89105 if ( isVerified != true ) {
90106 const dlg = document . getElementById ( rr ? "verification-dialog2" : "verification-dialog1" ) ;
91107 dlg . showModal ( ) ;
@@ -97,6 +113,7 @@ window.addEventListener('load', (event) => {
97113 dlg . showModal ( ) ;
98114 }
99115 }
116+ if ( isAutoLogin && ( ! fromvnc ) ) startSession ( "interlisp" ) ;
100117} ) ;
101118
102119function startSession ( interlispOrXterm ) {
@@ -165,6 +182,7 @@ function startSession (interlispOrXterm) {
165182 + `&rooms=${ runRooms || "false" } `
166183 + `&sftp=${ startSftp || "false" } `
167184 + `&exec=${ medleyExec || "inter" } `
185+ + ( isAutoLogin ? "&autologin" : "" )
168186 ) ;
169187 }
170188 ) ;
@@ -181,6 +199,7 @@ function startSession (interlispOrXterm) {
181199 + `&rooms=${ runRooms || "false" } `
182200 + `&sftp=${ startSftp || "false" } `
183201 + `&exec=${ medleyExec || "inter" } `
202+ + ( isAutoLogin ? "&autologin" : "" )
184203 ) ;
185204 }
186205 } ,
0 commit comments