Democracy Power Course

document.addEventListener(“DOMContentLoaded”, function () { let updated = false;function updateLessonNavigation() { if (updated) return;// Update parent course link text const link = document.querySelector(“.llms-parent-course-link a”); if (link) { link.textContent = “Table of Contents”; }// Update “Previous Lesson” to “Previous FD” const prevLesson = document.querySelector(“.llms-course-nav.llms-prev-lesson .llms-pre-text”); if (prevLesson) { prevLesson.textContent = “Previous FD”; }// Update “Next Lesson” to “Next FD” let nextLesson = document.querySelector(“.llms-course-nav.llms-next-lesson .llms-pre-text”); if (!nextLesson) { nextLesson = document.querySelector(“.llms-next-lesson .llms-main .llms-pre-text”); } if (nextLesson) { nextLesson.textContent = “Next FD”; }// Mark update as complete to prevent infinite updates updated = true; }// Run immediately on load updateLessonNavigation();// Watch for dynamic DOM changes const observer = new MutationObserver(() => { if (!updated) { setTimeout(updateLessonNavigation, 100); } });observer.observe(document.body, { childList: true, subtree: true });// Disconnect observer after 3 seconds to avoid loop risks setTimeout(() => observer.disconnect(), 3000); });document.addEventListener(“DOMContentLoaded”, function () { document.querySelectorAll(“section.llms-lesson-locked”).forEach(section => { const tooltip = section.getAttribute(“data-tooltip-msg”); if (tooltip && tooltip.includes(“cannot be accessed”)) { section.setAttribute(“data-tooltip-msg”, “Mark Complete to advance”); } }); });document.addEventListener(“DOMContentLoaded”, function () { const el = document.querySelector(“.llms-parent-course-link”); if (el) { el.setAttribute(“style”, ` all: unset !important; display: block !important; width: fit-content !important; margin-left: auto !important; margin-right: auto !important; text-align: center !important; font-size: inherit; `); } });

Leave a Reply