User:Ultimate Dark Carnage/wikia.js

/*importArticles({   type: 'script',    articles: [        'u:dev:NewUserIdentityBox/code.js'    ] });*/

$(document).ready(function{   var $community_header = $('.wds-community-header');    $community_header.find('.wds-button-group').children('.wds-button').filter(function{ return $(this).attr('data-tracking') == 'wiki-activity'; }).append(' Wiki Activity '); });

var mw_config = mw.config.get([           'skin',            'wgPageName',            'wgCanonicalSpecialPageName',            'wgUserName'        ]), settings = $.extend(mediaViewer, {           isOasis: ( typeof Array.prototype.some !== 'undefined' ? Array.prototype.some.call(['oasis', 'wikia'], function(s){                   return mw_config.skin == s;                }) : ['oasis', 'wikia'].indexOf(mw_config.skin) > -1 ),           isImages: mw_config.wgCanonicalSpecialPageName == 'Images',            noop: false        }); if (!settings.isOasis || !settings.isImages){ settings.noop = true; }   if (settings.noop) return; else { $(document).ready(function{           if (!$('.wikia-gallery-item').length) return;            $('.wikia-gallery-item').each(function(index){ var $item = $(this), $lightbox = $item.find('a.image.lightbox'), $caption = $item.find('.lightbox-caption'); $lightbox.on('click', function(event){                   console.log($(event.target).prop('outerHTML'));                    event.preventDefault;                    var $mediaViewer = $(' ', { 'class': 'media-viewer', 'id': 'media-viewer'}),                        $mvWrapper = $(' ', { 'class': 'media-viewer-wrapper mw-wrapper', 'id': 'media-viewer-wrapper'}),                        link = ($(event.target).is('.image.lightbox') ? $(event.target) : $(event.target).parent).attr('href'),                       image_src = ($(event.target).is('.thumbimage') ? $(event.target) : $(event.target).find('.thumbimage')).attr('src'),                       user = $caption.find('.wikia-gallery-item-user').text;                    $mvWrapper.html(function{ var $mvImage = $(' ', { 'class': 'media-viewer-image mv-image', 'src': image_src, 'alt': ($(event.target).is('.thumbimage') ? $(event.target) : $(event.target).find('.thumbimage')).attr('data-image-name') }), $mvDescription = $(' ', { 'class': 'media-viewer-description mv-description'}); $mvDescription.html(function{                           var $descHeader = $(' ', { 'class': 'description-header', 'id': 'description-header', html: ($(event.target).is('.thumbimage') ? $(event.target) : $(event.target).find('.thumbimage')).attr('data-image-name') }),                                $descContent = $(' ', { 'class': 'description', 'id': 'description-content' });                            $descContent.html([ $(' ', { 'class': 'description-user' }) .html(function{                                       var $avatar = $(' ', { 'class': 'description-avatar'}),                                            $user = $(' ', { 'class': 'description-user', text: user });                                        $.ajax({ method: 'GET', dataType: 'json', url: mw.util.wikiScript('wikia'), data: { controller: 'UserProfilePageController', method: 'renderUserIdentityBox', title: 'User:' + user, format: 'json' }                                       }).done(function(data){ if (!data.error || typeof data.error !== 'undefined'){ var avatar_src = data.user.avatar; $avatar.attr('src', avatar_src); }                                       });                                        return [$avatar, $user];                                    }), $('', { 'class': 'wds-button', 'href': link, text: 'More details'}) ]);                           return [$descHeader, $descContent];                        }); return [$mvImage, $mvDescription]; });                   $mediaViewer.html($mvWrapper);                    if (!$('#media-viewer').length) $('.WikiaSiteWrapper').append($mediaViewer);                }); });       });    } })(this.mediaWiki, this.jQuery, this.MediaViewer = this.MediaViewer || {});
 * (function(mw, $, mediaViewer){

$('.WikiaBarWrapper .tools').append(' » ▲ ● ► ▼ #trigger{font-size:16px;color:white !important;display:inline-block;cursor:default;transition:transform .5s;-moz-transition:-moz-transform .5s;-webkit-transition:-webkit-transform .5s;-o-transition:-o-transform .5s}.spell{display:inline-block;color:white !important;margin:0 3px;vertical-align:top;cursor:pointer;transition:transform .5s,text-shadow .5s;-moz-transition:-moz-transform .5s,text-shadow .5s;-webkit-transition:-webkit-transform .5s,text-shadow .5s;-o-transition:-o-transform .5s,text-shadow .5s}.spell:hover{text-shadow:0 0 4px silver} '); $('#MagicSpells').mouseenter(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'}); } ); $('#MagicSpells').mouseleave(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'}); } ); $('.scroll-top').click(function {	$(this).parents('html, body').animate({scrollTop:0}, 'slow'); } ); $('#toggle-ads').toggle(function {	$('#toggle-ads').attr('title','Show ads');	$('.wikia-ad, .SelfServeUrl, .home-top-right-ads').hide('slow'); },	function {		$('#toggle-ads').attr('title','Hide ads');		$('.wikia-ad, .SelfServeUrl, .home-top-right-ads').show('slow');	} ); $('#hide-rail').toggle(function {	$('#hide-rail').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'});	$('#hide-rail').attr('title', 'Show rail');	$('.WikiaRail').hide('slow');	$('.WikiaMainContent').animate({width:'1010'}, 'slow'); },	function {		$('#hide-rail').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'});		$('#hide-rail').attr('title', 'Hide rail');		$('.WikiaRail').show('slow');		$('.WikiaMainContent').animate({width:'670'}, 'slow');	} ); $('.scroll-bottom').click(function {	$(this).parents('html, body').animate({scrollTop: $(document).height}, 'slow'); } );