en el moras

This commit is contained in:
mynah
2018-07-18 16:04:47 -05:00
parent 4f0061cd7d
commit 5a7566eaf7
21 changed files with 94 additions and 55 deletions

View File

@@ -0,0 +1,41 @@
d3.select("#clink").on("click",function(){
var newWindow = window.open('candy','_blank');
});
var ciface =" #exec candy_loader/candyInterface.pl&v=";
d3.json(ciface+"isOn" ,function(d){
if(d != undefined){
if (d.a==1) { on(); }
else if (d.a==0) { off(); }}
else {console.error(ciface+"isOn");}
});
d3.select("#myonoffswitch")
.on("change",function(){
if (this.checked) { on();}
else {off();}
});
function on(){
d3.select("#clink").style("visibility","visible");
d3.json(ciface+"on",function(d){
if (d.a==1){
d3.select("#clink").style("visibility","visible");
d3.select("#myonoffswitch").property("checked","checked"); }
else {
d3.select("#myonoffswitch").property("checked","");
}}); }
function off(){
d3.select("#clink").style("visibility","hidden");
d3.json(ciface+"off",function(d){
if (d.a==1){
d3.select("#clink").style("visibility","hidden");
d3.select("#myonoffswitch").property("checked",""); }
else {
d3.select("#myonoffswitch").property("checked","checked");
}}); }