merge the formfield patch from ooo-build
[ooovba.git] / sd / res / webview / poll.pl
blob08a31c3e22b4bffe00a6373abcbea440d70769b8
1 #!/usr/bin/perl
3 require "common.pl";
5 print "Content-type: text/html\n\n";
6 print "<HTML>";
8 # get current and last shown picture id
9 $sCurrPic = join( "", common::File_read( "currpic.txt" ) );
11 %aRequestMap = common::HTTP_getRequest();
12 $sLastPic = $aRequestMap{ "LastPic" };
14 print "<HEAD>";
15 print "<META http-equiv=\"refresh\" CONTENT=\"" . $common::REFRESH_TIME . "; URL=poll.pl?LastPic=" . $sCurrPic . "\">";
16 print "</HEAD>";
18 #' a new picture was chosen ?
19 if( $sLastPic ne $sCurrPic )
21 # then show the new picture
22 print "<BODY bgcolor=\"red\" onLoad=\"parent.frame1.location.href='./show.pl?" . $sCurrPic . "'\">";
24 else
26 # otherwise do nothing
27 print "<BODY bgcolor=\"green\">";
30 print "</BODY>";
32 print "</HTML>";