Jump to content

MediaWiki:Common.js: Difference between revisions

From Electron: Chat App Wiki
Johnball589 (talk | contribs)
No edit summary
Johnball589 (talk | contribs)
No edit summary
Line 1: Line 1:
// Any JavaScript here will be loaded for all users on every page load.
var today = new Date();
var today = new Date();
var month = today.getMonth() + 1;
var month = today.getMonth() + 1;
var day = today.getDate();
var day = today.getDate();


var prankMonth = 10;
var prankMonth = 10; // October
var prankDay = 12;
var prankDay = 12;   // your test day


var pageName = mw.config.get('wgPageName');
var pageName = mw.config.get('wgPageName');


if (month === prankMonth && day === prankDay) {
if (month === prankMonth && day === prankDay) {
     if (
     if (
         !pageName.startsWith('AF:') &&
         !pageName.startsWith('AF:') &&
         pageName !== 'MediaWiki:Common.js'
         pageName !== 'MediaWiki:Common.js'
     ) {
     ) {
         window.location.href = '/wiki/AF:' + pageName;
         if (pageName === 'Main_Page') {
            window.location.href = '/wiki/AF:Main_Page';
        } else {
            window.location.href = '/wiki/AF:' + pageName;
        }
     }
     }
}
}

Revision as of 16:45, 12 October 2025

// Any JavaScript here will be loaded for all users on every page load.

var today = new Date();
var month = today.getMonth() + 1;
var day = today.getDate();

var prankMonth = 10;  // October
var prankDay = 12;    // your test day

var pageName = mw.config.get('wgPageName');

if (month === prankMonth && day === prankDay) {

    if (
        !pageName.startsWith('AF:') &&
        pageName !== 'MediaWiki:Common.js'
    ) {
        if (pageName === 'Main_Page') {
            window.location.href = '/wiki/AF:Main_Page';
        } else {
            window.location.href = '/wiki/AF:' + pageName;
        }
    }
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.