From 862e72b9215429b04f7724ff0111491c984860d0 Mon Sep 17 00:00:00 2001 From: eddyem Date: Thu, 22 Sep 2016 17:52:37 +0300 Subject: [PATCH] little fix --- BTApanels/SAO.js | 1 - BTApanels/panels.js | 13 +++++++------ BTApanels/weather.html | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/BTApanels/SAO.js b/BTApanels/SAO.js index b5b7a6d..521f237 100644 --- a/BTApanels/SAO.js +++ b/BTApanels/SAO.js @@ -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"); diff --git a/BTApanels/panels.js b/BTApanels/panels.js index 1b1241d..a515aee 100644 --- a/BTApanels/panels.js +++ b/BTApanels/panels.js @@ -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+"
"+_2(now.getHours())+":"+_2(now.getMinutes())+"
("+str+" ago)"; if(Gtime >= 60) Gust.className = "border"; diff --git a/BTApanels/weather.html b/BTApanels/weather.html index da5b3ae..aa81809 100644 --- a/BTApanels/weather.html +++ b/BTApanels/weather.html @@ -46,8 +46,8 @@ -
Sun
-
? ()
+
Sun altitude
+
? ()
Moon
A=?, Z=?
Temp. difference