User:Tpbradbury/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.
// Load various user scripts
mw.loader.load("https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript");
importScript('User:Trappist_the_monk/HarvErrors.js');
importScript('User:Ohconfucius/script/Common_Terms.js');
importScript('User:Headbomb/unreliable.js');
importScript('User:Tpbradbury/unreliable-rules.js');
importScript('User:Novem_Linguae/Scripts/CiteHighlighter.js');
mw.loader.load('/w/index.php?title=User:Evad37/rater.js&action=raw&ctype=text/javascript');
importStylesheet('User:N8wilson/AQFetcher-Icons.css');
importScript('User:Anomie/linkclassifier.js');
importScript('User:EpochFail/ArticleQuality-loader.js');
importScript('User:Skynxnex/VitalTopicon.js');
importScript('User:Phlsph7/Readability.js');

// Highlight unreferenced passages automatically
highlightUnreferencedPassagesAutomatic = true;
importScript('User:Phlsph7/HighlightUnreferencedPassages.js');

// Ensure compatibility with Monobook
mw.loader.using(['mediawiki.util'], function () {
    function highlightUnreferencedPassages() {
        var elements = document.querySelectorAll('.unreferenced, .Template-Fact');
        elements.forEach(function (element) {
            element.style.backgroundColor = 'LightPink';
        });
    }
    
    $(document).ready(function () {
        highlightUnreferencedPassages();
    });
});

// Scroll to top when previewing
(function() {
    const allowedActions = ['edit', 'submit'];
    if (allowedActions.indexOf(mw.config.get("wgAction")) !== -1) {
        setTimeout(function() {
            window.scrollTo({ top: 0 });
        }, 1000);
    }
})();
importScript('User:TheTVExpert/rmCloser.js'); // Backlink: [[User:TheTVExpert/rmCloser.js]]