@@ -652,8 +652,6 @@ function setFrequencyDigits(frequency)
652652
653653
654654
655-
656-
657655function listenButtonClicked ( form )
658656{
659657 //console.log("listenButtonClicked");
@@ -670,13 +668,17 @@ function listenButtonClicked(form)
670668 xhttp . onreadystatechange = function ( ) {
671669 if ( this . readyState == 4 && this . status == 200 ) {
672670 // response received ok
671+ window . top . nowPlayingTitle = window . document . getElementById ( "listen_title" ) ;
672+
673+ // handle the audio tag with the new source
674+ window . top . postMessage ( "startaudio" , "*" ) ;
673675 }
674676 } ;
675677 xhttp . open ( "POST" , listenButtonClickedUrl , true ) ;
676678 xhttp . send ( jsonData ) ;
677679
678680 // handle the audio tag with the new source
679- window . top . postMessage ( "startaudio" , "*" ) ;
681+ // window.top.postMessage("startaudio", "*");
680682
681683 //console.log("postMessage startaudio");
682684}
@@ -730,13 +732,17 @@ function frequencyListenButtonClicked()
730732 //console.log("readyState="+this.readyState+", status="+this.status);
731733 if ( this . readyState == 4 && this . status == 200 ) {
732734 // response received ok
735+ window . top . nowPlayingTitle = window . document . getElementById ( "listen_title" ) ;
736+
737+ // handle the audio tag with the new source
738+ window . top . postMessage ( "startaudio" , "*" ) ;
733739 }
734740 } ;
735741 xhttp . open ( "POST" , frequencyListenButtonClickedUrl , true ) ;
736742 xhttp . send ( jsonData ) ;
737743
738744 // handle the audio tag with the new source
739- window . top . postMessage ( "startaudio" , "*" ) ;
745+ // window.top.postMessage("startaudio", "*");
740746
741747 //console.log("postMessage startaudio");
742748}
@@ -762,18 +768,23 @@ function scannerListenButtonClicked(form)
762768 xhttp . onreadystatechange = function ( ) {
763769 if ( this . readyState == 4 && this . status == 200 ) {
764770 // response received ok
771+ window . top . nowPlayingTitle = window . document . getElementById ( "listen_title" ) ;
772+
773+ // handle the audio tag with the new source
774+ window . top . postMessage ( "startaudio" , "*" ) ;
765775 }
766776 } ;
767777 xhttp . open ( "POST" , scannerListenButtonClickedUrl , true ) ;
768778 xhttp . send ( jsonData ) ;
769779
770780 // handle the audio tag with the new source
771- window . top . postMessage ( "startaudio" , "*" ) ;
781+ // window.top.postMessage("startaudio", "*");
772782
773783 //console.log("postMessage startaudio");
774784}
775785
776786
787+
777788function deviceListenButtonClicked ( form )
778789{
779790 //console.log("deviceListenButtonClicked");
@@ -790,13 +801,17 @@ function deviceListenButtonClicked(form)
790801 xhttp . onreadystatechange = function ( ) {
791802 if ( this . readyState == 4 && this . status == 200 ) {
792803 // response received ok
804+ window . top . nowPlayingTitle = window . document . getElementById ( "listen_title" ) ;
805+
806+ // handle the audio tag with the new source
807+ window . top . postMessage ( "startaudio" , "*" ) ;
793808 }
794809 } ;
795810 xhttp . open ( "POST" , listenButtonClickedUrl , true ) ;
796811 xhttp . send ( jsonData ) ;
797812
798813 // handle the audio tag with the new source
799- window . top . postMessage ( "startaudio" , "*" ) ;
814+ // window.top.postMessage("startaudio", "*");
800815
801816 //console.log("postMessage startaudio");
802817}
0 commit comments