User:Jafeluv/vector.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. |
![]() | The accompanying .css page for this skin is at User:Jafeluv/vector.css. |
// <nowiki>
// Direct link to upload page
mw.util.addPortletLink('p-tb', '//en.wikipedia.org/w/index.php?title=Special:Upload', 'Upload file (direct)', 't-direct', 'Go directly to the upload page', '', document.getElementById('t-upload'));
jQuery( document ).ready( function( $ ) {
var pageTitle = document.getElementById('firstHeading').getElementsByTagName('span')[0].innerHTML;
// Add sandbox link to navigation bar.
mw.util.addPortletLink('p-navigation', '//en.wikipedia.org/wiki/User:Jafeluv/Sandbox', 'Sandbox', 'n-sandbox', 'Show user sandbox', '', '');
// Add inspection toolbox; adapted from [[User:Smith609/toolbox.js]].
var toolboxElement = document.getElementById("p-tb");
var inspectionElement= toolboxElement.cloneNode(true);
inspectionElement.id="p-insp";
inspectionElement.innerHTML = "<h3>Inspection tools</h3><div class=body><ul></ul></div>";
toolboxElement.parentNode.insertBefore(inspectionElement, toolboxElement.nextSibling);
// Add traffic stats link to inspection toolbox; from [[User:Smith609/toolbox.js]].
var now = new Date();
var month = now.getMonth();
var thisMonth = (now.getDay() > 6);
if (thisMonth) month++;
var year = now.getFullYear();
if (month == 0) {
var month=12;
--year;
} else {
var month = ((month <10)?'0':'') + month;
}
mw.util.addPortletLink("p-insp", "http://stats.grok.se/en/" + year + month + "/"+mw.config.get('wgPageName'), 'Traffic stats', '', "Traffic to this page " + (thisMonth?'this':'last') + " month");
// Add Dablinks tool to inspection toolbox.
mw.util.addPortletLink('p-insp', 'http://toolserver.org/~dispenser/cgi-bin/dablinks.py?page=' + mw.config.get('wgPageName'), 'Dablinks', '', 'Check disambiguation links', '');
// Add Checklinks tool to inspection toolbox.
mw.util.addPortletLink('p-insp', 'http://toolserver.org/~dispenser/cgi-bin/webchecklinks.py?page=' + mw.config.get('wgPageName'), 'Checklinks', '', 'Check external links', '');
// Make edits to redirects minor by default.
if(pageTitle.match(/Editing /) && document.editform.wpTextbox1.value.match(/^#redirect/i)) {
// Skip the redirect if it's currently at RfD.
if(document.editform.wpTextbox1.value.toLowerCase().indexOf('{{' + 'rfd}}') == -1) {
if(document.editform.wpMinoredit) {
document.editform.wpMinoredit.checked = true;
}
}
}
});
// </nowiki>