Community Central
Community Central
No edit summary
No edit summary
Line 34: Line 34:
 
// Force source editor on template pages (damn you, InfoboxBuilder!)
 
// Force source editor on template pages (damn you, InfoboxBuilder!)
 
var editButton = document.getElementById( 'ca-edit' );
 
var editButton = document.getElementById( 'ca-edit' );
if ( conf.wgNamespaceNumber === 10 && editButton ) editButton.href += '&useeditor=source';
+
if ( mw.config.get( 'wgNamespaceNumber' ) === 10 && editButton ) editButton.href += '&useeditor=source';

Revision as of 10:36, 1 April 2020

importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:UsefulDropdown/code.js',
        'u:dev:MediaWiki:WHAM/code.2.js',
        'u:dev:MediaWiki:RecentChangesModule/code.js',
        'u:dev:MediaWiki:FindAndReplace/code.js',
        'u:dev:MediaWiki:ToggleDebugMode/code.js',
    ]
});

// Global nav menu
function createLink( target, label, type ) {
    return {
        href: mw.util.getUrl( target ),
        text: label,
        class: ( type === 'nav' ? 'wds-global-navigation__link' : null ),
    };
}
$('.wds-global-navigation__links').empty().append(
    $( '<a>', createLink( 'Special:ListAdmins', 'Admini', 'nav' ) ),
    $( '<a>', createLink( 'Special:Contact/general', 'Kontakt', 'nav' ) ),
    $( '<a>', createLink( 'Special:Community', 'Społeczność', 'nav' ) ),
    $( '<a>', createLink( 'w:c:spolecznosc', 'Centrala', 'nav' ) ),
    $( '<a>', createLink( 'Special:WikiActivity', 'OZ', 'nav' ) ),
    $( '<a>', {
        href: '#',
        class: 'wds-global-navigation__link',
        text: '',
        id: 'get-quick-stats'
    } )
);

// Force source editor on template pages (damn you, InfoboxBuilder!)
var editButton = document.getElementById( 'ca-edit' );
if ( mw.config.get( 'wgNamespaceNumber' ) === 10 && editButton ) editButton.href += '&useeditor=source';