MediaWiki:Gadget-defaultVisibilityToggles.js: Difference between revisions

m 1 revision imported
No edit summary
Tag: Reverted
Line 1: Line 1:
/* jshint undef: true */
/* jshint undef: true, esversion: 6 */
/* globals $, jQuery, mw, window, getComputedStyle */
/* globals $, jQuery, mw, window, getComputedStyle */


Line 99: Line 99:
navHead.style.cursor = "pointer";
navHead.style.cursor = "pointer";
var toggleCategory = $(navFrame).data("toggle-category")
var toggleCategory = $(navFrame).data("toggle-category") || getToggleCategory(navFrame, "other boxes");
|| getToggleCategory(navFrame, "other boxes");
navHead.onclick = window.VisibilityToggles.register(toggleCategory,
navHead.onclick = window.VisibilityToggles.register(toggleCategory,
function show() {
function show() {
Line 137: Line 136:
itCaption.style.cursor = "pointer";
itCaption.style.cursor = "pointer";
var toggleCategory = $(it).data("toggle-category")
var toggleCategory = $(it).data("toggle-category") || getToggleCategory(it, "other boxes");
|| getToggleCategory(it, "other boxes");
itCaption.onclick = window.VisibilityToggles.register(toggleCategory,
itCaption.onclick = window.VisibilityToggles.register(toggleCategory,
function show() {
function show() {
Line 181: Line 179:


function show() {
function show() {
HQToggleButton.text("quotations ▲");
HQToggleButton.text("quotations ▲");
$(li).children("ul").show();
$(li).children("ul").show();
}
}
function hide() {
function hide() {
HQToggleButton.text("quotations ▼");
HQToggleButton.text("quotations ▼");
$(li).children("ul").hide();
$(li).children("ul").hide();
}
}
Line 289: Line 287:
// attribute or will be based on the text of the closest preceding
// attribute or will be based on the text of the closest preceding
// fourth-to-sixth-level header.
// fourth-to-sixth-level header.
var toggleCategory = $rootElement.data("toggle-category")
var toggleCategory = $rootElement.data("toggle-category") || getToggleCategory($rootElement[0], "other lists");
|| getToggleCategory($rootElement[0], "other lists");
// Determine the text for the $toggleButton.
// Determine the text for the $toggleButton.