testing a new GUI for the standalone predictor
|
@ -0,0 +1,79 @@
|
|||
/* Basic font-size and family. */
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0; padding: 0;
|
||||
}
|
||||
|
||||
/* The whoppping map in the centre */
|
||||
#map_canvas { width: 100%; height: 100%; }
|
||||
|
||||
.box {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
border: 1px solid #6666ff;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.box {
|
||||
background: rgba(255,255,255,0.75); /* for more modern browsers */
|
||||
}
|
||||
|
||||
.box * {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.box table {
|
||||
margin: 0.25em auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.box h1 {
|
||||
text-align: center;
|
||||
margin: 0em 0em 0.5em 0em;
|
||||
}
|
||||
|
||||
.box p {
|
||||
margin: 0 auto;
|
||||
margin-bottom: 0.25em;
|
||||
width: 25em;
|
||||
}
|
||||
|
||||
#trail_table {
|
||||
right: 0; bottom: 0;
|
||||
border-right: none;
|
||||
border-bottom: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#scenario_template {
|
||||
left: 0; bottom: 0;
|
||||
border-left: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
td.right-td {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td.spacer {
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
table#trails {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table#trails td, table#trails th {
|
||||
border: 1px solid #6666ff;
|
||||
padding: 0.1em 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table#trails th {
|
||||
background-color: #6666ff;
|
||||
color: white;
|
||||
}
|
Po Szerokość: | Wysokość: | Rozmiar: 4.9 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 7.2 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 421 B |
Po Szerokość: | Wysokość: | Rozmiar: 776 B |
Po Szerokość: | Wysokość: | Rozmiar: 3.2 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.5 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.3 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.3 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.3 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.4 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.3 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.2 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.3 KiB |
|
@ -0,0 +1,120 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>GUI test</title>
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
<link href="css/hourly.css" type="text/css" rel="stylesheet">
|
||||
<script src="js/jquery.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var map;
|
||||
var launch_img = "images/marker-sm-red.png";
|
||||
var land_img = "images/marker-sm-red.png";
|
||||
var burst_img = "images/pop-marker.png";
|
||||
|
||||
function initialize() {
|
||||
var latlng = new google.maps.LatLng(52, 0);
|
||||
var myOptions = {
|
||||
zoom: 8,
|
||||
center: latlng,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
|
||||
parseCSV("new.csv");
|
||||
}
|
||||
|
||||
function parseCSV(csv_name) {
|
||||
$.get(csv_name, null, function(data, textStatus) {
|
||||
var lines = data.split('\n');
|
||||
var path = [];
|
||||
var max_height = -10; //just any -ve number
|
||||
var max_point = null;
|
||||
var launch_pt;
|
||||
var land_pt;
|
||||
$.each(lines, function(idx, line) {
|
||||
entry = line.split(',');
|
||||
if(entry.length >= 4) { // check valid entry length
|
||||
var point = new google.maps.LatLng( parseFloat(entry[1]), parseFloat(entry[2]) );
|
||||
if ( idx == 0 ) { // get the launch lat/long for marker
|
||||
var launch_lat = entry[1];
|
||||
var launch_lon = entry[2];
|
||||
launch_pt = point;
|
||||
}
|
||||
|
||||
// set on every iteration, last valid entry
|
||||
// gives landing position
|
||||
var land_lat = entry[1];
|
||||
var land_lon = entry[2];
|
||||
land_pt = point;
|
||||
|
||||
if(parseFloat(entry[3]) > max_height) {
|
||||
max_height = parseFloat(entry[3]);
|
||||
max_point = point;
|
||||
}
|
||||
path.push(point);
|
||||
}
|
||||
});
|
||||
|
||||
// make some nice icons
|
||||
var launch_icon = new google.maps.MarkerImage(launch_img,
|
||||
new google.maps.Size(16,16),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(8, 8)
|
||||
);
|
||||
|
||||
var land_icon = new google.maps.MarkerImage(land_img,
|
||||
new google.maps.Size(16,16),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(8, 8)
|
||||
);
|
||||
|
||||
var launch_marker = new google.maps.Marker({
|
||||
position: launch_pt,
|
||||
map: map,
|
||||
icon: launch_icon,
|
||||
title: 'Balloon launch'
|
||||
});
|
||||
|
||||
var land_marker = new google.maps.Marker({
|
||||
position: land_pt,
|
||||
map:map,
|
||||
icon: land_icon,
|
||||
title: 'Predicted Landing'
|
||||
});
|
||||
|
||||
// now add the launch/land markers to map
|
||||
launch_marker.setMap(map);
|
||||
land_marker.setMap(map);
|
||||
|
||||
var path_polyline = new google.maps.Polyline({
|
||||
path:path,
|
||||
strokeColor: '#000000',
|
||||
strokeWeight: 3,
|
||||
strokeOpacity: 0.75
|
||||
});
|
||||
|
||||
path_polyline.setMap(map);
|
||||
|
||||
var pop_marker = new google.maps.Marker({
|
||||
position: max_point,
|
||||
map: map,
|
||||
icon: burst_img,
|
||||
title: 'Balloon burst (max. altitude: ' + max_height + 'm)',
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="initialize()">
|
||||
<div id="map_canvas" style="width:100%; height:100%"></div>
|
||||
<div id="scenario_template" class="box">
|
||||
<h1>Scenario Template</h1>
|
||||
hello world :)
|
||||
<br>
|
||||
this is a happy box
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
<title>Apex Hourly Landing Prediction</title>
|
||||
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css" type="text/css" rel="stylesheet">
|
||||
<link href="css/hourly.css" type="text/css" rel="stylesheet">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="js/mootools-1.2.4.2-more.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript">
|
||||
</script>
|
||||
<script src="js/hourly.js" type="text/javascript">
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map_canvas"></div>
|
||||
<div id="scenario_template" class="box">
|
||||
<h1>Scenario Template</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Latitude</td>
|
||||
<td class="right-td" id="launch-lat"></td>
|
||||
<td>deg N</td>
|
||||
<td class="spacer"></td>
|
||||
<td>Ascent rate</td>
|
||||
<td class="right-td" id="ascent-rate"></td>
|
||||
<td>m/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Longitude</td>
|
||||
<td class="right-td" id="launch-lon"></td>
|
||||
<td>deg E</td>
|
||||
<td class="spacer"></td>
|
||||
<td>Descent rate</td>
|
||||
<td class="right-td" id="descent-rate"></td>
|
||||
<td>m/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Altitude</td>
|
||||
<td class="right-td" id="launch-alt"></td>
|
||||
<td>m</td>
|
||||
<td class="spacer"></td>
|
||||
<td>Burst altitude</td>
|
||||
<td class="right-td" id="burst-alt"></td>
|
||||
<td>m</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1>Brief instructions</h1>
|
||||
<p>Hover over point to see launch time, click to see path, right-click to see full information. Click on a path to remove it. See <a href="http://www.srcf.ucam.org/~cuspaceflight/wiki/doku.php?id=members:landing_prediction">wiki</a> to change scenario.</p>
|
||||
</div>
|
||||
<div id="trail_table" class="box">
|
||||
<h1>Predictions</h1>
|
||||
<table id="trails">
|
||||
<thead>
|
||||
<tr><th>Launch Date</th><th>Launch Time</th><th>Duration</th><th>Tools</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,234 @@
|
|||
var g_map_object = null;
|
||||
function init_map() {
|
||||
var latlng = new google.maps.LatLng(52, 0);
|
||||
var options = {
|
||||
zoom: 8,
|
||||
center: latlng,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById('map_canvas'), options)
|
||||
g_map_object = map;
|
||||
}
|
||||
|
||||
function prediction_entry_convert_date(when) {
|
||||
var time = new Date();
|
||||
time.setUTCFullYear(when.year);
|
||||
time.setUTCMonth(when.month - 1);
|
||||
time.setUTCDate(when.day);
|
||||
time.setUTCHours(when.hour);
|
||||
time.setUTCMinutes(when.minute);
|
||||
time.setUTCSeconds(when.second);
|
||||
return time;
|
||||
}
|
||||
|
||||
var g_predictions = { };
|
||||
function show_prediction(uuid, launch_time, landing_time) {
|
||||
if(g_predictions[uuid] != null) { return; }
|
||||
|
||||
$.get('data/' + uuid + '/output.csv', null, function(data, textStatus) {
|
||||
var lines = data.split('\n');
|
||||
var path = [ ];
|
||||
var max_height = -10;
|
||||
var max_point = null;
|
||||
$.each(lines, function(idx, line) {
|
||||
entry = line.split(',');
|
||||
if(entry.length >= 4) {
|
||||
var point = new google.maps.LatLng( parseFloat(entry[1]), parseFloat(entry[2]) );
|
||||
if(parseFloat(entry[3]) > max_height) {
|
||||
max_height = parseFloat(entry[3]);
|
||||
max_point = point;
|
||||
}
|
||||
path.push(point);
|
||||
}
|
||||
});
|
||||
|
||||
var path_polyline = new google.maps.Polyline({
|
||||
path: path,
|
||||
strokeColor: '#000000',
|
||||
strokeWeight: 3,
|
||||
strokeOpacity: 0.75,
|
||||
});
|
||||
path_polyline.setMap(g_map_object);
|
||||
|
||||
var pop_icon = new google.maps.MarkerImage('images/pop-marker.png',
|
||||
new google.maps.Size(16, 16),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(8, 8));
|
||||
|
||||
var pop_marker = new google.maps.Marker({
|
||||
position: max_point,
|
||||
map: g_map_object,
|
||||
icon: pop_icon,
|
||||
title: 'Baloon burst (max. altitude: ' + max_height + 'm)',
|
||||
});
|
||||
|
||||
google.maps.event.addListener(path_polyline, 'click', function() {
|
||||
hide_prediction(uuid);
|
||||
});
|
||||
|
||||
google.maps.event.addListener(pop_marker, 'click', function() {
|
||||
hide_prediction(uuid);
|
||||
});
|
||||
|
||||
// Add a row to the prediction table
|
||||
|
||||
var new_row = $(
|
||||
'table#trails tbody').append('<tr id="trail-row-' + uuid + '">' +
|
||||
'<td>' + launch_time.format('%a %d/%b/%Y') + '</td>' +
|
||||
'<td>' + launch_time.format('%H:%M:%S') + '</td>' +
|
||||
'<td>' + ((landing_time - launch_time) / (1000*60*60)).toPrecision(3) + ' hrs</td>' +
|
||||
'<td>' +
|
||||
'<a href="#" onclick="hide_prediction(\''+uuid+'\')">hide</a> ' +
|
||||
'<a href="#" onclick="show_info(\''+uuid+'\')">info</a>' +
|
||||
'</td>' +
|
||||
'</tr>');
|
||||
|
||||
g_predictions[uuid] = { 'polyline': path_polyline, 'row': new_row, 'pop_marker': pop_marker };
|
||||
$('#trail_table').fadeIn('normal');
|
||||
}, 'text');
|
||||
}
|
||||
|
||||
function hide_prediction(uuid) {
|
||||
var prediction = g_predictions[uuid];
|
||||
if(prediction == null) { return; }
|
||||
|
||||
g_predictions[prediction.uuid] = null;
|
||||
|
||||
prediction.polyline.setMap( null );
|
||||
prediction.pop_marker.setMap( null );
|
||||
|
||||
var table_rows = $('table#trails tr').filter(function() { return this.id.match(/^trail-row-/); });
|
||||
var this_row = $('table#trails #trail-row-' + uuid);
|
||||
|
||||
if(table_rows.length > 1) {
|
||||
// If there is more than just this row, fade it out
|
||||
this_row.fadeOut('normal', function() { this_row.remove(); } );
|
||||
} else {
|
||||
// fade the whole table.
|
||||
$('#trail_table').fadeOut('normal', function() { this_row.remove(); });
|
||||
}
|
||||
}
|
||||
|
||||
function show_info(uuid) {
|
||||
var map_objects = g_prediction_map_objects[uuid];
|
||||
if(map_objects == null) { return; }
|
||||
map_objects.info_window.open(g_map_object, map_objects.marker);
|
||||
}
|
||||
|
||||
var g_prediction_map_objects = [];
|
||||
function populate_map() {
|
||||
$.getJSON('data/manifest.json', null,
|
||||
function(data) {
|
||||
var marker_image = new google.maps.MarkerImage('images/marker-sm-red.png',
|
||||
new google.maps.Size(11,11),
|
||||
new google.maps.Point(0,0), // origin
|
||||
new google.maps.Point(5.5,5.5)); // anchor
|
||||
|
||||
// extract the predictions to an array of uuid, entry pairs
|
||||
var predictions = [];
|
||||
$.each(data['predictions'], function(uuid, entry) {
|
||||
predictions.push( { 'uuid': uuid, 'entry': entry } );
|
||||
});
|
||||
|
||||
// sort the predictions in order of date
|
||||
predictions.sort(function(a,b) {
|
||||
var a_date = prediction_entry_convert_date(a.entry['launch-time']);
|
||||
var b_date = prediction_entry_convert_date(b.entry['launch-time']);
|
||||
if(a_date < b_date) { return -1; }
|
||||
if(a_date > b_date) { return 1; }
|
||||
return 0;
|
||||
});
|
||||
|
||||
// Add each prediction to the map
|
||||
var prediction_coords = [];
|
||||
$.each(predictions, function(idx, prediction) {
|
||||
// console.log(prediction);
|
||||
var where = prediction.entry['landing-location'];
|
||||
var launch_time = prediction_entry_convert_date(prediction.entry['launch-time']);
|
||||
var landing_time = prediction_entry_convert_date(prediction.entry['landing-time']);
|
||||
var latlng = new google.maps.LatLng(
|
||||
where.latitude, where.longitude);
|
||||
var marker = new google.maps.Marker({
|
||||
position: latlng,
|
||||
map: g_map_object,
|
||||
icon: marker_image,
|
||||
title: launch_time.format('%a %d/%b/%Y %H:%M:%S'),
|
||||
});
|
||||
prediction_coords.push(latlng);
|
||||
|
||||
var info_window = new google.maps.InfoWindow({
|
||||
content:
|
||||
'<p><strong>Launch time:</strong> ' + launch_time.format('%d/%b/%Y %H:%M:%S') + '</p>' +
|
||||
'<p><strong>Landing time:</strong> ' + landing_time.format('%d/%b/%Y %H:%M:%S') + '</p>' +
|
||||
'<p><strong>Landing location:</strong> ' + where.latitude + '°N ' + where.longitude + '°E</p>' +
|
||||
'<p><a target="_new" href="data/' + prediction.uuid + '/">Raw output data</a> (opens in new window)</p>'
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
show_prediction(prediction.uuid, launch_time, landing_time);
|
||||
});
|
||||
google.maps.event.addListener(marker, 'rightclick', function() {
|
||||
info_window.open(g_map_object, marker);
|
||||
});
|
||||
|
||||
g_prediction_map_objects[prediction.uuid] = {
|
||||
'info_window': info_window,
|
||||
'marker': marker,
|
||||
};
|
||||
});
|
||||
|
||||
// Plot a path for the predictions
|
||||
var pred_path = new google.maps.Polyline({
|
||||
path: prediction_coords,
|
||||
strokeColor: '#ff4444',
|
||||
strokeOpacity: 0.5,
|
||||
strokeWeight: 2,
|
||||
});
|
||||
pred_path.setMap(g_map_object);
|
||||
|
||||
var template = data['scenario-template'];
|
||||
$('#launch-lat').text(template['launch-site'].latitude);
|
||||
$('#launch-lon').text(template['launch-site'].longitude);
|
||||
$('#launch-alt').text(template['launch-site'].altitude);
|
||||
$('#ascent-rate').text(template['altitude-model']['ascent-rate']);
|
||||
$('#descent-rate').text(template['altitude-model']['descent-rate']);
|
||||
$('#burst-alt').text(template['altitude-model']['burst-altitude']);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function generateLinks(uuid) {
|
||||
var html;
|
||||
html = '<a target="_new" href="predictions/' + uuid + '/log">log</a>, ';
|
||||
html += '<a href="predictions/' + uuid + '/output">output</a>, ';
|
||||
html += '<a href="predictions/' + uuid + '/output.kml">KML output</a>';
|
||||
return html;
|
||||
}
|
||||
|
||||
function refreshPredictionTable() {
|
||||
// Clear any existing pred_table.
|
||||
predictions_table.fnClearTable();
|
||||
|
||||
$.getJSON('list.cgi', null,
|
||||
function(data) {
|
||||
$.each(data, function() {
|
||||
predictions_table.fnAddData([ this.creation, this.creation ], false);
|
||||
});
|
||||
predictions_table.fnDraw();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function POSIXtoDate(timestamp)
|
||||
{
|
||||
var d = new Date();
|
||||
d.setTime(timestamp * 1000);
|
||||
return d.format('%d/%b/%Y %H:%M:%S')
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
init_map();
|
||||
populate_map();
|
||||
});
|
||||
|
||||
// vim:et:ts=8:sw=8:autoindent
|
|
@ -0,0 +1,56 @@
|
|||
//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License.
|
||||
|
||||
MooTools.More={version:"1.2.4.2",build:"bd5a93c0913cce25917c48cbdacde568e15e02ef"};(function(){var a={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};
|
||||
var b;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(c){if(!a.languages[c]){return this;}a.language=c;this.load();this.fireEvent("langChange",c);
|
||||
return this;},load:function(){var c=this.cascade(this.getCurrentLanguage());b={};$each(c,function(e,d){b[d]=this.lambda(e);},this);},getCurrentLanguage:function(){return a.language;
|
||||
},addLanguage:function(c){a.languages[c]=a.languages[c]||{};return this;},cascade:function(e){var c=(a.languages[e]||{}).cascades||[];c.combine(a.cascades);
|
||||
c.erase(e).push(e);var d=c.map(function(f){return a.languages[f];},this);return $merge.apply(this,d);},lambda:function(c){(c||{}).get=function(e,d){return $lambda(c[e]).apply(this,$splat(d));
|
||||
};return c;},get:function(e,d,c){if(b&&b[e]){return(d?b[e].get(d,c):b[e]);}},set:function(d,e,c){this.addLanguage(d);langData=a.languages[d];if(!langData[e]){langData[e]={};
|
||||
}$extend(langData[e],c);if(d==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",d);}return this;},list:function(){return Hash.getKeys(a.languages);
|
||||
}});})();(function(){var i=this.Date;if(!i.now){i.now=$time;}i.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};
|
||||
["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(p){i.Methods[p.toLowerCase()]=p;
|
||||
});var d=function(q,p){return new Array(p-String(q).length+1).join("0")+q;};i.implement({set:function(t,r){switch($type(t)){case"object":for(var s in t){this.set(s,t[s]);
|
||||
}break;case"string":t=t.toLowerCase();var q=i.Methods;if(q[t]){this["set"+q[t]](r);}}return this;},get:function(q){q=q.toLowerCase();var p=i.Methods;if(p[q]){return this["get"+p[q]]();
|
||||
}return null;},clone:function(){return new i(this.get("time"));},increment:function(p,r){p=p||"day";r=$pick(r,1);switch(p){case"year":return this.increment("month",r*12);
|
||||
case"month":var q=this.get("date");this.set("date",1).set("mo",this.get("mo")+r);return this.set("date",q.min(this.get("lastdayofmonth")));case"week":return this.increment("day",r*7);
|
||||
case"day":return this.set("date",this.get("date")+r);}if(!i.units[p]){throw new Error(p+" is not a supported interval");}return this.set("time",this.get("time")+r*i.units[p]());
|
||||
},decrement:function(p,q){return this.increment(p,-1*$pick(q,1));},isLeapYear:function(){return i.isLeapYear(this.get("year"));},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0});
|
||||
},diff:function(q,p){if($type(q)=="string"){q=i.parse(q);}return((q-this)/i.units[p||"day"](3,3)).toInt();},getLastDayOfMonth:function(){return i.daysInMonth(this.get("mo"),this.get("year"));
|
||||
},getDayOfYear:function(){return(i.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-i.UTC(this.get("year"),0,1))/i.units.day();},getWeek:function(){return(this.get("dayofyear")/7).ceil();
|
||||
},getOrdinal:function(p){return i.getMsg("ordinal",p||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");
|
||||
},getGMTOffset:function(){var p=this.get("timezoneOffset");return((p>0)?"-":"+")+d((p.abs()/60).floor(),2)+d(p%60,2);},setAMPM:function(p){p=p.toUpperCase();
|
||||
var q=this.get("hr");if(q>11&&p=="AM"){return this.decrement("hour",12);}else{if(q<12&&p=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM";
|
||||
},parse:function(p){this.set("time",i.parse(p));return this;},isValid:function(p){return !!(p||this).valueOf();},format:function(p){if(!this.isValid()){return"invalid date";
|
||||
}p=p||"%x %X";p=k[p.toLowerCase()]||p;var q=this;return p.replace(/%([a-z%])/gi,function(s,r){switch(r){case"a":return i.getMsg("days")[q.get("day")].substr(0,3);
|
||||
case"A":return i.getMsg("days")[q.get("day")];case"b":return i.getMsg("months")[q.get("month")].substr(0,3);case"B":return i.getMsg("months")[q.get("month")];
|
||||
case"c":return q.toString();case"d":return d(q.get("date"),2);case"H":return d(q.get("hr"),2);case"I":return((q.get("hr")%12)||12);case"j":return d(q.get("dayofyear"),3);
|
||||
case"m":return d((q.get("mo")+1),2);case"M":return d(q.get("min"),2);case"o":return q.get("ordinal");case"p":return i.getMsg(q.get("ampm"));case"S":return d(q.get("seconds"),2);
|
||||
case"U":return d(q.get("week"),2);case"w":return q.get("day");case"x":return q.format(i.getMsg("shortDate"));case"X":return q.format(i.getMsg("shortTime"));
|
||||
case"y":return q.get("year").toString().substr(2);case"Y":return q.get("year");case"T":return q.get("GMTOffset");case"Z":return q.get("Timezone");}return r;
|
||||
});},toISOString:function(){return this.format("iso8601");}});i.alias("toISOString","toJSON");i.alias("diff","compare");i.alias("format","strftime");var k={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"};
|
||||
var g=[];var e=i.parse;var n=function(s,u,r){var q=-1;var t=i.getMsg(s+"s");switch($type(u)){case"object":q=t[u.get(s)];break;case"number":q=t[month-1];
|
||||
if(!q){throw new Error("Invalid "+s+" index: "+index);}break;case"string":var p=t.filter(function(v){return this.test(v);},new RegExp("^"+u,"i"));if(!p.length){throw new Error("Invalid "+s+" string");
|
||||
}if(p.length>1){throw new Error("Ambiguous "+s);}q=p[0];}return(r)?t.indexOf(q):q;};i.extend({getMsg:function(q,p){return MooTools.lang.get("Date",q,p);
|
||||
},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(q,p){var r=new i;
|
||||
return i.daysInMonth($pick(q,r.get("mo")),$pick(p,r.get("year")))*86400000;},year:function(p){p=p||new i().get("year");return i.isLeapYear(p)?31622400000:31536000000;
|
||||
}},daysInMonth:function(q,p){return[31,i.isLeapYear(p)?29:28,31,30,31,30,31,31,30,31,30,31][q];},isLeapYear:function(p){return((p%4===0)&&(p%100!==0))||(p%400===0);
|
||||
},parse:function(r){var q=$type(r);if(q=="number"){return new i(r);}if(q!="string"){return r;}r=r.clean();if(!r.length){return null;}var p;g.some(function(t){var s=t.re.exec(r);
|
||||
return(s)?(p=t.handler(s)):false;});return p||new i(e(r));},parseDay:function(p,q){return n("day",p,q);},parseMonth:function(q,p){return n("month",q,p);
|
||||
},parseUTC:function(q){var p=new i(q);var r=i.UTC(p.get("year"),p.get("mo"),p.get("date"),p.get("hr"),p.get("min"),p.get("sec"));return new i(r);},orderIndex:function(p){return i.getMsg("dateOrder").indexOf(p)+1;
|
||||
},defineFormat:function(p,q){k[p]=q;},defineFormats:function(p){for(var q in p){i.defineFormat(q,p[q]);}},parsePatterns:g,defineParser:function(p){g.push((p.re&&p.handler)?p:l(p));
|
||||
},defineParsers:function(){Array.flatten(arguments).each(i.defineParser);},define2DigitYearStart:function(p){h=p%100;m=p-h;}});var m=1900;var h=70;var j=function(p){return new RegExp("(?:"+i.getMsg(p).map(function(q){return q.substr(0,3);
|
||||
}).join("|")+")[a-z]*");};var a=function(p){switch(p){case"x":return((i.orderIndex("month")==1)?"%m[.-/]%d":"%d[.-/]%m")+"([.-/]%y)?";case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%T?";
|
||||
}return null;};var o={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,T:/Z|[+-]\d{2}(?::?\d{2})?/};
|
||||
o.m=o.I;o.S=o.M;var c;var b=function(p){c=p;o.a=o.A=j("days");o.b=o.B=j("months");g.each(function(r,q){if(r.format){g[q]=l(r.format);}});};var l=function(r){if(!c){return{format:r};
|
||||
}var p=[];var q=(r.source||r).replace(/%([a-z])/gi,function(t,s){return a(s)||t;}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(t,s){var u=o[s];
|
||||
if(!u){return s;}p.push(s);return"("+u.source+")";}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff]");return{format:r,re:new RegExp("^"+q+"$","i"),handler:function(u){u=u.slice(1).associate(p);
|
||||
var s=new i().clearTime();if("d" in u){f.call(s,"d",1);}if("m" in u){f.call(s,"m",1);}for(var t in u){f.call(s,t,u[t]);}return s;}};};var f=function(p,q){if(!q){return this;
|
||||
}switch(p){case"a":case"A":return this.set("day",i.parseDay(q,true));case"b":case"B":return this.set("mo",i.parseMonth(q,true));case"d":return this.set("date",q);
|
||||
case"H":case"I":return this.set("hr",q);case"m":return this.set("mo",q-1);case"M":return this.set("min",q);case"p":return this.set("ampm",q.replace(/\./g,""));
|
||||
case"S":return this.set("sec",q);case"s":return this.set("ms",("0."+q)*1000);case"w":return this.set("day",q);case"Y":return this.set("year",q);case"y":q=+q;
|
||||
if(q<100){q+=m+(q<h?100:0);}return this.set("year",q);case"T":if(q=="Z"){q="+00";}var r=q.match(/([+-])(\d{2}):?(\d{2})?/);r=(r[1]+"1")*(r[2]*60+(+r[3]||0))+this.getTimezoneOffset();
|
||||
return this.set("time",this-r*60000);}return this;};i.defineParsers("%Y([-./]%m([-./]%d((T| )%X)?)?)?","%Y%m%d(T%H(%M%S?)?)?","%x( %X)?","%d%o( %b( %Y)?)?( %X)?","%b( %d%o)?( %Y)?( %X)?","%Y %b( %d%o( %X)?)?","%o %b %d %X %T %Y");
|
||||
MooTools.lang.addEvent("langChange",function(p){if(MooTools.lang.get("Date")){b(p);}}).fireEvent("langChange",MooTools.lang.getCurrentLanguage());})();
|
||||
MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(a){return(a>3&&a<21)?"th":["th","st","nd","rd","th"][Math.min(a%10,4)];
|
||||
},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"});
|
||||
MooTools.lang.set("en-GB","Date",{dateOrder:["date","month","year"],shortDate:"%d/%m/%Y",shortTime:"%H:%M"}).set("cascade",["en-US"]);
|
|
@ -0,0 +1,176 @@
|
|||
1274997650,52.2134,0.100343,250
|
||||
1274997700,52.2126,0.105933,500
|
||||
1274997750,52.2119,0.111818,750
|
||||
1274997800,52.2113,0.117999,1000
|
||||
1274997850,52.2109,0.124788,1250
|
||||
1274997900,52.2104,0.131845,1500
|
||||
1274997950,52.2101,0.139078,1750
|
||||
1274998000,52.2101,0.146274,2000
|
||||
1274998050,52.2102,0.15374,2250
|
||||
1274998100,52.2104,0.161393,2500
|
||||
1274998150,52.2106,0.169389,2750
|
||||
1274998200,52.2107,0.17825,3000
|
||||
1274998250,52.2111,0.187804,3250
|
||||
1274998300,52.2117,0.198313,3500
|
||||
1274998350,52.2125,0.209847,3750
|
||||
1274998400,52.2135,0.222338,4000
|
||||
1274998450,52.2148,0.235413,4250
|
||||
1274998500,52.2164,0.249184,4500
|
||||
1274998550,52.218,0.263648,4750
|
||||
1274998600,52.2199,0.278888,5000
|
||||
1274998650,52.222,0.294957,5250
|
||||
1274998700,52.2246,0.312267,5500
|
||||
1274998750,52.2273,0.330395,5750
|
||||
1274998800,52.2305,0.34978,6000
|
||||
1274998850,52.2338,0.370015,6250
|
||||
1274998900,52.2372,0.391462,6500
|
||||
1274998950,52.2412,0.414484,6750
|
||||
1274999000,52.2454,0.438249,7000
|
||||
1274999050,52.2499,0.462996,7250
|
||||
1274999100,52.2547,0.488868,7500
|
||||
1274999150,52.26,0.515799,7750
|
||||
1274999200,52.2657,0.54312,8000
|
||||
1274999250,52.2715,0.571192,8250
|
||||
1274999300,52.2774,0.599848,8500
|
||||
1274999350,52.2836,0.629299,8750
|
||||
1274999400,52.2897,0.659225,9000
|
||||
1274999450,52.2958,0.689587,9250
|
||||
1274999500,52.3018,0.719743,9500
|
||||
1274999550,52.3075,0.749533,9750
|
||||
1274999600,52.3131,0.778285,10000
|
||||
1274999650,52.3181,0.80659,10250
|
||||
1274999700,52.3229,0.833251,10500
|
||||
1274999750,52.3274,0.857854,10750
|
||||
1274999800,52.3316,0.881211,11000
|
||||
1274999850,52.3352,0.902966,11250
|
||||
1274999900,52.3385,0.922042,11500
|
||||
1274999950,52.3407,0.940643,11750
|
||||
1275000000,52.3428,0.955849,12000
|
||||
1275000050,52.3443,0.970143,12250
|
||||
1275000100,52.3463,0.98264,12500
|
||||
1275000150,52.3481,0.9943,12750
|
||||
1275000200,52.3498,1.00519,13000
|
||||
1275000250,52.3516,1.01591,13250
|
||||
1275000300,52.3533,1.02593,13500
|
||||
1275000350,52.3551,1.0358,13750
|
||||
1275000400,52.3567,1.0453,14000
|
||||
1275000450,52.3582,1.0547,14250
|
||||
1275000500,52.3596,1.06371,14500
|
||||
1275000550,52.361,1.07234,14750
|
||||
1275000600,52.3622,1.08077,15000
|
||||
1275000650,52.3635,1.08886,15250
|
||||
1275000700,52.3646,1.09691,15500
|
||||
1275000750,52.3655,1.10458,15750
|
||||
1275000800,52.3663,1.11176,16000
|
||||
1275000850,52.3671,1.11863,16250
|
||||
1275000900,52.3677,1.1255,16500
|
||||
1275000950,52.3684,1.13194,16750
|
||||
1275001000,52.3689,1.13854,17000
|
||||
1275001050,52.3693,1.14473,17250
|
||||
1275001100,52.3698,1.15078,17500
|
||||
1275001150,52.3701,1.1565,17750
|
||||
1275001200,52.3706,1.16191,18000
|
||||
1275001250,52.3708,1.1669,18250
|
||||
1275001300,52.371,1.17171,18500
|
||||
1275001350,52.3714,1.17622,18750
|
||||
1275001400,52.3718,1.18047,19000
|
||||
1275001450,52.3722,1.18472,19250
|
||||
1275001500,52.3723,1.18831,19500
|
||||
1275001550,52.3724,1.19169,19750
|
||||
1275001600,52.3727,1.19484,20000
|
||||
1275001650,52.3728,1.19777,20250
|
||||
1275001700,52.3731,1.20014,20500
|
||||
1275001750,52.3729,1.2025,20750
|
||||
1275001800,52.3733,1.20423,21000
|
||||
1275001850,52.3735,1.20624,21250
|
||||
1275001900,52.3736,1.2073,21500
|
||||
1275001950,52.3737,1.2084,21750
|
||||
1275002000,52.374,1.20915,22000
|
||||
1275002050,52.3739,1.20967,22250
|
||||
1275002100,52.374,1.20973,22500
|
||||
1275002150,52.3741,1.21007,22750
|
||||
1275002200,52.3741,1.20987,23000
|
||||
1275002250,52.3741,1.20937,23250
|
||||
1275002300,52.374,1.20883,23500
|
||||
1275002350,52.374,1.20778,23750
|
||||
1275002400,52.3741,1.20647,24000
|
||||
1275002450,52.3742,1.2049,24250
|
||||
1275002500,52.3742,1.20343,24500
|
||||
1275002550,52.3741,1.20176,24750
|
||||
1275002600,52.3742,1.20008,25000
|
||||
1275002650,52.3742,1.19829,25250
|
||||
1275002700,52.3741,1.19663,25500
|
||||
1275002750,52.3741,1.19485,25750
|
||||
1275002800,52.374,1.19285,26000
|
||||
1275002850,52.3739,1.19072,26250
|
||||
1275002900,52.3737,1.1886,26500
|
||||
1275002950,52.3736,1.18649,26750
|
||||
1275003000,52.3738,1.18425,27000
|
||||
1275003050,52.374,1.18173,27250
|
||||
1275003100,52.3741,1.17875,27500
|
||||
1275003150,52.3742,1.176,27750
|
||||
1275003200,52.3741,1.17298,28000
|
||||
1275003250,52.3739,1.16978,28250
|
||||
1275003300,52.3742,1.16621,28500
|
||||
1275003350,52.3742,1.16269,28750
|
||||
1275003400,52.3743,1.15915,29000
|
||||
1275003450,52.3743,1.15524,29250
|
||||
1275003500,52.3746,1.1508,29500
|
||||
1275003550,52.3747,1.14628,29750
|
||||
1275003600,52.3748,1.14189,30000
|
||||
1275003650,52.3751,1.13834,28066.9
|
||||
1275003700,52.375,1.13602,26398.8
|
||||
1275003750,52.375,1.13432,24936.2
|
||||
1275003800,52.3751,1.13304,23639.3
|
||||
1275003850,52.3753,1.1327,22462.4
|
||||
1275003900,52.3756,1.13345,21385.1
|
||||
1275003950,52.3758,1.13531,20392
|
||||
1275004000,52.3759,1.13803,19470.8
|
||||
1275004050,52.3761,1.14193,18611.8
|
||||
1275004100,52.3763,1.14688,17807
|
||||
1275004150,52.3766,1.15271,17050.2
|
||||
1275004200,52.3772,1.15921,16335.8
|
||||
1275004250,52.3779,1.16636,15659.4
|
||||
1275004300,52.3791,1.17433,15017.1
|
||||
1275004350,52.3805,1.18257,14405.7
|
||||
1275004400,52.3823,1.19183,13822.3
|
||||
1275004450,52.3843,1.20161,13264.4
|
||||
1275004500,52.3864,1.21215,12730
|
||||
1275004550,52.3883,1.22417,12217.1
|
||||
1275004600,52.3903,1.23888,11724
|
||||
1275004650,52.3936,1.25691,11249.4
|
||||
1275004700,52.3978,1.27908,10791.4
|
||||
1275004750,52.4033,1.30401,10346.6
|
||||
1275004800,52.4096,1.33196,9913.87
|
||||
1275004850,52.4164,1.36188,9492.4
|
||||
1275004900,52.4236,1.39217,9081.49
|
||||
1275004950,52.4309,1.42234,8680.53
|
||||
1275005000,52.4382,1.45155,8288.91
|
||||
1275005050,52.4451,1.48001,7906.14
|
||||
1275005100,52.4516,1.50785,7531.73
|
||||
1275005150,52.4574,1.53473,7165.24
|
||||
1275005200,52.4629,1.5602,6806.27
|
||||
1275005250,52.4677,1.58419,6454.45
|
||||
1275005300,52.4725,1.60657,6109.45
|
||||
1275005350,52.4769,1.62731,5770.94
|
||||
1275005400,52.4808,1.64621,5438.63
|
||||
1275005450,52.4842,1.66351,5112.24
|
||||
1275005500,52.4873,1.67953,4791.52
|
||||
1275005550,52.49,1.69482,4476.25
|
||||
1275005600,52.4924,1.70924,4166.18
|
||||
1275005650,52.4947,1.72221,3861.12
|
||||
1275005700,52.4968,1.73419,3560.86
|
||||
1275005750,52.4985,1.74507,3265.24
|
||||
1275005800,52.4999,1.75524,2974.07
|
||||
1275005850,52.5011,1.7649,2687.19
|
||||
1275005900,52.5024,1.77398,2404.45
|
||||
1275005950,52.504,1.78264,2125.71
|
||||
1275006000,52.5057,1.79036,1850.82
|
||||
1275006050,52.507,1.7972,1579.66
|
||||
1275006100,52.5078,1.8036,1312.11
|
||||
1275006150,52.5083,1.80968,1048.05
|
||||
1275006200,52.5083,1.81536,787.371
|
||||
1275006250,52.508,1.82069,529.965
|
||||
1275006300,52.5077,1.82582,275.734
|
||||
1275006350,52.5077,1.83058,24.584
|
||||
1275006355,52.5077,1.83095,-0.365139
|
|