Version 23.47.4: Nov 08, 2023 Fixed bug in program resources.

This commit is contained in:
acanas 2023-11-09 09:54:13 +01:00
parent 19371744a8
commit 58b5572072
6 changed files with 5173 additions and 17 deletions

5134
css/swad23.47.3.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1025,7 +1025,8 @@ var refreshingOldTimeline = false;
function handleInfiniteScroll () {
if (refreshingOldTimeline) return; // Don't check scroll while refreshing
if (window.scrollY + window.innerHeight >= document.body.scrollHeight - 240) { // Near the end of the page
if (window.scrollY + window.innerHeight >= document.documentElement.scrollHeight - 360) {
// Near the end of the page (subtract at least 360 pixels so it works well on mobile)
refreshingOldTimeline = true;
refreshOldTimeline ();
}
@ -1059,6 +1060,10 @@ function refreshOldTimeline () {
}
function readOldTimelineData () {
// Hide view more button, unhide waiting image
document.getElementById("view_more").style.display = 'none';
document.getElementById("loading_old_timeline").style.display = '';
if (objXMLHttpReqOldTml.readyState == 4) // Check if data have been received
if (objXMLHttpReqOldTml.status == 200) {
// Access to UL with the old timeline
@ -1080,6 +1085,9 @@ function readOldTimelineData () {
var timeline = document.getElementById("timeline_list");
for (var i=0; i<countOldTimeline; i++)
timeline.appendChild(oldTimeline.firstChild);
// Unhide view more button only if oldest pub not reached
document.getElementById("view_more").style.display = '';
}
else { // No old publications retrieved, so we have reached the oldest pub.
// Remove event listener
@ -1087,7 +1095,10 @@ function readOldTimelineData () {
// Hide container with link to get old publications
document.getElementById("view_old_pubs_container").style.display = 'none';
}
// Hide waiting image
document.getElementById("loading_old_timeline").style.display = 'none';
refreshingOldTimeline = false; // Refreshing is finished
}
}

View File

@ -633,10 +633,13 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/
#define Log_PLATFORM_VERSION "SWAD 23.47 (2023-11-08)"
#define CSS_FILE "swad23.46.1.css"
#define JS_FILE "swad23.47.js"
#define Log_PLATFORM_VERSION "SWAD 23.47.4 (2023-11-09)"
#define CSS_FILE "swad23.47.3.css"
#define JS_FILE "swad23.47.3.js"
/*
Version 23.47.4: Nov 08, 2023 Fixed bug in program resources. (335581 lines)
Version 23.47.3: Nov 08, 2023 Changes in infinite scroll in timeline. (335581 lines)
Version 23.47.2: Nov 08, 2023 Changes in infinite scroll in timeline. (335566 lines)
Version 23.47: Nov 08, 2023 Infinite scroll in timeline. (335560 lines)
Version 23.46.1: Nov 07, 2023 Improvements in responsive design. (? lines)
Version 23.46: Nov 07, 2023 Code refactoring and layout changes in lists of my courses, forums and chat. (335525 lines)

View File

@ -189,8 +189,8 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
};
static void (*PrgRsc_PutIconsResources[Vie_NUM_VIEW_TYPES]) (void *ItmCod) =
{
[Vie_VIEW] = PrgRsc_PutIconsViewResources,
[Vie_EDIT] = PrgRsc_PutIconsEditResources,
[Vie_VIEW] = PrgRsc_PutIconsEditResources,
[Vie_EDIT] = PrgRsc_PutIconsViewResources,
};
/***** Trivial check *****/

View File

@ -490,16 +490,24 @@ void TmlPub_PutLinkToViewOldPubs (void)
extern const char *Txt_See_more;
/***** Begin container *****/
HTM_DIV_Begin ("id=\"view_old_pubs_container\""
" class=\"Tml_WIDTH Tml_SEP BG_HIGHLIGHT\"");
HTM_DIV_Begin ("id=\"view_old_pubs_container\" class=\"Tml_WIDTH Tml_SEP\"");
/***** Put button to refresh *****/
HTM_BUTTON_Begin (Txt_See_more,
"class=\"BT_LINK FORM_IN_%s BOLD\""
" onclick=\"refreshOldTimeline();return false;\"",
The_GetSuffix ());
Ico_PutIconTextUpdate (Txt_See_more);
HTM_BUTTON_End ();
/***** Put button to refresh *****/
// div is visible. When refresh starts, div is hidden
HTM_DIV_Begin ("id=\"view_more\"");
HTM_BUTTON_Begin (Txt_See_more,
"class=\"BT_LINK FORM_IN_%s BOLD\""
" onclick=\"refreshOldTimeline();return false;\"",
The_GetSuffix ());
Ico_PutIconTextUpdate (Txt_See_more);
HTM_BUTTON_End ();
HTM_DIV_End ();
/***** Put icon refreshing *****/
// div is hidden. When refresh starts, div is unhidden
HTM_DIV_Begin ("id=\"loading_old_timeline\" style=\"display:none;\"");
Ico_PutIcon ("Spin-1s-200px.gif",Ico_BLACK,Txt_See_more,"Tml_WAIT_IMG");
HTM_DIV_End ();
/***** End container *****/
HTM_DIV_End ();

View File

@ -39,7 +39,7 @@
// Number of recent publishings got and shown the first time, before refreshing
#define TmlPub_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // New publishings retrieved (big number)
#define TmlPub_MAX_REC_PUBS_TO_GET_AND_SHOW 10 // Recent publishings to show (first time)
#define TmlPub_MAX_OLD_PUBS_TO_GET_AND_SHOW 10 // Old publishings are retrieved in packs of this size
#define TmlPub_MAX_OLD_PUBS_TO_GET_AND_SHOW 20 // Old publishings are retrieved in packs of this size
/*****************************************************************************/
/******************************** Public types *******************************/