| 1 |
WORLD_CLOCK = [==========[ |
| 2 |
<style> |
| 3 |
table { spacing : 0px 0px 0px 0px} |
| 4 |
table { margins: 50 50 50 50} |
| 5 |
table {font-size: 80% } |
| 6 |
.active {font-size : 180%} |
| 7 |
.more_cities {font-size : 16px} |
| 8 |
td { border : 1px solid orange;} |
| 9 |
.hour00 { background-color: black; color: #ccc} |
| 10 |
.hour01 { background-color: black; color: #ccc} |
| 11 |
.hour02 { background-color: black; color: #ccc} |
| 12 |
.hour03 { background-color: black; color: #ccc} |
| 13 |
.hour04 { background-color: black; color: #ccc} |
| 14 |
.hour05 { background-color: #666; color: black} |
| 15 |
.hour06 { background-color: #f99; color: black} |
| 16 |
.hour07 { background-color: #fdd; color: black} |
| 17 |
.hour08 { background-color: #fdd; color: black} |
| 18 |
.hour09 { background-color: white; color: black} |
| 19 |
.hour10 { background-color: white; color: black} |
| 20 |
.hour11 { background-color: white; color: black} |
| 21 |
.hour12 { background-color: yellow; color: black} |
| 22 |
.hour13 { background-color: yellow; color: black} |
| 23 |
.hour14 { background-color: white; color: black} |
| 24 |
.hour15 { background-color: white; color: black} |
| 25 |
.hour16 { background-color: white; color: black} |
| 26 |
.hour17 { background-color: white; color: black} |
| 27 |
.hour18 { background-color: #ddd; color: black} |
| 28 |
.hour19 { background-color: #ddd; color: black} |
| 29 |
.hour20 { background-color: #ddd; color: black} |
| 30 |
.hour21 { background-color: #999; color: yellow} |
| 31 |
.hour22 { background-color: #999; color: yellow} |
| 32 |
.hour23 { background-color: black; color: white} |
| 33 |
</style> |
| 34 |
<div id="worldclock"> |
| 35 |
<table> |
| 36 |
$do_hour[[ |
| 37 |
<tr class="hour$hh"> |
| 38 |
<td class="active">$city</td> |
| 39 |
<td align="right" class="active">$hh:$mm:$ss</td> |
| 40 |
</tr> |
| 41 |
]],[[ |
| 42 |
<tr> |
| 43 |
<td class="hour$hh" colspan="2"> </td> |
| 44 |
</tr> |
| 45 |
]] |
| 46 |
</table> |
| 47 |
</div> |
| 48 |
]==========] |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
TIMED_UPDATE = [======[ |
| 53 |
<div id="world_clock">Wait a second</div> |
| 54 |
<script> |
| 55 |
function ahah(url,target) { |
| 56 |
//document.getElementById(target).innerHTML = 'loading data...'; |
| 57 |
if (window.XMLHttpRequest) { |
| 58 |
req = new XMLHttpRequest(); |
| 59 |
req.onreadystatechange = function() {ahahDone(target);}; |
| 60 |
req.open("GET", url, true); |
| 61 |
req.send(null); |
| 62 |
} else if (window.ActiveXObject) { |
| 63 |
req = new ActiveXObject("Microsoft.XMLHTTP"); |
| 64 |
if (req) { |
| 65 |
req.onreadystatechange = function() {ahahDone(target);}; |
| 66 |
req.open("GET", url, true); |
| 67 |
req.send(); |
| 68 |
} |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
function ahahDone(target) { |
| 73 |
// only if req is "loaded" |
| 74 |
if (req.readyState == 4) { |
| 75 |
// only if "OK" |
| 76 |
if (req.status == 200 || req.status == 304) { |
| 77 |
results = req.responseText; |
| 78 |
document.getElementById(target).innerHTML = results; |
| 79 |
} else { |
| 80 |
document.getElementById(target).innerHTML="ahah error:\n" + |
| 81 |
req.statusText; |
| 82 |
} |
| 83 |
} |
| 84 |
} |
| 85 |
|
| 86 |
function updateTime() { |
| 87 |
setTimeout( 'ahah( "$url", "world_clock", 1)', 1 ); |
| 88 |
setTimeout("updateTime()", $timeout); |
| 89 |
} |
| 90 |
|
| 91 |
updateTime(); |
| 92 |
</script> |
| 93 |
|
| 94 |
]======] |