
FAIR is a non-profit organization dedicated to providing well-documented answers to criticisms of the doctrine, practice, and history of The Church of Jesus Christ of Latter-day Saints.
MikeParker (talk | contribs) No edit summary Tag: Manual revert |
MikeParker (talk | contribs) No edit summary |
||
| Line 32: | Line 32: | ||
header.find(".collapse-toggle").text(icon); | header.find(".collapse-toggle").text(icon); | ||
}); | }); | ||
}); | |||
}); | |||
// COLLAPSIBLE NOTES SECTION | |||
$(document).ready(function () { | |||
// Find the Notes div generated by the template | |||
var notesHeader = $('.notes-collapsible-header'); | |||
if (notesHeader.length === 0) return; | |||
// The references container is after the header | |||
var notesContent = notesHeader.next('.notes-collapsible-content'); | |||
if (notesContent.length === 0) return; | |||
// Initial state: collapsed | |||
notesContent.hide(); | |||
var isOpen = false; | |||
// Update the icon based on the state | |||
function updateIcon() { | |||
var icon = isOpen ? "▲" : "▼"; | |||
notesHeader.find('.notes-collapse-toggle').text(icon); | |||
} | |||
updateIcon(); | |||
// Handle clicks on the header | |||
notesHeader.on('click', function(e) { | |||
// Do nothing if clicking on the "BACK TO TOP" link | |||
if ($(e.target).closest('a[href="#top"]').length > 0) { | |||
return; // Allow the link to work normally | |||
} | |||
// Prevent the link from activating if clicking elsewhere | |||
e.preventDefault(); | |||
// Toggle the content | |||
notesContent.slideToggle(150); | |||
isOpen = !isOpen; | |||
updateIcon(); | |||
}); | }); | ||
}); | }); | ||
// COLLAPSIBLE HEADERS
$(document).ready(function () {
$(".collapsible-wrapper").each(function () {
var wrapper = $(this);
var titleContent = wrapper.find(".collapsible-title-content");
var bodyContent = wrapper.find(".collapsible-body-content");
if (titleContent.length === 0 || bodyContent.length === 0) return;
var startsOpen = wrapper.data("state") === "open";
var titleHTML = titleContent.html();
var bodyHTML = bodyContent.html();
var header = $('<div class="collapsible-header"></div>');
var content = $('<div class="collapsible-content"></div>');
if (startsOpen) header.addClass("open");
var arrow = startsOpen ? "▲" : "▼";
header.append(titleHTML);
header.append('<span class="collapse-toggle" aria-hidden="true">' + arrow + '</span>');
content.html(bodyHTML);
if (!startsOpen) content.hide();
wrapper.replaceWith(header.add(content));
// Inicializar elementos mw-collapsible dentro del contenido
content.find('.mw-collapsible').each(function() {
if (typeof mw !== 'undefined' && mw.hook) {
mw.hook('wikipage.content').fire($(this));
}
});
header.on("click", function () {
content.slideToggle(150);
header.toggleClass("open");
var icon = header.hasClass("open") ? "▲" : "▼";
header.find(".collapse-toggle").text(icon);
});
});
});
// COLLAPSIBLE NOTES SECTION
$(document).ready(function () {
// Find the Notes div generated by the template
var notesHeader = $('.notes-collapsible-header');
if (notesHeader.length === 0) return;
// The references container is after the header
var notesContent = notesHeader.next('.notes-collapsible-content');
if (notesContent.length === 0) return;
// Initial state: collapsed
notesContent.hide();
var isOpen = false;
// Update the icon based on the state
function updateIcon() {
var icon = isOpen ? "▲" : "▼";
notesHeader.find('.notes-collapse-toggle').text(icon);
}
updateIcon();
// Handle clicks on the header
notesHeader.on('click', function(e) {
// Do nothing if clicking on the "BACK TO TOP" link
if ($(e.target).closest('a[href="#top"]').length > 0) {
return; // Allow the link to work normally
}
// Prevent the link from activating if clicking elsewhere
e.preventDefault();
// Toggle the content
notesContent.slideToggle(150);
isOpen = !isOpen;
updateIcon();
});
});

FAIR is a non-profit organization dedicated to providing well-documented answers to criticisms of the doctrine, practice, and history of The Church of Jesus Christ of Latter-day Saints.
We are a volunteer organization. We invite you to give back.
Donate Now