MediaWiki:Wikia.js

// Putting it here because its a Wikia-skin (oasis) only problem.

// Resize Wikia page 90% of desktop width if wider than 1024 pixels.

desktop = 1024; $w_main = $('section#WikiaPage'); w_main = (screen.width > desktop) ? screen.width * 0.85 : $w_main.width;

$w_rail = $('div.WikiaRail#WikiaRail'); w_rail = (document.URL.split('?')[0]            == 'http://unchartedwaters.wikia.com/wiki/Official_Uncharted_Waters_Wiki') ? 0 : 320;

$w_head = $('header#wikiheader'); w_head = w_main - 20;

$w_navi = $('div.navbackground'); w_navi = w_head - 251;

$w_content = $('article.WikiaMainContent'); w_content = (screen.width > desktop) ? w_main - w_rail : $w_content.width;

xpanbutt = 'Xpand -->'; xpanded = false;

function rszpg(content, rail, xpanstat, dsplay, txt, title) { xpanded = xpanstat; $w_content.css('width', content); $w_rail.css({ 'width': rail, 'display': dsplay }); $xpanbutt.text(txt).attr('title', title); }

if (w_rail != 0) { $('div.buttons', 'header#WikiHeader').prepend(xpanbutt); $xpanbutt = $('a#XpanButton'); $xpanbutt.click(function {        if (xpanded == false) {            rszpg(w_main, 0, true, 'none', 'Restor <--', 'Compress the content area & restore the side rail');        } else {            rszpg(w_content, w_rail - 20, false, 'block', 'Xpand -->', 'Expands the content area & hide the side rail');        }    }); }

if (screen.width > desktop) { $('header#WikiaHeader').width(w_main + 14); $w_main.width(w_main); $w_head.width(w_head); $w_navi.width(w_navi); $w_content.width(w_content); $('div.wikiaPhotoGallery-slider-body').css('margin', 'auto'); $('div.toolbar').width(w_main + 10); $('section#EditPageDialog').width(w_content);

//$shr = $('a.wikia-button.share-button.secondary') //$p_shr = $shr.offset.left + 3; //$('div#SharingToolbar').css({ 'left': $p_shr, 'z-index': '5' }); $('div#SharingToolbar').css({ 'left': w_main, 'z-index': '5' }); }

function importScriptPage(page, server) { var url = '/index.php?title=' + encodeURIComponent(page.replace(/ /g, '_')).replace('%2F', '/').replace('%3A', ':') + '&action=raw&ctype=text/javascript'; if (typeof server == "string") url = (server.indexOf('://') == -1) ? 'http://' + server + '.wikia.com' + url : server + url; return importScriptURI(url); } /** See: http://dev.wikia.com/wiki/Talk:ShowHide#The_Oasis_problem_has_been_solved **/