User:I Am Andumé/common.js

Source: Wikipedia, the free encyclopedia.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
mw.loader.load( '/w/index.php?title=User:RedWarn/.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:RedWarn/.js]]
mw.loader.load( '/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Joeytje50/JWB.js/load.js]]
/* Automate purge confirmation dialog */
if (mw.config.get('wgAction') === 'purge') {
    $('form[action*="action=purge"]').submit();
}
importScript('User:Enterprisey/archiver.js'); // Backlink: [[User:Enterprisey/archiver.js]]
importScript('User:Ahecht/Scripts/TemplateSearch.js'); // Backlink: [[User:Ahecht/Scripts/TemplateSearch.js]]
importScript('User:Eejit43/scripts/afcrc-helper.js'); // Backlink: [[User:Eejit43/scripts/afcrc-helper.js]]
importScript('User:Eejit43/scripts/null-edit.js'); // Backlink: [[User:Eejit43/scripts/null-edit.js]]
importScript('User:Eejit43/scripts/redirect-helper.js'); // Backlink: [[User:Eejit43/scripts/redirect-helper.js]]
syntaxHighlighterConfig = {
    timeout: 50,
}
importScript('User:Jackmcbarn/editProtectedHelper.js'); // Backlink: [[User:Jackmcbarn/editProtectedHelper.js]]
(function () {
   const c = document.documentElement.classList;
   if ( c.contains( 'skin-night-mode-page-disabled' ) || c.contains( 'skin-theme-clientpref--excluded' ) ) {
     c.remove( 'skin-night-mode-page-disabled' );
     c.remove( 'skin-theme-clientpref--excluded' );

     if ( mw.user.options.values[mw.config.get('skin').replace('-2022','') + '-theme'] === 'day' ) {
       c.add( 'skin-theme-clientpref-day' );
     } else {
       c.add( 'skin-theme-clientpref-night' );
     }
     const btn = document.createElement('button');
     btn.textContent = 'restore day theme';
     btn.setAttribute('style', 'position: fixed; bottom: 0; right: 0;' );
     document.body.appendChild(btn);
     btn.addEventListener('click', () => {
          c.add( 'skin-night-mode-page-disabled' );
          c.remove( 'skin-theme-clientpref-night' );
     } );
   }
}());
mw.loader.load( '/w/index.php?title=User:I_Am_Andum%C3%A9/SyntaxHighlight.css&action=raw&ctype=text/css', 'text/css' ); // Backlink: [[User:I Am Andumé/SyntaxHighlight.css]]

$.when( mw.loader.using( [ 'mediawiki.util' ] ), $.ready ).then( function () {
     mw.util.addPortletLink( 'p-personal', mw.util.getUrl( 'User:' + mw.config.get( 'wgUserName' ) + '/common.css' ), 'Common.css', 'pt-commoncss', '', '', '#pt-preferences'  );
     mw.util.addPortletLink( 'p-personal', mw.util.getUrl( 'User:' + mw.config.get( 'wgUserName' ) + '/common.js' ), 'Common.js', 'pt-commonjs', '', '', '#pt-commoncss'  );
} );