Misplaced Pages

User:The Earwig/monobook.js

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:The Earwig

This is an old revision of this page, as edited by MusikAnimal (talk | contribs) at 01:14, 18 December 2019 (User:The Earwig: removing reference to ext.gadget.dropdown-menus-nonvector which no longer exists; new version of the gadget will surface BRFAs. There's also an API to add more links, see meta:MoreMenu#Customization :)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Revision as of 01:14, 18 December 2019 by MusikAnimal (talk | contribs) (User:The Earwig: removing reference to ext.gadget.dropdown-menus-nonvector which no longer exists; new version of the gadget will surface BRFAs. There's also an API to add more links, see meta:MoreMenu#Customization :))(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
The accompanying .css page for this skin is at User:The Earwig/monobook.css.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Misplaced Pages:Bypass your cache.
// ------------------------------ Script imports ------------------------------

importScript("User:The Earwig/copyvios.js"); // ]
importScript("User:The Earwig/permalink.js"); // ]
importScript("User:The Earwig/tfdclerk.js"); // ]
importScript("User:The Earwig/orfurrev.js"); // ]

importScript('User:Shubinator/DYKcheck.js');
importScript('User:Mr.Z-man/closeAFD.js');
importScript('User:Dr_pda/prosesize.js');
importScript("User:PleaseStand/userinfo.js");
importScript('User:Ale_jrb/Scripts/csdhelper.js'); // ]
importScript('User:Anomie/linkclassifier.js'); // ]

// ----------------------------- Interface tweaks -----------------------------

// <nowiki>

// Fix sandbox link

$.when(mw.loader.using(), $.ready).then(function() {
	var uname = mw.util.wikiUrlencode(mw.config.get("wgUserName"));
	var url = "/User:" + uname + "/Sandbox";
	$("#pt-sandbox a").attr("href", url).toggleClass("new");
});

// Add a ] portlet link for subpages

$.when(mw.loader.using(), $.ready).then(function() {
	var title = mw.util.wikiUrlencode(mw.config.get("wgPageName"));
	var url = mw.util.getUrl("Special:PrefixIndex/" + title);
	mw.util.addPortletLink(
    	"p-tb",
    	url,
    	"Prefix index",
    	"t-prefixindex",
    	"List subpages of the current page"
	);
});

// Move "Upload file" and "Special pages" from tools portlet to interaction portlet

$.when($.ready).then(function() {
	$("#t-upload,#t-specialpages").appendTo($("#p-interaction ul"));
});

// Modifications to edit links

$.when(mw.loader.using(), $.ready).then(function() {
	if ($("#ca-edit a").text().indexOf("Create") >= 0)
		$("#ca-edit a").text("Create");  // "create this page / create source" -> "create"
	else
		$("#ca-edit a").text("Edit");  // "edit this page / edit source" -> "edit"
	$("#ca-addsection a").text("+"); // "new section" -> "+"
	$("#ca-ve-edit a").text("VE"); // "edit this page" -> "ve"

	$(".mw-editsection a:first-of-type").text("edit"); // "edit source" -> "edit"
	$(".mw-editsection-visualeditor").text("ve"); // "edit" -> "ve"
});

// Add a SUL info link to userpages

$.when(mw.loader.using(), $.ready).then(function() {
	if (mw.config.get("wgNamespaceNumber") & ~1 != 2)
		return;
	var parts = mw.config.get("wgPageName").split("/", 1).split(":");
	parts.shift();
	var user = mw.util.wikiUrlencode(parts.join(":"));
	var url = mw.util.getUrl("Special:CentralAuth/" + user);
	mw.util.addPortletLink(
    	"p-tb",
    	url,
    	"SUL info",
    	"t-sulinfo",
    	"Show global user account info"
	);
});

// Nav popups

window.popupFixDabs = true;

// </nowiki>