mirror of https://github.com/acanas/swad-core.git
Version18.75
This commit is contained in:
parent
4b602e2f83
commit
3eba689e80
|
@ -465,7 +465,7 @@ function refreshConnected () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receives and show connected users data
|
// Receive and show connected users data
|
||||||
function readConnUsrsData () {
|
function readConnUsrsData () {
|
||||||
if (objXMLHttpReqCon.readyState == 4) { // Check if data have been received
|
if (objXMLHttpReqCon.readyState == 4) { // Check if data have been received
|
||||||
if (objXMLHttpReqCon.status == 200) {
|
if (objXMLHttpReqCon.status == 200) {
|
||||||
|
@ -550,7 +550,7 @@ function readLastClicksData () {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**** Automatic refresh of new publications in social timeline using AJAX ****/
|
/*** Automatically refresh 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
|
||||||
|
@ -569,19 +569,16 @@ function refreshNewTimeline () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receives and show new social timeline data
|
// Receive and show new social timeline data
|
||||||
function readNewTimelineData () {
|
function readNewTimelineData () {
|
||||||
if (objXMLHttpReqNewTL.readyState == 4) { // Check if data have been received
|
if (objXMLHttpReqNewTL.readyState == 4) { // Check if data have been received
|
||||||
if (objXMLHttpReqNewTL.status == 200) {
|
if (objXMLHttpReqNewTL.status == 200) {
|
||||||
var endOfDelay = objXMLHttpReqNewTL.responseText.indexOf('|',0); // Get separator position
|
|
||||||
var delay = parseInt(objXMLHttpReqNewTL.responseText.substring(0,endOfDelay)); // Get refresh delay
|
|
||||||
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 publications in just now timeline
|
justNowTimeline.innerHTML = objXMLHttpReqNewTL.responseText; // 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
|
||||||
// Scripts in timeline got via AJAX are not executed ==> execute them
|
// Scripts in timeline got via AJAX are not executed ==> execute them
|
||||||
evalScriptsInElem (justNowTimeline);
|
evalScriptsInElem (justNowTimeline);
|
||||||
|
@ -605,9 +602,10 @@ function readNewTimelineData () {
|
||||||
viewNewPostsContainer.style.display = '';
|
viewNewPostsContainer.style.display = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delay >= 10000) // If refresh slower than 1 time each 10 seconds, do refresh; else abort
|
// Global delay variable is set initially in swad-core
|
||||||
setTimeout('refreshNewTimeline()',delay);
|
delayNewTimeline += 1000; // Increase 1 second
|
||||||
|
setTimeout('refreshNewTimeline()',delayNewTimeline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -638,7 +636,7 @@ function moveNewTimelineToTimeline () {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******** Refresh of old publications in social timeline using AJAX **********/
|
/********** Refresh 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
|
||||||
|
@ -664,7 +662,7 @@ function refreshOldTimeline () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receives and show old social timeline data
|
// Receive and show old social timeline data
|
||||||
function readOldTimelineData () {
|
function readOldTimelineData () {
|
||||||
if (objXMLHttpReqOldTL.readyState == 4) { // Check if data have been received
|
if (objXMLHttpReqOldTL.readyState == 4) { // Check if data have been received
|
||||||
if (objXMLHttpReqOldTL.status == 200) {
|
if (objXMLHttpReqOldTL.status == 200) {
|
|
@ -431,6 +431,8 @@ Lo de mutear anuncios, en principio prefiero hacer una opci
|
||||||
|
|
||||||
// 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í
|
||||||
|
|
||||||
|
// TODO: En Timeline cambiar "Comentario eliminado" para los posts por "Publicación eliminada"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -450,10 +452,11 @@ En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 18.74.4 (2019-03-13)"
|
#define Log_PLATFORM_VERSION "SWAD 18.75 (2019-03-13)"
|
||||||
#define CSS_FILE "swad18.68.3.css"
|
#define CSS_FILE "swad18.68.3.css"
|
||||||
#define JS_FILE "swad18.74.4.js"
|
#define JS_FILE "swad18.75.js"
|
||||||
/*
|
/*
|
||||||
|
Version 18.75: Mar 13, 2019 Timeline refresh rate is increased on each refresh. (239633 lines)
|
||||||
Version 18.74.4: Mar 13, 2019 Fixed bug in JavaScript related to timeline. (239628 lines)
|
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.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.2: Mar 13, 2019 Fixed bug in JavaScript related to timeline. (239628 lines)
|
||||||
|
|
|
@ -455,7 +455,8 @@
|
||||||
|
|
||||||
#define Cfg_TIME_TO_REFRESH_LAST_CLICKS ((time_t)( 1UL * 1000UL)) // Refresh period of last clicks in miliseconds
|
#define Cfg_TIME_TO_REFRESH_LAST_CLICKS ((time_t)( 1UL * 1000UL)) // Refresh period of last clicks in miliseconds
|
||||||
|
|
||||||
#define Cfg_TIME_TO_REFRESH_TIMELINE ((time_t)( 10UL * 1000UL)) // Refresh period of social timeline in miliseconds
|
#define Cfg_TIME_TO_REFRESH_TIMELINE ((time_t)( 1UL * 1000UL)) // Initial refresh period of social timeline in miliseconds
|
||||||
|
// This delay is increased 1 second on each refresh
|
||||||
|
|
||||||
#define Cfg_TIME_TO_CHANGE_BANNER ((time_t)( 2UL * 60UL)) // After these seconds, change banner
|
#define Cfg_TIME_TO_CHANGE_BANNER ((time_t)( 2UL * 60UL)) // After these seconds, change banner
|
||||||
#define Cfg_NUMBER_OF_BANNERS 1 // Number of banners to show simultaneously
|
#define Cfg_NUMBER_OF_BANNERS 1 // Number of banners to show simultaneously
|
||||||
|
|
|
@ -651,11 +651,37 @@ static void Lay_WriteScriptMathJax (void)
|
||||||
static void Lay_WriteScriptInit (void)
|
static void Lay_WriteScriptInit (void)
|
||||||
{
|
{
|
||||||
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
||||||
|
bool RefreshLastClicks = false;
|
||||||
|
bool RefreshNewTimeline = false;
|
||||||
|
|
||||||
|
switch (Gbl.Action.Act)
|
||||||
|
{
|
||||||
|
case ActLstClk:
|
||||||
|
RefreshLastClicks = true;
|
||||||
|
break;
|
||||||
|
case ActSeeSocTmlGbl:
|
||||||
|
case ActRcvSocPstGbl:
|
||||||
|
case ActRcvSocComGbl:
|
||||||
|
case ActShaSocNotGbl:
|
||||||
|
case ActUnsSocNotGbl:
|
||||||
|
case ActReqRemSocPubGbl:
|
||||||
|
case ActRemSocPubGbl:
|
||||||
|
case ActReqRemSocComGbl:
|
||||||
|
case ActRemSocComGbl:
|
||||||
|
RefreshNewTimeline = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
|
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
|
||||||
|
|
||||||
Dat_WriteScriptMonths ();
|
Dat_WriteScriptMonths ();
|
||||||
|
|
||||||
|
if (RefreshNewTimeline)
|
||||||
|
fprintf (Gbl.F.Out,"var delayNewTimeline = %lu;\n",
|
||||||
|
Cfg_TIME_TO_REFRESH_TIMELINE);
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"function init(){\n");
|
fprintf (Gbl.F.Out,"function init(){\n");
|
||||||
|
|
||||||
if ((Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible
|
if ((Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible
|
||||||
|
@ -667,29 +693,12 @@ static void Lay_WriteScriptInit (void)
|
||||||
Lan_STR_LANG_ID[Gbl.Prefs.Language],
|
Lan_STR_LANG_ID[Gbl.Prefs.Language],
|
||||||
Gbl.Usrs.Connected.TimeToRefreshInMs);
|
Gbl.Usrs.Connected.TimeToRefreshInMs);
|
||||||
|
|
||||||
if (Gbl.Action.Act == ActLstClk)
|
if (RefreshLastClicks) // Refresh last clicks via AJAX
|
||||||
// Refresh fav button via AJAX
|
|
||||||
fprintf (Gbl.F.Out," setTimeout(\"refreshLastClicks()\",%lu);\n",
|
fprintf (Gbl.F.Out," setTimeout(\"refreshLastClicks()\",%lu);\n",
|
||||||
Cfg_TIME_TO_REFRESH_LAST_CLICKS);
|
Cfg_TIME_TO_REFRESH_LAST_CLICKS);
|
||||||
else
|
else if (RefreshNewTimeline) // Refresh timeline via AJAX
|
||||||
switch (Gbl.Action.Act)
|
fprintf (Gbl.F.Out," setTimeout(\"refreshNewTimeline()\",delayNewTimeline);\n");
|
||||||
{
|
|
||||||
case ActSeeSocTmlGbl:
|
|
||||||
case ActRcvSocPstGbl:
|
|
||||||
case ActRcvSocComGbl:
|
|
||||||
case ActShaSocNotGbl:
|
|
||||||
case ActUnsSocNotGbl:
|
|
||||||
case ActReqRemSocPubGbl:
|
|
||||||
case ActRemSocPubGbl:
|
|
||||||
case ActReqRemSocComGbl:
|
|
||||||
case ActRemSocComGbl:
|
|
||||||
// Refresh timeline via AJAX
|
|
||||||
fprintf (Gbl.F.Out," setTimeout(\"refreshNewTimeline()\",%lu);\n",
|
|
||||||
Cfg_TIME_TO_REFRESH_TIMELINE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
fprintf (Gbl.F.Out,"}\n"
|
fprintf (Gbl.F.Out,"}\n"
|
||||||
"</script>\n");
|
"</script>\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -440,10 +440,6 @@ void TL_RefreshNewTimelineGbl (void)
|
||||||
|
|
||||||
if (Gbl.Session.IsOpen) // If session has been closed, do not write anything
|
if (Gbl.Session.IsOpen) // If session has been closed, do not write anything
|
||||||
{
|
{
|
||||||
/***** Send, before the HTML, the refresh time *****/
|
|
||||||
fprintf (Gbl.F.Out,"%lu|",
|
|
||||||
Cfg_TIME_TO_REFRESH_TIMELINE);
|
|
||||||
|
|
||||||
/***** Get which users *****/
|
/***** Get which users *****/
|
||||||
TL_GetParamsWhichUsrs ();
|
TL_GetParamsWhichUsrs ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue