little fix

This commit is contained in:
eddyem 2016-09-22 17:52:37 +03:00
parent c086eaa7b1
commit 862e72b921
3 changed files with 9 additions and 9 deletions

View File

@ -33,7 +33,6 @@ globCalc = function(){
chval('MoonA', Math.round(MoonPos.azimuth) + "°");
chval('MoonZ', Math.round(MoonPos.zenith) + "°");
// astronomical twilight
alt *= _2deg;
if(alt < -18) chvalcls('daytime', "night", "Black");
else if(alt < -12) chvalcls('daytime', "astronomical twilight", "Gray");
else if(alt < -6) chvalcls('daytime', "nautical twilight", "LGray");

View File

@ -51,11 +51,12 @@ return{
function checkStorage(){
if(Storage) return;
var ret = localCookies;
var ret;
try{
ret = localStorage;
} catch(e){
console.log(e);
console.log("Can't get localstorage! " + e);
ret = localCookies;
}
Storage = ret;
}
@ -69,10 +70,10 @@ function LoadObject(nm, defval){
var val = null;
try{
var X = Storage.getItem(nm);
tlog(X);
tlog("Storage:" + X);
val = JSON.parse(X);
}catch(e){
console.log(e);
console.log("Nothing in storage! " +e);
}
if(val == null && typeof(defval) != "undefined"){
tlog("Can't load object, try to use defaults");
@ -361,7 +362,7 @@ function showGustTime(){
var Gust = $('Gust');
var Gtime = Number(Blast15);
var pref = ">=15 m/s";
if (Gtime > 1440){
if (Gtime > 60){
var G10 = Number(Blast10);
if(G10 < 1440){
pref = ">=10 m/s";
@ -374,7 +375,7 @@ function showGustTime(){
var now = new Date();
var h = Math.floor(Gtime/60);
now.setTime(MskTime.getTime() - Gtime * 60000);
var str = (Gtime < 1) ? _2(Gtime)+"s" : ((Gtime < 60)? _2(Gtime)+"m" :
var str = (Gtime < 1) ? _2(Gtime*60)+"s" : ((Gtime < 60)? _2(Gtime)+"m" :
_2(h)+"h "+_2(Gtime%h)+"m");
Gust.innerHTML = pref+"<br>"+_2(now.getHours())+":"+_2(now.getMinutes())+"<br>("+str+" ago)";
if(Gtime >= 60) Gust.className = "border";

View File

@ -46,8 +46,8 @@
<img width="100%" id="seeing">
</td>
<td class="border" width="150px">
<div class="label">Sun</div>
<div class="border" id="Sun" style="font-size: 12pt;"><span id="SunH">?</span> (<span id="daytime"></span>)</div>
<div class="label">Sun altitude</div>
<div class="border" id="Sun"><span id="SunH">?</span> (<span id="daytime"></span>)</div>
<div class="label">Moon</div>
<div class="border" style="font-size: 12pt;">A=<span id="MoonA">?</span>, Z=<span id="MoonZ">?</span></div>
<div class="label">Temp. difference</div>