Version 15.25.4

This commit is contained in:
Antonio Cañas Vargas 2015-10-27 19:44:31 +01:00
parent 4b14fb8722
commit 2ae53c304a
5 changed files with 43 additions and 11 deletions

View File

@ -29,7 +29,7 @@ var secondsSince1970UTC;
// Global variables used in writeClockConnected() // Global variables used in writeClockConnected()
var NumUsrsCon; var NumUsrsCon;
var ListSeconds = new Array(); var ListSeconds = [];
var countClockConnected = 0; var countClockConnected = 0;
// Write a date in client local time // Write a date in client local time
@ -254,9 +254,11 @@ function setDateTo (Yea,Mon,Day) {
// Write clock in client local time updated every minute // Write clock in client local time updated every minute
function writeLocalClock() { function writeLocalClock() {
var d; var d;
var H; var Mon;
var M; var Day;
var StrM; var Hou;
var Min;
var StrMin;
setTimeout('writeLocalClock()',60000); setTimeout('writeLocalClock()',60000);
@ -264,10 +266,12 @@ function writeLocalClock() {
d.setTime(secondsSince1970UTC * 1000); d.setTime(secondsSince1970UTC * 1000);
secondsSince1970UTC += 60; // For next call secondsSince1970UTC += 60; // For next call
H = d.getHours(); Mon = d.getMonth();
M = d.getMinutes(); Day = d.getDate();
StrM = ((M < 10) ? '0' : '') + M; Hou = d.getHours();
document.getElementById('hm').innerHTML = H + ':' + StrM; Min = d.getMinutes();
StrMin = ((Min < 10) ? '0' : '') + Min;
document.getElementById('hm').innerHTML = Day + ' ' + Months[Mon] + ', ' + Hou + ':' + StrMin;
} }
function writeClockConnected() { function writeClockConnected() {

View File

@ -108,11 +108,12 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.25.3 (2015/10/27)" #define Log_PLATFORM_VERSION "SWAD 15.25.4 (2015/10/27)"
// Number of lines (includes comments but not blank lines) has been got with the following command: // Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.25.4: Oct 27, 2015 Day and month are displayed in clock. (186251 lines)
Version 15.25.3: Oct 27, 2015 Statistics computed using time UTC. (186225 lines) Version 15.25.3: Oct 27, 2015 Statistics computed using time UTC. (186225 lines)
Version 15.25.2: Oct 26, 2015 Changes related to date-times. (186247 lines) Version 15.25.2: Oct 26, 2015 Changes related to date-times. (186247 lines)
Version 15.25.1: Oct 26, 2015 Warning about stats computed in server time instead of user's local time. (186263 lines) Version 15.25.1: Oct 26, 2015 Warning about stats computed in server time instead of user's local time. (186263 lines)

View File

@ -977,3 +977,24 @@ void Dat_AssignDate (struct Date *DateDst,struct Date *DateSrc)
DateDst->Day = DateSrc->Day; DateDst->Day = DateSrc->Day;
DateDst->Week = DateSrc->Week; DateDst->Week = DateSrc->Week;
} }
/*****************************************************************************/
/****** Write script to automatically update clocks of connected users *******/
/*****************************************************************************/
void Dat_WriteScriptMonths (void)
{
extern const char *Txt_MONTHS_SMALL_SHORT[12];
unsigned NumMonth;
fprintf (Gbl.F.Out,"var Months = [");
for (NumMonth = 0;
NumMonth < 12;
NumMonth++)
{
if (NumMonth)
fprintf (Gbl.F.Out,",");
fprintf (Gbl.F.Out,"'%s'",Txt_MONTHS_SMALL_SHORT[NumMonth]);
}
fprintf (Gbl.F.Out,"];\n");
}

View File

@ -113,4 +113,6 @@ unsigned Dat_GetDayOfYear (struct Date *Date);
void Dat_CalculateWeekOfYear (struct Date *Date); void Dat_CalculateWeekOfYear (struct Date *Date);
void Dat_AssignDate (struct Date *DateDst,struct Date *DateSrc); void Dat_AssignDate (struct Date *DateDst,struct Date *DateSrc);
void Dat_WriteScriptMonths (void);
#endif #endif

View File

@ -535,8 +535,12 @@ static void Lay_WriteScriptInit (void)
{ {
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n" fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
"function init(){\n");
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP)
Dat_WriteScriptMonths ();
fprintf (Gbl.F.Out,"function init(){\n");
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP && if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
(Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible