User:Equazcion/jsTab.js

if (wgNamespaceNumber == 2 || wgNamespaceNumber == 3) { // Don't do anything unless we're in user or usertalk space // Get the current page's username var username = wgTitle.split("/")[0]; // Grab main page tab, remove 'new' class in case it was red var tabjsmain = $('#left-navigation li:not(.selected)').slice(0,1).css('opacity','0.9').removeClass('new'); // Clone main page tab var tabVector = tabjsmain.clone(true).attr('id', main.attr('id')+'-').css('opacity','0.6'); // Construct contribs URL var tabVectorURL = 'http://' + wgPageContentLanguage + '.' + wgNoticeProject + '.org/w/index.php?title=User:' + username + '/vector.js'; // Set contribs tab URL, text, and tooltip tabVector.find('a').attr('href', tabVectorURL).empty.text('vector.js').attr('title', "Show this user's vector.js page"); // Clone main page tab var tabCommon = tabjsmain.clone(true).attr('id', main.attr('id')+'-').css('opacity','0.6'); // Construct stats URL var tabCommonURL = 'http://' + wgPageContentLanguage + '.' + wgNoticeProject + '.org/w/index.php?title=User:' + username + '/common.js'; // Set stats tab URL, text, and tooltip tabCommon.find('a').attr('href', tabCommonURL).empty.text('common.js').attr('title', "Show this user's common.js page");

// Place constructed tabs (done here for easy ordering) tabVector.insertAfter(main); tabCommon.insertAfter(main); }