User:Ultimate Dark Carnage/wikia.js

var mw_config = mw.config.get([           'wgUserName',            'skin',            'wgPageName',            'wgServer',            'wgUserGroups'        ]), masthead = $.extend({}, config, {           staffLogo: 'http://slot1.images.wikia.nocookie.net/__cb1493831368/common/extensions/wikia/DesignSystem/bower_components/design-system/dist/svg/wds-company-logo-fandom.svg',            theme_color: ''        }); function toLink(page){ return mw.util.wikiGetlink(page); }   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': mw_config.wgServer + toLink('User:' + _user.name),                        'Talk Page': mw_config.wgServer + toLink('User talk:' + _user.name),                        'Blog': mw_config.wgServer + toLink('User blog:' + _user.name),                        'Contributions': mw_config.wgServer + toLink('Special:Contributions/' + _user.name),                        'Following': mw_config.wgServer + toLink('Special:Following'), 'User Activity': mw_config.wgServer + toLink('Special:UserActivity') };               $masthead_content.html(function{                    var $avatar = $(''),                        $masthead_body = $('');                    $avatar.html(function{ var $avatar_img = $(''.replace('$avatar', _user.avatar.replace(/\/scale-to-width-down\/(\d*)/, '/scale-to-width-down/' + 120))), $button = $('') .html('Edit Avatar'); return [$avatar_img, $button]; });                   $masthead_body.html(function{ var row1 = $(''), row2 = $(''); row1.html([                           $('').html([ $('').text(_user.name), $('').html((_user.realName !== ) ? ' aka ' + _user.realName : ), $(' ').html(_user.tags.map(function(group, index){ return $('').html(function{                                       var tag_html = '';                                        if (group == 'Staff'){                                            tag_html = group + ' ';                                            tag_html = tag_html.concat('<img class="staff-logo" src="' + masthead.staffLogo + '" />');                                        } else {                                            tag_html = group;                                        }                                        return tag_html;                                    }); }))                           ]),                            $(' ').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.filter(function(wiki){                                        return wiki.wikiName !== false;                                    }).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){