// Javascript for printing OpenSprinkler homepage (manual mode) // Firmware v1.8 // All content is published under: // Creative Commons Attribution ShareAlike 3.0 License // Sep 2012, Rayshobby.net function id(s) {return document.getElementById(s);} function snf(sid,sbit) { if(sbit==1) window.location="/sn"+(sid+1)+"=0"; // turn off station else { var strmm=id("mm"+sid).value, strss=id("ss"+sid).value; var mm=(strmm=="")?0:parseInt(strmm); var ss=(strss=="")?0:parseInt(strss); if(!(mm>=0&&ss>=0&&ss<60)) {alert("Timer values wrong: "+strmm+":"+strss);return;} window.location="/sn"+(sid+1)+"=1"+"&t="+(mm*60+ss); // turn it off with timer } } w("Manual Control: (timer is optional)
"); w(""); sid=bid*8+s; sn=sid+1; //w("Station "+(sn/10>>0)+(sn%10)+": "); w(snames[sid]+": | "); if(sn==sd['mas']) {w(((sbits[bid]>>s)&1?("On").fontcolor("green"):("Off").fontcolor("black"))+" (Master)");} else { rem=ps[sid][1]; if(rem>65536) rem=0; remm=rem/60>>0;rems=rem%60;sbit=(sbits[bid]>>s)&1; var bg=(sbit?"#FFCCCC":"#CCFFCC"),tx=(sbit?"off":"on"),dis=(sbit?"disabled":""); w(""); w(sbit?" in ":" with timer "); w(":"); w(" (mm:ss)"); } w(" | "); } } w("