MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
KokoroSenshi (talk | contribs) m (Moved 'Temporary upload-related things' to Upload Validation gadget (the Required attribute for Source)) |
PhantomCaleb (talk | contribs) (remove unused (I think?) variables) |
||
Line 1: | Line 1: | ||
// Any JavaScript here will be loaded for all users on every page load. | // Any JavaScript here will be loaded for all users on every page load. | ||
// -------------------------------------------------------- | // -------------------------------------------------------- | ||
Line 34: | Line 7: | ||
$(function() { | $(function() { | ||
var isMovingFile = | var isMovingFile = mw.config.get("wgPageName").startsWith("Special:MovePage/File"); | ||
if(isMovingFile) { | if(isMovingFile) { | ||
var leaveRedirectCheckbox = $("input[name=wpLeaveRedirect]")[0]; | var leaveRedirectCheckbox = $("input[name=wpLeaveRedirect]")[0]; | ||
Line 48: | Line 21: | ||
$(function() { | $(function() { | ||
if ( | if (mw.config.get("wgPageName") == "Special:ExpandTemplates") { | ||
var suppressNowikiTagsCheckbox = $("input[name=wpRemoveNowiki]")[0]; | var suppressNowikiTagsCheckbox = $("input[name=wpRemoveNowiki]")[0]; | ||
suppressNowikiTagsCheckbox.checked = true; | suppressNowikiTagsCheckbox.checked = true; |
Revision as of 20:52, 5 November 2017
// Any JavaScript here will be loaded for all users on every page load.
// --------------------------------------------------------
// Special:MovePage
// Uncheck "Leave a redirect behind" if moving a file
// --------------------------------------------------------
$(function() {
var isMovingFile = mw.config.get("wgPageName").startsWith("Special:MovePage/File");
if(isMovingFile) {
var leaveRedirectCheckbox = $("input[name=wpLeaveRedirect]")[0];
leaveRedirectCheckbox.checked = false;
}
});
// --------------------------------------------------------
// Special:ExpandTemplates
// Check "Suppress <nowiki> tags in result" when using ExpandTemplates
// --------------------------------------------------------
$(function() {
if (mw.config.get("wgPageName") == "Special:ExpandTemplates") {
var suppressNowikiTagsCheckbox = $("input[name=wpRemoveNowiki]")[0];
suppressNowikiTagsCheckbox.checked = true;
}
});
// --------------------------------------------------
// CrazyEgg Tracking
// --------------------------------------------------
setTimeout(function(){
var a=document.createElement("script"),
b=document.getElementsByTagName("script")[0];
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0011/8371.js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}
, 1);