Diskuse s wikipedistou:Wesalius/vector.js

Obsah stránky není podporován v jiných jazycích.
Přidat téma
Z Wikipedie, otevřené encyklopedie

if (mw.config.get('wgNamespaceNumber') == 2 || mw.config.get('wgNamespaceNumber') == 3) { // Don't do anything unless we're in user or usertalk space

 // Set default options for any that haven't been set
 if (contribsTabName == null) var contribsTabName = "Příspěvky";
 if (contribsTabNumber == null) var contribsTabNumber = 50;
 if (contribsTabStats == null) var contribsTabStats = true;
 if (contribsTab == null) var contribsTab = true;
 if (contribsTabStatsName == null) var contribsTabStatsName = "Statistiky";

 // Get the current page's username
 var username = mw.config.get('wgRelevantUserName');

 // Grab leftmost tab
 var contribsTabMain = $j('#left-navigation li:not(.selected)').slice(0,1).css('opacity','0.9');

 if (contribsTab) { // Construct the contribs tab, if it's not turned off

    // Clone main page tab, remove 'new' class in case it was red
    var tabContribs = contribsTabMain.clone(true).attr('id', contribsTabMain.attr('id')+'-').css('opacity','0.9').removeClass('new');

    // Construct contribs URL
    if (mw.config.get('wgNoticeProject') == 'commons') {
        var contribsTabURL = 'http://commons.wikimedia.org/w/index.php?title=Special:Contributions&target=' + username + '&limit=' + contribsTabNumber + '&uselang=' + mw.user.options.get('language');
    } else {
        var contribsTabURL = 'http://' + mw.user.options.get('language')+ '.' + mw.config.get('wgNoticeProject') + '.org/w/index.php?title=Special:Contributions&target=' + username + '&limit=' + contribsTabNumber + '&uselang=' + mw.user.options.get('language');
    }

    // Set contribs tab URL, text, and tooltip
    tabContribs.find('a').attr('href', contribsTabURL).empty().text(contribsTabName).attr('title', "Show this user's contributions");

 }

 if (contribsTabStats) { // Construct the stats tab, if it's not turned off

    // Clone main page tab, remove 'new' class in case it was red
    var tabStats = contribsTabMain.clone(true).attr('id', contribsTabMain.attr('id')+'-').css('opacity','0.9').removeClass('new');

    // Construct stats URL
    var contribsTabStatsURL = 'https://tools.wmflabs.org/supercount/index.php?user=' + username + '&project=' + 
                               mw.user.options.get('language') + '.' + mw.config.get('wgNoticeProject');

    // Set stats tab URL, text, and tooltip
    tabStats.find('a').attr('href', contribsTabStatsURL).empty().text(contribsTabStatsName).attr('title', "Show this user's editing statistics");

 }

 // Place constructed tabs before the first right-hand tab (done here for easy ordering)
 if (contribsTabStats) tabStats.insertBefore($j('#right-navigation li').slice(0,1));
 if (contribsTab) tabContribs.insertBefore($j('#right-navigation li').slice(0,1));

}