]> jspc29.x-matter.uni-frankfurt.de Git - labtools.git/commitdiff
some updates for presenter
authorJan Michel <j.michel@gsi.de>
Tue, 25 Aug 2015 14:51:43 +0000 (16:51 +0200)
committerJan Michel <j.michel@gsi.de>
Tue, 25 Aug 2015 14:51:43 +0000 (16:51 +0200)
presenter/deletePic.pl [new file with mode: 0755]
presenter/getfiles.pl
presenter/scripts.js
presenter/showroom.pl
presenter/style.css
presenter/uploadFiles.pl

diff --git a/presenter/deletePic.pl b/presenter/deletePic.pl
new file mode 100755 (executable)
index 0000000..ed54524
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+use CGI::Carp qw(warningsToBrowser fatalsToBrowser); 
+use CGI;
+print "Content-type: text/html\n\n";
+
+my $cgi = new CGI();
+
+
+my $room = $cgi->param("room");
+if (!($room =~ /^[a-zA-Z0-9]+$/) || !(-d "store/$room")) {
+  print "Invalid room";
+  return 1;
+}
+
+my $t = $cgi->param("img");
+if(($t =~ /[\"\$\(\)\/]/ || !(-e "store/$room/$t")) && ($t =~ /.png$/i || $t =~ /.jpg$/i)) {
+  print "Invalid selection";
+  return 1;
+}
+
+system("rm store/$room/$t store/$room/thumb/$t");
+
+
+print <<REDOC;
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="refresh"   content="0; url=showroom.pl?$room">
+</head>
+<body>
+</body>
+</html>
+REDOC
+
+1;
index 5010e7ecf5e0d8fed1fa24da650476b56c851986..c70caff1bbb45a8f0ae570158172e4f847dc9cf3 100755 (executable)
@@ -15,11 +15,12 @@ if (!($room =~ /^[a-zA-Z0-9]+$/) || !(-d "store/$room")) {
 
 my $cmd = "cd store;cd $room; ls -1 -v";
 my @files = qx($cmd);
-print "<select id=\"filelist\" size=\"20\">\n";
+print "<select  onChange=\"previewSelected()\" id=\"filelist\" size=\"20\">\n";
 foreach my $f (@files) {
   chomp($f);
   next if $f eq "currentstate";
-  print "<option value='$f'>$f\n";
+  next if $f eq "thumb";
+  print "<option  onMouseover=\"preview('$f')\" value='$f'>$f</option>\n";
   } 
 print "</select>";
 
index 42001c3a1eb2aaa31c07cff673c2f0a3494f9dad..5b2cafad6d9aa993651899d0be2457dc0ade4c37 100644 (file)
@@ -40,6 +40,15 @@ function present(f) {
     }
   }
 
+function deletePic(f) {
+  if(f != "") {
+    getData("deletePic.pl?img="+f+"&room="+currentRoom);
+    }
+  else {
+    alert("Select a file to show!");
+    }
+  }
+
 function pointer(e) {
   var t = document.getElementById("screen");
 //   alert(t.offsetLeft);
@@ -66,6 +75,15 @@ function updatepresentation(t) {
   setTimeout('getData("getPic.pl?old='+t+'&room='+currentRoom+'",null,updatepresentation)',1000);  
   }
 
+function preview(f) {
+  document.getElementById("preview").innerHTML = '<img src="store/'+currentRoom+'/thumb/'+f+'">';
+  }
+
+function previewSelected() {
+  f = document.getElementById("filelist").value;
+  document.getElementById("preview").innerHTML = '<img src="store/'+currentRoom+'/thumb/'+f+'">';
+  }
+
 
 setTimeout('updatefiles();',500);
 setTimeout('updatepresentation(" ");',200);
index 738af226c05b191ce2cb4bc0ad6a52ffe5e4760e..2fc030b1ccac627dcf931c068019d1b96ed0b778 100755 (executable)
@@ -31,15 +31,17 @@ print <<HDOC;
 <div id="content">Remote Presenter<br>&lt;-- Click to show or just watch!</div>
 <div id="control">
 Select a file and press upload.
-<form method="post" action="uploadFiles.pl" enctype="multipart/form-data">
+<form method="post" action="uploadFiles.pl" enctype="multipart/form-data" >
 <input type="hidden" name="room" value="$room">
-<input type="file" name="upfile"><input type="submit" name="button" value="Upload">
+<input type="file" name="upfile" ><input type="submit" name="button" value="Upload">
 </form>
 <hr>
 <button type="button" onClick="updatefiles();">Update file list</button>
 <div id="files"> &nbsp; </div>
 <button type="button" onClick="window.open('store/$room/'+document.getElementById('filelist').value)">Show 2 Me</button>
 <button type="button" onClick="present(document.getElementById('filelist').value)">Show 2 All</button>
+<button type="button" onClick="deletePic(document.getElementById('filelist').value)">Delete</button>
+<div id="preview"></div>
 
 </body></html>
 HDOC
index 9736239576298872de64ee87329b1642a1d76f6d..f4981158654a621cb3d6610f73192cdd7270e98a 100644 (file)
@@ -38,15 +38,16 @@ h1 {
   left:-200px;
   position:absolute;
   top:0;
-  border-right:40px solid #000;
+  border-right:70px solid #000;
   background:#ccb;
-  transition:left 0.3s;
+  transition:left 0.6s 3s ease-out, border 0.6s 3s ease-out;
   overflow:hidden;
   }
   
 #control:hover {
   left:0;
   border:0;
+  transition:left 0.2s 0s ease-in, border 0.2s 0s ease-in;
   }
   
 #content {
@@ -103,3 +104,14 @@ h1 {
   position:absolute;
   //animation: pointerani 1s infinite alternate;
   }
+
+#preview {
+  width:205px;
+  border:1px solid #aaa;
+  margin:1px;
+  position:relative;
+  left:5px;
+  padding:1px;
+  text-align:center;
+  background:white;
+  }
index 276d4dfc731b5ce9b39e0114b423941be11392eb..487e514b4112d9bb32145f83283273b39f84df01 100755 (executable)
@@ -42,7 +42,12 @@ if($basename =~ /\.pdf$/i) {
   $b =~ s/.pdf//i;
   system("cd store/$room;../../convert.sh \"$basename\" \"$b\"");
   system("rm \"store/$room/$basename\"");
+  system("cd store/$room;mogrify -path thumb -thumbnail 200x200 $b*.png");
   }
+else {
+  system("cd store/$room;mogrify -path thumb -thumbnail 200x200 $basename");
+  }
+
 
 
 sub GetBasename {
@@ -60,7 +65,6 @@ sub GetBasename {
 }
 
 
-
 print <<REDOC;
 <!DOCTYPE html>
 <html>