mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-11 19:25:22 +02:00
Version 15.15.1
This commit is contained in:
parent
f26f1533e2
commit
611e835614
42
js/swad.js
42
js/swad.js
|
@ -24,41 +24,25 @@
|
||||||
// Global variable used in refreshConnected()
|
// Global variable used in refreshConnected()
|
||||||
var ActionAJAX;
|
var ActionAJAX;
|
||||||
|
|
||||||
// Global variables used in writeClock()
|
// Global variables used in writeLocalTime()
|
||||||
var IsToday;
|
var secondsSince1970UTC;
|
||||||
var StrToday;
|
|
||||||
var Hour;
|
|
||||||
var Minute;
|
|
||||||
|
|
||||||
// Global variables used in writeClockConnected()
|
// Global variables used in writeClockConnected()
|
||||||
var NumUsrsCon;
|
var NumUsrsCon;
|
||||||
var ListSeconds = new Array();
|
var ListSeconds = new Array();
|
||||||
var countClockConnected = 0;
|
var countClockConnected = 0;
|
||||||
|
|
||||||
// Write a clock updated every minute
|
// Write local date-time updated every minute
|
||||||
// IsToday, StrToday, Hour and Minute are global variables initialized before call this function
|
function writeLocalTime() {
|
||||||
function writeClock() {
|
var d = new Date;
|
||||||
var StrHour = Hour;
|
var PrintableDate;
|
||||||
var StrMinute = Minute;
|
|
||||||
var MidnightExceeded = false;
|
d.setTime(secondsSince1970UTC * 1000);
|
||||||
var PrintableClock;
|
PrintableDate = d.toLocaleDateString() + "<br />" + d.getHours() + ":" + d.getMinutes();
|
||||||
if (Minute < 10)
|
document.getElementById('hm').innerHTML = PrintableDate;
|
||||||
StrMinute = "0" + StrMinute;
|
|
||||||
if (++Minute == 60) {
|
secondsSince1970UTC += 60; // For next call
|
||||||
Minute = 0;
|
setTimeout("writeLocalTime()",60000);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeClockConnected() {
|
function writeClockConnected() {
|
||||||
|
|
|
@ -142,7 +142,7 @@ void Cal_DrawCalendar (void)
|
||||||
/***** Draw several months *****/
|
/***** Draw several months *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"CENTER_TOP\">"
|
"<td class=\"CENTER_TOP\">"
|
||||||
"<table style=\"border-spacing:6px;\">");
|
"<table style=\"margin:0 auto; border-spacing:6px;\">");
|
||||||
for (Row = 0;
|
for (Row = 0;
|
||||||
Row < 4;
|
Row < 4;
|
||||||
Row++)
|
Row++)
|
||||||
|
|
|
@ -107,11 +107,12 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** 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:
|
// 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.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.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.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)
|
Version 15.14.1: Oct 16, 2015 Fixed minor bug in edition of degrees. (186170 lines)
|
||||||
|
|
|
@ -207,11 +207,11 @@ void Con_GetAndShowLastClicks (void)
|
||||||
fprintf (Gbl.F.Out,"<table class=\"TABLE10\">"
|
fprintf (Gbl.F.Out,"<table class=\"TABLE10\">"
|
||||||
"<tr>"
|
"<tr>"
|
||||||
"<th class=\"LEFT_MIDDLE\""
|
"<th class=\"LEFT_MIDDLE\""
|
||||||
" style=\"width:87px;\">"
|
" style=\"width:85px;\">"
|
||||||
"%s" // Click
|
"%s" // Click
|
||||||
"</th>"
|
"</th>"
|
||||||
"<th class=\"LEFT_MIDDLE\""
|
"<th class=\"LEFT_MIDDLE\""
|
||||||
" style=\"width:75px;\">"
|
" style=\"width:70px;\">"
|
||||||
"%s" // Hour
|
"%s" // Hour
|
||||||
"</th>"
|
"</th>"
|
||||||
"<th class=\"LEFT_MIDDLE\""
|
"<th class=\"LEFT_MIDDLE\""
|
||||||
|
@ -223,7 +223,7 @@ void Con_GetAndShowLastClicks (void)
|
||||||
"%s" // Country
|
"%s" // Country
|
||||||
"</th>"
|
"</th>"
|
||||||
"<th class=\"LEFT_MIDDLE\""
|
"<th class=\"LEFT_MIDDLE\""
|
||||||
" style=\"width:100px;\">"
|
" style=\"width:150px;\">"
|
||||||
"%s" // Institution
|
"%s" // Institution
|
||||||
"</th>"
|
"</th>"
|
||||||
"<th class=\"LEFT_MIDDLE\""
|
"<th class=\"LEFT_MIDDLE\""
|
||||||
|
|
24
swad_date.c
24
swad_date.c
|
@ -154,7 +154,7 @@ bool Dat_GetDateTimeFromYYYYMMDDHHMMSS (struct DateTime *DateTime,const char *YY
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Show date ant time ****************************/
|
/***************************** Show date ant time ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
/*
|
||||||
void Dat_ShowCurrentDateTime (void)
|
void Dat_ShowCurrentDateTime (void)
|
||||||
{
|
{
|
||||||
extern const char *The_ClassCurrentTime[The_NUM_THEMES];
|
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],
|
Txt_MONTHS_SMALL_SHORT[Gbl.Now.Date.Month-1],
|
||||||
Gbl.Now.Time.Hour,Gbl.Now.Time.Minute);
|
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 *****************/
|
/***************** Compute local time, adjusting day of week *****************/
|
||||||
|
|
|
@ -533,22 +533,15 @@ static void Lay_WriteScripts (void)
|
||||||
|
|
||||||
static void Lay_WriteScriptInit (void)
|
static void Lay_WriteScriptInit (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_MONTHS_SMALL_SHORT[12];
|
|
||||||
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");
|
"function init(){\n");
|
||||||
|
|
||||||
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) // Clock visible
|
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) // Clock visible
|
||||||
fprintf (Gbl.F.Out," IsToday = true;\n"
|
fprintf (Gbl.F.Out," secondsSince1970UTC = %ld;\n"
|
||||||
" StrToday = \"%u %s\";\n"
|
" writeLocalTime();",
|
||||||
" Hour = %u;\n"
|
(long) Gbl.TimeStartExecution);
|
||||||
" 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);
|
|
||||||
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user