MediaWiki:NewUserIdentityBox/code.js

var mw_config = mw.config.get([       'wgUserName',        'skin',        'wgPageName',        'wgServer',        'wgUserGroups'    ]); if (       ['oasis', 'wikia'].indexOf(mw_config.skin) > -1        && $('#UserProfileMasthead').length    ){ var $masthead_old = $('#WikiaUserPagesHeader'), $masthead = $(''); $.nirvana.getJson('UserProfilePage', 'renderUserIdentityBox', {           title: mw_config.wgPageName.replace('_', ' ')        }, $.proxy(function renderBox(data){ var _user = data.user; $masthead.html(function createIdentityBox{               var $reloadURI = $(''.replace('$reload_uri', _user.userPage)),                    $masthead_content = $(''),                    $tabs = $(''),                    tabs = {                        'Profile': wgServer + '/wiki/User:' + encodeURIComponent(_user.name),                        'Talk Page': wgServer + '/wiki/User_talk:' + encodeURIComponent(_user.name),                        'Blog': wgServer + '/wiki/User_blog:' + encodeURIComponent(_user.name),                        'Contributions': wgServer + '/wiki/Special:Contributions/' + encodeURIComponent(_user.name),                        'Following': wgServer + '/wiki/Special:Following', 'User Activity': wgServer + '/wiki/Special:UserActivity' };               $masthead_content.html(function{                    var $avatar = $(''),                        $masthead_body = $('');                    $avatar.html(function{ var $avatar_img = $(''.replace('$avatar', _user.avatar)), $button = $('') .html('Edit Avatar'); return [$avatar_img, $button]; });                   $masthead_body.html(function{ var row1 = $(''), row2 = $(''); row1.html([                           $('').html([ $('').text(_user.name), $('').html(' aka ' + _user.realName), $(' ').html(_user.tags.map(function(group, index){ return $('').text(group); }))                           ]),                            $(' ').html([ $(' ').html([                                   $('<h3 class="masthead-section-head" />').text('I live in'),                                    $(' ').html(_user.location)                                ]), $(' ').html([                                   $('<h3 class="masthead-section-head" />').text('My occupation is'),                                    $(' ').html(_user.occupation || 'None')                                ]), $(' ').html([                                   $('<h3 class="masthead-section-head" />').text('I am'),                                    $(' ').html(_user.gender)                                ]) ]),                           $(' ').html([ $(' ').html([                                   $('<strong class="edit-counter" />').text(_user.edits),                                    $(' ').text('edits')                                ]), $(' ').html([                                   $('<strong class="tally-head" />').text('Joined:'),                                    $(' ').text(_user.registration)                                ]) ])                       ]);                        row2.html([                            $(' ').html([ $(' ').html([                                   $('<h3 class="masthead-section-head" />').text('Favorite wikis'),                                    $('<ul class="masthead-section-body wikis" />').html(_user.topWikis.map(function(wiki){                                        var $item = $(' ').html('' + wiki.wikiName + '</a>');                                        return $item;                                    }))                                ])/*, $(' ').html([                                   $('<h3 class="masthead-section-head" />').text('My occupation is'),                                    $(' ').text(_user.occupation || 'None')                                ])*/ ])                       ]);                        return [row1, row2]; });                   return [$avatar, $masthead_body];                }); $tabs.html(Object.keys(tabs).map(function(name, index){ if ('User Activity' == name){ var db_name = wgServer.replace(/http:\/\/(.*)\.wikia\.com/g, '$1'); if (['c', 'community'].indexOf(db_name) > -1){ return $('<div class="tab-item _tab" />').html('' + name + '</a>'); }                   } else { return $('<div class="tab-item _tab" />').html('' + name + '</a>'); }               }));                return [$reloadURI, $masthead_content, $tabs]; });       }, this));        $masthead_old.replaceWith($masthead);    } })(this.mediaWiki, this.jQuery, this.masthead || {});
 * (function(mw, $, config){