@@ -700,6 +700,7 @@ function Replay(completed) {
700700 }
701701 newText = newText + words [ i ] ;
702702 elements . workAreaText . value += newText ;
703+ ScrollToEnd ( ) ;
703704 i ++ ;
704705 setTimeout ( type , kReplayDelay ) ;
705706 }
@@ -899,58 +900,6 @@ function WorkAreaTextClicked(event) {
899900 return result ;
900901}
901902
902- function HandleColorWheel ( event ) {
903- var degrees = 30 ;
904-
905- if ( event . shiftKey ) {
906- degrees = - degrees ;
907- }
908-
909- RotateColors ( degrees ) ;
910- }
911-
912- function RotateColors ( degrees ) {
913- let root = document . querySelector ( ':root' ) ;
914- let computedStyle = getComputedStyle ( root ) ;
915-
916- while ( degrees < 0 ) {
917- degrees += 360 ;
918- }
919-
920- let color1 = computedStyle . getPropertyValue ( '--color1' )
921- let color2 = computedStyle . getPropertyValue ( '--color2' )
922- let color3 = computedStyle . getPropertyValue ( '--color3' )
923- let color4 = computedStyle . getPropertyValue ( '--color4' )
924- let color5 = computedStyle . getPropertyValue ( '--color5' )
925- let color6 = computedStyle . getPropertyValue ( '--color6' )
926- let color7 = computedStyle . getPropertyValue ( '--color7' )
927- let color8 = computedStyle . getPropertyValue ( '--color8' )
928- let color9 = computedStyle . getPropertyValue ( '--color9' )
929- let color10 = computedStyle . getPropertyValue ( '--color10' )
930-
931- color1 = rotateRGB ( color1 , degrees ) ;
932- color2 = rotateRGB ( color2 , degrees ) ;
933- color3 = rotateRGB ( color3 , degrees ) ;
934- color4 = rotateRGB ( color4 , degrees ) ;
935- color5 = rotateRGB ( color5 , degrees ) ;
936- color6 = rotateRGB ( color6 , degrees ) ;
937- color7 = rotateRGB ( color7 , degrees ) ;
938- color8 = rotateRGB ( color8 , degrees ) ;
939- color9 = rotateRGB ( color9 , degrees ) ;
940- color10 = rotateRGB ( color10 , degrees ) ;
941-
942- root . style . setProperty ( '--color1' , color1 ) ;
943- root . style . setProperty ( '--color2' , color2 ) ;
944- root . style . setProperty ( '--color3' , color3 ) ;
945- root . style . setProperty ( '--color4' , color4 ) ;
946- root . style . setProperty ( '--color5' , color5 ) ;
947- root . style . setProperty ( '--color6' , color6 ) ;
948- root . style . setProperty ( '--color7' , color7 ) ;
949- root . style . setProperty ( '--color8' , color8 ) ;
950- root . style . setProperty ( '--color9' , color9 ) ;
951- root . style . setProperty ( '--color10' , color10 ) ;
952- }
953-
954903function ToggleFullScreen ( ) {
955904 var elt = document . documentElement ;
956905
@@ -1382,18 +1331,10 @@ function UseHash() {
13821331 // convert old generate to complete.
13831332 if ( 'generated' in data ) {
13841333 completed = data [ 'generated' ] ;
1385- elements . completedText . value = completed ;
1386- }
1387- else {
1388- elements . completedText . value = '' ;
13891334 }
13901335
13911336 if ( 'auto-generate' in data ) {
13921337 autoComplete = data [ 'auto-generate' ] ;
1393- elements . autoCompleteCheckbox . checked = autoComplete ;
1394- }
1395- else {
1396- elements . autoCompleteCheckbox . checked = false ;
13971338 }
13981339
13991340 if ( kLogging || logThis ) console . log ( '- cue:' ) ;
@@ -1422,6 +1363,7 @@ function UseHash() {
14221363 }
14231364 }
14241365 else {
1366+ if ( kLogging || logThis ) console . log ( 'Mode is cue.' ) ;
14251367 elements . workAreaText . value = cue ;
14261368 PushChange ( ) ;
14271369 }
@@ -1441,6 +1383,8 @@ function UseHash() {
14411383
14421384 }
14431385 catch {
1386+ if ( kLogging || logThis ) console . log ( 'completed != empty.' ) ;
1387+
14441388 // If something goes wrong, restore the settings.
14451389 elements . workAreaText . value = saveWorkAreaValue ;
14461390 elements . temperature . value = saveTemperatureValue ;
@@ -1462,7 +1406,7 @@ function UseHash() {
14621406 Complete ( ) ;
14631407 } , kWaitToComplete ) ;
14641408 }
1465- else if ( completed != '' ) {
1409+ else if ( ( completed != null ) && ( completed != '' ) ) {
14661410 setTimeout ( ( ) => {
14671411 Replay ( completed ) ;
14681412 } , kWaitToComplete ) ;
0 commit comments