Jump to content

MediaWiki:Common.js: Difference between revisions

From Ditzy Wiki
imported>BigGarrison
No edit summary
No edit summary
Tag: Manual revert
 
(28 intermediate revisions by 5 users not shown)
Line 1: Line 1:
// we should make this into a wiki forpeople doing recreational birth control pills
(function () {
// What. Who are you Ballswoman? Stop reverying my changers.
     if (mw.config.get('wgNamespaceNumber') < 0) return;
alert("This Is War, Ballswoman");
setInterval(() => {
     const randomNumber = Math.floor(Math.random() * 20) + 1;
   
    if (randomNumber === 10) {
        location.reload();
    }
}, 1000);
(function() {
  const css = `


     body, body * {
     var title = mw.config.get('wgPageName'); // underscores already
      color: #8A0303 !important;
 
      background-color: #4B0000 !important;
    var cssPage = 'MediaWiki:' + title + '.css';
      border-color: #8A0303 !important;
    var jsPage  = 'MediaWiki:' + title + '.js';
     }
 
  `;
     // Load page CSS
  const style = document.createElement('style');
    mw.loader.load(
  style.type = 'text/css';
        mw.util.getUrl(cssPage, { action: 'raw', ctype: 'text/css' }),
  style.appendChild(document.createTextNode(css));
        'text/css'
  document.head.appendChild(style);
    );
 
    // Load page JS
    mw.loader.load(
        mw.util.getUrl(jsPage, { action: 'raw', ctype: 'text/javascript' }),
        'text/javascript'
    );
})();
})();

Latest revision as of 12:02, 12 March 2026

(function () {
    if (mw.config.get('wgNamespaceNumber') < 0) return;

    var title = mw.config.get('wgPageName'); // underscores already

    var cssPage = 'MediaWiki:' + title + '.css';
    var jsPage  = 'MediaWiki:' + title + '.js';

    // Load page CSS
    mw.loader.load(
        mw.util.getUrl(cssPage, { action: 'raw', ctype: 'text/css' }),
        'text/css'
    );

    // Load page JS
    mw.loader.load(
        mw.util.getUrl(jsPage, { action: 'raw', ctype: 'text/javascript' }),
        'text/javascript'
    );
})();