View source for MediaWiki:Common.js
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
/* Any JavaScript here will be loaded for all users on every page load. */
// I wasn't totally satisfied with MediaWiki's built-in way to make collapsible elements, so here is an alternative implementation I made.
function customcollapseShow(jQueryObj) {
let container = $(jQueryObj).parents(".customcollapse");
container.find(".customcollapse-content").show();
container.find(".customcollapse-show").hide().removeAttr("aria-expanded");
container.find(".customcollapse-hide").show().attr("aria-expanded", "true");
container.find(".customcollapse-toggle").each(function () {
$(this).attr("aria-expanded", "true");
if ($(this).attr("data-hidetext")) $(this).text($(this).attr("data-hidetext"));
});
}
function customcollapseHide(jQueryObj) {
let container = $(jQueryObj).parents(".customcollapse");
container.find(".customcollapse-content").hide();
container.find(".customcollapse-hide").hide().removeAttr("aria-expanded");
container.find(".customcollapse-show").show().attr("aria-expanded", "false");
container.find(".customcollapse-toggle").each(function () {
$(this).attr("aria-expanded", "false");
000
1:0
Return to MediaWiki:Common.js.