@@ -317,8 +317,8 @@ <h4>Bash file preview:</h4>
317317 <!-- Collect the nav links, forms, and other content for toggling -->
318318 < ul class ="nav navbar-nav ">
319319 < li > < a id ="copyLab "> < i class ="fas fa-copy "> </ i > < strong > Copy lab on Host *</ strong > </ a > </ li >
320- < li > < a id ="lstart "> < i class ="fas fa-play-circle "> </ i > < strong > Run LStart on Host **</ strong > </ a > </ li >
321- < li > < a id ="lclean "> < i class ="fas fa-stop-circle "> </ i > < strong > Run LClean on Host **</ strong > </ a > </ li >
320+ < li > < a id ="lstart " class =" disabledLink " > < i class ="fas fa-play-circle "> </ i > < strong > Run LStart on Host **</ strong > </ a > </ li >
321+ < li > < a id ="lclean " class =" disabledLink " > < i class ="fas fa-stop-circle "> </ i > < strong > Run LClean on Host **</ strong > </ a > </ li >
322322 </ ul >
323323 < div style ="clear:both ">
324324 < span class ="label label-warning ">
@@ -416,26 +416,36 @@ <h4 class="modal-title">Running Commands</h4>
416416
417417 var electron ;
418418 var isWin ;
419+ var isCopied = false ;
419420
420421 function copyLab ( e ) {
421422 e . preventDefault ( ) ;
422423 var script = document . querySelector ( '#sh_script' ) . value ;
423424 const { ipcRenderer} = electron ;
424425 //console.log(script);
425426 ipcRenderer . send ( 'script:copy' , script ) ;
427+ isCopied = true ;
428+ var lStartButton = document . getElementById ( 'lstart' ) ;
429+ lStartButton . classList . remove ( "disabledLink" ) ;
430+ var lCleanButton = document . getElementById ( 'lclean' ) ;
431+ lCleanButton . classList . remove ( "disabledLink" ) ;
426432 }
427433 function executeStart ( e ) {
428434 e . preventDefault ( ) ;
429- show_modal ( ) ;
430- const { ipcRenderer} = electron ;
431- //console.log(script);
432- ipcRenderer . send ( 'script:execute' ) ;
435+ if ( isCopied ) {
436+ show_modal ( ) ;
437+ const { ipcRenderer} = electron ;
438+ //console.log(script);
439+ ipcRenderer . send ( 'script:execute' ) ;
440+ }
433441 }
434442 function executeClean ( e ) {
435443 e . preventDefault ( ) ;
436- show_modal ( ) ;
437- const { ipcRenderer} = electron ;
438- ipcRenderer . send ( 'script:clean' ) ;
444+ if ( isCopied ) {
445+ show_modal ( ) ;
446+ const { ipcRenderer} = electron ;
447+ ipcRenderer . send ( 'script:clean' ) ;
448+ }
439449 }
440450
441451 if ( isElectron ( ) ) {
0 commit comments