@@ -212,8 +212,8 @@ class PyRadioServer(object):
212
212
<div class="col-xs-4 col-lg-4">
213
213
<div class="text-center">
214
214
<button id="rb" onclick="js_toggle_radio_browser();" type="button" class="btn btn-info">Radio<br>Browser</button>
215
- <button id="next" onclick="js_send_simple_command_with_stop('/html/next', 1500 );" type="button" class="btn btn-warning">Play<br>Next</button>
216
- <button id="prev" onclick="js_send_simple_command_with_stop('/html/previous', 1500 );" type="button" class="btn btn-warning">Play<br>Previous</button>
215
+ <button id="next" onclick="js_play_next( );" type="button" class="btn btn-warning">Play<br>Next</button>
216
+ <button id="prev" onclick="js_play_previous( );" type="button" class="btn btn-warning">Play<br>Previous</button>
217
217
<button id="hnext" onclick="js_send_simple_command_with_stop('/html/histnext', 1500);" type="button" class="btn btn-success">Play Hist.<br> Next</button>
218
218
<button id="hprev" onclick="js_send_simple_command_with_stop('/html/histprev', 1500);" type="button" class="btn btn-success">Play Hist.<br>Previous</button>
219
219
<button id="tplay" onclick="js_send_simple_command_with_stop('/html/toggle', 1500);" type="button" class="btn btn-danger">Toggle<br>Playback</button>
@@ -370,7 +370,7 @@ class PyRadioServer(object):
370
370
}
371
371
372
372
function js_send_simple_command(the_command, the_timeout){
373
-
373
+ // js_disable_all_buttons(true);
374
374
console.log("the_command =", the_command);
375
375
if ( ( the_command == "/html/open_radio_browser" ) || ( the_command == "/html/close_radio_browser" ) ) {
376
376
clearTimeout(msg_timeout);
@@ -435,6 +435,7 @@ class PyRadioServer(object):
435
435
result = '<div class="alert alert-success">Player mute state <b>toggled!</b></div>'
436
436
} else if ( the_command == "/html/open_radio_browser" ) {
437
437
result = '<div class="alert alert-success">Connection to <b>Radio Browser</b> established!</div>'
438
+ js_fix_radio_browser();
438
439
} else if ( the_command == "/html/close_radio_browser" ) {
439
440
result = '<div class="alert alert-success"><b>Local</b> Playlist restored</div>'
440
441
} else if ( ( the_command.startsWith("/html/search_radio_browser") ) || ( the_command.startsWith("/html/srb") ) ) {
@@ -504,9 +505,20 @@ class PyRadioServer(object):
504
505
}
505
506
}
506
507
// console.log("--------");
508
+ js_disable_all_buttons(false);
507
509
});
508
510
}
509
511
512
+ function js_play_next(){
513
+ js_disable_all_buttons(true);
514
+ js_send_simple_command_with_stop('/html/next', 1500)
515
+ }
516
+
517
+ function js_play_previous(){
518
+ js_disable_all_buttons(true);
519
+ js_send_simple_command_with_stop('/html/previous', 1500)
520
+ }
521
+
510
522
function js_set_title(a_tag, a_title, the_command=''){
511
523
// console.log(" ", last_title);
512
524
// console.log("a_title.length < last_title.length :", a_title.length < last_title.length);
@@ -576,15 +588,15 @@ class PyRadioServer(object):
576
588
577
589
function js_disable_group_button(enable){
578
590
var element = document.getElementById("group");
579
- element.disabled = enable;
591
+ // DIS element.disabled = enable;
580
592
}
581
593
582
594
function js_disable_buttons_on_stopped(enable){
583
595
let b_id = ["vu", "vd", "vs", "mute", "like" ];
584
596
for (let i in b_id) {
585
597
var element = document.getElementById(b_id[i]);
586
598
// console.log("async:", data);
587
- element.disabled = enable;
599
+ // DIS element.disabled = enable;
588
600
}
589
601
}
590
602
@@ -598,7 +610,7 @@ class PyRadioServer(object):
598
610
element.disabled = true;
599
611
}
600
612
}else{
601
- let b_id = ["rb", "next", "prev", "hnext", "hprev", "tplay", "st ", "info ", "vu ", "vd ", "vs ", "group", "like ", "pl "];
613
+ let b_id = ["rb", "next", "prev", "hnext", "hprev", "tplay", "vu ", "vd ", "vs ", "mute ", "st ", "group", "pl ", "info", "logging", "like "];
602
614
for (let i in b_id) {
603
615
var element = document.getElementById(b_id[i]);
604
616
// console.log("async:", data);
@@ -615,14 +627,14 @@ class PyRadioServer(object):
615
627
var el_p = document.getElementById("hprev");
616
628
var s = document.getElementById("pl");
617
629
if ( window.radio_browser == 0 ){
618
- el_n.disabled = false;
619
- el_p.disabled = false;
630
+ // DIS el_n.disabled = false;
631
+ // DIS el_p.disabled = false;
620
632
//s.disabled = true
621
633
s.innerHTML = "Show<br>Playlists";
622
634
// s.className = "btn btn-primary";
623
635
}else{
624
- el_n.disabled = true;
625
- el_p.disabled = true;
636
+ // DIS el_n.disabled = true;
637
+ // DIS el_p.disabled = true;
626
638
//s.disabled = false
627
639
s.innerHTML = "Show<br>Searches";
628
640
// s.className = "btn btn-danger";
@@ -633,15 +645,17 @@ class PyRadioServer(object):
633
645
js_hide_msg();
634
646
js_disable_all_buttons(true);
635
647
var element = document.getElementById("rb");
636
- element.disabled = true;
648
+ // DIS element.disabled = true;
637
649
if ( window.radio_browser == 0 ){
638
650
js_send_simple_command('/html/open_radio_browser', 1500)
639
651
}else{
640
652
js_send_simple_command('/html/close_radio_browser', 1500)
641
653
}
642
- element.disabled = true;
643
- js_disable_all_buttons(false);
644
- js_fix_history_buttons();
654
+ // DIS element.disabled = true;
655
+ //js_disable_all_buttons(false);
656
+ //js_fix_logging_titles();
657
+ //js_fix_muted();
658
+ //js_fix_history_buttons();
645
659
}
646
660
647
661
function js_toggle_titles_logging(){
@@ -702,8 +716,11 @@ class PyRadioServer(object):
702
716
window.radio_browser = 1
703
717
}
704
718
console.log("set radio_browser: ", radio_browser);
719
+ js_disable_all_buttons(false);
720
+ js_fix_muted();
705
721
js_fix_history_buttons();
706
- element.disabled = false;
722
+ js_fix_logging_titles();
723
+ // DIS element.disabled = false;
707
724
}
708
725
getRadioBrowser();
709
726
}
0 commit comments