Skip to content

Commit bccf24b

Browse files
author
dsward2
committed
When a "Listen" button is tapped in a web page, the page header will be updated to display the new station name selection. The "Now Playing" page will continuously update the station name in the page header.
1 parent c9f9325 commit bccf24b

19 files changed

Lines changed: 52 additions & 22 deletions

LocalRadio/Web/category.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="container">
5151
<section class="header">
5252
<h2 class="title">LocalRadio</h2>
53-
<h3 class="title">%%CATEGORY_NAME%%</h3>
53+
<h3 class="title" id="listen_title">%%CATEGORY_NAME%%</h3>
5454
%%SCAN_CATEGORY_BUTTON%%
5555
%%CATEGORY_TABLE%%
5656
%%EDIT_CATEGORY_LIST_BUTTON%%

LocalRadio/Web/css/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@
226226

227227
.navbar-list {
228228
list-style: none;
229+
width: 2000px;
230+
white-space: no-wrap;
231+
overflow: hidden;
232+
text-overflow: ellipsis;
229233
margin-bottom: 0; }
230234
.navbar-item {
231235
position: relative;
@@ -240,6 +244,9 @@
240244
margin-right: 15px;
241245
text-decoration: none;
242246
line-height: 6.5rem;
247+
white-space: no-wrap;
248+
overflow: hidden;
249+
text-overflow: ellipsis;
243250
color: #222; }
244251
.has-docked-nav .navbar {
245252
position: fixed;

LocalRadio/Web/devices.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="container">
5151
<section class="header">
5252
<h2 class="title">LocalRadio</h2>
53-
<h3 class="title">Audio Devices</h3>
53+
<h3 class="title" id="listen_title">Audio Devices</h3>
5454
%%DEVICES_FORM%%
5555
<br>&nbsp;
5656
<br>&nbsp;

LocalRadio/Web/editcategorysettings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="container">
5151
<section class="header">
5252
<h2 class="title">LocalRadio</h2>
53-
<h3 class="title">%%EDIT_CATEGORY_NAME%%</h3>
53+
<h3 class="title" id="listen_title">%%EDIT_CATEGORY_NAME%%</h3>
5454
%%EDIT_CATEGORY_SETTINGS%%
5555
</section>
5656
</div>

LocalRadio/Web/editfavorite.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="container">
5151
<section class="header">
5252
<h2 class="title">LocalRadio</h2>
53-
<h3 class="title">%%EDIT_FAVORITE_NAME%%</h3>
53+
<h3 class="title" id="listen_title">%%EDIT_FAVORITE_NAME%%</h3>
5454
%%EDIT_FAVORITE%%
5555
</section>
5656
</div>

LocalRadio/Web/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
<script>
114114

115115
var iframeResizeDone = false;
116+
var nowPlayingTitle = "";
116117

117118
function audioElementLog(audioElement, message)
118119
{
@@ -306,6 +307,9 @@
306307
function startAudioPlayer()
307308
{
308309
console.log("startAudioPlayer");
310+
311+
var nowPlayingNavBarLink = window.document.getElementById("nowPlayingNavBarLink");
312+
nowPlayingNavBarLink.innerText = "NOW PLAYING: " + nowPlayingTitle.innerText;
309313

310314
var needsAudioPlayerStart = true;
311315

@@ -325,7 +329,6 @@
325329
}
326330

327331

328-
329332

330333
function seekToEndForAudioElement(audioPlayer)
331334
{

LocalRadio/Web/js/localradio.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,6 @@ function setFrequencyDigits(frequency)
652652

653653

654654

655-
656-
657655
function 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+
777788
function 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
}

LocalRadio/Web/listen.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="container">
5151
<section class="header">
5252
<h2 class="title">LocalRadio</h2>
53-
<h3 class="title">%%LISTEN_NAME%%</h3>
53+
<h3 class="title" id="listen_title">%%LISTEN_NAME%%</h3>
5454
%%VIEW_LISTEN%%
5555
</section>
5656
</div>

LocalRadio/Web/nowplaying.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@
202202
var nowPlayingDetails = document.getElementById("now-playing-details");
203203
nowPlayingDetails.innerHTML = statusHtml;
204204

205+
window.top.nowPlayingTitle = station_name;
206+
207+
var nowPlayingNavBarLink = window.top.document.getElementById("nowPlayingNavBarLink");
208+
nowPlayingNavBarLink.innerText = "NOW PLAYING: " + station_name;
209+
205210
if (firstPass == true)
206211
{
207212
resizeIframe(window);

LocalRadio/Web/scancategory.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="container">
5151
<section class="header">
5252
<h2 class="title">LocalRadio</h2>
53-
<h3 class="title">%%SCAN_CATEGORY_NAME%%</h3>
53+
<h3 class="title" id="listen_title">%%SCAN_CATEGORY_NAME%%</h3>
5454
%%SCAN_CATEGORY%%
5555
</section>
5656
</div>

0 commit comments

Comments
 (0)