Jump to content

MediaWiki:Common.js: Difference between revisions

From Verified Wikipedia
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
// Remove stats box on CreateAccount page (strong force)
// Remove stats panel on Create Account Page
mw.loader.using('mediawiki.util').then(function () {
mw.loader.using('mediawiki.util').then(function () {
     if (mw.config.get('wgCanonicalSpecialPageName') === 'CreateAccount') {
     if (mw.config.get('wgCanonicalSpecialPageName') === 'CreateAccount') {
 
       
         function removeStatsBox() {
         function removePanel() {
             var statsSelectors = [
             var box = document.querySelector('.mw-createacct-benefits-container');
                '.mw-ge-homepage-stats',
             if (box) box.remove();
                '.mw-ge-homepage-impact',
                '.growth-homepage-module--impact',
                '.growth-homepage-module-type-impact'
            ];
 
             statsSelectors.forEach(function(selector) {
                document.querySelectorAll(selector).forEach(function(el) {
                    el.remove();
                });
            });
         }
         }


         // Run immediately + run again after GrowthExperiments loads
         removePanel();
        removeStatsBox();
         setTimeout(removePanel, 500);
         setTimeout(removeStatsBox, 500);
         setTimeout(removePanel, 1500);
         setTimeout(removeStatsBox, 1500);
         setTimeout(removePanel, 3000);
         setTimeout(removeStatsBox, 3000);
     }
     }
});
});

Revision as of 14:38, 3 December 2025

// Remove stats panel on Create Account Page
mw.loader.using('mediawiki.util').then(function () {

    if (mw.config.get('wgCanonicalSpecialPageName') === 'CreateAccount') {
        
        function removePanel() {
            var box = document.querySelector('.mw-createacct-benefits-container');
            if (box) box.remove();
        }

        removePanel();
        setTimeout(removePanel, 500);
        setTimeout(removePanel, 1500);
        setTimeout(removePanel, 3000);
    }
});