var currentPic = ' ';
+var currentRoom = ' ';
function getData(command,dId,callback) {
function updatefiles() {
- room = document.getElementById("showroom").getAttribute("room");
- getData("getfiles.pl?room="+room,"files");
-}
+ getData("getfiles.pl?room="+currentRoom,"files");
+ }
function present(f) {
if(f != "") {
- getData("showPic.pl?img="+f+"&room="+document.getElementById("showroom").getAttribute("room"));
+ getData("showPic.pl?img="+f+"&room="+currentRoom+'&posx=-1&posy=-1');
}
else {
alert("Select a file to show!");
}
-}
+ }
+
+function pointer(e) {
+ var t = document.getElementById("screen");
+// alert(t.offsetLeft);
+ var x = Math.round((e.pageX - t.offsetLeft)/t.offsetWidth*100);
+ var y = Math.round((e.pageY - t.offsetTop)/t.offsetHeight*100);
+ var i = currentPic.split(",");
+ getData("showPic.pl?img="+i[0]+"&room="+currentRoom+'&posx='+x+'&posy='+y);
+ }
function updatepresentation(t) {
- room = document.getElementById("showroom").getAttribute("room");
+ currentRoom = document.getElementById("showroom").getAttribute("room");
t = t.trim();
if(currentPic != t) {
+ var s = document.getElementById("screen");
currentPic = t;
- document.getElementById("content").innerHTML = '<img src="store/'+room+'/'+t+'">';
+ var i = t.split(",");
+ if(s) {
+ x = i[1]*s.offsetWidth/100-30 + s.offsetLeft;
+ y = i[2]*s.offsetHeight/100-10 + s.offsetTop;
+ }
+ else { x=0;y=0; }
+ document.getElementById("content").innerHTML = '<img id="screen" onClick="pointer(event);" src="store/'+currentRoom+'/'+i[0]+'"><div id="pointer" style="left:'+x+'px;top:'+y+'px;"> </div>';
}
- setTimeout('getData("getPic.pl?old='+t+'&room='+room+'",null,updatepresentation)',1000);
+ setTimeout('getData("getPic.pl?old='+t+'&room='+currentRoom+'",null,updatepresentation)',1000);
}
return 1;
}
+my $tmp = $cgi->param("posx").','.$cgi->param("posy");
+if(!($tmp =~ /^-?[0-9]+,-?[0-9]+$/)) {
+ print "Invalid Position";
+ return 1;
+ }
+$t .= ','.$tmp;
+
system("echo $t>store/$room/currentstate");
1;
\ No newline at end of file
width:100%;
position:absolute;
padding-right:100px;
+ text-align:center;
}
+#content div {
+ display:inline-block;
+ }
+
#content img {
height:100%;
+/* width:100%; */
+ max-height:100%;
max-width:100%;
object-fit:contain;
- margin:0;
+ margin:auto;
padding:0;
}
#roomlist {
width:200px;
}
-
-
+
+
+@keyframes pointerani {
+/* 0% {margin:5px 0 0 0px;}
+ 100% {margin:0px 0 0 5px;}*/
+ 0% {width:25px;height:25px;margin:0;}
+ 100% {width:20px;height:20px;margin:2.5px 0 0 2.5px;}
+}
+
+#pointer {
+ width:20px;
+ height:20px;
+ background:transparent;
+ border:5px solid red;
+ opacity:0.7;
+ border-radius:15px;
+ position:absolute;
+ animation: pointerani 1s infinite alternate;
+ }