Version 15.15.1

This commit is contained in:
Antonio Cañas Vargas 2015-10-21 19:53:35 +02:00
parent f26f1533e2
commit 611e835614
6 changed files with 45 additions and 45 deletions

View File

@ -24,41 +24,25 @@
// Global variable used in refreshConnected()
var ActionAJAX;
// Global variables used in writeClock()
var IsToday;
var StrToday;
var Hour;
var Minute;
// Global variables used in writeLocalTime()
var secondsSince1970UTC;
// Global variables used in writeClockConnected()
var NumUsrsCon;
var ListSeconds = new Array();
var countClockConnected = 0;
// Write a clock updated every minute
// IsToday, StrToday, Hour and Minute are global variables initialized before call this function
function writeClock() {
var StrHour = Hour;
var StrMinute = Minute;
var MidnightExceeded = false;
var PrintableClock;
if (Minute < 10)
StrMinute = "0" + StrMinute;
if (++Minute == 60) {
Minute = 0;
if (++Hour == 24) {
Hour = 0;
MidnightExceeded = true;
}
}
if (IsToday)
PrintableClock = StrToday + ", " + StrHour + ":" + StrMinute;
else
PrintableClock = StrHour + ":" + StrMinute;
if (MidnightExceeded)
IsToday = false; // For next call
document.getElementById('hm').innerHTML = PrintableClock;
setTimeout("writeClock()",60000);
// Write local date-time updated every minute
function writeLocalTime() {
var d = new Date;
var PrintableDate;
d.setTime(secondsSince1970UTC * 1000);
PrintableDate = d.toLocaleDateString() + "<br />" + d.getHours() + ":" + d.getMinutes();
document.getElementById('hm').innerHTML = PrintableDate;
secondsSince1970UTC += 60; // For next call
setTimeout("writeLocalTime()",60000);
}
function writeClockConnected() {

View File

@ -142,7 +142,7 @@ void Cal_DrawCalendar (void)
/***** Draw several months *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"CENTER_TOP\">"
"<table style=\"border-spacing:6px;\">");
"<table style=\"margin:0 auto; border-spacing:6px;\">");
for (Row = 0;
Row < 4;
Row++)

View File

@ -107,11 +107,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.15 (2015/10/19)"
#define Log_PLATFORM_VERSION "SWAD 15.15.1 (2015/10/21)"
// 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
/*
Version 15.15.1: Oct 21, 2015 Top-left date-time is now displayed in local time. (186249 lines)
Version 15.15: Oct 19, 2015 Statistic figure about institutions can be displayed as a class photo or as a list. (186251 lines)
Version 15.14.2: Oct 16, 2015 Minor changes in layout. (186166 lines)
Version 15.14.1: Oct 16, 2015 Fixed minor bug in edition of degrees. (186170 lines)

View File

@ -207,11 +207,11 @@ void Con_GetAndShowLastClicks (void)
fprintf (Gbl.F.Out,"<table class=\"TABLE10\">"
"<tr>"
"<th class=\"LEFT_MIDDLE\""
" style=\"width:87px;\">"
" style=\"width:85px;\">"
"%s" // Click
"</th>"
"<th class=\"LEFT_MIDDLE\""
" style=\"width:75px;\">"
" style=\"width:70px;\">"
"%s" // Hour
"</th>"
"<th class=\"LEFT_MIDDLE\""
@ -223,7 +223,7 @@ void Con_GetAndShowLastClicks (void)
"%s" // Country
"</th>"
"<th class=\"LEFT_MIDDLE\""
" style=\"width:100px;\">"
" style=\"width:150px;\">"
"%s" // Institution
"</th>"
"<th class=\"LEFT_MIDDLE\""

View File

@ -154,7 +154,7 @@ bool Dat_GetDateTimeFromYYYYMMDDHHMMSS (struct DateTime *DateTime,const char *YY
/*****************************************************************************/
/***************************** Show date ant time ****************************/
/*****************************************************************************/
/*
void Dat_ShowCurrentDateTime (void)
{
extern const char *The_ClassCurrentTime[The_NUM_THEMES];
@ -169,6 +169,28 @@ void Dat_ShowCurrentDateTime (void)
Txt_MONTHS_SMALL_SHORT[Gbl.Now.Date.Month-1],
Gbl.Now.Time.Hour,Gbl.Now.Time.Minute);
}
*/
/*****************************************************************************/
/***************************** Show date ant time ****************************/
/*****************************************************************************/
void Dat_ShowCurrentDateTime (void)
{
extern const char *The_ClassCurrentTime[The_NUM_THEMES];
/*
<script type="text/javascript">
function localize(t)
{
var d=new Date(t+" UTC");
document.write(d.toString());
}
</script>
*/
fprintf (Gbl.F.Out,"<div id=\"hm\" class=\"%s\""
" style=\"padding-top:10px;\">"
"</div>",
The_ClassCurrentTime[Gbl.Prefs.Theme]);
}
/*****************************************************************************/
/***************** Compute local time, adjusting day of week *****************/

View File

@ -533,22 +533,15 @@ static void Lay_WriteScripts (void)
static void Lay_WriteScriptInit (void)
{
extern const char *Txt_MONTHS_SMALL_SHORT[12];
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n"
"function init(){\n");
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) // Clock visible
fprintf (Gbl.F.Out," IsToday = true;\n"
" StrToday = \"%u %s\";\n"
" Hour = %u;\n"
" Minute = %u;\n"
" writeClock();\n",
Gbl.Now.Date.Day,
Txt_MONTHS_SMALL_SHORT[Gbl.Now.Date.Month - 1],
Gbl.Now.Time.Hour,
Gbl.Now.Time.Minute);
fprintf (Gbl.F.Out," secondsSince1970UTC = %ld;\n"
" writeLocalTime();",
(long) Gbl.TimeStartExecution);
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
(Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible