Version 21.67.4: Dec 07, 2021 Fixed bug in CSS for photos. Reported by Cristina Sánchez Justicia.

This commit is contained in:
acanas 2021-12-08 11:25:40 +01:00
parent fd71489d1c
commit 52b67d237a
4 changed files with 30 additions and 28 deletions

View File

@ -94,18 +94,14 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,Language,
WriteToday,WriteDateOnSameDay,WriteWeekDay,WriteHMS) { WriteToday,WriteDateOnSameDay,WriteWeekDay,WriteHMS) {
// HMS: Hour, Minutes, Seconds // HMS: Hour, Minutes, Seconds
var today = new Date(); var today = new Date();
var todayYea = today.getFullYear(); var todayYea = today.getFullYear ();
var todayMon = today.getMonth() + 1; var todayMon = today.getMonth () + 1;
var todayDay = today.getDate(); var todayDay = today.getDate ();
var d = new Date(); var d = new Date();
var WriteDate; var WriteDate;
var Yea; var Yea,Mon,Day;
var Mon;
var Day;
var DayOfWeek; var DayOfWeek;
var Hou; var Hou,Min,Sec;
var Min;
var Sec;
var StrDat; var StrDat;
var StrMon; var StrMon;
var StrDay; var StrDay;
@ -113,21 +109,22 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,Language,
var StrMin; var StrMin;
var StrSec; var StrSec;
d.setTime(TimeUTC * 1000); d.setTime (TimeUTC * 1000);
Yea = d.getFullYear(); Yea = d.getFullYear ();
Mon = d.getMonth() + 1; Mon = d.getMonth () + 1;
Day = d.getDate(); Day = d.getDate ();
if (WriteDateOnSameDay) if (WriteDateOnSameDay)
WriteDate = true; WriteDate = true;
// Check to see if the last date has been initialized // Check to see if the last date has been initialized
else if (typeof writeLocalDateHMSFromUTC.lastd == 'undefined') // Static variable to remember current date for the next call else if (typeof writeLocalDateHMSFromUTC.lastd == 'undefined')
// lastd: static variable to remember current date for the next call
// Not initialized // Not initialized
WriteDate = true; WriteDate = true;
else else
WriteDate = (Yea != writeLocalDateHMSFromUTC.lastd.getFullYear() || WriteDate = (Yea != writeLocalDateHMSFromUTC.lastd.getFullYear () ||
Mon != writeLocalDateHMSFromUTC.lastd.getMonth() + 1 || Mon != writeLocalDateHMSFromUTC.lastd.getMonth () + 1 ||
Day != writeLocalDateHMSFromUTC.lastd.getDate()) Day != writeLocalDateHMSFromUTC.lastd.getDate ());
writeLocalDateHMSFromUTC.lastd = d; // Update last date for the next call writeLocalDateHMSFromUTC.lastd = d; // Update last date for the next call
@ -144,13 +141,17 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,Language,
case 0: // Dat_FORMAT_YYYY_MM_DD case 0: // Dat_FORMAT_YYYY_MM_DD
StrMon = ((Mon < 10) ? '0' : '') + Mon; StrMon = ((Mon < 10) ? '0' : '') + Mon;
StrDay = ((Day < 10) ? '0' : '') + Day; StrDay = ((Day < 10) ? '0' : '') + Day;
StrDat = Yea.toString() + '-' + StrMon + '-' + StrDay; StrDat = Yea.toString () + '-' + StrMon + '-' + StrDay;
break; break;
case 1: // Dat_FORMAT_DD_MONTH_YYYY case 1: // Dat_FORMAT_DD_MONTH_YYYY
StrDat = Day.toString() + '&nbsp;' + MonthsShort[Mon - 1] + '&nbsp;' + Yea.toString(); StrDat = Day.toString () + '&nbsp;' +
MonthsShort[Mon - 1] + '&nbsp;' +
Yea.toString ();
break; break;
case 2: // Dat_FORMAT_MONTH_DD_YYYY case 2: // Dat_FORMAT_MONTH_DD_YYYY
StrDat = MonthsShort[Mon - 1] + '&nbsp;' + Day.toString() + ',&nbsp;' + Yea.toString(); StrDat = MonthsShort[Mon - 1] + '&nbsp;' +
Day.toString() + ',&nbsp;' +
Yea.toString ();
break; break;
default: default:
break; break;
@ -174,18 +175,18 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,Language,
StrHou = ((Hou < 10) ? '0' : '') + Hou; StrHou = ((Hou < 10) ? '0' : '') + Hou;
if (WriteHMS & (1<<1)) { if (WriteHMS & (1<<1)) {
// Bits 2,1 on => Write minutes // Bits 2,1 on => Write minutes
Min = d.getMinutes(); Min = d.getMinutes ();
StrMin = ((Min < 10) ? ':0' : ':') + Min; StrMin = ((Min < 10) ? ':0' : ':') + Min;
if (WriteHMS & 1) { if (WriteHMS & 1) {
// Bits 2,1,0 on => Write seconds // Bits 2,1,0 on => Write seconds
Sec = d.getSeconds(); Sec = d.getSeconds ();
StrSec = ((Sec < 10) ? ':0' : ':') + Sec; StrSec = ((Sec < 10) ? ':0' : ':') + Sec;
} }
} }
} }
/* Write date and time */ /* Write date and time */
document.getElementById(id).innerHTML = StrDat + StrHou + StrMin + StrSec; document.getElementById (id).innerHTML = StrDat + StrHou + StrMin + StrSec;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1243,7 +1244,7 @@ function mediaClickOnActivateUpload (id) {
var url = document.getElementById (id + '_url'); var url = document.getElementById (id + '_url');
var tit = document.getElementById (id + '_tit'); var tit = document.getElementById (id + '_tit');
// Enable embed, disable others // Enable upload, disable others
par_upl.disabled = false; // Enable upload par_upl.disabled = false; // Enable upload
par_you.disabled = true; // Disable youtube par_you.disabled = true; // Disable youtube
par_emb.disabled = true; // Disable embed par_emb.disabled = true; // Disable embed

View File

@ -602,10 +602,11 @@ TODO: FIX BUG, URGENT! En las fechas como par
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/ */
#define Log_PLATFORM_VERSION "SWAD 21.67.3 (2021-12-04)" #define Log_PLATFORM_VERSION "SWAD 21.67.4 (2021-12-07)"
#define CSS_FILE "swad21.67.css" #define CSS_FILE "swad21.67.4.css"
#define JS_FILE "swad21.67.js" #define JS_FILE "swad21.67.4.js"
/* /*
Version 21.67.4: Dec 07, 2021 Fixed bug in CSS for photos. Reported by Cristina Sánchez Justicia. (320339 lines)
Version 21.67.3: Dec 04, 2021 Help about user photo shapes. (320337 lines) Version 21.67.3: Dec 04, 2021 Help about user photo shapes. (320337 lines)
Version 21.67.2: Dec 04, 2021 Renamed exam announcements to calls for exams in help wiki. (320316 lines) Version 21.67.2: Dec 04, 2021 Renamed exam announcements to calls for exams in help wiki. (320316 lines)
Version 21.67.1: Dec 04, 2021 Renamed CENTRE to CENTER in help wiki. (320316 lines) Version 21.67.1: Dec 04, 2021 Renamed CENTRE to CENTER in help wiki. (320316 lines)

View File

@ -1303,7 +1303,7 @@ static void Prf_ShowUsrInRanking (struct UsrData *UsrDat,unsigned Rank,bool ItsM
{ {
[Pho_SHAPE_CIRCLE ] = "PHOTOC30x40", [Pho_SHAPE_CIRCLE ] = "PHOTOC30x40",
[Pho_SHAPE_ELLIPSE ] = "PHOTOE30x40", [Pho_SHAPE_ELLIPSE ] = "PHOTOE30x40",
[Pho_SHAPE_OVAL ] = "PHOTOO30x48", [Pho_SHAPE_OVAL ] = "PHOTOO30x40",
[Pho_SHAPE_RECTANGLE] = "PHOTOR30x40", [Pho_SHAPE_RECTANGLE] = "PHOTOR30x40",
}; };
bool Visible = Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat); bool Visible = Pri_ShowingIsAllowed (UsrDat->BaPrfVisibility,UsrDat);