Jump to content

User:Tpbradbury/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tpbradbury (talk | contribs) at 09:31, 17 June 2024 (Installing User:Novem_Linguae/Scripts/anrfc-lister.js (script-installer)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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:Novem_Linguae/Scripts/anrfc-lister.js'); // Backlink: [[User:Novem_Linguae/Scripts/anrfc-lister.js]]