deploying passwd
This commit is contained in:
83
public/global/nav/bcast.js
Executable file
83
public/global/nav/bcast.js
Executable file
@@ -0,0 +1,83 @@
|
|||||||
|
|
||||||
|
window.onload = function(){
|
||||||
|
radioUpdate();
|
||||||
|
|
||||||
|
function radioUpdate(){
|
||||||
|
d3.json(radio_server +"/status-json.xsl")
|
||||||
|
.timeout(10000)
|
||||||
|
.get(function(e,d){
|
||||||
|
if(e !=undefined){
|
||||||
|
console.warn("sin conxion");
|
||||||
|
offline();}
|
||||||
|
else{
|
||||||
|
if(d.icestats.source!=undefined){
|
||||||
|
if(d.icestats.source.listenurl == webm_listen_url){
|
||||||
|
console.log("transmitiendo video");
|
||||||
|
onlinev(d); }
|
||||||
|
else if (d.icestats.source.listenurl == radio_listen_url){
|
||||||
|
console.log("transmitiendo radio");
|
||||||
|
onliner(d); }
|
||||||
|
else if (d.icestats.source.listenurl == radiop_listen_url){
|
||||||
|
console.log("transmitiendo radio");
|
||||||
|
onlinerp(d); }
|
||||||
|
else {
|
||||||
|
console.warn("otro canal");
|
||||||
|
offline(); }}
|
||||||
|
else {
|
||||||
|
console.warn("fuera de línea");
|
||||||
|
offline();
|
||||||
|
}
|
||||||
|
} }); };
|
||||||
|
|
||||||
|
|
||||||
|
function dataUpdate(){
|
||||||
|
d3.json(radio_server+"/status-json.xsl")
|
||||||
|
.timeout(10000)
|
||||||
|
.get(function(e,d){
|
||||||
|
if(e !=undefined){ console.warn("sin datos radio"); }
|
||||||
|
else{
|
||||||
|
if(d.icestats.source!=undefined){
|
||||||
|
if(d.icestats.source.listenurl == listen_url ){
|
||||||
|
d3.select("#now").text(d.icestats.source.title);
|
||||||
|
}}}
|
||||||
|
|
||||||
|
d3.select("#ra").transition().on("end",dataUpdate).delay(60000);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function offline(){
|
||||||
|
d3.selectAll("article.broadcast").style("display","none")
|
||||||
|
d3.select("article.broadcast").transition().on("end",radioUpdate).delay(90000);
|
||||||
|
d3.selectAll("a.radiolink").style("display", "display");
|
||||||
|
d3.selectAll("a.radiolinkp").style("display", "none");
|
||||||
|
};
|
||||||
|
|
||||||
|
function onlinev(d){
|
||||||
|
d3.selectAll("article.broadcast")
|
||||||
|
.style("display","block");
|
||||||
|
d3.selectAll("article.broadcast,p.broadcast")
|
||||||
|
.on("click",function(){window.location="bcast";});
|
||||||
|
dataUpdate();
|
||||||
|
}
|
||||||
|
function onliner(d){
|
||||||
|
d3.selectAll(".broadcast")
|
||||||
|
.style("display","block");
|
||||||
|
d3.selectAll("article.broadcast,p.broadcast")
|
||||||
|
.on("click",function(){window.location="radio";});
|
||||||
|
d3.selectAll("a.radiolink").style("display", "display");
|
||||||
|
d3.selectAll("a.radiolinkp").style("display", "none");
|
||||||
|
dataUpdate();
|
||||||
|
}
|
||||||
|
function onlinerp(d){
|
||||||
|
d3.selectAll(".broadcast")
|
||||||
|
.style("display","block");
|
||||||
|
d3.selectAll("article.broadcast,p.broadcast")
|
||||||
|
.on("click",function(){window.location="radiop";});
|
||||||
|
d3.selectAll("a.radiolinkp").style("display", "display");
|
||||||
|
d3.selectAll("a.radiolink").style("display", "none");
|
||||||
|
dataUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ window.onload = function(){
|
|||||||
if(e !=undefined){ console.warn("sin datos radio"); }
|
if(e !=undefined){ console.warn("sin datos radio"); }
|
||||||
else{
|
else{
|
||||||
if(d.icestats.source!=undefined){
|
if(d.icestats.source!=undefined){
|
||||||
if(d.icestats.source.listenurl == listen_url ){
|
if(d.icestats.source.listenurl == radio_listen_url ){
|
||||||
d3.select("#now").text(d.icestats.source.title);
|
d3.select("#now").text(d.icestats.source.title);
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
@@ -58,6 +58,14 @@ window.onload = function(){
|
|||||||
.on("click",function(){window.location="bcast";});
|
.on("click",function(){window.location="bcast";});
|
||||||
dataUpdate();
|
dataUpdate();
|
||||||
}
|
}
|
||||||
|
function onliner(d){
|
||||||
|
d3.selectAll(".broadcast")
|
||||||
|
.style("display","block");
|
||||||
|
d3.selectAll("article.broadcast,p.broadcast")
|
||||||
|
.on("click",function(){window.location="radio";});
|
||||||
|
dataUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
function onlinerp(d){
|
function onlinerp(d){
|
||||||
d3.selectAll(".broadcast")
|
d3.selectAll(".broadcast")
|
||||||
.style("display","block");
|
.style("display","block");
|
||||||
|
|||||||
@@ -66,5 +66,7 @@
|
|||||||
<script>
|
<script>
|
||||||
const webm_listen_url="<%= $config->{webm_server_name} %>";
|
const webm_listen_url="<%= $config->{webm_server_name} %>";
|
||||||
const radio_listen_url="<%= $config->{radio_server_name} %>";
|
const radio_listen_url="<%= $config->{radio_server_name} %>";
|
||||||
|
const radiop_listen_url="<%= $config->{radiop_server_name} %>";
|
||||||
const radio_server="<%= $config->{radio_server} %>";
|
const radio_server="<%= $config->{radio_server} %>";
|
||||||
|
const radiop_server="<%= $config->{radiop_server} %>";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user