yWeb: move some js-functions directly to Y_NI_About.yhtm

Origin commit data
------------------
Branch: ni/coolstream
Commit: cd9294bf14
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-02-20 (Mon, 20 Feb 2023)

Origin message was:
------------------
- yWeb: move some js-functions directly to Y_NI_About.yhtm

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2023-02-20 20:47:53 +01:00
parent cec69d5c86
commit 68b4ee95bb
3 changed files with 73 additions and 73 deletions

View File

@@ -20,6 +20,78 @@
{=var-set:boxmodel={=func:get_boxmodel=}=}
<script>
// taken from http://www.jjam.de/JavaScript/Datum_Uhrzeit/Wochentag.html
function getWeekDay(dd,mm,yyyy) {
var month = "312831303130313130313031";
var days = (yyyy-1)*365 + (dd-1);
for(var i=0;i<mm-1;i++) days += month.substr(i*2,2)*1;
if(yyyy>1582 || yyyy==1582 && (mm>10 || mm==10 && dd >4)) days -= 10;
var leapyears = Math.floor(yyyy / 4);
if(yyyy%4==0 && mm<3) leapyears--;
if(yyyy>=1600) {
leapyears -= Math.floor((yyyy-1600) / 100);
leapyears += Math.floor((yyyy-1600) / 400);
if(yyyy%100==0 && mm<3) {
leapyears++;
if(yyyy%400==0) leapyears--;
}
}
days += leapyears;
return "SatSonMonThuWedThuFri".substr(days%7*3,3);
}
function compareVersion(_vi, _vo)
{
if (_vi == "" || _vo == "") return;
if (_vi >= _vo) jQuery(document).ready(function(){jQuery('.upd_no').show().css('color', '#c0c0c0')});
else jQuery(document).ready(function(){jQuery('.upd_yes').show().css('color', '#008000')});
}
function getVersion(_version)
{
if (_version == "") return;
var Vmajor = _version.substr(1, 1);
var Vminor = _version.substr(2, 2);
document.write(Vmajor + "." + Vminor);
}
function getBuild(_version)
{
if (_version == "") return;
var month=new Array(13);
month[0]="";
month[1]="Jan";
month[2]="Feb";
month[3]="Mar";
month[4]="Apr";
month[5]="May";
month[6]="Jun";
month[7]="Jul";
month[8]="Aug";
month[9]="Sep";
month[10]="Oct";
month[11]="Nov";
month[12]="Dec";
var Byear = _version.substr(4, 4);
var Bmonth = _version.substr(8, 2).replace( /^(0+)/g, '' );
var Bday = _version.substr(10, 2);
var Bhour = _version.substr(12, 2);
var Bmin = _version.substr(14, 2);
document.write(getWeekDay(Bday,Bmonth,Byear) + " " + month[Bmonth] + " " + Bday + " " + Bhour + ":" + Bmin + " CEST " + Byear);
}
function get_update_txt()
{
//show_waitbox(true);
loadSyncURL("/control/exec?Y_NI_Tools&get_update_txt");
window.document.location.href="/Y_NI_About.yhtm?ani=false";
}
jQuery(document).ready(function(){
if ("{=ani=}" == "false")
{

View File

@@ -35,75 +35,3 @@ function Y_NI_Tools(_cmd, _tout){
window.setTimeout("document.location.reload()", _tout);
}
}
// taken from http://www.jjam.de/JavaScript/Datum_Uhrzeit/Wochentag.html
function getWeekDay(dd,mm,yyyy) {
var month = "312831303130313130313031";
var days = (yyyy-1)*365 + (dd-1);
for(var i=0;i<mm-1;i++) days += month.substr(i*2,2)*1;
if(yyyy>1582 || yyyy==1582 && (mm>10 || mm==10 && dd >4)) days -= 10;
var leapyears = Math.floor(yyyy / 4);
if(yyyy%4==0 && mm<3) leapyears--;
if(yyyy>=1600) {
leapyears -= Math.floor((yyyy-1600) / 100);
leapyears += Math.floor((yyyy-1600) / 400);
if(yyyy%100==0 && mm<3) {
leapyears++;
if(yyyy%400==0) leapyears--;
}
}
days += leapyears;
return "SatSonMonThuWedThuFri".substr(days%7*3,3);
}
function compareVersion(_vi, _vo)
{
if (_vi == "" || _vo == "") return;
if (_vi >= _vo) jQuery(document).ready(function(){jQuery('.upd_no').show().css('color', '#c0c0c0')});
else jQuery(document).ready(function(){jQuery('.upd_yes').show().css('color', '#008000')});
}
function getVersion(_version)
{
if (_version == "") return;
var Vmajor = _version.substr(1, 1);
var Vminor = _version.substr(2, 2);
document.write(Vmajor + "." + Vminor);
}
function getBuild(_version)
{
if (_version == "") return;
var month=new Array(13);
month[0]="";
month[1]="Jan";
month[2]="Feb";
month[3]="Mar";
month[4]="Apr";
month[5]="May";
month[6]="Jun";
month[7]="Jul";
month[8]="Aug";
month[9]="Sep";
month[10]="Oct";
month[11]="Nov";
month[12]="Dec";
var Byear = _version.substr(4, 4);
var Bmonth = _version.substr(8, 2).replace( /^(0+)/g, '' );
var Bday = _version.substr(10, 2);
var Bhour = _version.substr(12, 2);
var Bmin = _version.substr(14, 2);
document.write(getWeekDay(Bday,Bmonth,Byear) + " " + month[Bmonth] + " " + Bday + " " + Bhour + ":" + Bmin + " CEST " + Byear);
}
function get_update_txt()
{
//show_waitbox(true);
loadSyncURL("/control/exec?Y_NI_Tools&get_update_txt");
window.document.location.href="/Y_NI_About.yhtm?ani=false";
}

View File

@@ -1,3 +1,3 @@
version=3.0.38
version=3.0.39
date=20.02.2023
info=NI-Neutrino-Webinterface