Commit aeae757e authored by Mitchell Pomery's avatar Mitchell Pomery

Base code currently in use

parent b59a3cb6
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!-- This is the new Javascript based webcams page by [PXY],
who was sick of the page reloads. Extra crack added by
[TRS], who wanted back and forward to work. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>UCC Webcams @ Loading...</title>
<noscript>
<meta http-equiv="refresh" content="0;URL=http://www.ucc.asn.au/cgi-bin/webcam.py">
</noscript>
<link rel="stylesheet" href="http://planet.ucc.asn.au/planet.css" type="text/css" media="screen" />
<link rel="stylesheet" href="http://webcam.ucc.asn.au/webcam-overrides.css" type="text/css" media="screen" />
<link rel="icon" type="image/png" href="http://planet.ucc.asn.au/icon.png" />
<link rel="SHORTCUT ICON" type="image/png" href="http://planet.ucc.asn.au/icon.png" />
<script type="text/javascript">
var d;
var months = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var days = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
function windowOnload()
{
// set the initial date from the server
// get an XML HTTP Request object
var req = false;
try
{
req = new XMLHttpRequest ();
}
catch (e)
{
try
{
req = new ActiveXObject ("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
if (req)
{
req.onreadystatechange = function ()
{
if (req.readyState == 4)
{
d = new Date (Date.parse (req.getResponseHeader ("Date")));
if (location.hash.length > 0)
{
d.setTime (location.hash.substring(1, location.hash.length));
}
else
{
d.setMinutes(d.getMinutes() - 1);
}
setupPage();
setDate();
}
};
var timestamp = new Date ();
req.open ("HEAD", "index.html?" + timestamp.getTime (), true);
req.send ("");
}
}
function setDateNow()
{
// get a new date from the server
// get an XML HTTP Request object
var req = false;
try
{
req = new XMLHttpRequest ();
}
catch (e)
{
try
{
req = new ActiveXObject ("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
if (req)
{
req.onreadystatechange = function ()
{
if (req.readyState == 4)
{
d = new Date (Date.parse (req.getResponseHeader ("Date")));
d.setMinutes(d.getMinutes() - 1);
setDate();
alignSelects();
}
};
var timestamp = new Date ();
req.open ("HEAD", "index.html?" + timestamp.getTime (), true);
req.send ("");
}
}
function setupPage()
{
var form;
var i;
document.getElementById("nav-dayname").firstChild.data = days[d.getDay()];
form = document.getElementById("nav-day");
for (i = 0; i < 31; i++)
{
form[i] = new Option(i+1,i+1,(d.getDate() == i+1));
}
form = document.getElementById("nav-month");
for (i = 0; i < 12; i++)
{
form[i] = new Option(months[i],i,(d.getMonth() == i));
}
form = document.getElementById("nav-year");
for (i = 2003; i < d.getFullYear() + 1; i++)
{
form[i-2003] = new Option(i,i,(d.getFullYear() == i));
}
form = document.getElementById("nav-hour");
for (i = 0; i < 24; i++)
{
form[i] = new Option(zPad(i.toString()),i,(d.getHours() == i));
}
form = document.getElementById("nav-minute");
for (i = 0; i < 60; i++)
{
form[i] = new Option(zPad(i.toString()),i,(d.getMinutes() == i));
}
}
function alignSelects()
{
var form;
var i;
form = document.getElementById("nav-day");
for (i = 0; i < 31; i++)
{
if (d.getDate() == i+1)
{
form[i].selected = true;
}
else
{
form[i].selected = false;
}
}
form = document.getElementById("nav-month");
for (i = 0; i < 12; i++)
{
if (d.getMonth() == i)
{
form[i].selected = true;
}
else
{
form[i].selected = false;
}
}
form = document.getElementById("nav-year");
for (i = 2003; i < d.getFullYear() + 1; i++)
{
if (d.getFullYear() == i)
{
form[i-2003].selected = true;
}
else
{
form[i-2003].selected = false;
}
}
form = document.getElementById("nav-hour");
for (i = 0; i < 24; i++)
{
if (d.getHours() == i)
{
form[i].selected = true;
}
else
{
form[i].selected = false;
}
}
form = document.getElementById("nav-minute");
for (i = 0; i < 60; i++)
{
if (d.getMinutes() == i)
{
form[i].selected = true;
}
else
{
form[i].selected = false;
}
}
}
function navDate()
{
d.setDate(document.getElementById("nav-day").value);
d.setMonth(document.getElementById("nav-month").value);
d.setFullYear(document.getElementById("nav-year").value);
d.setHours(document.getElementById("nav-hour").value);
d.setMinutes(document.getElementById("nav-minute").value);
setDate();
}
function zPad(str)
{
if (str.length == 1)
{
str = "0" + str;
}
return str;
}
function setAlt (img, text)
{
var lines = img.alt.split ("\n");
if (lines.length > 0)
{
img.alt = lines[0] + "\n" + text;
}
else
{
img.alt += "\n" + text;
}
}
function updateWebcam (webcamid, webcamurl)
{
var img = document.getElementById (webcamid);
// get an XML HTTP Request object
var req = false;
try
{
req = new XMLHttpRequest ();
}
catch (e)
{
try
{
req = new ActiveXObject ("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
if (req)
{
req.onreadystatechange = function ()
{
if (req.readyState == 4)
{
if (req.status == 200 || req.status == 304)
{
//img.parentNode.style.backgroundColor = "transparent";
img.style.display = 'inline';
//setAlt (img, "");
}
else
{
img.style.display = 'none';
//img.parentNode.style.backgroundColor = "darkred";
//setAlt (img, "(status " + req.status + ")");
}
}
};
req.open ("HEAD", webcamurl, true);
req.send ("");
}
// set the image
img.setAttribute ("src",webcamurl);
}
function setDate()
{
window.location.hash = d.getTime();
//document.getElementById("timeremaining").firstChild.data = "loading...";
var timeString = days[d.getDay()]+" "+d.getDate()+" "+months[d.getMonth()]+" "+d.getFullYear()+", "+zPad(d.getHours().toString())+":"+zPad(d.getMinutes().toString());
document.title = "UCC Webcams @ "+timeString;
document.getElementById("header").firstChild.data = "UCC Webcams @ "+timeString;
document.getElementById("timeindex").firstChild.data = d.getTime();
document.getElementById("timeindex").href = "#"+d.getTime();
document.getElementById("nav-dayname").firstChild.data = days[d.getDay()];
var image = d.getFullYear()+zPad((d.getMonth()+1).toString())+"/"+zPad(d.getDate().toString())+"/"+zPad(d.getHours().toString())+"/"+zPad(d.getMinutes().toString())+".jpg";
updateWebcam ("webcam1", "/archive/colour/" + image);
//updateWebcam ("webcam1-datetime", "/archive/colour/" + image);
updateWebcam ("webcam2", "/archive/colour1/" + image);
updateWebcam ("webcam3", "/archive/colour3/" + image);
updateWebcam ("webcam4", "/archive/bw/" + image);
updateWebcam ("uvc1", "/archive/uvc1/" + image);
updateWebcam ("ipcamera1", "/archive/ipcamera1/" + image);
updateWebcam ("ipcamera2", "/archive/ipcamera2/" + image);
updateWebcam ("ipcamera3", "/archive/ipcamera3/" + image);
updateWebcam ("ipcamera4", "/archive/ipcamera4/" + image);
updateWebcam ("ipcamera5", "/archive/ipcamera5/" + image);
updateWebcam ("ipcamera6", "/archive/ipcamera6/" + image);
//setTimeout("clearText()",1000);
}
function setMinutes(mins)
{
d.setMinutes(d.getMinutes() + mins);
setDate();
alignSelects();
}
function setHours(hours)
{
d.setHours(d.getHours() + hours);
setDate();
alignSelects();
}
function setDays(days)
{
d.setDate(d.getDate() + days);
setDate();
alignSelects();
}
function clearText()
{
document.getElementById("timeremaining").firstChild.data = "";
}
</script>
<style>
.camera {
margin: 4px;
/*padding: 20px;*/
margin-left: auto;
margin-right: auto;
display: inline-block;
font-size: 0;
}
.header {
background: none;
}
</style>
</head>
<body onload="windowOnload()">
<div class="header">
<img alt="Planet UCC" id="pucc_logo"
src="//www.ucc.asn.au/images/ucc_logo.gif" />
<!--<img src="http://planet.ucc.asn.au/cam_collage.jpg" alt="UCC Webcam Collage" id="pucc_banner1" />
<img src="http://planet.ucc.asn.au/cam_collage.gif" alt="UCC Webcam Collage" id="pucc_banner2" />-->
<div id="globalnav-wrapper">
<ul id="portal-globalnav">
<li id="portaltab-index_html" class="plain">
<a href="http://www.ucc.asn.au">Home</a>
</li>
<li id="portaltab-aboutucc" class="plain">
<a href="http://www.ucc.asn.au/aboutucc/">About Us</a>
</li>
<li id="portaltab-infobase" class="plain">
<a href="http://www.ucc.asn.au/infobase/">Information</a>
</li>
<li id="portaltab-services" class="plain">
<a href="http://www.ucc.asn.au/services/">Services</a>
</li>
<li id="portaltab-events" class="plain">
<a href="http://www.ucc.asn.au/infobase/events/">Events</a>
</li>
<li id="portaltab-planetucc" class="plain">
<a href="http://planet.ucc.asn.au/">Planet UCC</a>
</li>
<li id="portaltab-planetucc" class="plain">
<a href="http://wiki.ucc.asn.au/">Wiki</a>
</li>
</ul>
</div>
</div>
<div class="items">
<h1 id="header">UCC Webcams @ Loading...</h1>
<div class="navMenu">
<a href="index.html">Live</a>
<a href="http://webcam.ucc.asn.au/clubroom-schematic.png">Map</a>
<a href="index-nojs.php" title="Non-Javascript Webcam Page">Web0 Version</a>
</div>
<div class=camSection>
<div class="camera"><img id="webcam4" alt="BW Webcam" /></div>
<div class="camera"><img id="webcam3" alt="Webcam 3" /></div>
<div class="camera"><img id="webcam2" alt="Webcam 1" /></div>
<div class="camera"><img id="uvc1" alt="UVC 1" /></div>
<div class="camera"><img id="webcam1" alt="Webcam 2" /></div>
<div class="camera"><img id="ipcamera1" alt="IPCamera1" /></div>
<div class="camera"><img id="ipcamera2" alt="IPCamera2" /></div>
<div class="camera"><img id="ipcamera3" alt="IPCamera3" /></div>
<div class="camera"><img id="ipcamera4" alt="IPCamera4" /></div>
<div class="camera"><img id="ipcamera5" alt="IPCamera5" /></div>
<div class="camera"><img id="ipcamera6" alt="IPCamera6" /></div>
</div>
<div class="nav">
<table width="100%">
<tr>
<td>
&laquo; Back<br />
<a href="javascript:setMinutes(-30)">30</a>&nbsp;
<a href="javascript:setMinutes(-10)">10</a>&nbsp;
<a href="javascript:setMinutes(-5)">5</a>&nbsp;
<a href="javascript:setMinutes(-2)">2</a>&nbsp;
<a href="javascript:setMinutes(-1)">1</a>&nbsp;
minutes
<br />
<a href="javascript:setDays(-10)">10</a>&nbsp;
<a href="javascript:setDays(-7)">7</a>&nbsp;
<a href="javascript:setDays(-5)">5</a>&nbsp;
<a href="javascript:setDays(-2)">2</a>&nbsp;
<a href="javascript:setDays(-1)">1</a>&nbsp;
days
<a href="javascript:setHours(-6)">6</a>&nbsp;
<a href="javascript:setHours(-2)">2</a>&nbsp;
<a href="javascript:setHours(-1)">1</a>&nbsp;
hours&nbsp;
</td>
<td align="middle">
Time Index: <a id="timeindex" href="">Loading...</a><br />
<a href="javascript:setDateNow()">Now</a>
(<a href="index.html">Live</a>)
</td>
<td align="right">
Forward &raquo;<br />
<a href="javascript:setMinutes(1)">1</a>&nbsp;
<a href="javascript:setMinutes(2)">2</a>&nbsp;
<a href="javascript:setMinutes(5)">5</a>&nbsp;
<a href="javascript:setMinutes(10)">10</a>&nbsp;
<a href="javascript:setMinutes(30)">30</a>&nbsp;
minutes
<br />
<a href="javascript:setHours(1)">1</a>&nbsp;
<a href="javascript:setHours(2)">2</a>&nbsp;
<a href="javascript:setHours(6)">6</a>&nbsp;
hours&nbsp;
<a href="javascript:setDays(1)">1</a>&nbsp;
<a href="javascript:setDays(2)">2</a>&nbsp;
<a href="javascript:setDays(5)">5</a>&nbsp;
<a href="javascript:setDays(7)">7</a>&nbsp;
<a href="javascript:setDays(10)">10</a>&nbsp;
days
</td>
</tr>
</table>
<form>
<p align="middle" style="padding:0; margin:0;">
<span id="nav-dayname">...</span>
<select onChange="navDate()" id="nav-day"></select>
<select onChange="navDate()" id="nav-month"></select>
<select onChange="navDate()" id="nav-year"></select>,
<select onChange="navDate()" id="nav-hour"></select>:
<select onChange="navDate()" id="nav-minute"></select>
</p>
</form></div>
</div>
<div class="footer">
<p>Copyright 1993-2011, The University Computer Club Inc.
&lt;<a href="mailto:[email protected]">[email protected]</a>&gt;<br />
Written to be <a href="http://www.w3c.org/">specifications compliant</a>.
</p>
<p class="logos" style="text-align: center;">
<a href="http://www.ucc.asn.au">
<img style="padding-bottom:1ex;" src="http://www.ucc.asn.au/images/ucc-sun-logo-black.png" alt="UCC" title="University Computer Club" />
</a>
<img alt="Hacking Life" title="Hacking Life" style="padding-bottom:1ex;" src="http://www.ucc.asn.au/images/glider.png" />
<a href="http://www.gu.uwa.edu.au">
<img alt="Guide of Undergraduates" title="UWA Guild of Undergraduates" style="padding-bottom:1ex;" src="http://www.ucc.asn.au/images/guild/spot2001-blue.png" />
</a>
<a href="http://www.uwa.edu.au">
<img alt="University of Western Australia" title="University of Western Australia" src="http://www.ucc.asn.au/images/uwa_crest.png" />
</a>
</p>
</div>
</body>
</html>
<?php header( "HTTP/1.0 410 Gone" ); ?>
<HTML><HEAD><TITLE>The UCC Webcam archive is no longer available</TITLE></HEAD>
<BODY BGCOLOR=white>
<P>The UCC webcam archive is no longer available.</P>
</BODY></HTML>
<?php exit(); ?>
<?php if ( !isset( $broken ) ) { $broken = 0; if ( filemtime("../webcam.jpg")<(time()-5*60) ) $broken = 1; }
$count = 0;
$WEBCAM = "/home/ucc/devenish/webcam/archives/today";
$count = (integer)exec( "cat $WEBCAM/count" );
$requested = (integer)$QUERY_STRING;
if ( $requested < 1 ) $requested = $count;
?>
<?php header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT"); ?>
<HTML><HEAD><META HTTP-EQUIV=REFRESH CONTENT="<?php if ( $broken ) echo "300"; else echo "60"; ?>;URL=./"><TITLE>UCC Webcam</TITLE></HEAD>
<BODY BGCOLOR=white>
<P>The UCC webcam is a colour camera running off our G3 known as <A HREF=http://www.ucc.asn.au/machines/nautilus.ucc>nautilus.</A></P>
<P>The UCC also has a <A HREF='./bw-archive'>black-and-white camera</A>.</P>
<?php if ( $broken ): ?>
<P><FONT COLOR='fushia'><EM>The webcam is currently off-line so no new images are being created.</EM></FONT></P>
<?php endif; ?>
<?php if ( $count ): ?>
<P>
<FONT COLOR='navy'><EM>The most recent picture is number <a href='archive?<?echo $count?>'><?echo $count?></a>.</EM></FONT>
</P>
<?php endif; ?>
<?php if ( $requested ): ?>
<h2>Image <?echo $requested?> of <?echo $count?></h2>
<P>
[ <A <?php echo ( $requested > 1 && $count > 0)?"href":"name"; echo "='archive?".($requested-1); ?>'>Previous</A> |
<A <?php echo ( $requested < $count && $count > 0 )?"href":"name"; echo "='archive?".($requested+1); ?>'>Next</A> ]
</P>
<img src='webcam.php?<?echo $requested?>' alt='Image <?echo $requested?>' />
<?php else: ?>
There are no images to display.
<?php endif; ?>
<P>Back to the latest <A HREF="/">webcam images</A>.</P>
<P>Check out the <A HREF="http://www.ucc.gu.uwa.edu.au/">UCC web page</A>.</P>
<?php if ( $broken ) : ?>
<P><FONT SIZE='-1'>This page generated at <?php echo date( "g:i A D d M Y", filemtime("../webcam.jpg") ); ?>.</FONT></P>
<?php endif; ?>
</BODY>
<HTML>
<?php header( "HTTP/1.0 410 Gone" ); ?>
<HTML><HEAD><TITLE>The UCC Webcam archive is no longer available</TITLE></HEAD>
<BODY BGCOLOR=white>
<P>The UCC webcam archive is no longer available.</P>
</BODY></HTML>
<?php exit(); ?>
<?php if ( !isset( $broken ) ) { $broken = 0; if ( filemtime("../bw-webcam.jpg")<(time()-5*60) ) $broken = 1; }
$count = 0;
$WEBCAM = "/home/ucc/devenish/webcam/bw-archives/today";
$count = (integer)exec( "cat $WEBCAM/bw-count" );
$requested = (integer)$QUERY_STRING;
if ( $requested < 1 ) $requested = $count;
?>
<?php header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT"); ?>
<HTML><HEAD><META HTTP-EQUIV=REFRESH CONTENT="<?php if ( $broken ) echo "300"; else echo "60"; ?>;URL=./"><TITLE>UCC B&amp;W Webcam</TITLE></HEAD>
<BODY BGCOLOR=white>
<P>The UCC B&amp;W webcam is a monochrome camera running off a Quadra 660/AV known as kormoran.</A></P>
<P>The UCC also has a <A HREF='./archive'>colour camera</A>.</P>
<?php if ( $broken ): ?>
<P><FONT COLOR='fushia'><EM>The webcam is currently off-line so no new images are being created.</EM></FONT></P>
<?php endif; ?>
<?php if ( $count ): ?>
<P>
<FONT COLOR='navy'><EM>The most recent picture is number <a href='bw-archive?<?echo $count?>'><?echo $count?></a>.</EM></FONT>
</P>
<?php endif; ?>
<?php if ( $requested ): ?>
<h2>Image <?echo $requested?> of <?echo $count?></h2>
<P>
[ <A <?php echo ( $requested > 1 && $count > 0)?"href":"name"; echo "='bw-archive?1"; ?>'>First</A> |
<A <?php echo ( $requested > 1 && $count > 0)?"href":"name"; echo "='bw-archive?".($requested-1); ?>'>Previous</A> |
<A <?php echo ( $requested < $count && $count > 0 )?"href":"name"; echo "='bw-archive?".($requested+1); ?>'>Next</A> |
<A <?php echo ( $requested < $count && $count > 0 )?"href":"name"; echo "='bw-archive?".($count); ?>'>Last</A> ]
</P>
<img src='bw-webcam.php?<?echo $requested?>' alt='Image <?echo $requested?>' />
<?php else: ?>
There are no images to display.
<?php endif; ?>
<P>Back to the latest <A HREF="/">webcam images</A>.</P>
<P>Check out the <A HREF="http://www.ucc.gu.uwa.edu.au/">UCC web page</A>.</P>
<?php if ( $broken ) : ?>
<P><FONT SIZE='-1'>This page generated at <?php echo date( "g:i A D d M Y", filemtime("../bw-webcam.jpg") ); ?>.</FONT></P>
<?php endif; ?>
</BODY>
<HTML>
<?php
$file="./bw-webcam-overlay.svg";
if ( (integer)($QUERY_STRING) ):
$WEBCAM = "/home/ucc/devenish/webcam/bw-archives/today";
$file = "$WEBCAM/bw-webcam.jpg.".(integer)($QUERY_STRING);
endif;
header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT");