/* //<nowiki>
HeaderIcons.js
Created by: Terasail
*/
if (mw.config.get("skin") === "vector-2022") {
//Static header
let headerIconList = $("#p-vector-user-menu-overflow .vector-menu-content-list")[0];
let headerIcons = headerIconList.children;
for (let i = 0; i < headerIcons.length; i++) {//Remove icons after notification buttons
if (headerIcons[i].id !== "pt-userpage-2" && headerIcons[i].id.indexOf("-2") >= 0) {
headerIcons[i].remove();
}
}
let userLinks = $("#p-personal .mw-list-item");
for (let i = 1; i < userLinks.length; i++) {
let tempElem = userLinks[i].cloneNode(true);
tempElem.id = userLinks[i].id + '-2';
tempElem.className = 'user-links-collapsible-item mw-list-item';
tempElem.children[0].className = 'cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only';
$(headerIconList).append(tempElem);
let imageSpan = tempElem.children[0].children[0];
if (window.getComputedStyle(imageSpan).backgroundImage == "none") {
imageSpan.style = "background-image:" + window.getComputedStyle(userLinks[i].children[0].children[0]).backgroundImage;
}
}
//Sticky header
if ($('#vector-sticky-header').length !== 0) {//Check for sticky header
let stickyIconList = $(".vector-sticky-header-buttons")[0];
for (let i = 1; i < userLinks.length; i++) {
let tempElem = userLinks[i].children[0].cloneNode(true);
tempElem.id = userLinks[i].id + '-sticky-header-2';
tempElem.className = 'cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only';
$(stickyIconList).append(tempElem);
let imageSpan = tempElem.children[0];
if (window.getComputedStyle(imageSpan).backgroundImage == "none") {
imageSpan.style = "background-image:" + window.getComputedStyle(userLinks[i].children[0].children[0]).backgroundImage;
}
}
}
}
//</nowiki>[[Category:Wikipedia scripts]]