From b683b5286433c405d97be5c86c93414127c34441 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 21 Jan 2015 14:13:42 +0100 Subject: [PATCH 1/5] JS: Improved code formatting see https://github.com/beautify-web/js-beautify --- cunimb.js | 1697 +++++++++++++++++++++++++++-------------------------- 1 file changed, 875 insertions(+), 822 deletions(-) diff --git a/cunimb.js b/cunimb.js index 243eb35..8da7647 100644 --- a/cunimb.js +++ b/cunimb.js @@ -9,31 +9,31 @@ */ var map; -var autoc=""; -var acaff=""; -var cton=false; -var tcolor= ["000000","FF0000","00FF00","0000FF","FFFF00","00FFFF","FF00FF","C0C0C0","FFFFFF"]; -var ccolor=0; +var autoc = ""; +var acaff = ""; +var cton = false; +var tcolor = ["000000", "FF0000", "00FF00", "0000FF", "FFFF00", "00FFFF", "FF00FF", "C0C0C0", "FFFFFF"]; +var ccolor = 0; var aflist = true; var vallpolon = true; var vallpoloff = true; var vallmaron = true; var vallmaroff = true; -var lside = 0; // 0=right 1=left +var lside = 0; // 0=right 1=left var infowindow = new google.maps.InfoWindow(); -var online = []; // ([cn,alt*1,cn+"_"+ps,colcn,afdif]); +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 -var onoff = 1; // 1: online, 2: offline, 3: Menu -var onoffaff ="OnLine"; +var all = 0; +var pathl = 30; // path length 5' (30points) +var unit = "m"; // metric units +var onoff = 1; // 1: online, 2: offline, 3: Menu +var onoffaff = "OnLine"; var triasc = 1; // 1: asc 2: desc var tricol = 0; // 0:tri sur cn 1: tri sur alti -var ett1 = "
      
"; -var w = 0; // watchdog variable -var tmgm,tmwd; +var ett1 = "
      
