mirror of
https://github.com/eddyem/bta-panels.git
synced 2025-12-06 10:45:20 +03:00
little fix
This commit is contained in:
parent
c086eaa7b1
commit
862e72b921
@ -33,7 +33,6 @@ globCalc = function(){
|
|||||||
chval('MoonA', Math.round(MoonPos.azimuth) + "°");
|
chval('MoonA', Math.round(MoonPos.azimuth) + "°");
|
||||||
chval('MoonZ', Math.round(MoonPos.zenith) + "°");
|
chval('MoonZ', Math.round(MoonPos.zenith) + "°");
|
||||||
// astronomical twilight
|
// astronomical twilight
|
||||||
alt *= _2deg;
|
|
||||||
if(alt < -18) chvalcls('daytime', "night", "Black");
|
if(alt < -18) chvalcls('daytime', "night", "Black");
|
||||||
else if(alt < -12) chvalcls('daytime', "astronomical twilight", "Gray");
|
else if(alt < -12) chvalcls('daytime', "astronomical twilight", "Gray");
|
||||||
else if(alt < -6) chvalcls('daytime', "nautical twilight", "LGray");
|
else if(alt < -6) chvalcls('daytime', "nautical twilight", "LGray");
|
||||||
|
|||||||
@ -51,11 +51,12 @@ return{
|
|||||||
|
|
||||||
function checkStorage(){
|
function checkStorage(){
|
||||||
if(Storage) return;
|
if(Storage) return;
|
||||||
var ret = localCookies;
|
var ret;
|
||||||
try{
|
try{
|
||||||
ret = localStorage;
|
ret = localStorage;
|
||||||
} catch(e){
|
} catch(e){
|
||||||
console.log(e);
|
console.log("Can't get localstorage! " + e);
|
||||||
|
ret = localCookies;
|
||||||
}
|
}
|
||||||
Storage = ret;
|
Storage = ret;
|
||||||
}
|
}
|
||||||
@ -69,10 +70,10 @@ function LoadObject(nm, defval){
|
|||||||
var val = null;
|
var val = null;
|
||||||
try{
|
try{
|
||||||
var X = Storage.getItem(nm);
|
var X = Storage.getItem(nm);
|
||||||
tlog(X);
|
tlog("Storage:" + X);
|
||||||
val = JSON.parse(X);
|
val = JSON.parse(X);
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.log(e);
|
console.log("Nothing in storage! " +e);
|
||||||
}
|
}
|
||||||
if(val == null && typeof(defval) != "undefined"){
|
if(val == null && typeof(defval) != "undefined"){
|
||||||
tlog("Can't load object, try to use defaults");
|
tlog("Can't load object, try to use defaults");
|
||||||
@ -361,7 +362,7 @@ function showGustTime(){
|
|||||||
var Gust = $('Gust');
|
var Gust = $('Gust');
|
||||||
var Gtime = Number(Blast15);
|
var Gtime = Number(Blast15);
|
||||||
var pref = ">=15 m/s";
|
var pref = ">=15 m/s";
|
||||||
if (Gtime > 1440){
|
if (Gtime > 60){
|
||||||
var G10 = Number(Blast10);
|
var G10 = Number(Blast10);
|
||||||
if(G10 < 1440){
|
if(G10 < 1440){
|
||||||
pref = ">=10 m/s";
|
pref = ">=10 m/s";
|
||||||
@ -374,7 +375,7 @@ function showGustTime(){
|
|||||||
var now = new Date();
|
var now = new Date();
|
||||||
var h = Math.floor(Gtime/60);
|
var h = Math.floor(Gtime/60);
|
||||||
now.setTime(MskTime.getTime() - Gtime * 60000);
|
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");
|
_2(h)+"h "+_2(Gtime%h)+"m");
|
||||||
Gust.innerHTML = pref+"<br>"+_2(now.getHours())+":"+_2(now.getMinutes())+"<br>("+str+" ago)";
|
Gust.innerHTML = pref+"<br>"+_2(now.getHours())+":"+_2(now.getMinutes())+"<br>("+str+" ago)";
|
||||||
if(Gtime >= 60) Gust.className = "border";
|
if(Gtime >= 60) Gust.className = "border";
|
||||||
|
|||||||
@ -46,8 +46,8 @@
|
|||||||
<img width="100%" id="seeing">
|
<img width="100%" id="seeing">
|
||||||
</td>
|
</td>
|
||||||
<td class="border" width="150px">
|
<td class="border" width="150px">
|
||||||
<div class="label">Sun</div>
|
<div class="label">Sun altitude</div>
|
||||||
<div class="border" id="Sun" style="font-size: 12pt;"><span id="SunH">?</span> (<span id="daytime"></span>)</div>
|
<div class="border" id="Sun"><span id="SunH">?</span> (<span id="daytime"></span>)</div>
|
||||||
<div class="label">Moon</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="border" style="font-size: 12pt;">A=<span id="MoonA">?</span>, Z=<span id="MoonZ">?</span></div>
|
||||||
<div class="label">Temp. difference</div>
|
<div class="label">Temp. difference</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user