mirror of
https://github.com/acanas/swad-core.git
synced 2024-07-01 04:45:54 +02:00
Version18.74.4
This commit is contained in:
parent
98782055b1
commit
4b602e2f83
|
@ -550,36 +550,36 @@ function readLastClicksData () {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**** Automatic refresh of new publishings in social timeline using AJAX *****/
|
/**** Automatic refresh of new publications in social timeline using AJAX ****/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
// This function must be called from time to time
|
// This function must be called from time to time
|
||||||
var objXMLHttpReqSoc = false;
|
var objXMLHttpReqNewTL = false;
|
||||||
function refreshNewTimeline () {
|
function refreshNewTimeline () {
|
||||||
objXMLHttpReqSoc = AJAXCreateObject();
|
objXMLHttpReqNewTL = AJAXCreateObject();
|
||||||
if (objXMLHttpReqSoc) {
|
if (objXMLHttpReqNewTL) {
|
||||||
var RefreshParams = RefreshParamNxtActNewPub + '&' +
|
var RefreshParams = RefreshParamNxtActNewPub + '&' +
|
||||||
RefreshParamIdSes + '&' +
|
RefreshParamIdSes + '&' +
|
||||||
RefreshParamWhichUsrs;
|
RefreshParamWhichUsrs;
|
||||||
|
|
||||||
objXMLHttpReqSoc.onreadystatechange = readNewTimelineData; // onreadystatechange must be lowercase
|
objXMLHttpReqNewTL.onreadystatechange = readNewTimelineData; // onreadystatechange must be lowercase
|
||||||
objXMLHttpReqSoc.open('POST',ActionAJAX,true);
|
objXMLHttpReqNewTL.open('POST',ActionAJAX,true);
|
||||||
objXMLHttpReqSoc.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
objXMLHttpReqNewTL.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||||
objXMLHttpReqSoc.send(RefreshParams);
|
objXMLHttpReqNewTL.send(RefreshParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receives and show new social timeline data
|
// Receives and show new social timeline data
|
||||||
function readNewTimelineData () {
|
function readNewTimelineData () {
|
||||||
if (objXMLHttpReqSoc.readyState == 4) { // Check if data have been received
|
if (objXMLHttpReqNewTL.readyState == 4) { // Check if data have been received
|
||||||
if (objXMLHttpReqSoc.status == 200) {
|
if (objXMLHttpReqNewTL.status == 200) {
|
||||||
var endOfDelay = objXMLHttpReqSoc.responseText.indexOf('|',0); // Get separator position
|
var endOfDelay = objXMLHttpReqNewTL.responseText.indexOf('|',0); // Get separator position
|
||||||
var delay = parseInt(objXMLHttpReqSoc.responseText.substring(0,endOfDelay)); // Get refresh delay
|
var delay = parseInt(objXMLHttpReqNewTL.responseText.substring(0,endOfDelay)); // Get refresh delay
|
||||||
var htmlJustNowTimeline = objXMLHttpReqSoc.responseText.substring(endOfDelay + 1); // Get HTML code for social timeline
|
var htmlJustNowTimeline = objXMLHttpReqNewTL.responseText.substring(endOfDelay + 1); // Get HTML code for timeline
|
||||||
|
|
||||||
var justNowTimeline = document.getElementById('just_now_timeline_list');// Access to UL for the just received timeline
|
var justNowTimeline = document.getElementById('just_now_timeline_list');// Access to UL for the just received timeline
|
||||||
if (justNowTimeline) {
|
if (justNowTimeline) {
|
||||||
justNowTimeline.innerHTML = htmlJustNowTimeline; // Update list of publishings in just now timeline
|
justNowTimeline.innerHTML = htmlJustNowTimeline; // Update list of publications in just now timeline
|
||||||
var countJustNowTimeline = justNowTimeline.childNodes.length;
|
var countJustNowTimeline = justNowTimeline.childNodes.length;
|
||||||
|
|
||||||
if (countJustNowTimeline) { // New pubs just retrieved
|
if (countJustNowTimeline) { // New pubs just retrieved
|
||||||
|
@ -613,7 +613,7 @@ function readNewTimelineData () {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* View new publishing in timeline by moving new timeline to top of timeline */
|
/* View new publication in timeline by moving new timeline to top of timeline */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
function moveNewTimelineToTimeline () {
|
function moveNewTimelineToTimeline () {
|
||||||
|
@ -638,14 +638,14 @@ function moveNewTimelineToTimeline () {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********* Refresh of old publishings in social timeline using AJAX **********/
|
/******** Refresh of old publications in social timeline using AJAX **********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
// This function is called when user clicks in link
|
// This function is called when user clicks in link
|
||||||
var objXMLHttpReqSoc = false;
|
var objXMLHttpReqOldTL = false;
|
||||||
function refreshOldTimeline () {
|
function refreshOldTimeline () {
|
||||||
objXMLHttpReqSoc = AJAXCreateObject ();
|
objXMLHttpReqOldTL = AJAXCreateObject ();
|
||||||
if (objXMLHttpReqSoc) {
|
if (objXMLHttpReqOldTL) {
|
||||||
var RefreshParams = RefreshParamNxtActOldPub + '&' +
|
var RefreshParams = RefreshParamNxtActOldPub + '&' +
|
||||||
RefreshParamIdSes;
|
RefreshParamIdSes;
|
||||||
if (typeof RefreshParamUsr !== 'undefined') {
|
if (typeof RefreshParamUsr !== 'undefined') {
|
||||||
|
@ -657,26 +657,22 @@ function refreshOldTimeline () {
|
||||||
RefreshParams += '&' + RefreshParamWhichUsrs;
|
RefreshParams += '&' + RefreshParamWhichUsrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
objXMLHttpReqSoc.onreadystatechange = readOldTimelineData; // onreadystatechange must be lowercase
|
objXMLHttpReqOldTL.onreadystatechange = readOldTimelineData; // onreadystatechange must be lowercase
|
||||||
objXMLHttpReqSoc.open('POST',ActionAJAX,true);
|
objXMLHttpReqOldTL.open('POST',ActionAJAX,true);
|
||||||
objXMLHttpReqSoc.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
objXMLHttpReqOldTL.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||||
objXMLHttpReqSoc.send(RefreshParams);
|
objXMLHttpReqOldTL.send(RefreshParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receives and show old social timeline data
|
// Receives and show old social timeline data
|
||||||
function readOldTimelineData () {
|
function readOldTimelineData () {
|
||||||
if (objXMLHttpReqSoc.readyState == 4) { // Check if data have been received
|
if (objXMLHttpReqOldTL.readyState == 4) { // Check if data have been received
|
||||||
if (objXMLHttpReqSoc.status == 200) {
|
if (objXMLHttpReqOldTL.status == 200) {
|
||||||
var endOfDelay = objXMLHttpReqSoc.responseText.indexOf('|',0); // Get separator position
|
var oldTimeline = document.getElementById('old_timeline_list'); // Access to UL with the old timeline
|
||||||
var delay = parseInt(objXMLHttpReqSoc.responseText.substring(0,endOfDelay)); // Get refresh delay
|
|
||||||
var htmlOldTimeline = objXMLHttpReqSoc.responseText.substring(endOfDelay + 1); // Get HTML code for social timeline
|
|
||||||
|
|
||||||
var oldTimeline = document.getElementById('old_timeline_list'); // Access to UL with the recent timeline
|
|
||||||
if (oldTimeline) {
|
if (oldTimeline) {
|
||||||
oldTimeline.innerHTML = htmlOldTimeline; // Fill list of publishings in old timeline
|
oldTimeline.innerHTML = objXMLHttpReqOldTL.responseText; // Fill list of publications in old timeline
|
||||||
var countOldTimeline = oldTimeline.childNodes.length;
|
|
||||||
|
|
||||||
|
var countOldTimeline = oldTimeline.childNodes.length;
|
||||||
if (countOldTimeline) {
|
if (countOldTimeline) {
|
||||||
// Scripts in timeline got via AJAX are not executed ==> execute them
|
// Scripts in timeline got via AJAX are not executed ==> execute them
|
||||||
evalScriptsInElem (oldTimeline);
|
evalScriptsInElem (oldTimeline);
|
||||||
|
@ -688,16 +684,14 @@ function readOldTimelineData () {
|
||||||
var timeline = document.getElementById("timeline_list");
|
var timeline = document.getElementById("timeline_list");
|
||||||
for (var i=0; i<countOldTimeline; i++)
|
for (var i=0; i<countOldTimeline; i++)
|
||||||
timeline.appendChild(oldTimeline.firstChild);
|
timeline.appendChild(oldTimeline.firstChild);
|
||||||
}
|
|
||||||
|
|
||||||
if (countOldTimeline < RefreshParamMaxOldPubsToGetAndShow) // Set to TL_MAX_OLD_PUBS_TO_GET_AND_SHOW
|
// There may be more publications
|
||||||
// No more old publishings
|
|
||||||
document.getElementById("view_old_posts_container").style.display = 'none';
|
|
||||||
else {
|
|
||||||
// There may be more publishings
|
|
||||||
document.getElementById('get_old_timeline').style.display=''; // Show icon to be hidden on click
|
document.getElementById('get_old_timeline').style.display=''; // Show icon to be hidden on click
|
||||||
document.getElementById('getting_old_timeline').style.display='none'; // Hide icon to be shown on click
|
document.getElementById('getting_old_timeline').style.display='none'; // Hide icon to be shown on click
|
||||||
}
|
}
|
||||||
|
else // No old publications retrieved, so we have reached the oldest publication
|
||||||
|
// Hide container with link to get old publications
|
||||||
|
document.getElementById("view_old_posts_container").style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -429,8 +429,6 @@ Lo de mutear anuncios, en principio prefiero hacer una opci
|
||||||
// TODO: Change in usability of Announcements of exams, suggested by Javier Fernández Baldomero.
|
// TODO: Change in usability of Announcements of exams, suggested by Javier Fernández Baldomero.
|
||||||
// TODO: Al pulsar sobre una convocatoria de examen / aviso --> ir a la sección de esa convocatoria/aviso en lugar de mostrarlo repetido y destacado arriba
|
// TODO: Al pulsar sobre una convocatoria de examen / aviso --> ir a la sección de esa convocatoria/aviso en lugar de mostrarlo repetido y destacado arriba
|
||||||
|
|
||||||
// TODO: Fix important bug: Cuando se baja varias veces el timeline pulsando en "Ver más", se para aleatoriamente tras varias actualizaciones hacia abajo, no siempre llega hasta la primera publicación
|
|
||||||
|
|
||||||
// TODO: Los usuarios que no tienes permiso para ver su perfil público, se debería mostrar algo, una mínima ficha sin tinmeline o algo así
|
// TODO: Los usuarios que no tienes permiso para ver su perfil público, se debería mostrar algo, una mínima ficha sin tinmeline o algo así
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -452,10 +450,14 @@ En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 18.74 (2019-03-12)"
|
#define Log_PLATFORM_VERSION "SWAD 18.74.4 (2019-03-13)"
|
||||||
#define CSS_FILE "swad18.68.3.css"
|
#define CSS_FILE "swad18.68.3.css"
|
||||||
#define JS_FILE "swad18.64.js"
|
#define JS_FILE "swad18.74.4.js"
|
||||||
/*
|
/*
|
||||||
|
Version 18.74.4: Mar 13, 2019 Fixed bug in JavaScript related to timeline. (239628 lines)
|
||||||
|
Version 18.74.3: Mar 13, 2019 Fixed bug in JavaScript related to timeline. (239628 lines)
|
||||||
|
Version 18.74.2: Mar 13, 2019 Fixed bug in JavaScript related to timeline. (239628 lines)
|
||||||
|
Version 18.74.1: Mar 12, 2019 Changes in JavaScript related to timeline. (239630 lines)
|
||||||
Version 18.74: Mar 12, 2019 Module swad_social is renamed swad_timeline. (239633 lines)
|
Version 18.74: Mar 12, 2019 Module swad_social is renamed swad_timeline. (239633 lines)
|
||||||
Version 18.73.7: Mar 12, 2019 Code refactoring related to list of users and options. (239614 lines)
|
Version 18.73.7: Mar 12, 2019 Code refactoring related to list of users and options. (239614 lines)
|
||||||
Version 18.73.6: Mar 12, 2019 Create new email message from list of users. This option will be active when email action allows selecting individual users. (239580 lines)
|
Version 18.73.6: Mar 12, 2019 Create new email message from list of users. This option will be active when email action allows selecting individual users. (239580 lines)
|
||||||
|
|
|
@ -734,11 +734,9 @@ static void Lay_WriteScriptParamsAJAX (void)
|
||||||
put parameters used by AJAX */
|
put parameters used by AJAX */
|
||||||
fprintf (Gbl.F.Out,"var RefreshParamNxtActNewPub = \"act=%ld\";\n"
|
fprintf (Gbl.F.Out,"var RefreshParamNxtActNewPub = \"act=%ld\";\n"
|
||||||
"var RefreshParamNxtActOldPub = \"act=%ld\";\n"
|
"var RefreshParamNxtActOldPub = \"act=%ld\";\n"
|
||||||
"var RefreshParamMaxOldPubsToGetAndShow = \"%u\";\n"
|
|
||||||
"var RefreshParamWhichUsrs = \"WhichUsrs=%u\";\n",
|
"var RefreshParamWhichUsrs = \"WhichUsrs=%u\";\n",
|
||||||
Act_GetActCod (ActRefNewSocPubGbl),
|
Act_GetActCod (ActRefNewSocPubGbl),
|
||||||
Act_GetActCod (ActRefOldSocPubGbl),
|
Act_GetActCod (ActRefOldSocPubGbl),
|
||||||
TL_MAX_OLD_PUBS_TO_GET_AND_SHOW,
|
|
||||||
(unsigned) Gbl.Timeline.WhichUsrs);
|
(unsigned) Gbl.Timeline.WhichUsrs);
|
||||||
break;
|
break;
|
||||||
case ActSeeOthPubPrf:
|
case ActSeeOthPubPrf:
|
||||||
|
@ -756,10 +754,8 @@ static void Lay_WriteScriptParamsAJAX (void)
|
||||||
Nck_GetNicknameFromUsrCod (Gbl.Usrs.Other.UsrDat.UsrCod,
|
Nck_GetNicknameFromUsrCod (Gbl.Usrs.Other.UsrDat.UsrCod,
|
||||||
Gbl.Usrs.Other.UsrDat.Nickname);
|
Gbl.Usrs.Other.UsrDat.Nickname);
|
||||||
fprintf (Gbl.F.Out,"var RefreshParamNxtActOldPub = \"act=%ld\";\n"
|
fprintf (Gbl.F.Out,"var RefreshParamNxtActOldPub = \"act=%ld\";\n"
|
||||||
"var RefreshParamMaxOldPubsToGetAndShow = \"%u\";\n"
|
|
||||||
"var RefreshParamUsr = \"OtherUsrCod=%s\";\n",
|
"var RefreshParamUsr = \"OtherUsrCod=%s\";\n",
|
||||||
Act_GetActCod (ActRefOldSocPubUsr),
|
Act_GetActCod (ActRefOldSocPubUsr),
|
||||||
TL_MAX_OLD_PUBS_TO_GET_AND_SHOW,
|
|
||||||
Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -109,7 +109,7 @@ struct TL_Comment
|
||||||
{
|
{
|
||||||
long PubCod;
|
long PubCod;
|
||||||
long UsrCod;
|
long UsrCod;
|
||||||
long NotCod; // Note code
|
long NotCod; // Note code to which this comment belongs
|
||||||
time_t DateTimeUTC;
|
time_t DateTimeUTC;
|
||||||
unsigned NumFavs; // Number of times (users) this comment has been favourited
|
unsigned NumFavs; // Number of times (users) this comment has been favourited
|
||||||
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
|
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
|
||||||
|
@ -712,7 +712,8 @@ static void TL_BuildQueryToGetTimeline (char **Query,
|
||||||
switch (TimelineUsrOrGbl)
|
switch (TimelineUsrOrGbl)
|
||||||
{
|
{
|
||||||
case TL_TIMELINE_USR: // Show the timeline of a user
|
case TL_TIMELINE_USR: // Show the timeline of a user
|
||||||
sprintf (SubQueryRangeBottom,"PubCod>%ld AND ",RangePubsToGet.Bottom);
|
sprintf (SubQueryRangeBottom,"PubCod>%ld AND ",
|
||||||
|
RangePubsToGet.Bottom);
|
||||||
break;
|
break;
|
||||||
case TL_TIMELINE_GBL: // Show the global timeline
|
case TL_TIMELINE_GBL: // Show the global timeline
|
||||||
switch (Gbl.Timeline.WhichUsrs)
|
switch (Gbl.Timeline.WhichUsrs)
|
||||||
|
@ -738,7 +739,8 @@ static void TL_BuildQueryToGetTimeline (char **Query,
|
||||||
switch (TimelineUsrOrGbl)
|
switch (TimelineUsrOrGbl)
|
||||||
{
|
{
|
||||||
case TL_TIMELINE_USR: // Show the timeline of a user
|
case TL_TIMELINE_USR: // Show the timeline of a user
|
||||||
sprintf (SubQueryRangeTop,"PubCod<%ld AND ",RangePubsToGet.Top);
|
sprintf (SubQueryRangeTop,"PubCod<%ld AND ",
|
||||||
|
RangePubsToGet.Top);
|
||||||
break;
|
break;
|
||||||
case TL_TIMELINE_GBL: // Show the global timeline
|
case TL_TIMELINE_GBL: // Show the global timeline
|
||||||
switch (Gbl.Timeline.WhichUsrs)
|
switch (Gbl.Timeline.WhichUsrs)
|
||||||
|
@ -882,7 +884,8 @@ static long TL_GetPubCodFromSession (const char *FieldName)
|
||||||
|
|
||||||
/***** Get last publication code from database *****/
|
/***** Get last publication code from database *****/
|
||||||
if (DB_QuerySELECT (&mysql_res,"can not get publication code from session",
|
if (DB_QuerySELECT (&mysql_res,"can not get publication code from session",
|
||||||
"SELECT %s FROM sessions WHERE SessionId='%s'",
|
"SELECT %s FROM sessions"
|
||||||
|
" WHERE SessionId='%s'",
|
||||||
FieldName,Gbl.Session.Id) != 1)
|
FieldName,Gbl.Session.Id) != 1)
|
||||||
Lay_ShowErrorAndExit (Txt_The_session_has_expired);
|
Lay_ShowErrorAndExit (Txt_The_session_has_expired);
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,7 @@
|
||||||
// Number of recent publishings got and shown the first time, before refreshing
|
// Number of recent publishings got and shown the first time, before refreshing
|
||||||
#define TL_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // Unlimited
|
#define TL_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // Unlimited
|
||||||
#define TL_MAX_REC_PUBS_TO_GET_AND_SHOW 10 // Recent publishings to show (first time)
|
#define TL_MAX_REC_PUBS_TO_GET_AND_SHOW 10 // Recent publishings to show (first time)
|
||||||
#define TL_MAX_OLD_PUBS_TO_GET_AND_SHOW 10 // Old publishings are retrieved in packs of this size
|
#define TL_MAX_OLD_PUBS_TO_GET_AND_SHOW 20 // Old publishings are retrieved in packs of this size
|
||||||
// This constant is also used in JavaScript function readOldTimelineData
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************************** Public types *******************************/
|
/******************************** Public types *******************************/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user