MediaWiki:Minerva.js: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
function TLPExpand(x) { | function TLPExpand(x) { | ||
var y = "tlp-children-".concat(x); // | var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21" | ||
var z = document.getElementById(y); // | var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21") | ||
var a = "tlp-button-text-".concat(x); // | var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21" | ||
var b = document.getElementById(a); // | var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21") | ||
if (z.style.display === "block") { | if (z.style.display === "block") { | ||
z.style.display = "none"; | z.style.display = "none"; | ||
Line 15: | Line 15: | ||
b.innerHTML = "Collapse"; | b.innerHTML = "Collapse"; | ||
} | } | ||
} | |||
const TLPPropositions = ["1", | |||
"1.1", | |||
"1.11", | |||
"1.12", | |||
"1.13", | |||
"1.2", | |||
"1.21", | |||
"2", | |||
"2.01", | |||
"2.011", | |||
"2.012", | |||
"2.0121", | |||
"2.0122", | |||
"2.0123", | |||
"2.01231", | |||
"2.0124", | |||
"2.013", | |||
"2.0131", | |||
"2.014", | |||
"2.0141", | |||
"2.02", | |||
"2.0201", | |||
"2.021", | |||
"2.0211", | |||
"2.0212", | |||
"2.022", | |||
"2.023", | |||
"2.0231", | |||
"2.0232", | |||
"2.0233", | |||
"2.02331", | |||
"2.024", | |||
"2.025", | |||
"2.0251", | |||
"2.026", | |||
"2.027", | |||
"2.0271", | |||
"2.0272", | |||
"2.03", | |||
"2.031", | |||
"2.032", | |||
"2.033", | |||
"2.034", | |||
"2.04", | |||
"2.05", | |||
"2.06", | |||
"2.061", | |||
"2.062", | |||
"2.063", | |||
"2.1", | |||
"2.11", | |||
"2.12", | |||
"2.13", | |||
"2.131", | |||
"2.14", | |||
"2.141", | |||
"2.15", | |||
"2.151", | |||
"2.1511", | |||
"2.1512", | |||
"2.15121", | |||
"2.1513", | |||
"2.1514", | |||
"2.1515", | |||
"2.16", | |||
"2.161", | |||
"2.17", | |||
"2.171", | |||
"2.172", | |||
"2.173", | |||
"2.174", | |||
"2.18", | |||
"2.181", | |||
"2.182", | |||
"2.19", | |||
"2.2", | |||
"2.201", | |||
"2.202", | |||
"2.203", | |||
"2.21", | |||
"2.22", | |||
"2.221", | |||
"2.222", | |||
"2.223", | |||
"2.224", | |||
"2.225", | |||
"3", | |||
"3.001", | |||
"3.01", | |||
"3.02", | |||
"3.03", | |||
"3.031", | |||
"3.032", | |||
"3.0321", | |||
"3.04", | |||
"3.05", | |||
"3.1", | |||
"3.11", | |||
"3.12", | |||
"3.13", | |||
"3.14", | |||
"3.141", | |||
"3.142", | |||
"3.143", | |||
"3.1431", | |||
"3.1432", | |||
"3.144", | |||
"3.2", | |||
"3.201", | |||
"3.202", | |||
"3.203", | |||
"3.21", | |||
"3.22", | |||
"3.221", | |||
"3.23", | |||
"3.24", | |||
"3.25", | |||
"3.251", | |||
"3.26", | |||
"3.261", | |||
"3.262", | |||
"3.263", | |||
"3.3", | |||
"3.31", | |||
"3.311", | |||
"3.312", | |||
"3.313", | |||
"3.314", | |||
"3.315", | |||
"3.316", | |||
"3.317", | |||
"3.318", | |||
"3.32", | |||
"3.321", | |||
"3.322", | |||
"3.323", | |||
"3.324", | |||
"3.325", | |||
"3.326", | |||
"3.327", | |||
"3.328", | |||
"3.33", | |||
"3.331", | |||
"3.332", | |||
"3.333", | |||
"3.334", | |||
"3.34", | |||
"3.341", | |||
"3.3411", | |||
"3.342", | |||
"3.3421", | |||
"3.343", | |||
"3.344", | |||
"3.3441", | |||
"3.3442", | |||
"3.4", | |||
"3.41", | |||
"3.411", | |||
"3.42", | |||
"3.5", | |||
"4", | |||
"4.001", | |||
"4.002", | |||
"4.003", | |||
"4.0031", | |||
"4.01", | |||
"4.011", | |||
"4.012", | |||
"4.013", | |||
"4.014", | |||
"4.0141", | |||
"4.015", | |||
"4.016", | |||
"4.02", | |||
"4.021", | |||
"4.022", | |||
"4.023", | |||
"4.024", | |||
"4.025", | |||
"4.026", | |||
"4.027", | |||
"4.03", | |||
"4.031", | |||
"4.0311", | |||
"4.0312", | |||
"4.032", | |||
"4.04", | |||
"4.041", | |||
"4.0411", | |||
"4.0412", | |||
"4.05", | |||
"4.06", | |||
"4.061", | |||
"4.062", | |||
"4.0621", | |||
"4.063", | |||
"4.064", | |||
"4.0641", | |||
"4.1", | |||
"4.11", | |||
"4.111", | |||
"4.112", | |||
"4.1121", | |||
"4.1122", | |||
"4.113", | |||
"4.114", | |||
"4.115", | |||
"4.116", | |||
"4.12", | |||
"4.121", | |||
"4.1211", | |||
"4.1212", | |||
"4.1213", | |||
"4.122", | |||
"4.1221", | |||
"4.123", | |||
"4.124", | |||
"4.1241", | |||
"4.125", | |||
"4.1251", | |||
"4.1252", | |||
"4.126", | |||
"4.127", | |||
"4.1271", | |||
"4.1272", | |||
"4.12721", | |||
"4.1273", | |||
"4.1274", | |||
"4.128", | |||
"4.2", | |||
"4.21", | |||
"4.211", | |||
"4.22", | |||
"4.221", | |||
"4.2211", | |||
"4.23", | |||
"4.24", | |||
"4.241", | |||
"4.242", | |||
"4.243", | |||
"4.25", | |||
"4.26", | |||
"4.27", | |||
"4.28", | |||
"4.3", | |||
"4.31", | |||
"4.4", | |||
"4.41", | |||
"4.411", | |||
"4.42", | |||
"4.43", | |||
"4.431", | |||
"4.44", | |||
"4.441", | |||
"4.442", | |||
"4.45", | |||
"4.46", | |||
"4.461", | |||
"4.4611", | |||
"4.462", | |||
"4.463", | |||
"4.464", | |||
"4.465", | |||
"4.466", | |||
"4.4661", | |||
"4.5", | |||
"4.51", | |||
"4.52", | |||
"4.53", | |||
"5", | |||
"5.01", | |||
"5.02", | |||
"5.1", | |||
"5.101", | |||
"5.11", | |||
"5.12", | |||
"5.121", | |||
"5.122", | |||
"5.123", | |||
"5.124", | |||
"5.1241", | |||
"5.13", | |||
"5.131", | |||
"5.1311", | |||
"5.132", | |||
"5.133", | |||
"5.134", | |||
"5.135", | |||
"5.136", | |||
"5.1361", | |||
"5.1362", | |||
"5.1363", | |||
"5.14", | |||
"5.141", | |||
"5.142", | |||
"5.143", | |||
"5.15", | |||
"5.151", | |||
"5.1511", | |||
"5.152", | |||
"5.153", | |||
"5.154", | |||
"5.155", | |||
"5.156", | |||
"5.2", | |||
"5.21", | |||
"5.22", | |||
"5.23", | |||
"5.231", | |||
"5.232", | |||
"5.233", | |||
"5.234", | |||
"5.2341", | |||
"5.24", | |||
"5.241", | |||
"5.242", | |||
"5.25", | |||
"5.251", | |||
"5.252", | |||
"5.2521", | |||
"5.2522", | |||
"5.2523", | |||
"5.253", | |||
"5.254", | |||
"5.3", | |||
"5.31", | |||
"5.32", | |||
"5.4", | |||
"5.41", | |||
"5.42", | |||
"5.43", | |||
"5.44", | |||
"5.441", | |||
"5.442", | |||
"5.45", | |||
"5.451", | |||
"5.452", | |||
"5.453", | |||
"5.454", | |||
"5.4541", | |||
"5.46", | |||
"5.461", | |||
"5.4611", | |||
"5.47", | |||
"5.471", | |||
"5.4711", | |||
"5.472", | |||
"5.473", | |||
"5.4731", | |||
"5.4732", | |||
"5.47321", | |||
"5.4733", | |||
"5.474", | |||
"5.475", | |||
"5.476", | |||
"5.5", | |||
"5.501", | |||
"5.502", | |||
"5.503", | |||
"5.51", | |||
"5.511", | |||
"5.512", | |||
"5.513", | |||
"5.514", | |||
"5.515", | |||
"5.5151", | |||
"5.52", | |||
"5.521", | |||
"5.522", | |||
"5.523", | |||
"5.524", | |||
"5.525", | |||
"5.526", | |||
"5.5261", | |||
"5.5262", | |||
"5.53", | |||
"5.5301", | |||
"5.5302", | |||
"5.5303", | |||
"5.531", | |||
"5.532", | |||
"5.5321", | |||
"5.533", | |||
"5.534", | |||
"5.535", | |||
"5.5351", | |||
"5.5352", | |||
"5.54", | |||
"5.541", | |||
"5.542", | |||
"5.5421", | |||
"5.5422", | |||
"5.5423", | |||
"5.55", | |||
"5.551", | |||
"5.552", | |||
"5.5521", | |||
"5.553", | |||
"5.554", | |||
"5.5541", | |||
"5.5542", | |||
"5.555", | |||
"5.556", | |||
"5.5561", | |||
"5.5562", | |||
"5.5563", | |||
"5.557", | |||
"5.5571", | |||
"5.6", | |||
"5.61", | |||
"5.62", | |||
"5.621", | |||
"5.63", | |||
"5.631", | |||
"5.632", | |||
"5.633", | |||
"5.6331", | |||
"5.634", | |||
"5.64", | |||
"5.641", | |||
"6", | |||
"6.001", | |||
"6.002", | |||
"6.01", | |||
"6.02", | |||
"6.021", | |||
"6.022", | |||
"6.03", | |||
"6.031", | |||
"6.1", | |||
"6.11", | |||
"6.111", | |||
"6.112", | |||
"6.113", | |||
"6.12", | |||
"6.1201", | |||
"6.1202", | |||
"6.1203", | |||
"6.121", | |||
"6.122", | |||
"6.1221", | |||
"6.1222", | |||
"6.1223", | |||
"6.1224", | |||
"6.123", | |||
"6.1231", | |||
"6.1232", | |||
"6.1233", | |||
"6.124", | |||
"6.125", | |||
"6.1251", | |||
"6.126", | |||
"6.1261", | |||
"6.1262", | |||
"6.1263", | |||
"6.1264", | |||
"6.1265", | |||
"6.127", | |||
"6.1271", | |||
"6.13", | |||
"6.2", | |||
"6.21", | |||
"6.211", | |||
"6.22", | |||
"6.23", | |||
"6.231", | |||
"6.232", | |||
"6.2321", | |||
"6.2322", | |||
"6.2323", | |||
"6.233", | |||
"6.2331", | |||
"6.234", | |||
"6.2341", | |||
"6.24", | |||
"6.241", | |||
"6.3", | |||
"6.31", | |||
"6.32", | |||
"6.321", | |||
"6.3211", | |||
"6.33", | |||
"6.34", | |||
"6.341", | |||
"6.342", | |||
"6.343", | |||
"6.3431", | |||
"6.3432", | |||
"6.35", | |||
"6.36", | |||
"6.361", | |||
"6.3611", | |||
"6.36111", | |||
"6.362", | |||
"6.363", | |||
"6.3631", | |||
"6.36311", | |||
"6.37", | |||
"6.371", | |||
"6.372", | |||
"6.373", | |||
"6.374", | |||
"6.375", | |||
"6.3751", | |||
"6.4", | |||
"6.41", | |||
"6.42", | |||
"6.421", | |||
"6.422", | |||
"6.423", | |||
"6.43", | |||
"6.431", | |||
"6.4311", | |||
"6.4312", | |||
"6.432", | |||
"6.4321", | |||
"6.44", | |||
"6.45", | |||
"6.5", | |||
"6.51", | |||
"6.52", | |||
"6.521", | |||
"6.522", | |||
"6.53", | |||
"6.54", | |||
"7"]; | |||
TLPPropositions.forEach(TLPExpandAll); | |||
function TLPExpandAll(x) { | |||
var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21" | |||
var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21") | |||
var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21" | |||
var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21") | |||
z.style.display = "block"; | |||
b.innerHTML = "Collapse"; | |||
} | } |
Revision as of 21:16, 30 March 2022
/* All JavaScript here will be loaded for users of the MinervaNeue skin */
// Template:TLP drawer
function TLPExpand(x) {
var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21")
var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
if (z.style.display === "block") {
z.style.display = "none";
b.innerHTML = "Expand";
} else {
z.style.display = "block";
b.innerHTML = "Collapse";
}
}
const TLPPropositions = ["1",
"1.1",
"1.11",
"1.12",
"1.13",
"1.2",
"1.21",
"2",
"2.01",
"2.011",
"2.012",
"2.0121",
"2.0122",
"2.0123",
"2.01231",
"2.0124",
"2.013",
"2.0131",
"2.014",
"2.0141",
"2.02",
"2.0201",
"2.021",
"2.0211",
"2.0212",
"2.022",
"2.023",
"2.0231",
"2.0232",
"2.0233",
"2.02331",
"2.024",
"2.025",
"2.0251",
"2.026",
"2.027",
"2.0271",
"2.0272",
"2.03",
"2.031",
"2.032",
"2.033",
"2.034",
"2.04",
"2.05",
"2.06",
"2.061",
"2.062",
"2.063",
"2.1",
"2.11",
"2.12",
"2.13",
"2.131",
"2.14",
"2.141",
"2.15",
"2.151",
"2.1511",
"2.1512",
"2.15121",
"2.1513",
"2.1514",
"2.1515",
"2.16",
"2.161",
"2.17",
"2.171",
"2.172",
"2.173",
"2.174",
"2.18",
"2.181",
"2.182",
"2.19",
"2.2",
"2.201",
"2.202",
"2.203",
"2.21",
"2.22",
"2.221",
"2.222",
"2.223",
"2.224",
"2.225",
"3",
"3.001",
"3.01",
"3.02",
"3.03",
"3.031",
"3.032",
"3.0321",
"3.04",
"3.05",
"3.1",
"3.11",
"3.12",
"3.13",
"3.14",
"3.141",
"3.142",
"3.143",
"3.1431",
"3.1432",
"3.144",
"3.2",
"3.201",
"3.202",
"3.203",
"3.21",
"3.22",
"3.221",
"3.23",
"3.24",
"3.25",
"3.251",
"3.26",
"3.261",
"3.262",
"3.263",
"3.3",
"3.31",
"3.311",
"3.312",
"3.313",
"3.314",
"3.315",
"3.316",
"3.317",
"3.318",
"3.32",
"3.321",
"3.322",
"3.323",
"3.324",
"3.325",
"3.326",
"3.327",
"3.328",
"3.33",
"3.331",
"3.332",
"3.333",
"3.334",
"3.34",
"3.341",
"3.3411",
"3.342",
"3.3421",
"3.343",
"3.344",
"3.3441",
"3.3442",
"3.4",
"3.41",
"3.411",
"3.42",
"3.5",
"4",
"4.001",
"4.002",
"4.003",
"4.0031",
"4.01",
"4.011",
"4.012",
"4.013",
"4.014",
"4.0141",
"4.015",
"4.016",
"4.02",
"4.021",
"4.022",
"4.023",
"4.024",
"4.025",
"4.026",
"4.027",
"4.03",
"4.031",
"4.0311",
"4.0312",
"4.032",
"4.04",
"4.041",
"4.0411",
"4.0412",
"4.05",
"4.06",
"4.061",
"4.062",
"4.0621",
"4.063",
"4.064",
"4.0641",
"4.1",
"4.11",
"4.111",
"4.112",
"4.1121",
"4.1122",
"4.113",
"4.114",
"4.115",
"4.116",
"4.12",
"4.121",
"4.1211",
"4.1212",
"4.1213",
"4.122",
"4.1221",
"4.123",
"4.124",
"4.1241",
"4.125",
"4.1251",
"4.1252",
"4.126",
"4.127",
"4.1271",
"4.1272",
"4.12721",
"4.1273",
"4.1274",
"4.128",
"4.2",
"4.21",
"4.211",
"4.22",
"4.221",
"4.2211",
"4.23",
"4.24",
"4.241",
"4.242",
"4.243",
"4.25",
"4.26",
"4.27",
"4.28",
"4.3",
"4.31",
"4.4",
"4.41",
"4.411",
"4.42",
"4.43",
"4.431",
"4.44",
"4.441",
"4.442",
"4.45",
"4.46",
"4.461",
"4.4611",
"4.462",
"4.463",
"4.464",
"4.465",
"4.466",
"4.4661",
"4.5",
"4.51",
"4.52",
"4.53",
"5",
"5.01",
"5.02",
"5.1",
"5.101",
"5.11",
"5.12",
"5.121",
"5.122",
"5.123",
"5.124",
"5.1241",
"5.13",
"5.131",
"5.1311",
"5.132",
"5.133",
"5.134",
"5.135",
"5.136",
"5.1361",
"5.1362",
"5.1363",
"5.14",
"5.141",
"5.142",
"5.143",
"5.15",
"5.151",
"5.1511",
"5.152",
"5.153",
"5.154",
"5.155",
"5.156",
"5.2",
"5.21",
"5.22",
"5.23",
"5.231",
"5.232",
"5.233",
"5.234",
"5.2341",
"5.24",
"5.241",
"5.242",
"5.25",
"5.251",
"5.252",
"5.2521",
"5.2522",
"5.2523",
"5.253",
"5.254",
"5.3",
"5.31",
"5.32",
"5.4",
"5.41",
"5.42",
"5.43",
"5.44",
"5.441",
"5.442",
"5.45",
"5.451",
"5.452",
"5.453",
"5.454",
"5.4541",
"5.46",
"5.461",
"5.4611",
"5.47",
"5.471",
"5.4711",
"5.472",
"5.473",
"5.4731",
"5.4732",
"5.47321",
"5.4733",
"5.474",
"5.475",
"5.476",
"5.5",
"5.501",
"5.502",
"5.503",
"5.51",
"5.511",
"5.512",
"5.513",
"5.514",
"5.515",
"5.5151",
"5.52",
"5.521",
"5.522",
"5.523",
"5.524",
"5.525",
"5.526",
"5.5261",
"5.5262",
"5.53",
"5.5301",
"5.5302",
"5.5303",
"5.531",
"5.532",
"5.5321",
"5.533",
"5.534",
"5.535",
"5.5351",
"5.5352",
"5.54",
"5.541",
"5.542",
"5.5421",
"5.5422",
"5.5423",
"5.55",
"5.551",
"5.552",
"5.5521",
"5.553",
"5.554",
"5.5541",
"5.5542",
"5.555",
"5.556",
"5.5561",
"5.5562",
"5.5563",
"5.557",
"5.5571",
"5.6",
"5.61",
"5.62",
"5.621",
"5.63",
"5.631",
"5.632",
"5.633",
"5.6331",
"5.634",
"5.64",
"5.641",
"6",
"6.001",
"6.002",
"6.01",
"6.02",
"6.021",
"6.022",
"6.03",
"6.031",
"6.1",
"6.11",
"6.111",
"6.112",
"6.113",
"6.12",
"6.1201",
"6.1202",
"6.1203",
"6.121",
"6.122",
"6.1221",
"6.1222",
"6.1223",
"6.1224",
"6.123",
"6.1231",
"6.1232",
"6.1233",
"6.124",
"6.125",
"6.1251",
"6.126",
"6.1261",
"6.1262",
"6.1263",
"6.1264",
"6.1265",
"6.127",
"6.1271",
"6.13",
"6.2",
"6.21",
"6.211",
"6.22",
"6.23",
"6.231",
"6.232",
"6.2321",
"6.2322",
"6.2323",
"6.233",
"6.2331",
"6.234",
"6.2341",
"6.24",
"6.241",
"6.3",
"6.31",
"6.32",
"6.321",
"6.3211",
"6.33",
"6.34",
"6.341",
"6.342",
"6.343",
"6.3431",
"6.3432",
"6.35",
"6.36",
"6.361",
"6.3611",
"6.36111",
"6.362",
"6.363",
"6.3631",
"6.36311",
"6.37",
"6.371",
"6.372",
"6.373",
"6.374",
"6.375",
"6.3751",
"6.4",
"6.41",
"6.42",
"6.421",
"6.422",
"6.423",
"6.43",
"6.431",
"6.4311",
"6.4312",
"6.432",
"6.4321",
"6.44",
"6.45",
"6.5",
"6.51",
"6.52",
"6.521",
"6.522",
"6.53",
"6.54",
"7"];
TLPPropositions.forEach(TLPExpandAll);
function TLPExpandAll(x) {
var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21")
var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
z.style.display = "block";
b.innerHTML = "Collapse";
}