User:Euphoria/common.js: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
// Load necessary module asynchronously
window.catALotPrefs = { editpages: true, subcatcount: 100 };
mw.loader.using(['jquery.ui', 'mediawiki.util']).done(function () {
mw.loader.using(['mediawiki.util'])
.then(function () {
mw.util.addCSS("#cat_a_lot_settings { display:none !important;}"); // Preferences depend on some Commons gadgets, not available locally
// Clear contents of elements with class 'vector-menu-dropdown'
mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-Cat-a-lot.js&action=raw&ctype=text/javascript');
$('.vector-menu-dropdown').empty();
mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-Cat-a-lot.css&action=raw&ctype=text/css', 'text/css');

});
// Add a link to the 'p-cactions' portlet pointing to CentralAuth
var sulLink = mw.util.addPortletLink(
'p-cactions',
mw.util.getUrl('Special:CentralAuth/' + mw.user.getName()),
'SUL',
'ca-sul',
'SUL',
null,
'#ca-sul'
);
});

Revision as of 06:47, 10 November 2023

// Load necessary module asynchronously
mw.loader.using(['mediawiki.util'])
    .then(function () {
        // Clear contents of elements with class 'vector-menu-dropdown'
        $('.vector-menu-dropdown').empty();

        // Add a link to the 'p-cactions' portlet pointing to CentralAuth
        var sulLink = mw.util.addPortletLink(
            'p-cactions',
            mw.util.getUrl('Special:CentralAuth/' + mw.user.getName()),
            'SUL',
            'ca-sul',
            'SUL',
            null,
            '#ca-sul'
        );
    });