function Ctvcmd(conf) {
this.commandObject=conf.getAttribute("object");
var widget = this.init(conf);
aRow = $("
");
bRow = $("
");
cRow = $("
");
dRow = $("
");
eRow = $("
");
fRow = $("
");
widget.append(aRow);
widget.append(bRow);
widget.append(cRow);
widget.append(dRow);
widget.append(eRow);
widget.append(fRow);
content = $(" | ");
this.one= $("").get(0);
this.one.owner=this;
this.one.onmousedown=function() {
this.owner.updateObject(this.owner.one,'images/iPhone_1_ON.png');
$.get("/cgi-bin/tvcmd.cgi?1");
};
this.one.onmouseup=function() {
this.owner.updateObject(this.owner.one,'images/iPhone_1_OFF.png');
}
content.append(this.one);
this.two= $("").get(0);
this.two.owner=this;
this.two.onmousedown=function() {
this.owner.updateObject(this.owner.two,'images/iPhone_2_ON.png');
$.get("/cgi-bin/tvcmd.cgi?2");
}
this.two.onmouseup=function() {
this.owner.updateObject(this.owner.two,'images/iPhone_2_OFF.png');
}
content.append(this.two);
this.three= $("").get(0);
this.three.owner=this;
this.three.onmousedown=function() {
this.owner.updateObject(this.owner.three,'images/iPhone_3_ON.png');
$.get("/cgi-bin/tvcmd.cgi?3");
}
this.three.onmouseup=function() {
this.owner.updateObject(this.owner.three,'images/iPhone_3_OFF.png');
}
content.append(this.three);
aRow.append(content);
content1= $(" | ");
this.four= $("").get(0);
this.four.owner=this;
this.four.onmousedown=function() {
this.owner.updateObject(this.owner.four,'images/iPhone_4_ON.png');
$.get("/cgi-bin/tvcmd.cgi?4");
}
this.four.onmouseup=function() {
this.owner.updateObject(this.owner.four,'images/iPhone_4_OFF.png');
}
content1.append(this.four);
this.five= $("").get(0);
this.five.owner=this;
this.five.onmousedown=function() {
this.owner.updateObject(this.owner.five,'images/iPhone_5_ON.png');
$.get("/cgi-bin/tvcmd.cgi?5");
}
this.five.onmouseup=function() {
this.owner.updateObject(this.owner.five,'images/iPhone_5_OFF.png');
}
content1.append(this.five);
this.six= $("").get(0);
this.six.owner=this;
this.six.onmousedown=function() {
this.owner.updateObject(this.owner.six,'images/iPhone_6_ON.png');
$.get("/cgi-bin/tvcmd.cgi?6");
}
this.six.onmouseup=function() {
this.owner.updateObject(this.owner.six,'images/iPhone_6_OFF.png');
}
content1.append(this.six);
bRow.append(content1);
content2= $(" | ");
this.seven= $("").get(0);
this.seven.owner=this;
this.seven.onmousedown=function() {
this.owner.updateObject(this.owner.seven,'images/iPhone_7_ON.png');
$.get("/cgi-bin/tvcmd.cgi?7");
}
this.seven.onmouseup=function() {
this.owner.updateObject(this.owner.seven,'images/iPhone_7_OFF.png');
}
content2.append(this.seven);
this.eight= $("").get(0);
this.eight.owner=this;
this.eight.onmousedown=function() {
this.owner.updateObject(this.owner.eight,'images/iPhone_8_ON.png');
$.get("/cgi-bin/tvcmd.cgi?8");
}
this.eight.onmouseup=function() {
this.owner.updateObject(this.owner.eight,'images/iPhone_8_OFF.png');
}
content2.append(this.eight);
this.nine= $("").get(0);
this.nine.owner=this;
this.nine.onmousedown=function() {
this.owner.updateObject(this.owner.nine,'images/iPhone_9_ON.png');
$.get("/cgi-bin/tvcmd.cgi?9");
}
this.nine.onmouseup=function() {
this.owner.updateObject(this.owner.nine,'images/iPhone_9_OFF.png');
}
content2.append(this.nine);
cRow.append(content2);
var content3= $(" | ");
this.down= $("").get(0);
this.down.owner=this;
this.down.onmousedown=function() {
this.owner.updateObject(this.owner.down,'images/iPhone_backward_ON.png');
$.get("/cgi-bin/tvcmd.cgi?down");
}
this.down.onmouseup=function() {
this.owner.updateObject(this.owner.down,'images/iPhone_backward_OFF.png');
}
content3.append(this.down);
this.zero= $("").get(0);
this.zero.owner=this;
this.zero.onmousedown=function() {
this.owner.updateObject(this.owner.zero,'images/iPhone_0_ON.png');
$.get("/cgi-bin/tvcmd.cgi?0");
}
this.zero.onmouseup=function() {
this.owner.updateObject(this.owner.zero,'images/iPhone_0_OFF.png');
}
content3.append(this.zero);
this.up= $("").get(0);
this.up.owner=this;
this.up.onmousedown=function() {
this.owner.updateObject(this.owner.up,'images/iPhone_forward_ON.png');
$.get("/cgi-bin/tvcmd.cgi?up");
}
this.up.onmouseup=function() {
this.owner.updateObject(this.owner.up,'images/iPhone_forward_OFF.png');
}
content3.append(this.up);
dRow.append(content3);
var content4= $(" | ");
this.minus= $("").get(0);
this.minus.owner=this;
this.minus.onmousedown=function() {
this.owner.updateObject(this.owner.minus,'images/iPhone_bar_-_ON.png');
$.get("/cgi-bin/tvcmd.cgi?minus");
}
this.minus.onmouseup=function() {
this.owner.updateObject(this.owner.minus,'images/iPhone_bar_-_OFF.png');
}
content4.append(this.minus);
this.nosound= $("").get(0);
this.nosound.owner=this;
this.nosound.onmousedown=function() {
this.owner.updateObject(this.owner.nosound,'images/iPhone_nosound_ON.png');
$.get("/cgi-bin/tvcmd.cgi?mute");
}
this.nosound.onmouseup=function() {
this.owner.updateObject(this.owner.nosound,'images/iPhone_nosound_OFF.png');
}
content4.append(this.nosound);
this.plus= $("").get(0);
this.plus.owner=this;
this.plus.onmousedown=function() {
this.owner.updateObject(this.owner.plus,'images/iPhone_bar_+_ON.png');
$.get("/cgi-bin/tvcmd.cgi?plus");
}
this.plus.onmouseup=function() {
this.owner.updateObject(this.owner.plus,'images/iPhone_bar_+_OFF.png');
}
content4.append(this.plus);
eRow.append(content4);
var content5= $(" | ");
this.last= $("").get(0);
this.last.owner=this;
this.last.onmousedown=function() {
this.owner.updateObject(this.owner.last,'images/iPhone_back_ON.png');
$.get("/cgi-bin/tvcmd.cgi?last");
}
this.last.onmouseup=function() {
this.owner.updateObject(this.owner.last,'images/iPhone_back_OFF.png');
}
content5.append(this.last);
this.text= $("").get(0);
this.text.owner=this;
this.text.onmousedown=function() {
this.owner.updateObject(this.owner.text,'images/iPhone_teletext_ON.png');
$.get("/cgi-bin/tvcmd.cgi?text");
}
this.text.onmouseup=function() {
this.owner.updateObject(this.owner.text,'images/iPhone_teletext_OFF.png');
}
content5.append(this.text);
this.power= $("").get(0);
this.power.owner=this;
this.power.onclick=function() {
var val = this.owner.value ? 'off' : 'on';
EIBCommunicator.eibWrite(this.owner.commandObject, val);
}
content5.append(this.power);
fRow.append(content5);
}
Ctvcmd.type='tvcmd';
UIController.registerWidget(Ctvcmd);
Ctvcmd.prototype = new CWidget();
Ctvcmd.prototype.getListeningObject = function() {
return Array(this.commandObject);
};
Ctvcmd.prototype.updateObject = function(obj,value) {
if (obj==this.commandObject) {
if (value == 'on')
{
this.power.src='images/iPhone_power_ON.png';
this.value=true;
} else {
this.power.src='images/iPhone_power_OFF.png';
this.value=false;
}
} else {
obj.src=value;
}
};