Merge pull request #4 from Turbo87/master

JS Cleanup
pull/8/head
cunimb 2015-01-21 12:31:27 +01:00
commit 54f9519116
3 zmienionych plików z 1244 dodań i 1246 usunięć

172
cunimb.js
Wyświetl plik

@ -21,9 +21,9 @@ var vallmaron = true;
var vallmaroff = true;
var lside = 0; // 0=right 1=left
var infowindow = new google.maps.InfoWindow();
var online = new Array(); // ([cn,alt*1,cn+"_"+ps,colcn,afdif]);
var offline = new Array(); // ([cn,alt*1,cn+"_"+ps,colcn,afdif]);
var receivers = new Array();
var online = []; // ([cn,alt*1,cn+"_"+ps,colcn,afdif]);
var offline = []; // ([cn,alt*1,cn+"_"+ps,colcn,afdif]);
var receivers = [];
var all=0;
var pathl=30; // path length 5' (30points)
var unit="m"; // metric units
@ -48,7 +48,7 @@ var hnew = false;
selrec = "";
var ftype=["unknown","Glider/MotorGlider","Tow Plane","Helicopter","Parachute","Drop Plane","Hand Glider","Para Glider","Plane","Jet","UFO","Balloon","Airship","Drone","Static Object"];
var ftypec=["_b","","_g","_r","_b","_b","_p","_p","_b","_b","_b","_b","_b","_b","_b"];
var taska = new Array();
var taska = [];
var initialResolution = 2 * Math.PI * 6378137 / 256; // == 156543.0339
var originShift = 2 * Math.PI * 6378137 / 2.0; // == 20037508.34
var m2ft={"m":1, "i":3.2808};
@ -76,11 +76,11 @@ function op(maxw) {
d.style.display='block';
d.style.width = maxw + 'px';
d.style.height = maxw + 'px';
tmop = setTimeout('cp()', 15000);
tmop = setTimeout(cp, 15000);
}
function chunit() { // change units
if (document.getElementById('uni').checked==true) { // units imperial
if (document.getElementById('uni').checked === true) { // units imperial
unit='i';
hashu="&u=i";
} else { // units metric
@ -92,10 +92,10 @@ function chunit() { // change units
function chpl() { // change path length
if (document.getElementById('rp1').checked==true) { // 5 minutes
if (document.getElementById('rp1').checked === true) { // 5 minutes
pathl=30;
hashp="";
} else if (document.getElementById('rp2').checked==true) { // 10 minutes
} else if (document.getElementById('rp2').checked === true) { // 10 minutes
pathl=60;
hashp="&p=2";
} else { // all points
@ -174,12 +174,12 @@ function deleteallpath() {
function allpath() {
var j=-1;
if (onoff==1) {
if (vallpolon==true) vallpolon = false; else vallpolon = true;
if (vallpolon === true) vallpolon = false; else vallpolon = true;
while(online[++j]){
window["P_"+online[j][2]].setOptions( {visible: vallpolon } );
}
} else {
if (vallpoloff==true) vallpoloff = false; else vallpoloff = true;
if (vallpoloff === true) vallpoloff = false; else vallpoloff = true;
while(offline[++j]){
window["P_"+offline[j][2]].setOptions( {visible: vallpoloff } );
}
@ -190,12 +190,12 @@ function allpath() {
function allmarker() {
var j=-1;
if (onoff==1) {
if (vallmaron==true) vallmaron = false; else vallmaron = true;
if (vallmaron === true) vallmaron = false; else vallmaron = true;
while(online[++j]){
window["M_"+online[j][2]].setOptions( {visible: vallmaron } );
}
} else {
if (vallmaroff==true) vallmaroff = false; else vallmaroff = true;
if (vallmaroff === true) vallmaroff = false; else vallmaroff = true;
while(offline[++j]){
window["M_"+offline[j][2]].setOptions( {visible: vallmaroff } );
}
@ -214,19 +214,19 @@ function tricn() {
}
function trialti() {
if (tricol==0) triasc = 1;
if (tricol === 0) triasc = 1;
else if (triasc==1) triasc=2; else triasc=1;
tricol = 1;
afftab();
}
function focuson(poly) {
if (document.getElementById(poly)!=null) document.getElementById(poly).className= 'yel';
if (document.getElementById(poly) !== null) document.getElementById(poly).className= 'yel';
window[poly].setOptions ( {strokeWeight: 4, strokeOpacity: 1} );
}
function focusoff(poly) {
if (document.getElementById(poly)!=null) document.getElementById(poly).className= 'whi';
if (document.getElementById(poly) !== null) document.getElementById(poly).className= 'whi';
window[poly].setOptions ( {strokeWeight: 2, strokeOpacity: 0.75} );
}
@ -387,7 +387,7 @@ function bounds() {
}
else {
bound = false;
if (vstm==false) boundc = "";
if (vstm === false) boundc = "";
hashb="";
}
rehash();
@ -433,7 +433,7 @@ function afftab() {
}
dlistd +="</TABLE>";
document.getElementById("dtlist").innerHTML = dlistd;
if (aflist == true) document.getElementById("onoff").innerHTML = onoffaff + affcpt;;
if (aflist === true) document.getElementById("onoff").innerHTML = onoffaff + affcpt;
}
@ -441,15 +441,15 @@ function ASC(a,b){
a=a[tricol];
b=b[tricol];
if(a > b)
return 1
return 1;
if(a < b)
return -1
return 0
return -1;
return 0;
}
function alist() {
if (aflist == true) {
if (aflist === true) {
document.getElementById("ett1").innerHTML = "<CENTER><IMG style=\"z-index:50\" onclick=\"alist();\" SRC=\""+tld+"/pict/plu.png\"></CENTER>";
document.getElementById('dlist').style.width="20px";
document.getElementById('dlist').style.height="20px";
@ -468,7 +468,7 @@ function alist() {
}
function sideclick() {
if (lside==0) {
if (lside === 0) {
document.getElementById('dlist').className="lleft";
document.getElementById('ac').className="acleft";
document.getElementById('ac').style.right="";
@ -498,7 +498,7 @@ function centeron(mark) {
function centeroff() {
if (autoc!="") { map.setCenter(window[autoc].getPosition()); }
if (autoc !== "") { map.setCenter(window[autoc].getPosition()); }
cton=false;
}
@ -508,7 +508,7 @@ function vpolmar(chk, polmar) {
function isvisib(pol) {
if (window[pol].getVisible()==true) return "checked";
if (window[pol].getVisible() === true) return "checked";
else return "";
}
@ -539,14 +539,14 @@ function redraw(pol) {
mrk.set('tra', 1);
var aa="";
if (fi=="hidden") aa="&a=1";
downloadUrl(cxml1+'?id='+p+aa+"&l="+lo, function(data)
downloadUrl(tld + '/' + cxml1+'?id='+p+aa+"&l="+lo, function(data)
{
var vtrace = data.documentElement.getElementsByTagName("m");
var err = parseFloat(vtrace[0].getAttribute("e"));
var idd = vtrace[0].getAttribute("i");
var encodedt = vtrace[0].getAttribute("r");
if (err==0 && encodedt.length>2) {
if (err === 0 && encodedt.length>2) {
window['P_'+idd].getPath().clear();
var ftrace = google.maps.geometry.encoding.decodePath( encodedt );
window['P_'+idd].setPath(ftrace);
@ -585,11 +585,11 @@ function reclbox() {
function checkrec() {
downloadUrl(rxml, function(data)
downloadUrl(tld + '/' + rxml, function(data)
{
var vlrec = data.documentElement.getElementsByTagName("m");
var err = parseFloat(vlrec[0].getAttribute("e"));
if (err==0 && vlrec.length>1) {
if (err === 0 && vlrec.length>1) {
selrec = "";
// effacer markers
var j=-1;
@ -615,12 +615,12 @@ function checkrec() {
visible: vrecl
});
}
setTimeout('checkrec()', 120000);
setTimeout(checkrec, 120000);
}
else
{
selrec = "<option value='_error_'>Error</option>";
setTimeout('checkrec()', 20000);
setTimeout(checkrec, 20000);
}
reclbox();
});
@ -704,13 +704,13 @@ function affinfo(mark) {
document.getElementById("acty").innerHTML=ftype[mrk.get('type')*1];
if (fi!="hidden") {
document.getElementById("acif").innerHTML="<A HREF='https://www.google.com/search?nfpr=1&q=\""+rg+"\"' target='_blank' onclick=\"event.stopPropagation();\">Infos</a>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF='https://www.google.com/search?nfpr=1&q=\""+rg+"\"&tbm=isch' target='_blank' onclick=\"event.stopPropagation();\">Pictures</a>";
if (mrk.get('owner')=="") {
downloadUrl(dxml+'?i='+mark+'&f='+fi, function(data)
if (mrk.get('owner') === "") {
downloadUrl(tld + '/' + dxml+'?i='+mark+'&f='+fi, function(data)
{
var dat = data.documentElement.getElementsByTagName("m");
var err = parseFloat(dat[0].getAttribute("g"));
var mrk = dat[0].getAttribute("i");
if (err==0) {
if (err === 0) {
window[mrk].set('owner', ""+dat[0].getAttribute("a"));
window[mrk].set('airf', ""+dat[0].getAttribute("b"));
window[mrk].set('model', ""+dat[0].getAttribute("c"));
@ -759,8 +759,8 @@ function settomap() {
document.getElementById('latmin').value = amin;
document.getElementById('lonmax').value = omax;
document.getElementById('lonmin').value = omin;
if (bound==true) bounds();
if (vstm==true) {
if (bound === true) bounds();
if (vstm === true) {
boundc="&b="+amax+"&c="+amin+"&d="+omax+"&e="+omin;
hashs="&s=1";
rehash();
@ -780,7 +780,7 @@ function astm() {
} else {
vstm=false;
if (bound==false) boundc="";
if (bound === false) boundc="";
hashs="";
rehash();
}
@ -800,7 +800,7 @@ function dist(lat1,lon1,lat2,lon2) {
function gesmark()
{
downloadUrl(cxml+"?a="+all+boundc+recc+parc+tz, function(data)
downloadUrl(tld + '/' + cxml+"?a="+all+boundc+recc+parc+tz, function(data)
{
++w;
var planeurs = data.documentElement.getElementsByTagName("m");
@ -839,7 +839,7 @@ function gesmark()
{
// **** création de la couleur de la trace en fonction d'un tableau de 9 couleurs
hcol= tcolor[ccolor];
if (hnew==true) visib = false;
if (hnew === true) visib = false;
// création du PolyLine
var polyOptions = {
@ -937,7 +937,7 @@ function gesmark()
if (ddf<600) {
if (ddf>120) afdif="n";
else if (difalt==0) afdif="z";
else if (difalt === 0) afdif="z";
else if (difalt<-4) afdif="mmm";
else if (difalt<-1) afdif="mm";
else if (difalt<0) afdif="m";
@ -952,7 +952,7 @@ function gesmark()
window[markvar].set('off', 0);
}
if (window[markvar].get('tra')==0) {
if (window[markvar].get('tra') === 0) {
if (window[polyvar].getPath().getLength()>=pathl) window[polyvar].getPath().removeAt(0); // remove first point of the trace
}
@ -971,7 +971,7 @@ function gesmark()
}
else {
if (all==0) {
if (all === 0) {
if ( typeof(window[polyvar]) != 'undefined' ) { // si pas déjà effacé
// efface et détruit le PolyLine et le Marker
window[polyvar].setMap(null);
@ -991,7 +991,7 @@ function gesmark()
}
else {
offline.push([cn,alt*1,ps+"_"+cn,colcn,"n"]);
if (window[markvar].get('off')==0) {
if (window[markvar].get('off') === 0) {
window[markvar].setOptions( {zIndex: 10 } );
window[markvar].setIcon(""+tld+"/markers/"+cn+"_o.png");
window[markvar].set('off', 1);
@ -1003,7 +1003,7 @@ function gesmark()
if (autoc==markvar)
{
document.getElementById("divInfoac").innerHTML="<B>AC</B>: "+cn+" - "+ps+" @ "+(alt*m2ft[unit]).toFixed()+am2ft[unit];
if (cton==false) map.setCenter(new google.maps.LatLng(lat,lon));
if (cton === false) map.setCenter(new google.maps.LatLng(lat,lon));
}
if (acaff==markvar) affinfodata(markvar);
@ -1013,18 +1013,18 @@ function gesmark()
} // fin du for (var i = 0; i < planeurs.length; i++)
// tri et affichage du tableau
afftab();
tmgm = setTimeout('gesmark()', 10000);
tmgm = setTimeout(gesmark, 10000);
});
}
function wd() {
if (w==0) {
if (w === 0) {
clearTimeout(tmgm);
gesmark();
}
w=0;
tmwd = setTimeout('wd()', 30000);
tmwd = setTimeout(wd, 30000);
}
function rehash() {
@ -1035,22 +1035,22 @@ function rempl(po, c) {
var thl=hl;
hl= thl.substring(0,po) + c + thl.substring(po+1);
thl = hl.replace(/ /g,'');
if (thl=='') hashl=''; else hashl= "&l="+thl;
};
if (thl === '') hashl=''; else hashl= "&l="+thl;
}
function taskclic() { document.getElementById("chfile").click(); }
function task(cont) {
var res = JSON.parse(cont);
var tc,tn,ltp;
var tp = new Array();
var tasks= res['tasks'];
var tp = [];
var tasks= res.tasks;
for(var i= 0; i < tasks.length; i++) {
tn = tasks[i]['name'] || "task"+i;
tc = tasks[i]['color'] || "FFFFFF";
tn = tasks[i].name || "task"+i;
tc = tasks[i].color || "FFFFFF";
tp.length=0;
for (var ii=0; ii< tasks[i]['legs'].length; ii++) {
if (typeof tasks[i]['legs'][ii][1] == 'undefined') { // circle
for (var ii=0; ii< tasks[i].legs.length; ii++) {
if (typeof tasks[i].legs[ii][1] == 'undefined') { // circle
aatCircle = new google.maps.Circle({
strokeColor: '#'+tc,
strokeOpacity: 0.5,
@ -1059,11 +1059,11 @@ function task(cont) {
fillOpacity: 0.1,
map: map,
center: ltp,
radius: tasks[i]['legs'][ii][0]
radius: tasks[i].legs[ii][0]
});
taska.push(aatCircle);
} else {
ltp=new google.maps.LatLng(tasks[i]['legs'][ii][0],tasks[i]['legs'][ii][1]);
ltp=new google.maps.LatLng(tasks[i].legs[ii][0], tasks[i].legs[ii][1]);
tp.push(ltp);
}
}
@ -1118,16 +1118,16 @@ function initialize()
}
// parameter c=lat,lon (center of the map)
if (typeof(parh['c']) != 'undefined') {
cent=parh['c'].split(',');
if (typeof(parh.c) != 'undefined') {
cent=parh.c.split(',');
vlat=parseFloat(cent[0]);
vlon=parseFloat(cent[1]);
hashc= "c="+vlat.toFixed(5)+","+vlon.toFixed(5);
}
// parameter o=1 (display offline)
if (typeof(parh['o']) != 'undefined') {
if (parh['o']==1) { all=1; hasho="&o=1";}
if (typeof(parh.o) != 'undefined') {
if (parh.o==1) { all=1; hasho="&o=1";}
}
/*
@ -1224,7 +1224,7 @@ function initialize()
draggableCursor: 'default',
draggingCursor: 'default'
//mapTypeId: google.maps.MapTypeId.TERRAIN
}
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
//map.mapTypes.set('RELIEF' , RELIEF);
@ -1233,9 +1233,9 @@ function initialize()
var tmid = { "r" : "ROADMAP", "t" : "TERRAIN", "s": "SATELLITE", "h": "HYBRID"};
// parameter m= map type
if (typeof(parh['m']) != 'undefined') {
mid = tmid[parh['m']];
hashm="&m="+parh['m'];
if (typeof(parh.m) != 'undefined') {
mid = tmid[parh.m];
hashm="&m="+parh.m;
}
map.setMapTypeId(google.maps.MapTypeId[mid]);
@ -1260,7 +1260,7 @@ function initialize()
});
google.maps.event.addListener(map, 'bounds_changed', function() {
if (vstm==true) settomap();
if (vstm === true) settomap();
});
google.maps.event.addListener(map, 'zoom_changed', function() {
@ -1275,7 +1275,7 @@ function initialize()
});
// parameter z= zoom level
if (typeof(parh['z']) != 'undefined') map.setZoom(parseInt(parh['z']));
if (typeof(parh.z) != 'undefined') map.setZoom(parseInt(parh.z));
else {
var southWest = new google.maps.LatLng(vlatmin, vlonmin);
var northEast = new google.maps.LatLng(vlatmax, vlonmax);
@ -1365,7 +1365,7 @@ function initialize()
var lonc = clickedLocation.lng();
var alon = (lonc>=0?"E":"W") + " " + dec2dms(lonc);
var positionalRequest = { 'locations': locations }
var positionalRequest = { 'locations': locations };
elevator.getElevationForLocations(positionalRequest, function(results, status) {
if (status == google.maps.ElevationStatus.OK) {
@ -1387,11 +1387,11 @@ function initialize()
document.getElementById("ett2").innerHTML = "<TABLE class=\"tt\"><TR width=\"12\"><TH class=\"cgv\" ondblclick=\"allmarker();\"><IMG src='"+tld+"/pict/ico.png'></TH><TH class=\"cgv\" ondblclick=\"allpath();\"><IMG src='"+tld+"/pict/tra.gif'></TH><TH class=\"cgn\" onclick=\"tricn();\">CN</TH><TH class=\"cgc\" ondblclick=\"deleteallpath();\"><IMG border =\"0\" src='"+tld+"/pict/a.gif'></TH><TH class=\"cga\" onclick=\"trialti();\">Alti.</TH><TH class=\"cgz\">Vz</TH></TR></table>";
document.getElementById("ac").innerHTML = "<span style=\"color: #333; font-weight: bold; font-size: 1.1em; line-height: 1.3em;\">&nbsp;&nbsp;&nbsp;..::Aircraft::..</span><BR><span class=\"act\">CN: </span><span id=\"accn\" class=\"aca\"></span><BR><DIV id=\"ac1\"><span class=\"act\">Regist.: </span><span id=\"acre\" class=\"aca\"></span><BR></DIV><span class=\"act\">Flarm Id: </span><span id=\"acfi\" class=\"aca\"></span><BR><span class=\"act\">Type: </span><span id=\"acty\" class=\"aca\"></span><BR><DIV id=\"ac2\"><span class=\"act\">Owner: </span><span id=\"acow\" class=\"aca\"></span><BR><span class=\"act\">Airfield: </span><span id=\"acaf\" class=\"aca\"></span><BR><span class=\"act\">Model: </span><span id=\"acmo\" class=\"aca\"></span><BR><span class=\"act\">Freq.: </span><span id=\"acfr\" class=\"aca\"></span></DIV><span class=\"act\">Last time: </span><span id=\"aclt\" class=\"aca\"></span><BR><span class=\"act\">Latitude: </span><span id=\"acla\" class=\"aca\"></span><BR><span class=\"act\">Longitude: </span><span id=\"aclo\" class=\"aca\"></span><BR><span class=\"act\">Altitude: </span><span id=\"acal\" class=\"aca\"></span><BR><span class=\"act\">G.Speed: </span><span id=\"acsp\" class=\"aca\"></span><BR><span class=\"act\">Track: </span><span id=\"actr\" class=\"aca\"></span><span class=\"aca\">&thinsp;&deg;</span><BR><span class=\"act\">Vz: </span><span id=\"acvz\" class=\"aca\"></span><BR><span class=\"act\">Receiver: </span><span id=\"acrx\" class=\"aca\"></span><BR><span id=\"acif\" class=\"aca\"></span>";
document.getElementById("dtable").innerHTML = "<DIV id=\"menu\" style=\"display:none;\"></DIV><DIV id=\"dtlist\" style=\"display:block\"></DIV>";
document.getElementById("menu").innerHTML = "<TABLE class=\"tt\"><TR><TD><INPUT type=\"checkbox\" id=\"hnewbox\" onChange='javascript : hidenew();'> Hide new gliders<BR><INPUT type=\"checkbox\" id=\"offl\" onChange='javascript : lineoff();'"+ ((all==0)?" checked":"") +"> Ignore Offline<HR><INPUT type=\"checkbox\" id=\"boundsbox\" onChange='javascript : bounds();'"+ ((bound==true)?" checked":"") +"> Bounds<BR><TABLE cellspacing=\"0\" cellpading=\"0\"><TR align=\"center\"><TD colspan=\"2\"><INPUT type=\"text\" id=\"latmax\" name=\"latmax\" size=\"7\" value=\""+amax+"\"></TD></TR><TR align=\"center\"><TD><INPUT type=\"text\" id=\"lonmin\" name=\"lonmin\" size=\"7\" value=\""+omin+"\"></TD><TD><INPUT type=\"text\" id=\"lonmax\" name=\"lonmax\" size=\"7\" value=\""+omax+"\"></TD></TR><TR align=\"center\"><TD colspan=\"2\"><INPUT type=\"text\" id=\"latmin\" name=\"latmin\" size=\"7\" value=\""+amin+"\"></TD></TR></TABLE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type=\"button\" onclick=\"settomap()\" value=\"Set to map\"><BR><INPUT type=\"checkbox\" id=\"astmbox\" onChange='javascript : astm();'> Auto Set to map<HR>..:: Layers ::..<BR><INPUT type=\"checkbox\" id=\"weabox\" onChange=\"javascript : wea();\"> Weather <BR><INPUT type=\"checkbox\" id=\"clobox\" onChange=\"javascript : clo();\"> Clouds <BR><INPUT type=\"checkbox\" id=\"winbox\" onChange=\"javascript : wind();\"> Wind <BR><INPUT type=\"checkbox\" id=\"prebox\" onChange=\"javascript : pres();\"> Pressure <BR><INPUT type=\"checkbox\" id=\"aspbox\" onChange=\"javascript : asp();\"> AirSpaces <A HREF=\"http://www.openaip.net\" target=\"_blank\" style=\"font-size:10px;\">( openaip.net )</A><BR><INPUT type=\"checkbox\" id=\"aptbox\" onChange=\"javascript : apt();\"> Airports <A HREF=\"http://www.openaip.net\" target=\"_blank\" style=\"font-size:10px;\">( openaip.net )</A><BR><INPUT type=\"checkbox\" id=\"reclbox\" onChange=\"javascript : reclbox();\"> Receivers<BR><span id=\"dtaskbox\"><INPUT type=\"checkbox\" disabled></span> <span onclick=\"taskclic();\">Tasks</span><BR> <DIV style=\"display:none\"><input type=\"file\" id=\"chfile\" onchange=\"rtask()\" /></DIV><HR>..::Units::..<BR><input type=\"radio\" name=\"units\" id=\"unm\" value=\"m\" onclick=\"chunit()\" checked>Met. <input type=\"radio\" name=\"units\" id=\"uni\" value=\"i\" onclick=\"chunit()\">Imp.<HR>..::Path length::..<BR><input type=\"radio\" name=\"pl\" id=\"rp1\" value=\"1\" checked onclick=\"chpl()\">5' <input type=\"radio\" name=\"pl\" id=\"rp2\" value=\"2\" onclick=\"chpl()\">10' <input type=\"radio\" name=\"pl\" id=\"rp3\" value=\"3\" onclick=\"chpl()\">All</TD></TR></TABLE>";
document.getElementById("menu").innerHTML = "<TABLE class=\"tt\"><TR><TD><INPUT type=\"checkbox\" id=\"hnewbox\" onChange='javascript : hidenew();'> Hide new gliders<BR><INPUT type=\"checkbox\" id=\"offl\" onChange='javascript : lineoff();'"+ ((all === 0)?" checked":"") +"> Ignore Offline<HR><INPUT type=\"checkbox\" id=\"boundsbox\" onChange='javascript : bounds();'"+ ((bound === true)?" checked":"") +"> Bounds<BR><TABLE cellspacing=\"0\" cellpading=\"0\"><TR align=\"center\"><TD colspan=\"2\"><INPUT type=\"text\" id=\"latmax\" name=\"latmax\" size=\"7\" value=\""+amax+"\"></TD></TR><TR align=\"center\"><TD><INPUT type=\"text\" id=\"lonmin\" name=\"lonmin\" size=\"7\" value=\""+omin+"\"></TD><TD><INPUT type=\"text\" id=\"lonmax\" name=\"lonmax\" size=\"7\" value=\""+omax+"\"></TD></TR><TR align=\"center\"><TD colspan=\"2\"><INPUT type=\"text\" id=\"latmin\" name=\"latmin\" size=\"7\" value=\""+amin+"\"></TD></TR></TABLE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type=\"button\" onclick=\"settomap()\" value=\"Set to map\"><BR><INPUT type=\"checkbox\" id=\"astmbox\" onChange='javascript : astm();'> Auto Set to map<HR>..:: Layers ::..<BR><INPUT type=\"checkbox\" id=\"weabox\" onChange=\"javascript : wea();\"> Weather <BR><INPUT type=\"checkbox\" id=\"clobox\" onChange=\"javascript : clo();\"> Clouds <BR><INPUT type=\"checkbox\" id=\"winbox\" onChange=\"javascript : wind();\"> Wind <BR><INPUT type=\"checkbox\" id=\"prebox\" onChange=\"javascript : pres();\"> Pressure <BR><INPUT type=\"checkbox\" id=\"aspbox\" onChange=\"javascript : asp();\"> AirSpaces <A HREF=\"http://www.openaip.net\" target=\"_blank\" style=\"font-size:10px;\">( openaip.net )</A><BR><INPUT type=\"checkbox\" id=\"aptbox\" onChange=\"javascript : apt();\"> Airports <A HREF=\"http://www.openaip.net\" target=\"_blank\" style=\"font-size:10px;\">( openaip.net )</A><BR><INPUT type=\"checkbox\" id=\"reclbox\" onChange=\"javascript : reclbox();\"> Receivers<BR><span id=\"dtaskbox\"><INPUT type=\"checkbox\" disabled></span> <span onclick=\"taskclic();\">Tasks</span><BR> <DIV style=\"display:none\"><input type=\"file\" id=\"chfile\" onchange=\"rtask()\" /></DIV><HR>..::Units::..<BR><input type=\"radio\" name=\"units\" id=\"unm\" value=\"m\" onclick=\"chunit()\" checked>Met. <input type=\"radio\" name=\"units\" id=\"uni\" value=\"i\" onclick=\"chunit()\">Imp.<HR>..::Path length::..<BR><input type=\"radio\" name=\"pl\" id=\"rp1\" value=\"1\" checked onclick=\"chpl()\">5' <input type=\"radio\" name=\"pl\" id=\"rp2\" value=\"2\" onclick=\"chpl()\">10' <input type=\"radio\" name=\"pl\" id=\"rp3\" value=\"3\" onclick=\"chpl()\">All</TD></TR></TABLE>";
// parameter b=lat1,lon1,lat2,lon2 bounds
if (typeof(parh['b']) != 'undefined') {
cent=parh['b'].split(',');
if (typeof(parh.b) != 'undefined') {
cent=parh.b.split(',');
document.getElementById('latmax').value = parseFloat(cent[0]);
document.getElementById('latmin').value = parseFloat(cent[1]);
document.getElementById('lonmax').value = parseFloat(cent[2]);
@ -1403,9 +1403,9 @@ function initialize()
}
// parameter l= active layers
if (typeof(parh['l']) != 'undefined') {
for (var i = 0; i < parh['l'].length; i++) {
switch(parh['l'][i]) {
if (typeof(parh.l) != 'undefined') {
for (var i = 0; i < parh.l.length; i++) {
switch(parh.l[i]) {
case 'w': // weather
document.getElementById('weabox').checked=true;
wea();
@ -1437,10 +1437,10 @@ function initialize()
}
}
if (typeof(parh['t']) != 'undefined') {
if (typeof(parh.t) != 'undefined') {
var xhr = new XMLHttpRequest();
xhr.open("GET", parh['t'], true);
xhr.open("GET", parh.t, true);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
var status = xhr.status;
@ -1457,18 +1457,18 @@ function initialize()
// parameter w=0 (Don't display the warning)
var warn=1;
if (typeof(parh['w']) != 'undefined') {
if (parh['w']==0) { warn=0; hashw="&w=0";}
if (typeof(parh.w) != 'undefined') {
if (parh.w === 0) { warn=0; hashw="&w=0";}
}
if (warn==1) {
document.getElementById("popup").innerHTML = "<img class=\"pr\" alt=\"close\" src=\"/pict/close.png\"><H1>Warning!</H1><BR><P style=\"text-align:justify;\"><B>The data on this site can be ambiguous in certain situations and the displayed position of an aircraft or glider can be displaced relative to the actual position.<BR>Before raising an alert please contact us so we can interpret the data correctly.</B></P>";
document.getElementById("popup").innerHTML = "<img class=\"pr\" alt=\"close\" src=\"" + tld + "/pict/close.png\"><H1>Warning!</H1><BR><P style=\"text-align:justify;\"><B>The data on this site can be ambiguous in certain situations and the displayed position of an aircraft or glider can be displaced relative to the actual position.<BR>Before raising an alert please contact us so we can interpret the data correctly.</B></P>";
op(300);
}
// parameter s=1 auto set bounds to the map
if (typeof(parh['s']) != 'undefined') {
if (parh['s']==1) {
if (typeof(parh.s) != 'undefined') {
if (parh.s==1) {
document.getElementById('astmbox').checked=true;
vstm=true;
hashs="&s=1";
@ -1476,8 +1476,8 @@ function initialize()
}
// parameter u=i units imperial ou metric (default))
if (typeof(parh['u']) != 'undefined') {
if (parh['u']=="i") {
if (typeof(parh.u) != 'undefined') {
if (parh.u=="i") {
document.getElementById('uni').checked=true;
unit="i";
hashs="&u=i";
@ -1486,12 +1486,12 @@ function initialize()
// parameter p=1,2 or 3 path length 5", 10" or all points
if (typeof(parh['p']) != 'undefined') {
if (parh['p']==2) { // 10 minutes
if (typeof(parh.p) != 'undefined') {
if (parh.p==2) { // 10 minutes
pathl=60;
document.getElementById('rp2').checked=true;
hashp="&p=2";
} else if (parh['p']==3) { // all points
} else if (parh.p==3) { // all points
pathl=99999;
document.getElementById('rp3').checked=true;
hashp="&p=3";
@ -1503,6 +1503,6 @@ function initialize()
rehash();
checkrec();
tmwd = setTimeout('wd()', 30000);
tmwd = setTimeout(wd, 30000);
gesmark();
}

Wyświetl plik

@ -29,11 +29,11 @@ html, body {
}
.yel {
background: #FF9;
background: #FF9;
}
.whi {
background: #FFF;
background: #FFF;
}
.lright {
@ -62,8 +62,7 @@ background: #FFF;
.pr {
float:right;
}
}
#ac {
position:absolute;
@ -81,7 +80,6 @@ background: #FFF;
z-index:15;
}
.cgv {
width: 20px;
}