"; +var w = 0; // watchdog variable +var tmgm, tmwd; var vasp = false; var vrec = false; var vrecl = false; @@ -46,10 +46,10 @@ var vwea = false; var vclo = false; 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 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 = []; -var initialResolution = 2 * Math.PI * 6378137 / 256; // == 156543.0339 +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}; var am2ft={"m":"m", "i":"ft"}; @@ -67,40 +67,40 @@ var hashc="",hashz="",hashm="",hasho="",hashb="",hashs="",hashl="",hasht="",hl=" function cp() { clearTimeout(tmop); var d = document.getElementById('popup'); - d.style.display='none'; - } + d.style.display = 'none'; +} // open popup function op(maxw) { var d = document.getElementById('popup'); - d.style.display='block'; + d.style.display = 'block'; d.style.width = maxw + 'px'; d.style.height = maxw + 'px'; tmop = setTimeout(cp, 15000); - } +} -function chunit() { // change units - if (document.getElementById('uni').checked === true) { // units imperial - unit='i'; - hashu="&u=i"; - } else { // units metric - unit='m'; - hashu=""; +function chunit() { // change units + if (document.getElementById('uni').checked === true) { // units imperial + unit = 'i'; + hashu = "&u=i"; + } else { // units metric + unit = 'm'; + hashu = ""; } rehash(); } -function chpl() { // change path length - if (document.getElementById('rp1').checked === true) { // 5 minutes - pathl=30; - hashp=""; - } else if (document.getElementById('rp2').checked === true) { // 10 minutes - pathl=60; - hashp="&p=2"; - } else { // all points - pathl=99999; - hashp="&p=3"; +function chpl() { // change path length + if (document.getElementById('rp1').checked === true) { // 5 minutes + pathl = 30; + hashp = ""; + } else if (document.getElementById('rp2').checked === true) { // 10 minutes + pathl = 60; + hashp = "&p=2"; + } else { // all points + pathl = 99999; + hashp = "&p=3"; } delpon(); delpoff(); @@ -109,61 +109,61 @@ function chpl() { // change path length function onofff() { - switch(onoff) { + switch (onoff) { case 1: - if (all==1) { - onoffaff="OffLine"; - onoff=2; + if (all == 1) { + onoffaff = "OffLine"; + onoff = 2; } else { - onoffaff="Menu"; - onoff=3; + onoffaff = "Menu"; + onoff = 3; document.getElementById("ett2").style.display = "none"; document.getElementById("dtlist").style.display = "none"; document.getElementById("menu").style.display = "block"; } break; case 2: - onoffaff="Menu"; - onoff=3; + onoffaff = "Menu"; + onoff = 3; document.getElementById("ett2").style.display = "none"; document.getElementById("dtlist").style.display = "none"; document.getElementById("menu").style.display = "block"; break; case 3: - onoffaff="OnLine"; - onoff=1; + onoffaff = "OnLine"; + onoff = 1; document.getElementById("ett2").style.display = "block"; document.getElementById("dtlist").style.display = "block"; document.getElementById("menu").style.display = "none"; break; - } + } afftab(); } -function delpon () { // delete all online path - var j=-1; - while(online[++j]){ - window["P_"+online[j][2]].getPath().clear(); - window["M_"+online[j][2]].set('tra', 0); +function delpon() { // delete all online path + var j = -1; + while (online[++j]) { + window["P_" + online[j][2]].getPath().clear(); + window["M_" + online[j][2]].set('tra', 0); } } -function delpoff () { // delete all offline path - var j=-1; - while(offline[++j]){ - window["P_"+offline[j][2]].getPath().clear(); - window["M_"+offline[j][2]].set('tra', 0); +function delpoff() { // delete all offline path + var j = -1; + while (offline[++j]) { + window["P_" + offline[j][2]].getPath().clear(); + window["M_" + offline[j][2]].set('tra', 0); } } function deletepath(pol) { window[pol].getPath().clear(); - window["M_"+pol.substring(2)].set('tra', 0); + window["M_" + pol.substring(2)].set('tra', 0); } function deleteallpath() { - if (onoff==1) { + if (onoff == 1) { delpon(); } else { delpoff(); @@ -172,32 +172,44 @@ function deleteallpath() { function allpath() { - var j=-1; - if (onoff==1) { - if (vallpolon === true) vallpolon = false; else vallpolon = true; - while(online[++j]){ - window["P_"+online[j][2]].setOptions( {visible: vallpolon } ); + var j = -1; + if (onoff == 1) { + 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; - while(offline[++j]){ - window["P_"+offline[j][2]].setOptions( {visible: vallpoloff } ); + if (vallpoloff === true) vallpoloff = false; + else vallpoloff = true; + while (offline[++j]) { + window["P_" + offline[j][2]].setOptions({ + visible: vallpoloff + }); } } afftab(); } function allmarker() { - var j=-1; - if (onoff==1) { - if (vallmaron === true) vallmaron = false; else vallmaron = true; - while(online[++j]){ - window["M_"+online[j][2]].setOptions( {visible: vallmaron } ); + var j = -1; + if (onoff == 1) { + 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; - while(offline[++j]){ - window["M_"+offline[j][2]].setOptions( {visible: vallmaroff } ); + if (vallmaroff === true) vallmaroff = false; + else vallmaroff = true; + while (offline[++j]) { + window["M_" + offline[j][2]].setOptions({ + visible: vallmaroff + }); } } afftab(); @@ -207,284 +219,306 @@ function allmarker() { function tricn() { - if (tricol==1) triasc = 1; - else if (triasc==1) triasc=2; else triasc=1; + if (tricol == 1) triasc = 1; + else if (triasc == 1) triasc = 2; + else triasc = 1; tricol = 0; afftab(); } function trialti() { if (tricol === 0) triasc = 1; - else if (triasc==1) triasc=2; else 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'; - window[poly].setOptions ( {strokeWeight: 4, strokeOpacity: 1} ); + 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'; - window[poly].setOptions ( {strokeWeight: 2, strokeOpacity: 0.75} ); + if (document.getElementById(poly) !== null) document.getElementById(poly).className = 'whi'; + window[poly].setOptions({ + strokeWeight: 2, + strokeOpacity: 0.75 + }); } function asp() { - if(document.getElementById('aspbox').checked) { - vasp=true; + if (document.getElementById('aspbox').checked) { + vasp = true; airspaceoverlay.setOpacity(1); map.overlayMapTypes.setAt(1, airspaceoverlay); - rempl(4,"z"); - } - else { - vasp=false; + rempl(4, "z"); + } else { + vasp = false; airspaceoverlay.setOpacity(0); map.overlayMapTypes.removeAt(1); - rempl(4," "); - } + rempl(4, " "); + } rehash(); } function apt() { - if(document.getElementById('aptbox').checked) { - vapt=true; + if (document.getElementById('aptbox').checked) { + vapt = true; airportoverlay.setOpacity(1); map.overlayMapTypes.setAt(2, airportoverlay); - rempl(5,"a"); - } - else { - vapt=false; + rempl(5, "a"); + } else { + vapt = false; airportoverlay.setOpacity(0); map.overlayMapTypes.removeAt(2); - rempl(5," "); - } + rempl(5, " "); + } rehash(); } function wind() { - if(document.getElementById('winbox').checked) { - vwin=true; + if (document.getElementById('winbox').checked) { + vwin = true; windoverlay.setOpacity(1); map.overlayMapTypes.setAt(3, windoverlay); - if (map.getZoom()>7) map.setZoom(7); - rempl(2,"v"); - } - else { - vwin=false; + if (map.getZoom() > 7) map.setZoom(7); + rempl(2, "v"); + } else { + vwin = false; windoverlay.setOpacity(0); map.overlayMapTypes.removeAt(3); - rempl(2," "); - } + rempl(2, " "); + } rehash(); } function pres() { - if(document.getElementById('prebox').checked) { - vpre=true; + if (document.getElementById('prebox').checked) { + vpre = true; presoverlay.setOpacity(1); map.overlayMapTypes.setAt(4, presoverlay); - if (map.getZoom()>7) map.setZoom(7); - rempl(3,"p"); - } - else { - vpre=false; + if (map.getZoom() > 7) map.setZoom(7); + rempl(3, "p"); + } else { + vpre = false; presoverlay.setOpacity(0); map.overlayMapTypes.removeAt(4); - rempl(3," "); - } + rempl(3, " "); + } rehash(); } function wea() { - if(document.getElementById('weabox').checked) { - vwea=true; - weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS }); + if (document.getElementById('weabox').checked) { + vwea = true; + weatherLayer = new google.maps.weather.WeatherLayer({ + temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS + }); weatherLayer.setMap(map); - if (map.getZoom()>12) map.setZoom(12); - rempl(0,"w"); - } - else { - vwea=false; + if (map.getZoom() > 12) map.setZoom(12); + rempl(0, "w"); + } else { + vwea = false; weatherLayer.setMap(null); - rempl(0," "); - } + rempl(0, " "); + } rehash(); } function clo() { - if(document.getElementById('clobox').checked) { - vclo=true; + if (document.getElementById('clobox').checked) { + vclo = true; cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map); - if (map.getZoom()>6) map.setZoom(6); - rempl(1,"c"); - } - else { - vclo=false; + if (map.getZoom() > 6) map.setZoom(6); + rempl(1, "c"); + } else { + vclo = false; cloudLayer.setMap(null); - rempl(1," "); - } + rempl(1, " "); + } rehash(); } function hidenew() { - if(document.getElementById('hnewbox').checked) hnew=true; else hnew=false; + if (document.getElementById('hnewbox').checked) hnew = true; + else hnew = false; } function lineoff() { - if(document.getElementById('offl').checked) { - all=0; - var j=-1; - while(offline[++j]){ - window["M_"+offline[j][2]].setMap(null); delete window["M_"+offline[j][2]]; - window["P_"+offline[j][2]].setMap(null); delete window["P_"+offline[j][2]]; + if (document.getElementById('offl').checked) { + all = 0; + var j = -1; + while (offline[++j]) { + window["M_" + offline[j][2]].setMap(null); + delete window["M_" + offline[j][2]]; + window["P_" + offline[j][2]].setMap(null); + delete window["P_" + offline[j][2]]; } - hasho=""; + hasho = ""; } else { - all=1; - hasho="&o=1"; + all = 1; + hasho = "&o=1"; } rehash(); } function bounds() { - if(document.getElementById('boundsbox').checked) { + if (document.getElementById('boundsbox').checked) { bound = true; - if(document.getElementById('astmbox').checked) { - vstm=false; - hashs=""; + if (document.getElementById('astmbox').checked) { + vstm = false; + hashs = ""; document.getElementById('astmbox').checked = false; } amax = parseFloat(document.getElementById('latmax').value); amin = parseFloat(document.getElementById('latmin').value); - if (amin > amax) { var tmp = amax; amax = amin; amin = tmp; } + if (amin > amax) { + var tmp = amax; + amax = amin; + amin = tmp; + } omax = parseFloat(document.getElementById('lonmax').value); omin = parseFloat(document.getElementById('lonmin').value); - if (omin > omax) { var tmp = omax; omax = omin; omin = tmp; } + if (omin > omax) { + var tmp = omax; + omax = omin; + omin = tmp; + } if (amax > 85) amax = 85; if (amin < -85) amin = -85; if (omax > 180) omax = 180; if (omin < -180) omin = -180; - boundc="&b="+amax+"&c="+amin+"&d="+omax+"&e="+omin; + boundc = "&b=" + amax + "&c=" + amin + "&d=" + omax + "&e=" + omin; document.getElementById('latmax').value = amax; document.getElementById('latmin').value = amin; document.getElementById('lonmax').value = omax; document.getElementById('lonmin').value = omin; - var j=-1; - while(online[++j]){ - window["M_"+online[j][2]].setMap(null); delete window["M_"+online[j][2]]; - window["P_"+online[j][2]].setMap(null); delete window["P_"+online[j][2]]; + var j = -1; + while (online[++j]) { + window["M_" + online[j][2]].setMap(null); + delete window["M_" + online[j][2]]; + window["P_" + online[j][2]].setMap(null); + delete window["P_" + online[j][2]]; } - j=-1; - while(offline[++j]){ - window["M_"+offline[j][2]].setMap(null); delete window["M_"+offline[j][2]]; - window["P_"+offline[j][2]].setMap(null); delete window["P_"+offline[j][2]]; + j = -1; + while (offline[++j]) { + window["M_" + offline[j][2]].setMap(null); + delete window["M_" + offline[j][2]]; + window["P_" + offline[j][2]].setMap(null); + delete window["P_" + offline[j][2]]; } - hashb="&b="+amax.toFixed(4)+","+amin.toFixed(4)+","+omax.toFixed(4)+","+omin.toFixed(4); - } - else { + hashb = "&b=" + amax.toFixed(4) + "," + amin.toFixed(4) + "," + omax.toFixed(4) + "," + omin.toFixed(4); + } else { bound = false; if (vstm === false) boundc = ""; - hashb=""; + hashb = ""; } rehash(); } function afftab() { - var j=-1; - var dlistd =""; - var mar=""; - var pol=""; - var affcpt=""; + var j = -1; + var dlistd = "
"; + var mar = ""; + var pol = ""; + var affcpt = ""; - switch(onoff) { + switch (onoff) { case 1: online.sort(ASC); - if (triasc==2) online.reverse(); - while(online[++j]){ - mar = "M_"+online[j][2]; - pol = "P_"+online[j][2]; - dlistd += ""; + if (triasc == 2) online.reverse(); + while (online[++j]) { + mar = "M_" + online[j][2]; + pol = "P_" + online[j][2]; + dlistd += ""; } affcpt = " (" + online.length + ")"; break; case 2: offline.sort(ASC); - if (triasc==2) offline.reverse(); - while(offline[++j]){ - mar = "M_"+offline[j][2]; - pol = "P_"+offline[j][2]; - dlistd += ""; + if (triasc == 2) offline.reverse(); + while (offline[++j]) { + mar = "M_" + offline[j][2]; + pol = "P_" + offline[j][2]; + dlistd += ""; } affcpt = " (" + offline.length + ")"; break; case 3: affcpt = "         "; break; - } - dlistd +="
"+online[j][0]+"  "; - if (unit=="i") { dlistd+= (online[j][1]*m2ft[unit]).toFixed(); } // { var tv=online[j][1]*m2ft[unit]; dlistd+= tv.toFixed(); } - else dlistd+=online[j][1]+"m"; - dlistd += "
" + online[j][0] + "  "; + if (unit == "i") { + dlistd += (online[j][1] * m2ft[unit]).toFixed(); + } // { var tv=online[j][1]*m2ft[unit]; dlistd+= tv.toFixed(); } + else dlistd += online[j][1] + "m"; + dlistd += "
"+offline[j][0]+"  "; - if (unit=="i") { dlistd+=(offline[j][1]*m2ft[unit]).toFixed(); } - else dlistd+=offline[j][1]+"m"; - dlistd += "
" + offline[j][0] + "  "; + if (unit == "i") { + dlistd += (offline[j][1] * m2ft[unit]).toFixed(); + } else dlistd += offline[j][1] + "m"; + dlistd += "
"; + } + dlistd += ""; document.getElementById("dtlist").innerHTML = dlistd; if (aflist === true) document.getElementById("onoff").innerHTML = onoffaff + affcpt; } -function ASC(a,b){ -a=a[tricol]; -b=b[tricol]; -if(a > b) - return 1; - if(a < b) - return -1; - return 0; - } +function ASC(a, b) { + a = a[tricol]; + b = b[tricol]; + if (a > b) + return 1; + if (a < b) + return -1; + return 0; +} -function alist() { +function alist() { if (aflist === true) { - document.getElementById("ett1").innerHTML = "
"; - document.getElementById('dlist').style.width="20px"; - document.getElementById('dlist').style.height="20px"; - if (lside==1) document.getElementById('ac').style.left="65px"; else document.getElementById('ac').style.right="0px"; + document.getElementById("ett1").innerHTML = "
"; + document.getElementById('dlist').style.width = "20px"; + document.getElementById('dlist').style.height = "20px"; + if (lside == 1) document.getElementById('ac').style.left = "65px"; + else document.getElementById('ac').style.right = "0px"; centeroff(); aflist = false; - } - else { + } else { document.getElementById("ett1").innerHTML = ett1; - document.getElementById('dlist').style.width="180px"; - document.getElementById('dlist').style.height="90%"; - if (lside==1) document.getElementById('ac').style.left="245px"; else document.getElementById('ac').style.right="180px"; + document.getElementById('dlist').style.width = "180px"; + document.getElementById('dlist').style.height = "90%"; + if (lside == 1) document.getElementById('ac').style.left = "245px"; + else document.getElementById('ac').style.right = "180px"; aflist = true; afftab(); - } + } } function sideclick() { if (lside === 0) { - document.getElementById('dlist').className="lleft"; - document.getElementById('ac').className="acleft"; - document.getElementById('ac').style.right=""; - lside=1; + document.getElementById('dlist').className = "lleft"; + document.getElementById('ac').className = "acleft"; + document.getElementById('ac').style.right = ""; + lside = 1; } else { - document.getElementById('dlist').className="lright"; - document.getElementById('ac').className="acright"; - document.getElementById('ac').style.left=""; - lside=0; + document.getElementById('dlist').className = "lright"; + document.getElementById('ac').className = "acright"; + document.getElementById('ac').style.left = ""; + lside = 0; } } function autocenter(mark) { - document.getElementById("divInfoac").innerHTML = "AC: "+window[mark].get('title'); - autoc=mark; + document.getElementById("divInfoac").innerHTML = "AC: " + window[mark].get('title'); + autoc = mark; document.getElementById("divInfoac").style.display = "block"; map.setCenter(window[mark].getPosition()); } @@ -492,18 +526,22 @@ function autocenter(mark) { function centeron(mark) { - cton=true; + cton = true; map.setCenter(window[mark].getPosition()); } function centeroff() { - if (autoc !== "") { map.setCenter(window[autoc].getPosition()); } - cton=false; + if (autoc !== "") { + map.setCenter(window[autoc].getPosition()); + } + cton = false; } function vpolmar(chk, polmar) { - window[polmar].setOptions( {visible: chk } ); + window[polmar].setOptions({ + visible: chk + }); } @@ -517,113 +555,115 @@ function isvisib(pol) { function dec2dms(dec) { dec = Math.abs(dec); var decd = Math.floor(dec); - var decm = Math.floor((dec-decd)*60); - var decs = Math.floor((dec-decd-(decm/60))*3600); - return ""+ decd + "° " + decm + "' " + decs + "\"" ; + var decm = Math.floor((dec - decd) * 60); + var decs = Math.floor((dec - decd - (decm / 60)) * 3600); + return "" + decd + "° " + decm + "' " + decs + "\""; } function changecolor(mark) { var colactive = window[mark].get('icol'); - if(++colactive==9) colactive=0; + if (++colactive == 9) colactive = 0; var ncol = tcolor[colactive]; - window[window[mark].get('poly')].setOptions ( {strokeColor: '#'+ncol} ); - window[mark].set('icol', ""+colactive); - return "#"+ncol; + window[window[mark].get('poly')].setOptions({ + strokeColor: '#' + ncol + }); + window[mark].set('icol', "" + colactive); + return "#" + ncol; } function redraw(pol) { - var p=pol.substring(2); - var mrk=window["M_"+p]; - var fi=mrk.get('fid'); - var lo=mrk.getPosition().lng().toFixed(); + var p = pol.substring(2); + var mrk = window["M_" + p]; + var fi = mrk.get('fid'); + var lo = mrk.getPosition().lng().toFixed(); mrk.set('tra', 1); - var aa=""; - if (fi=="hidden") aa="&a=1"; - downloadUrl(tld + '/' + cxml1+'?id='+p+aa+"&l="+lo, function(data) - { + var aa = ""; + if (fi == "hidden") aa = "&a=1"; + 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) { - window['P_'+idd].getPath().clear(); - var ftrace = google.maps.geometry.encoding.decodePath( encodedt ); - window['P_'+idd].setPath(ftrace); - } - }); + if (err === 0 && encodedt.length > 2) { + window['P_' + idd].getPath().clear(); + var ftrace = google.maps.geometry.encoding.decodePath(encodedt); + window['P_' + idd].setPath(ftrace); + } + }); } function taskbox() { - if(document.getElementById('taskbox').checked) { - vtas=true; + if (document.getElementById('taskbox').checked) { + vtas = true; } else { - vtas=false; + vtas = false; } - var j=-1; - while(taska[++j]){ - taska[j].setOptions( {visible: vtas } ); + var j = -1; + while (taska[++j]) { + taska[j].setOptions({ + visible: vtas + }); } } function reclbox() { - if(document.getElementById('reclbox').checked) { - vrecl=true; - rempl(6,"r"); + if (document.getElementById('reclbox').checked) { + vrecl = true; + rempl(6, "r"); } else { - vrecl=false; - rempl(6," "); + vrecl = false; + rempl(6, " "); } - var j=-1; - while(receivers[++j]){ - window["R_"+receivers[j][0]].setOptions( {visible: vrecl } ); + var j = -1; + while (receivers[++j]) { + window["R_" + receivers[j][0]].setOptions({ + visible: vrecl + }); } rehash(); } function checkrec() { - downloadUrl(tld + '/' + 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; - while(receivers[++j]){ - window["R_"+receivers[j][0]].setMap(null); delete window["R_"+receivers[j][0]]; + var j = -1; + while (receivers[++j]) { + window["R_" + receivers[j][0]].setMap(null); + delete window["R_" + receivers[j][0]]; } - receivers.length=0; - for (var i = 1; i < vlrec.length; i++) - { + receivers.length = 0; + for (var i = 1; i < vlrec.length; i++) { var re = vlrec[i].getAttribute("a"); var rlat = parseFloat(vlrec[i].getAttribute("b")); var rlon = parseFloat(vlrec[i].getAttribute("c")); var ract = parseInt(vlrec[i].getAttribute("d")); - var rind = 2000*ract; + var rind = 2000 * ract; selrec += ""; - receivers.push([re,rlat,rlon]); // lat et lon stockées mais jamais utilisées ? - window["R_"+re] = new google.maps.Marker({ - position: new google.maps.LatLng(rlat, rlon), - title: "Receiver: "+re, - map: map, - icon: ""+tld+"/pict/rec"+ract+".png", - zIndex: rind, - visible: vrecl - }); - } + receivers.push([re, rlat, rlon]); // lat et lon stockées mais jamais utilisées ? + window["R_" + re] = new google.maps.Marker({ + position: new google.maps.LatLng(rlat, rlon), + title: "Receiver: " + re, + map: map, + icon: "" + tld + "/pict/rec" + ract + ".png", + zIndex: rind, + visible: vrecl + }); + } setTimeout(checkrec, 120000); - } - else - { - selrec = ""; + } else { + selrec = ""; setTimeout(checkrec, 20000); - } + } reclbox(); - }); + }); } @@ -631,8 +671,8 @@ function checkrec() { function receiv() { - if(document.getElementById('recbox').checked) { - vrec=true; + if (document.getElementById('recbox').checked) { + vrec = true; /* var s = document.getElementById("recsel"); var sv = s.options[s.selectedIndex].value; @@ -649,9 +689,8 @@ function receiv() { } */ - } - else { - vrec=false; + } else { + vrec = false; /* recc=""; */ @@ -660,22 +699,22 @@ function receiv() { function affinfodata(mark) { - var mrk=window[mark]; - var vz=mrk.get('vz')*m2kt[unit]; - var vx=mrk.get('speed')*kh2kt[unit]; - var al=mrk.get('alt')*m2ft[unit]; - document.getElementById("aclt").innerHTML=mrk.get('tim'); - document.getElementById("acla").innerHTML=mrk.getPosition().lat().toFixed(6); - document.getElementById("aclo").innerHTML=mrk.getPosition().lng().toFixed(6); - document.getElementById("acal").innerHTML=al.toFixed()+" "+am2ft[unit]; - document.getElementById("acsp").innerHTML=vx.toFixed()+" "+akh2kt[unit]; - document.getElementById("actr").innerHTML=mrk.get('track'); - document.getElementById("acvz").innerHTML=((vz>=0)?"+":"–")+Math.abs(vz).toFixed(1)+" "+am2kt[unit]; + var mrk = window[mark]; + var vz = mrk.get('vz') * m2kt[unit]; + var vx = mrk.get('speed') * kh2kt[unit]; + var al = mrk.get('alt') * m2ft[unit]; + document.getElementById("aclt").innerHTML = mrk.get('tim'); + document.getElementById("acla").innerHTML = mrk.getPosition().lat().toFixed(6); + document.getElementById("aclo").innerHTML = mrk.getPosition().lng().toFixed(6); + document.getElementById("acal").innerHTML = al.toFixed() + " " + am2ft[unit]; + document.getElementById("acsp").innerHTML = vx.toFixed() + " " + akh2kt[unit]; + document.getElementById("actr").innerHTML = mrk.get('track'); + document.getElementById("acvz").innerHTML = ((vz >= 0) ? "+" : "–") + Math.abs(vz).toFixed(1) + " " + am2kt[unit]; var re = mrk.get('rec'); - if (typeof(window["R_"+re]) != 'undefined') { - var mre = window["R_"+re]; - var di = dist(mrk.getPosition().lat(), mrk.getPosition().lng(), mre.getPosition().lat(), mre.getPosition().lng() ); - re += " ("+di.toFixed()+" Km)"; + if (typeof(window["R_" + re]) != 'undefined') { + var mre = window["R_" + re]; + var di = dist(mrk.getPosition().lat(), mrk.getPosition().lng(), mre.getPosition().lat(), mre.getPosition().lng()); + re += " (" + di.toFixed() + " Km)"; } else { re += " (?)"; } @@ -683,454 +722,458 @@ function affinfodata(mark) { } function affinfodata2(mark) { - var mrk=window[mark]; - document.getElementById("acow").innerHTML=mrk.get('owner'); - document.getElementById("acaf").innerHTML=mrk.get('airf'); - document.getElementById("acmo").innerHTML=mrk.get('model'); - document.getElementById("acfr").innerHTML=mrk.get('freq'); + var mrk = window[mark]; + document.getElementById("acow").innerHTML = mrk.get('owner'); + document.getElementById("acaf").innerHTML = mrk.get('airf'); + document.getElementById("acmo").innerHTML = mrk.get('model'); + document.getElementById("acfr").innerHTML = mrk.get('freq'); } function affinfo(mark) { affinfodata(mark); - var mrk=window[mark]; - var rg=mrk.get('reg'); - var fi=mrk.get('fid'); - var vd="block"; - if (fi==rg) vd = "none"; + var mrk = window[mark]; + var rg = mrk.get('reg'); + var fi = mrk.get('fid'); + var vd = "block"; + if (fi == rg) vd = "none"; document.getElementById("ac1").style.display = vd; - document.getElementById("accn").innerHTML=mrk.get('cn'); - document.getElementById("acfi").innerHTML=fi; - document.getElementById("acre").innerHTML=rg; - document.getElementById("acty").innerHTML=ftype[mrk.get('type')*1]; - if (fi!="hidden") { - document.getElementById("acif").innerHTML="Infos    Pictures"; + document.getElementById("accn").innerHTML = mrk.get('cn'); + document.getElementById("acfi").innerHTML = fi; + document.getElementById("acre").innerHTML = rg; + document.getElementById("acty").innerHTML = ftype[mrk.get('type') * 1]; + if (fi != "hidden") { + document.getElementById("acif").innerHTML = "Infos    Pictures"; 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) { - window[mrk].set('owner', ""+dat[0].getAttribute("a")); - window[mrk].set('airf', ""+dat[0].getAttribute("b")); - window[mrk].set('model', ""+dat[0].getAttribute("c")); - window[mrk].set('freq', ""+dat[0].getAttribute("e")); - affinfodata2(mrk); - document.getElementById("ac2").style.display = "block"; - } else { - window[mrk].set('owner', "_"); - document.getElementById("ac2").style.display = "none"; - } - }); + 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) { + window[mrk].set('owner', "" + dat[0].getAttribute("a")); + window[mrk].set('airf', "" + dat[0].getAttribute("b")); + window[mrk].set('model', "" + dat[0].getAttribute("c")); + window[mrk].set('freq', "" + dat[0].getAttribute("e")); + affinfodata2(mrk); + document.getElementById("ac2").style.display = "block"; + } else { + window[mrk].set('owner', "_"); + document.getElementById("ac2").style.display = "none"; + } + }); } else { - if (mrk.get('owner')!="_") { + if (mrk.get('owner') != "_") { affinfodata2(mark); document.getElementById("ac2").style.display = "block"; } else { document.getElementById("ac2").style.display = "none"; } } - } - else { + } else { document.getElementById("ac2").style.display = "none"; - document.getElementById("acif").innerHTML=""; - document.getElementById("acow").innerHTML=""; - document.getElementById("acaf").innerHTML=""; - document.getElementById("acmo").innerHTML=""; - document.getElementById("acfr").innerHTML=""; + document.getElementById("acif").innerHTML = ""; + document.getElementById("acow").innerHTML = ""; + document.getElementById("acaf").innerHTML = ""; + document.getElementById("acmo").innerHTML = ""; + document.getElementById("acfr").innerHTML = ""; } - acaff=mark; + acaff = mark; document.getElementById("ac").style.display = "block"; } function settomap() { - var b= map.getBounds(); - amax = b.getNorthEast().lat(); - amin = b.getSouthWest().lat(); - omax = b.getNorthEast().lng(); - omin = b.getSouthWest().lng(); - if (amax > 85) amax = 85; - if (amin < -85) amin = -85; - if (omax > 180) omax = 180; - if (omin < -180) omin = -180; - document.getElementById('latmax').value = amax; - document.getElementById('latmin').value = amin; - document.getElementById('lonmax').value = omax; - document.getElementById('lonmin').value = omin; - if (bound === true) bounds(); - if (vstm === true) { - boundc="&b="+amax+"&c="+amin+"&d="+omax+"&e="+omin; - hashs="&s=1"; - rehash(); - } + var b = map.getBounds(); + amax = b.getNorthEast().lat(); + amin = b.getSouthWest().lat(); + omax = b.getNorthEast().lng(); + omin = b.getSouthWest().lng(); + if (amax > 85) amax = 85; + if (amin < -85) amin = -85; + if (omax > 180) omax = 180; + if (omin < -180) omin = -180; + document.getElementById('latmax').value = amax; + document.getElementById('latmin').value = amin; + document.getElementById('lonmax').value = omax; + document.getElementById('lonmin').value = omin; + if (bound === true) bounds(); + if (vstm === true) { + boundc = "&b=" + amax + "&c=" + amin + "&d=" + omax + "&e=" + omin; + hashs = "&s=1"; + rehash(); + } } function astm() { - if(document.getElementById('astmbox').checked) { - vstm=true; + if (document.getElementById('astmbox').checked) { + vstm = true; if (document.getElementById('boundsbox').checked) { - bound=false; + bound = false; document.getElementById('boundsbox').checked = false; - hashb=""; + hashb = ""; } settomap(); } else { - vstm=false; - if (bound === false) boundc=""; - hashs=""; + vstm = false; + if (bound === false) boundc = ""; + hashs = ""; rehash(); } } -function dist(lat1,lon1,lat2,lon2) { +function dist(lat1, lon1, lat2, lon2) { var torad = Math.PI / 180; lat1 *= torad; lon1 *= torad; lat2 *= torad; lon2 *= torad; - var dt=Math.acos( (Math.sin(lat1)*Math.sin(lat2)) + (Math.cos(lat1)*Math.cos(lat2)*Math.cos(lon1-lon2)) ); - dt *=6366; + var dt = Math.acos((Math.sin(lat1) * Math.sin(lat2)) + (Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon1 - lon2))); + dt *= 6366; return dt; } -function gesmark() - { +function gesmark() { - downloadUrl(tld + '/' + 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"); + online.length = 0; + offline.length = 0; + var colcn; + var del = "N"; + + for (var i = 0; i < planeurs.length; i++) { + // récupération des données transmises pour ce planeur + var tab = planeurs[i].getAttribute("a").split(","); + + var lat = parseFloat(tab[0]); + var lon = parseFloat(tab[1]); + var cn = tab[2]; + var ps = tab[3]; + var alt = tab[4]; + var tim = tab[5]; + var ddf = tab[6]; + var track = tab[7]; + var speed = tab[8]; + var vz = tab[9]; + var typ = tab[10]; + var rec = tab[11]; + + + + var posi = new google.maps.LatLng(lat, lon); + var polyvar = "P_" + ps + "_" + cn; + var markvar = "M_" + ps + "_" + cn; + var visib = true; + + + if (typeof(window[polyvar]) == 'undefined') // si planeur non créé (pas déjà présent sur la carte) { - ++w; - var planeurs = data.documentElement.getElementsByTagName("m"); - online.length=0; - offline.length=0; - var colcn; - var del = "N"; + // **** création de la couleur de la trace en fonction d'un tableau de 9 couleurs + hcol = tcolor[ccolor]; + if (hnew === true) visib = false; - for (var i = 0; i < planeurs.length; i++) - { - // récupération des données transmises pour ce planeur - var tab=planeurs[i].getAttribute("a").split(","); + // création du PolyLine + var polyOptions = { + strokeColor: '#' + hcol, + strokeOpacity: 0.75, + strokeWeight: 2, + visible: visib + }; + window[polyvar] = new google.maps.Polyline(polyOptions); + window[polyvar].setMap(map); + window[polyvar].set('nom', "" + cn + " - " + ps); + window[polyvar].set('poly', "" + polyvar); - var lat = parseFloat(tab[0]); - var lon = parseFloat(tab[1]); - var cn = tab[2]; - var ps = tab[3]; - var alt = tab[4]; - var tim = tab[5]; - var ddf = tab[6]; - var track = tab[7]; - var speed = tab[8]; - var vz = tab[9]; - var typ = tab[10]; - var rec = tab[11]; + window[polyvar].getPath().push(posi); // ajout d'une position sur le tracé + + google.maps.event.addListener(window[polyvar], "mouseover", function() { + focuson(this.get('poly')); + var bcol = this.strokeColor; + document.getElementById("divInfo").innerHTML = "    " + this.get('nom'); + }); + + google.maps.event.addListener(window[polyvar], "mouseout", function() { + focusoff(this.get('poly')); + document.getElementById("divInfo").innerHTML = " "; + }); + + // création du Marker + window[markvar] = new google.maps.Marker({ + position: posi, + title: cn + " - " + ps + " @ " + alt + "m", + map: map, + icon: "" + tld + "/markers/" + cn + ftypec[typ * 1] + ".png", + visible: visib + }); + window[markvar].set('poly', "" + polyvar); + window[markvar].set('mark', "" + markvar); + window[markvar].set('nom', "" + cn + " - " + ps); + window[markvar].set('cn', "" + cn); + window[markvar].set('reg', "" + ps); + var fid = tab[12]; + if (fid == "0") fid = "hidden"; + window[markvar].set('fid', "" + fid); + window[markvar].set('type', "" + typ); + window[markvar].set('icol', "" + ccolor); + window[markvar].set('off', 0); + window[markvar].set('owner', ""); + window[markvar].setTitle("" + cn + " - " + ps + " @ " + (alt * m2ft[unit]).toFixed() + am2ft[unit] + " @ " + tim); + window[markvar].set('speed', "" + speed); + window[markvar].set('track', "" + track); + window[markvar].set('vz', "" + vz); + window[markvar].set('tim', "" + tim); + window[markvar].set('rec', "" + rec); + window[markvar].set('alt', "" + alt); + window[markvar].set('tra', 0); + + + google.maps.event.addListener(window[markvar], "mouseover", function() { + var bcol = window[this.get('poly')].strokeColor; + document.getElementById("divInfo").innerHTML = "    " + this.get('nom'); + focuson(this.get('poly')); + }); + + google.maps.event.addListener(window[markvar], "mouseout", function() { + document.getElementById("divInfo").innerHTML = " "; + focusoff(this.get('poly')); + }); + + google.maps.event.addListener(window[markvar], "click", function() { + affinfo(this.get('mark')); + }); + + google.maps.event.addListener(window[markvar], "dblclick", function() { + document.getElementById("divInfoac").innerHTML = "AC: " + this.get('title'); + autoc = this.get('mark'); + document.getElementById("divInfoac").style.display = "block"; + map.setCenter(this.position); + }); + + google.maps.event.addListener(window[markvar], "rightclick", function() { + var pol = this.get('poly'); + redraw(pol); + }); + + if (++ccolor == 9) ccolor = 0; + } // fin du if typeof... - var posi= new google.maps.LatLng(lat, lon); - var polyvar="P_"+ps+"_"+cn; - var markvar="M_"+ps+"_"+cn; - var visib = true; + //var oldalt=window[markvar].get('alt'); + //var difalt=(alt-oldalt)/15; + var difalt = vz * 1; - if (typeof(window[polyvar]) == 'undefined') // si planeur non créé (pas déjà présent sur la carte) - { - // **** création de la couleur de la trace en fonction d'un tableau de 9 couleurs - hcol= tcolor[ccolor]; - if (hnew === true) visib = false; + colcn = window[polyvar].strokeColor; - // création du PolyLine - var polyOptions = { - strokeColor: '#'+hcol, - strokeOpacity: 0.75, - strokeWeight: 2, - visible: visib - }; - window[polyvar] = new google.maps.Polyline(polyOptions); - window[polyvar].setMap(map); - window[polyvar].set('nom', ""+cn+" - "+ps); - window[polyvar].set('poly', ""+polyvar); + if (ddf < 600) { + if (ddf > 120) afdif = "n"; + else if (difalt === 0) afdif = "z"; + else if (difalt < -4) afdif = "mmm"; + else if (difalt < -1) afdif = "mm"; + else if (difalt < 0) afdif = "m"; + else if (difalt > 4) afdif = "ppp"; + else if (difalt > 1) afdif = "pp"; + else afdif = "p"; - window[polyvar].getPath().push(posi); // ajout d'une position sur le tracé + online.push([cn, alt * 1, ps + "_" + cn, colcn, afdif]); + if (window[markvar].get('off') == 1) { + window[markvar].setOptions({ + zIndex: 50 + }); + window[markvar].setIcon("" + tld + "/markers/" + cn + ftypec[typ * 1] + ".png"); + window[markvar].set('off', 0); + } - google.maps.event.addListener(window[polyvar], "mouseover", function() { - focuson(this.get('poly')); - var bcol=this.strokeColor; - document.getElementById("divInfo").innerHTML="    "+this.get('nom'); - }); - - google.maps.event.addListener(window[polyvar], "mouseout", function() { - focusoff(this.get('poly')); - document.getElementById("divInfo").innerHTML=" "; - }); - - // création du Marker - window[markvar] = new google.maps.Marker({ - position: posi, - title: cn+" - "+ps+" @ "+alt+"m", - map: map, - icon: ""+tld+"/markers/"+cn+ftypec[typ*1]+".png", - visible: visib - }); - window[markvar].set('poly', ""+polyvar); - window[markvar].set('mark', ""+markvar); - window[markvar].set('nom', ""+cn+" - "+ps); - window[markvar].set('cn', ""+cn); - window[markvar].set('reg', ""+ps); - var fid = tab[12]; - if (fid=="0") fid="hidden"; - window[markvar].set('fid', ""+fid); - window[markvar].set('type', ""+typ); - window[markvar].set('icol', ""+ccolor); - window[markvar].set('off', 0); - window[markvar].set('owner', ""); - window[markvar].setTitle(""+cn+" - "+ps+" @ "+(alt*m2ft[unit]).toFixed()+am2ft[unit]+" @ "+tim); - window[markvar].set('speed', ""+speed); - window[markvar].set('track', ""+track); - window[markvar].set('vz', ""+vz); - window[markvar].set('tim', ""+tim); - window[markvar].set('rec', ""+rec); - window[markvar].set('alt', ""+alt); - window[markvar].set('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 + } - google.maps.event.addListener(window[markvar], "mouseover", function() { - var bcol=window[this.get('poly')].strokeColor; - document.getElementById("divInfo").innerHTML="    "+this.get('nom'); - focuson(this.get('poly')); - }); + window[polyvar].getPath().push(posi); // ajout d'une position sur le tracé + window[markvar].setPosition(posi); // déplace le marker - google.maps.event.addListener(window[markvar], "mouseout", function() { - document.getElementById("divInfo").innerHTML=" "; - focusoff(this.get('poly')); - }); + // change l'altitude affichée + window[markvar].setTitle("" + cn + " - " + ps + " @ " + (alt * m2ft[unit]).toFixed() + am2ft[unit] + " @ " + tim); + window[markvar].set('speed', "" + speed); + window[markvar].set('track', "" + track); + window[markvar].set('vz', "" + vz); + window[markvar].set('tim', "" + tim); + window[markvar].set('rec', "" + rec); + window[markvar].set('alt', "" + alt); - google.maps.event.addListener(window[markvar], "click", function() { - affinfo(this.get('mark')); - }); + } else { + 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); + delete window[polyvar]; - google.maps.event.addListener(window[markvar], "dblclick", function() { - document.getElementById("divInfoac").innerHTML="AC: "+this.get('title'); - autoc=this.get('mark'); - document.getElementById("divInfoac").style.display = "block"; - map.setCenter(this.position); - }); + window[markvar].setMap(null); + delete window[markvar]; - google.maps.event.addListener(window[markvar], "rightclick", function() { - var pol = this.get('poly'); - redraw(pol); - }); - - if(++ccolor==9) ccolor=0; - } // fin du if typeof... - - - - //var oldalt=window[markvar].get('alt'); - //var difalt=(alt-oldalt)/15; - var difalt=vz*1; - - - colcn=window[polyvar].strokeColor; - - if (ddf<600) { - if (ddf>120) afdif="n"; - else if (difalt === 0) afdif="z"; - else if (difalt<-4) afdif="mmm"; - else if (difalt<-1) afdif="mm"; - else if (difalt<0) afdif="m"; - else if (difalt>4) afdif="ppp"; - else if (difalt>1) afdif="pp"; - else afdif="p"; - - online.push([cn,alt*1,ps+"_"+cn,colcn,afdif]); - if (window[markvar].get('off')==1) { - window[markvar].setOptions( {zIndex: 50 } ); - window[markvar].setIcon(""+tld+"/markers/"+cn+ftypec[typ*1]+".png"); - window[markvar].set('off', 0); + if (autoc == markvar) { + autoc = ""; + document.getElementById("divInfoac").innerHTML = " "; + document.getElementById("divInfoac").style.display = "none"; } - - if (window[markvar].get('tra') === 0) { - if (window[polyvar].getPath().getLength()>=pathl) window[polyvar].getPath().removeAt(0); // remove first point of the trace - } - - - window[polyvar].getPath().push(posi); // ajout d'une position sur le tracé - window[markvar].setPosition(posi); // déplace le marker - - // change l'altitude affichée - window[markvar].setTitle(""+cn+" - "+ps+" @ "+(alt*m2ft[unit]).toFixed()+am2ft[unit]+" @ "+tim); - window[markvar].set('speed', ""+speed); - window[markvar].set('track', ""+track); - window[markvar].set('vz', ""+vz); - window[markvar].set('tim', ""+tim); - window[markvar].set('rec', ""+rec); - window[markvar].set('alt', ""+alt); + if (acaff == markvar) acaff = ""; } - else { - 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); - delete window[polyvar]; - - window[markvar].setMap(null); - delete window[markvar]; - - if (autoc==markvar) { - autoc=""; - document.getElementById("divInfoac").innerHTML=" "; - document.getElementById("divInfoac").style.display = "none"; - } - if (acaff==markvar) acaff=""; - - } - } - else { - offline.push([cn,alt*1,ps+"_"+cn,colcn,"n"]); - if (window[markvar].get('off') === 0) { - window[markvar].setOptions( {zIndex: 10 } ); - window[markvar].setIcon(""+tld+"/markers/"+cn+"_o.png"); - window[markvar].set('off', 1); - } - } - } + } else { + offline.push([cn, alt * 1, ps + "_" + cn, colcn, "n"]); + if (window[markvar].get('off') === 0) { + window[markvar].setOptions({ + zIndex: 10 + }); + window[markvar].setIcon("" + tld + "/markers/" + cn + "_o.png"); + window[markvar].set('off', 1); + } + } + } - if (autoc==markvar) - { - document.getElementById("divInfoac").innerHTML="AC: "+cn+" - "+ps+" @ "+(alt*m2ft[unit]).toFixed()+am2ft[unit]; - if (cton === false) map.setCenter(new google.maps.LatLng(lat,lon)); - } + if (autoc == markvar) { + document.getElementById("divInfoac").innerHTML = "AC: " + cn + " - " + ps + " @ " + (alt * m2ft[unit]).toFixed() + am2ft[unit]; + if (cton === false) map.setCenter(new google.maps.LatLng(lat, lon)); + } - if (acaff==markvar) affinfodata(markvar); + if (acaff == markvar) affinfodata(markvar); - } // fin du for (var i = 0; i < planeurs.length; i++) - // tri et affichage du tableau - afftab(); - tmgm = setTimeout(gesmark, 10000); - }); + } // fin du for (var i = 0; i < planeurs.length; i++) + // tri et affichage du tableau + afftab(); + tmgm = setTimeout(gesmark, 10000); + }); - } +} function wd() { if (w === 0) { clearTimeout(tmgm); gesmark(); } - w=0; + w = 0; tmwd = setTimeout(wd, 30000); } function rehash() { - window.location.hash=hashc+hashz+hashm+hasho+hashb+hashs+hashl+hashw+hashp+hashu; + window.location.hash = hashc + hashz + hashm + hasho + hashb + hashs + hashl + hashw + hashp + hashu; } 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; + var thl = hl; + hl = thl.substring(0, po) + c + thl.substring(po + 1); + thl = hl.replace(/ /g, ''); + if (thl === '') hashl = ''; + else hashl = "&l=" + thl; } -function taskclic() { document.getElementById("chfile").click(); } +function taskclic() { + document.getElementById("chfile").click(); +} function task(cont) { - var res = JSON.parse(cont); - var tc,tn,ltp; - 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"; - tp.length=0; - 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, - strokeWeight: 2, - fillColor: '#'+tc, - fillOpacity: 0.1, - map: map, - center: ltp, - 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]); - tp.push(ltp); - } - } - var flightPath = new google.maps.Polyline({ - path: tp, - strokeColor: "#"+tc, - strokeOpacity: 1.0, - strokeWeight: 2, - map: map - }); - flightPath.set('nom', ""+tn); - taska.push(flightPath); - google.maps.event.addListener(flightPath, "mouseover", function() { - var bcol=this.strokeColor; - document.getElementById("divInfo").innerHTML="    task: "+this.get('nom'); - }); + var res = JSON.parse(cont); + var tc, tn, ltp; + 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"; + tp.length = 0; + 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, + strokeWeight: 2, + fillColor: '#' + tc, + fillOpacity: 0.1, + map: map, + center: ltp, + 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]); + tp.push(ltp); + } + } + var flightPath = new google.maps.Polyline({ + path: tp, + strokeColor: "#" + tc, + strokeOpacity: 1.0, + strokeWeight: 2, + map: map + }); + flightPath.set('nom', "" + tn); + taska.push(flightPath); + google.maps.event.addListener(flightPath, "mouseover", function() { + var bcol = this.strokeColor; + document.getElementById("divInfo").innerHTML = "    task: " + this.get('nom'); + }); - google.maps.event.addListener(flightPath, "mouseout", function() { - document.getElementById("divInfo").innerHTML=" "; - }); + google.maps.event.addListener(flightPath, "mouseout", function() { + document.getElementById("divInfo").innerHTML = " "; + }); - // prévoir whitelist pour chaqsue task (avec couleur de fond différente?) - } - document.getElementById("dtaskbox").innerHTML =""; + // prévoir whitelist pour chaqsue task (avec couleur de fond différente?) + } + document.getElementById("dtaskbox").innerHTML = ""; } function rtask() { - var files = document.getElementById('chfile').files; - if (!files.length) { alert('Please select a file!'); return; } - var file = files[0]; - var reader = new FileReader(); - reader.onloadend = function(evt) { - if (evt.target.readyState == FileReader.DONE) { - var cont=evt.target.result; - cont = cont.trim(); - task(cont); - } - }; - reader.readAsText(file); + var files = document.getElementById('chfile').files; + if (!files.length) { + alert('Please select a file!'); + return; } + var file = files[0]; + var reader = new FileReader(); + reader.onloadend = function(evt) { + if (evt.target.readyState == FileReader.DONE) { + var cont = evt.target.result; + cont = cont.trim(); + task(cont); + } + }; + reader.readAsText(file); +} -function initialize() - { - var has = window.location.hash.substring(1).split('&'); // parse the parameters +function initialize() { + var has = window.location.hash.substring(1).split('&'); // parse the parameters var parh = []; var cent = []; - for (var i=0; i7) return; - return "http://www.openportguide.org/tiles/actual/wind_vector/5/"+zoom+"/"+tile.x+"/"+tile.y+".png"; - }, - maxZoom: 7, - opacity: 0, - tileSize: new google.maps.Size(256, 256) - }); + getTileUrl: function(tile, zoom) { + if (zoom > 7) return; + return "http://www.openportguide.org/tiles/actual/wind_vector/5/" + zoom + "/" + tile.x + "/" + tile.y + ".png"; + }, + maxZoom: 7, + opacity: 0, + tileSize: new google.maps.Size(256, 256) + }); presoverlay = new google.maps.ImageMapType({ - getTileUrl: function(tile, zoom) { - if (zoom>7) return; - return "http://www.openportguide.org/tiles/actual/surface_pressure/5/"+zoom+"/"+tile.x+"/"+tile.y+".png"; - }, - maxZoom: 7, - opacity: 0, - tileSize: new google.maps.Size(256, 256) - }); + getTileUrl: function(tile, zoom) { + if (zoom > 7) return; + return "http://www.openportguide.org/tiles/actual/surface_pressure/5/" + zoom + "/" + tile.x + "/" + tile.y + ".png"; + }, + maxZoom: 7, + opacity: 0, + tileSize: new google.maps.Size(256, 256) + }); var myOptions = { - mapTypeControlOptions: { - // mapTypeIds: ['RELIEF', google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID ] - mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID ] - }, - zoom: 13, - center: new google.maps.LatLng(vlat, vlon), - overviewMapControl: true, - scaleControl: true, - draggableCursor: 'default', - draggingCursor: 'default' - //mapTypeId: google.maps.MapTypeId.TERRAIN + mapTypeControlOptions: { + // mapTypeIds: ['RELIEF', google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID ] + mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID] + }, + zoom: 13, + center: new google.maps.LatLng(vlat, vlon), + overviewMapControl: true, + scaleControl: true, + draggableCursor: 'default', + draggingCursor: 'default' + //mapTypeId: google.maps.MapTypeId.TERRAIN }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); //map.mapTypes.set('RELIEF' , RELIEF); var mid = 'TERRAIN'; - var tmid = { "r" : "ROADMAP", "t" : "TERRAIN", "s": "SATELLITE", "h": "HYBRID"}; + 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; + hashm = "&m=" + parh.m; } map.setMapTypeId(google.maps.MapTypeId[mid]); google.maps.event.addListener(map, 'maptypeid_changed', function() { - hashm = "&m="+map.getMapTypeId().substr(0,1); - rehash(); - /* + hashm = "&m=" + map.getMapTypeId().substr(0, 1); + rehash(); + /* if (id=="RELIEF") { wateroverlay.setOpacity(1); map.overlayMapTypes.setAt(0, wateroverlay); @@ -1252,49 +1300,49 @@ function initialize() map.overlayMapTypes.removeAt(0); } */ - }); + }); google.maps.event.addListener(map, 'click', function() { - infowindow.close(); - }); + infowindow.close(); + }); google.maps.event.addListener(map, 'bounds_changed', function() { - if (vstm === true) settomap(); - }); + if (vstm === true) settomap(); + }); google.maps.event.addListener(map, 'zoom_changed', function() { - hashz= "&z="+map.getZoom(); - rehash(); - }); + hashz = "&z=" + map.getZoom(); + rehash(); + }); google.maps.event.addListener(map, 'center_changed', function() { - var nc = map.getCenter(); - hashc= "c="+nc.lat().toFixed(5)+","+nc.lng().toFixed(5); - rehash(); - }); + var nc = map.getCenter(); + hashc = "c=" + nc.lat().toFixed(5) + "," + nc.lng().toFixed(5); + rehash(); + }); // parameter z= zoom level 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); - var bounds = new google.maps.LatLngBounds(southWest,northEast); + var bounds = new google.maps.LatLngBounds(southWest, northEast); map.fitBounds(bounds); } - var divinfoCont = document.createElement ('DIV'); // contener glider info when overmouse + var divinfoCont = document.createElement('DIV'); // contener glider info when overmouse divinfoCont.style.paddingTop = "7px"; divinfoCont.style.paddingRight = "3px"; - var divinfoContac = document.createElement ('DIV'); // contener autocenter + var divinfoContac = document.createElement('DIV'); // contener autocenter divinfoContac.style.paddingTop = "7px"; divinfoContac.style.paddingRight = "3px"; - var divinfoContpb = document.createElement ('DIV'); // contener poweredby + var divinfoContpb = document.createElement('DIV'); // contener poweredby divinfoContpb.style.paddingTop = "7px"; divinfoContpb.style.paddingRight = "3px"; @@ -1306,7 +1354,7 @@ function initialize() divInfo.style.float = "left"; divInfo.style.display = "block"; - divInfo.appendChild ( document.createTextNode("...")); + divInfo.appendChild(document.createTextNode("...")); var divInfoac = document.createElement("div"); divInfoac.id = "divInfoac"; @@ -1316,7 +1364,7 @@ function initialize() divInfoac.style.float = "left"; divInfoac.style.display = "none"; - divInfoac.appendChild ( document.createTextNode("...")); + divInfoac.appendChild(document.createTextNode("...")); var divInfopb = document.createElement("div"); divInfopb.id = "divInfopb"; @@ -1328,15 +1376,15 @@ function initialize() divInfopb.style.cursor = 'pointer'; divInfopb.style.float = "left"; divInfopb.style.display = "block"; - divInfopb.innerHTML="  Powered By GliderNet.Org  "; + divInfopb.innerHTML = "  Powered By GliderNet.Org  "; // divInfopb.appendChild ( document.createTextNode("Powered By GliderNet.Org")); - divinfoCont.appendChild (divInfo) ; - divinfoContac.appendChild (divInfoac) ; - divinfoContpb.appendChild (divInfopb) ; + divinfoCont.appendChild(divInfo); + divinfoContac.appendChild(divInfoac); + divinfoContpb.appendChild(divInfopb); divinfoCont.index = 1; map.controls[google.maps.ControlPosition.TOP_CENTER].push(divinfoCont); @@ -1344,8 +1392,8 @@ function initialize() map.controls[google.maps.ControlPosition.TOP_RIGHT].push(divinfoContpb); google.maps.event.addDomListener(divInfoac, 'click', function() { - document.getElementById("divInfoac").innerHTML=" "; - autoc=""; + document.getElementById("divInfoac").innerHTML = " "; + autoc = ""; document.getElementById("divInfoac").style.display = "none"; }); @@ -1354,155 +1402,160 @@ function initialize() // affiche l'altitude du terrain quand clic-droit elevator = new google.maps.ElevationService(); - google.maps.event.addListener(map, 'rightclick', function (event) { - var locations = []; - var clickedLocation = event.latLng; - locations.push(clickedLocation); + google.maps.event.addListener(map, 'rightclick', function(event) { + var locations = []; + var clickedLocation = event.latLng; + locations.push(clickedLocation); - var latc = clickedLocation.lat(); - var alat = (latc>=0?"N":"S") + " " + dec2dms(latc); + var latc = clickedLocation.lat(); + var alat = (latc >= 0 ? "N" : "S") + " " + dec2dms(latc); - var lonc = clickedLocation.lng(); - var alon = (lonc>=0?"E":"W") + " " + dec2dms(lonc); + 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) { - if (results[0]) { - var te= Math.round(results[0].elevation); - infowindow.setContent('Elevation:' + (te*m2ft[unit]).toFixed() + am2ft[unit] + '
Lat: ' + alat + '
Lon: ' + alon); - infowindow.setPosition(clickedLocation); - infowindow.open(map); - } else { - alert('No results found'); - } - } else { - alert('Elevation service failed due to: ' + status); - } - }); - }); + elevator.getElevationForLocations(positionalRequest, function(results, status) { + if (status == google.maps.ElevationStatus.OK) { + if (results[0]) { + var te = Math.round(results[0].elevation); + infowindow.setContent('Elevation:' + (te * m2ft[unit]).toFixed() + am2ft[unit] + '
Lat: ' + alat + '
Lon: ' + alon); + infowindow.setPosition(clickedLocation); + infowindow.open(map); + } else { + alert('No results found'); + } + } else { + alert('Elevation service failed due to: ' + status); + } + }); + }); document.getElementById("ett1").innerHTML = ett1; - document.getElementById("ett2").innerHTML = "
CNAlti.Vz
"; + document.getElementById("ett2").innerHTML = "
CNAlti.Vz
"; document.getElementById("ac").innerHTML = "   ..::Aircraft::..
CN:
Regist.:
Flarm Id:
Type:
Owner:
Airfield:
Model:
Freq.:
Last time:
Latitude:
Longitude:
Altitude:
G.Speed:
Track:  °
Vz:
Receiver:
"; document.getElementById("dtable").innerHTML = "
"; - document.getElementById("menu").innerHTML = "
Hide new gliders
Ignore Offline
Bounds

       
Auto Set to map
..:: Layers ::..
Weather
Clouds
Wind
Pressure
AirSpaces ( openaip.net )
Airports ( openaip.net )
Receivers
Tasks

..::Units::..
Met. Imp.
..::Path length::..
5' 10' All
"; + document.getElementById("menu").innerHTML = "
Hide new gliders
Ignore Offline
Bounds

       
Auto Set to map
..:: Layers ::..
Weather
Clouds
Wind
Pressure
AirSpaces ( openaip.net )
Airports ( openaip.net )
Receivers
Tasks

..::Units::..
Met. Imp.
..::Path length::..
5' 10' All
"; // parameter b=lat1,lon1,lat2,lon2 bounds if (typeof(parh.b) != 'undefined') { - cent=parh.b.split(','); + 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]); document.getElementById('lonmin').value = parseFloat(cent[3]); - boundc="&b="+cent[0]+"&c="+cent[1]+"&d="+cent[2]+"&e="+cent[3]; - document.getElementById('boundsbox').checked=true; + boundc = "&b=" + cent[0] + "&c=" + cent[1] + "&d=" + cent[2] + "&e=" + cent[3]; + document.getElementById('boundsbox').checked = true; bound = true; - hashb="&b="+cent[0]+","+cent[1]+","+cent[2]+","+cent[3]; + hashb = "&b=" + cent[0] + "," + cent[1] + "," + cent[2] + "," + cent[3]; } // parameter l= active layers 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(); - break; - case 'c': // cloud - document.getElementById('clobox').checked=true; - clo(); - break; - case 'v': // wind - document.getElementById('winbox').checked=true; - wind(); - break; - case 'p': // pressure - document.getElementById('prebox').checked=true; - pres(); - break; - case 'z': // airspace - document.getElementById('aspbox').checked=true; - asp(); - break; - case 'a': // airport - document.getElementById('aptbox').checked=true; - apt(); - break; - case 'r': // receivers - document.getElementById('reclbox').checked=true; - break; + switch (parh.l[i]) { + case 'w': // weather + document.getElementById('weabox').checked = true; + wea(); + break; + case 'c': // cloud + document.getElementById('clobox').checked = true; + clo(); + break; + case 'v': // wind + document.getElementById('winbox').checked = true; + wind(); + break; + case 'p': // pressure + document.getElementById('prebox').checked = true; + pres(); + break; + case 'z': // airspace + document.getElementById('aspbox').checked = true; + asp(); + break; + case 'a': // airport + document.getElementById('aptbox').checked = true; + apt(); + break; + case 'r': // receivers + document.getElementById('reclbox').checked = true; + break; } } } if (typeof(parh.t) != 'undefined') { - var xhr = new XMLHttpRequest(); - xhr.open("GET", parh.t, true); - xhr.onreadystatechange = function() { + var xhr = new XMLHttpRequest(); + xhr.open("GET", parh.t, true); + xhr.onreadystatechange = function() { if (xhr.readyState === 4) { var status = xhr.status; if ((status >= 200 && status < 300) || status === 304) { task(xhr.responseText); } else { - alert("Task Request unsuccessful"+status); + alert("Task Request unsuccessful" + status); } } - }; + }; - xhr.send(null); + xhr.send(null); } // parameter w=0 (Don't display the warning) - var warn=1; + var warn = 1; if (typeof(parh.w) != 'undefined') { - if (parh.w === 0) { warn=0; hashw="&w=0";} + if (parh.w === 0) { + warn = 0; + hashw = "&w=0"; + } } - if (warn==1) { + if (warn == 1) { document.getElementById("popup").innerHTML = "\"close\"

Warning!


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.
Before raising an alert please contact us so we can interpret the data correctly.

"; op(300); } // parameter s=1 auto set bounds to the map if (typeof(parh.s) != 'undefined') { - if (parh.s==1) { - document.getElementById('astmbox').checked=true; - vstm=true; - hashs="&s=1"; + if (parh.s == 1) { + document.getElementById('astmbox').checked = true; + vstm = true; + hashs = "&s=1"; } } // parameter u=i units imperial ou metric (default)) if (typeof(parh.u) != 'undefined') { - if (parh.u=="i") { - document.getElementById('uni').checked=true; - unit="i"; - hashs="&u=i"; + if (parh.u == "i") { + document.getElementById('uni').checked = true; + unit = "i"; + hashs = "&u=i"; } } // parameter p=1,2 or 3 path length 5", 10" or all points 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 - pathl=99999; - document.getElementById('rp3').checked=true; - hashp="&p=3"; + if (parh.p == 2) { // 10 minutes + pathl = 60; + document.getElementById('rp2').checked = true; + hashp = "&p=2"; + } else if (parh.p == 3) { // all points + pathl = 99999; + document.getElementById('rp3').checked = true; + hashp = "&p=3"; } } - tz ="&z="+(tz /-60); // the javascript gettimezone function return negative value in minutes then /-60 to have correct hours + tz = "&z=" + (tz / -60); // the javascript gettimezone function return negative value in minutes then /-60 to have correct hours rehash(); checkrec(); tmwd = setTimeout(wd, 30000); gesmark(); - } +} From 996c2c643a08ac6eff721fa0f379b80243e8cb98 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 21 Jan 2015 15:00:33 +0100 Subject: [PATCH 2/5] Fixed typos in aircraft types array --- cunimb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cunimb.js b/cunimb.js index 8da7647..bd01f12 100644 --- a/cunimb.js +++ b/cunimb.js @@ -46,7 +46,7 @@ var vwea = false; var vclo = false; 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 ftype = ["unknown", "Glider/MotorGlider", "Tow Plane", "Helicopter", "Parachute", "Drop Plane", "Hangglider", "Paraglider", "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 = []; var initialResolution = 2 * Math.PI * 6378137 / 256; // == 156543.0339 From 16174e77ffe2b019177ddc02e7f23c6c1e132707 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 21 Jan 2015 16:31:23 +0100 Subject: [PATCH 3/5] CSS: Remove trailing whitespace --- cunimb.css | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cunimb.css b/cunimb.css index c8593c8..b260a01 100644 --- a/cunimb.css +++ b/cunimb.css @@ -1,12 +1,12 @@ /* - ____ _____ _ _ _ _ _ _ _ - / __ \ / ____| (_) | | | \ | | | | | | + ____ _____ _ _ _ _ _ _ _ + / __ \ / ____| (_) | | | \ | | | | | | | | | |_ __ ___ _ __ | | __| |_ __| | ___ _ __ | \| | ___| |___ _____ _ __| | __ | | | | '_ \ / _ \ '_ \ | | |_ | | |/ _` |/ _ \ '__| | . ` |/ _ \ __\ \ /\ / / _ \| '__| |/ / - | |__| | |_) | __/ | | | | |__| | | | (_| | __/ | | |\ | __/ |_ \ V V / (_) | | | < + | |__| | |_) | __/ | | | | |__| | | | (_| | __/ | | |\ | __/ |_ \ V V / (_) | | | < \____/| .__/ \___|_| |_| \_____|_|_|\__,_|\___|_| |_| \_|\___|\__| \_/\_/ \___/|_| |_|\_\ - | | - |_| + | | + |_| */ html, body { @@ -143,11 +143,11 @@ div.divInfoclass { overflow: hidden; cursor: default; z-index:20; - + } #ett1 { - height:25px; + height:25px; background-color:cyan; } @@ -163,7 +163,7 @@ div.divInfoclass { left: 0px; right: 0px; overflow-y: auto; - overflow-x: hidden; + overflow-x: hidden; } #popup { @@ -181,7 +181,7 @@ div.divInfoclass { overflow:hidden; -moz-border-radius: 20px; -webkit-border-radius: 20px; - border-radius: 20px; + border-radius: 20px; -moz-box-shadow: 20px 20px 10px 0px #656565; -webkit-box-shadow: 20px 20px 10px 0px #656565; -o-box-shadow: 20px 20px 10px 0px #656565; @@ -191,7 +191,7 @@ div.divInfoclass { .tt { border-collapse:collapse; - border-spacing: 0; + border-spacing: 0; } .tt th,td { From 2cb35160646016f1ef390c79a4b958300ce8aa1d Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 21 Jan 2015 16:32:20 +0100 Subject: [PATCH 4/5] CSS: Adjusted indentation --- cunimb.css | 177 +++++++++++++++++++++++++-------------------------- cunimb3d.css | 2 +- 2 files changed, 89 insertions(+), 90 deletions(-) diff --git a/cunimb.css b/cunimb.css index b260a01..fe20a0d 100644 --- a/cunimb.css +++ b/cunimb.css @@ -30,90 +30,90 @@ html, body { } .yel { -background: #FF9; + background: #FF9; } .whi { -background: #FFF; + background: #FFF; } .lright { - border-radius: 10px 0 10px 10px; - top: 45px; - right: 0px; + border-radius: 10px 0 10px 10px; + top: 45px; + right: 0px; } .lleft { - border-radius: 0 10px 10px 10px; - left: 65px; - top: 45px; + border-radius: 0 10px 10px 10px; + left: 65px; + top: 45px; } .acright { - border-radius: 10px 0 0 10px; - top: 45px; - right: 180px; + border-radius: 10px 0 0 10px; + top: 45px; + right: 180px; } .acleft { - border-radius: 0 10px 10px 0; - top: 45px; - left: 245px; + border-radius: 0 10px 10px 0; + top: 45px; + left: 245px; } .pr { - float:right; - } + float:right; +} #ac { - position:absolute; - display: none; - color: black; - background-color: white; - border-color: black; - border-width: 1px; - border-style: solid; - font-family: Arial, Helvetica, sans-serif; - font-size: 13px; - line-height: 15px; - font-weight: bold; - padding: 5px; - z-index:15; + position:absolute; + display: none; + color: black; + background-color: white; + border-color: black; + border-width: 1px; + border-style: solid; + font-family: Arial, Helvetica, sans-serif; + font-size: 13px; + line-height: 15px; + font-weight: bold; + padding: 5px; + z-index:15; } .act { -color: #666; + color: #666; } .aca { -color: #222; + color: #222; } .cgv { - width: 20px; + width: 20px; } .cgn { - width: 45px; - font-family: "Times New Roman", Times, serif; - font-style:normal; - overflow: hidden; + width: 45px; + font-family: "Times New Roman", Times, serif; + font-style:normal; + overflow: hidden; display: inline-block; white-space: nowrap; } .cgc { - width: 9px; + width: 9px; } .cga { - width: 43px; - font-family: "Times New Roman", Times, serif; - font-style:normal; - text-align: right; - overflow: hidden; + width: 43px; + font-family: "Times New Roman", Times, serif; + font-style:normal; + text-align: right; + overflow: hidden; display: inline-block; white-space: nowrap; @@ -132,68 +132,67 @@ div.divInfoclass { } #dlist { - position:absolute; - background-color: white; - color: black; - border-color: black; - border-width: 1px; - border-style: solid; - height: 90%; - width: 180px; - overflow: hidden; - cursor: default; - z-index:20; - + position:absolute; + background-color: white; + color: black; + border-color: black; + border-width: 1px; + border-style: solid; + height: 90%; + width: 180px; + overflow: hidden; + cursor: default; + z-index:20; } #ett1 { - height:25px; - background-color:cyan; + height:25px; + background-color:cyan; } #ett2 { - height:22px; - background-color:white; + height:22px; + background-color:white; } #dtable { - position: absolute; - top: 47px; - bottom: 0px; - left: 0px; - right: 0px; - overflow-y: auto; - overflow-x: hidden; + position: absolute; + top: 47px; + bottom: 0px; + left: 0px; + right: 0px; + overflow-y: auto; + overflow-x: hidden; } #popup { - top:20%; - left: 50%; - margin-left: -150px; - padding:20px; - width: 10px; - height: 10px; - border: 1px solid #000000; - background-color: #FFFFFF; - display:none; - position: fixed; - z-index:99; - overflow:hidden; - -moz-border-radius: 20px; - -webkit-border-radius: 20px; - border-radius: 20px; - -moz-box-shadow: 20px 20px 10px 0px #656565; - -webkit-box-shadow: 20px 20px 10px 0px #656565; - -o-box-shadow: 20px 20px 10px 0px #656565; - box-shadow: 20px 20px 10px 0px #656565; - filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=134, Strength=10); - } + top:20%; + left: 50%; + margin-left: -150px; + padding:20px; + width: 10px; + height: 10px; + border: 1px solid #000000; + background-color: #FFFFFF; + display:none; + position: fixed; + z-index:99; + overflow:hidden; + -moz-border-radius: 20px; + -webkit-border-radius: 20px; + border-radius: 20px; + -moz-box-shadow: 20px 20px 10px 0px #656565; + -webkit-box-shadow: 20px 20px 10px 0px #656565; + -o-box-shadow: 20px 20px 10px 0px #656565; + box-shadow: 20px 20px 10px 0px #656565; + filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=134, Strength=10); +} .tt { - border-collapse:collapse; - border-spacing: 0; + border-collapse:collapse; + border-spacing: 0; } .tt th,td { - padding: 1px; + padding: 1px; } diff --git a/cunimb3d.css b/cunimb3d.css index 6b28ae7..51e9f19 100644 --- a/cunimb3d.css +++ b/cunimb3d.css @@ -187,7 +187,7 @@ div.divInfoclass { -o-box-shadow: 20px 20px 10px 0px #656565; box-shadow: 20px 20px 10px 0px #656565; filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=134, Strength=10); - } +} .tt { From 3961e33155c012f5399660572cd1152a7719875d Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 21 Jan 2015 16:32:53 +0100 Subject: [PATCH 5/5] CSS: Fixed comments // comments are not allowed in CSS, only /* ... */ is valid --- cunimb3d.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cunimb3d.css b/cunimb3d.css index 51e9f19..c7a95ea 100644 --- a/cunimb3d.css +++ b/cunimb3d.css @@ -37,25 +37,25 @@ html, body { } .lright { - // border-radius: 10px 0 10px 10px; + /* border-radius: 10px 0 10px 10px; */ top: 25px; right: 0px; } .lleft { - // border-radius: 0 10px 10px 10px; + /* border-radius: 0 10px 10px 10px; */ left: 75px; top: 35px; } .acright { - // border-radius: 10px 0 0 10px; + /* border-radius: 10px 0 0 10px; */ top: 45px; right: 180px; } .acleft { - // border-radius: 0 10px 10px 0; + /* border-radius: 0 10px 10px 0; */ top: 35px; left: 255px; }