User:Jerry/quicklinks.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:Jerry/quicklinks. |
//Please leave this link: [[User:Jerry/quicklinks.js]]
//<pre><nowiki>
// Quicklinks
// To install this, you can copy it into your monobook.js or use a script-inclusion
// method (see WikiProject User Scripts). It produces hypertext anchor links at the
// top of pages to purge the current page's cahce, and to several category pages of
// particular use to administrators. You can copy this script to your own userspace
// modify or remove the quicklinks if you don't like the ones I included.
// by User:Jerry
addOnloadHook(function () {
// if this is preview page or generated page, stop
if(
document.getElementById("wikiPreview") ||
document.getElementById("histlegend") ||
document.getElementById("difference") ||
document.getElementById("watchdetails") ||
document.getElementById("ca-viewsource") ||
window.location.href.indexOf("/wiki/Special:") != -1
) {
if(window.location.href.indexOf("&action=edit§ion=0") != -1) {
document.getElementById("wpSummary").value = "/* Intro */ ";
}
return;
};
// get the page title
var pageTitle = wgPageName;
// create div and set innerHTML to link
var divContainer2 = document.createElement("div");
divContainer2.innerHTML = '<div>[<a href="/wiki/'+pageTitle+'?action=purge">purge cache</a>] [<a href="/wiki/Wikipedia:Usernames_for_administrator_attention?action=purge">WP:UAA</a>] [<a href="/wiki/Wikipedia:Requests for page protection?action=purge">WP:RFPP</a>] [<a href="/wiki/Wikipedia:Administrator_intervention_against_vandalism?action=purge">WP:AIV</a>] [<a href="/wiki/Category:Candidates_for_speedy_deletion?action=purge">WP:CSD</a>] [<a href="/wiki/Wikipedia:Stub types for deletion?action=purge">WP:SFD</a>] [<a href="/wiki/Wikipedia:Administrators%27_noticeboard?action=purge">WP:AN</a>] [<a href="/wiki/User:Jerry/Maint?action=purge">Maint</a>] [<a href="/wiki/Wikipedia:Articles_for_deletion/Old/Open_AfDs?action=purge">WP:AFDO</a>] [<a href="http://tools.wikimedia.de/~agony/orphantalk/index.php?l=en">OrGen</a>] [<a href="/wiki/Special:NewPages">New</a>] [<a href="/wiki/Wikipedia:WikiProject_Deletion_sorting/Schools?action=purge">School</a>]</div>';
// insert divContainer2 into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer2, document.getElementsByTagName("h1")[0]);
}
});