User:Closed Limelike Curves/matrix-2022.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:Closed Limelike Curves/matrix-2022. This user script seems to have an accompanying .css page at User:Closed Limelike Curves/matrix-2022.css. |
// Replace logo with better one for small size
if (window.location.hostname.includes("wikipedia")) {
$("body").addClass("wikipedia");
$(".mw-logo-icon").attr("src", "/media/wikipedia/commons/1/10/Wikipedia-W-bold-in-square.svg");
}
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Closed_Limelike_Curves/ArticleInfo.js&action=raw&ctype=text/javascript');
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Closed_Limelike_Curves/Collapser.js&action=raw&ctype=text/javascript');
/* complete button layout changes */
$("#p-lang-btn").insertAfter($(".mw-logo"));
$("a.mw-logo").addClass("cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only");
// $("img.mw-logo-icon").addClass("vector-icon");
/* TODO: modify grid layout? */
/*
$(".mw-page-container-inner").css("display", "block");
$("#content").prepend($(".vector-column-start"));
$("#content").css("column-count", "3");
$(".mw-body .vector-page-titlebar").css("grid-column", "2");
$("#content .vector-page-toolbar").css("grid-row", "2");
$("#bodyContent").css("grid-column", "2");
$(".vector-column-start").css("grid-column", "1");
$(".vector-column-end").css("grid-column", "3");
*/
/* TODO: Replace mask with svg so I can use stroke instead of ugly drop-shadow
$(".cdx-button .vector-icon").each(function(index){
x = $(this)
x.append($('<mask>', {"src": x.css("mask-image").split('"')[1], "fill": x.css("background-color")}))
})
*/
// Citations menu
mw.util.addPortlet("p-cite", "Citations", "#p-tb");
buildCitationMenu();
async function buildCitationMenu() {
// Adds link to fill in references with ReFill
var link = "https://refill.toolforge.org/ng/result.php?page=" +
mw.config.get("wgPageName") +
"&wiki=en&method-wiki=Fix%20page&addblankmetadata=on&noaccessdate=on";
await mw.util.addPortletLink("p-cite", link, "ReFill", "t-refill", "Fill references with ReFill");
// Move citation tools to portlet
$("#p-cite > div.vector-menu-content > ul").append($("#t-refill"))
.append($("#ca-RefCon"));
}
// subtitle
// Remove "from Wikipedia"
$("#siteSub").hide();
// prepend to subtitle in case empty
$(".vector-body-before-content").prepend($("<div>"));
mw.hook( 'wikipage.indicators' ).add(function(){
const topicons = $("div.mw-indicators");
topicons.prepend($("#mw-indicator-user-info-popup-indicator"));
topicons.insertAfter($("#firstHeading")); // Move topicons
});
mw.hook( 'wikipage.content' ).add(function(){
$(".vector-body-before-content").css("display", "flex");
$(".vector-body-before-content").css("justify-content", "space-between");
$(".vector-body-before-content").append($("#xtools"));
$(".vector-body-before-content").append($("#p-pbar"));
$(".vector-body-before-content").prepend($("#sdh")); // Move #sdh
const topicons = $("div.mw-indicators");
topicons.prepend($("#mw-indicator-user-info-popup-indicator"));
topicons.insertAfter($("#firstHeading")); // Move topicons
});
/* Load CSS in case user hasn't added it themselves */
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Closed_Limelike_Curves/ColorfulButtons.css&action=raw&ctype=text/css', 'text/css');
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Closed_Limelike_Curves/matrix-2022.css&action=raw&ctype=text/css', 'text/css');