1 <!-- Get and update the GCC regression tester's web page.
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20 <?xml version="1.0" encoding="UTF-8"?>
22 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
23 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
24 <html xmlns="http://www.w3.org/1999/xhtml">
25 <META http-equiv="Content-Script-Type" content="text/javascript">
28 <script type='text/javascript'>
29 // A string representing NUM, with a leading zero if it would be 1 digit long
32 var result = num.toString();
33 if (result.length == 1)
39 // Get DATE as a string in standard ISO format in UTC
40 function getISO (date)
42 return (date.getUTCFullYear().toString() + '-'
43 + dig2 (date.getUTCMonth() + 1) + '-'
44 + dig2 (date.getUTCDate()) + 'T'
45 + dig2 (date.getUTCHours()) + ':'
46 + dig2 (date.getUTCMinutes()) + 'Z');
49 // STR is a bunch of lines of the form '<key>: <date>' where <date> is in
50 // standard ISO UTC format. Return a Date object corresponding to KEY, or null
52 function fromISO (str, key)
54 var rx = new RegExp (key + ": (\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+):(\\d+)Z");
55 var match = rx.exec (str);
56 if (match == null || match.length != 7)
58 var date = new Date(0);
59 date.setUTCFullYear (match[1], match[2] - 1, match[3]);
60 date.setUTCHours (match[4], match[5], match[6], 0);
65 function updateContents () {
66 var url = 'http://gcc.gnu.org/regtest/HEAD/status.txt';
67 var xml_request = new XMLHttpRequest();
69 xml_request.onload = function(e)
71 gotContents(e, xml_request);
73 xml_request.open("GET", url);
74 xml_request.setRequestHeader("Cache-Control", "max-age=0");
75 xml_request.send(null);
78 function gotContents (event, request) {
79 if (request.status != 200)
82 if (! request.responseText)
85 var txt = (request.responseText
86 .replace (/&/g,"&")
87 .replace (/</g,"<")
88 .replace (/"/g,""")
89 .replace (/>;/g,">"));
91 var today = new Date();
92 var date_r = fromISO (txt, "Date");
93 var completed_r = fromISO (txt, "Test-Completed");
94 var now_test_r = fromISO (txt, "Now-Testing");
97 if (date_r != null && completed_r != null && now_test_r != null)
99 var eta_r = new Date (now_test_r.getTime()
100 + completed_r.getTime() - date_r.getTime());
101 eta = "ETA: " + getISO (eta_r) + '\n';
104 var val = txt + "Now: " + getISO (today) + '\n' + eta;
105 document.getElementById ("contents").innerHTML = "<pre>"+val+"<\/pre>";
108 var mainTimer = null;
113 mainTimer = setInterval (updateContents, 60000);
121 clearInterval (mainTimer);
128 if ( window.widget ) {
129 widget.onshow = myOnShow;
130 widget.onhide = myOnHide;
144 padding: 1px 2px 1px 2px;
146 background-color: white;
152 <body onLoad='myOnLoad();'>
153 <div id="contents">Loading...</div>