Version 20.69.1: Apr 30, 2021 Code refactoring in JavaScript (firstChild instead of childNodes[0]).

This commit is contained in:
acanas 2021-04-30 17:32:58 +02:00
parent f0eb536f52
commit 2c419baa32
2 changed files with 9 additions and 7 deletions

View File

@ -938,7 +938,7 @@ function readNewTimelineData () {
// ...to the top of UL 'new_timeline_list')
var newTimeline = document.getElementById('new_timeline_list'); // Access to UL with the new timeline
for (var i=0; i<numNotesJustGot; i++)
newTimeline.insertBefore(justNowTimeline.lastChild, newTimeline.childNodes[0]);
newTimeline.insertBefore(justNowTimeline.lastChild, newTimeline.firstChild);
// Update number of new posts
var viewNewPostsCount = document.getElementById('view_new_posts_count');
@ -977,7 +977,8 @@ function moveNewTimelineToTimeline () {
var lastChildIndex = numNewNotes - i;
for (var j=0; j<lastChildIndex; j++)
if (newTimeline.childNodes[j].dataset.noteCode == newTimeline.lastChild.dataset.noteCode) {
if (newTimeline.childNodes[j].dataset.noteCode ==
newTimeline.lastChild.dataset.noteCode) {
mostRecentOcurrenceOfNote = false;
break;
}
@ -985,8 +986,8 @@ function moveNewTimelineToTimeline () {
// Move or remove node from new timeline
if (mostRecentOcurrenceOfNote) {
// Move node from new timeline to timeline
timeline.insertBefore(newTimeline.lastChild, timeline.childNodes[0]);
timeline.childNodes[0].className += " TL_NEW_PUB";
timeline.insertBefore(newTimeline.lastChild, timeline.firstChild);
timeline.firstChild.className += " TL_NEW_PUB";
}
else
// Remove last child (because is repeated in more recent pubs)
@ -1072,7 +1073,7 @@ function evalScriptsInElem (elem) {
var scrs = elem.getElementsByTagName("script");
var s;
for (var i=0; i<scrs.length; i++) {
s = scrs[i].childNodes[0].nodeValue;
s = scrs[i].firstChild.nodeValue;
if (s != null) eval(s);
}
}

View File

@ -600,13 +600,14 @@ TODO: Salvador Romero Cort
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
*/
#define Log_PLATFORM_VERSION "SWAD 20.69 (2021-04-30)"
#define Log_PLATFORM_VERSION "SWAD 20.69.1 (2021-04-30)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.69.js"
#define JS_FILE "swad20.69.1.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 20.69.1: Apr 30, 2021 Code refactoring in JavaScript (firstChild instead of childNodes[0]). (309775 lines)
Version 20.69: Apr 30, 2021 Changes in timeline to not repeat notes in new activity. (309773 lines)
Version 20.68.8: Apr 30, 2021 Code refactoring in timeline. (309751 lines)
Version 20.68.7: Apr 29, 2021 Code refactoring in timeline. (309749 lines)