User:Jäzzi/global.js

importScriptURI('http://c.wikia.com/index.php?title=User:J%C3%A4zzi/buttons.js&action=raw&ctype=text/javascript'); importScriptURI('http://c.wikia.com/index.php?title=User:J%C3%A4zzi/sidebar.js&action=raw&ctype=text/javascript'); importScriptPage('AdvancedOasisUI/code.js', 'dev'); importScriptPage('AjaxRC/code.js', 'dev');

// ============================================================ // displayTimer // ============================================================ var refreshDate; function addDate { var UTCDate = ((new Date).toUTCString).replace("GMT", "(UTC)"); $('#showdate').empty.append(' ' + UTCDate.substring(5) + ' '); window.clearTimeout(refreshDate); refreshDate = window.setTimeout(addDate, 5000); } $(document).ready(function {   if (skin == 'oasis')         $(' ').appendTo('#GlobalNavigation');    else        $('#p-personal ul').prepend(' ');    addDate;    refreshDate = window.setTimeout(addDate, 5000);    $('#displayTimer').css({'font-size': "12px"}); }); //

/* skin change buttons - 2/1/11 */ function CreateSkinChangeButtons { //Oasis buttons $('section header div.buttons a:first-child').before('MonobookVector'); //Monobook buttons $('div#p-cactions.portlet div.pBody ul li:nth-last-child(1)').after('OasisVector</a></li>'); //Vector buttons $('div#p-namespaces.vectorTabs').after(' <ul><a href="/index.php?title='+ encodeURIComponent(wgPageName) +'&useskin=wikia" title="Change to Oasis [o]" id="skinChangeButton" accesskey="o"> Oasis </a></li><a href="/index.php?title='+ encodeURIComponent(wgPageName) +'&useskin=monobook" title="Change to Monobook [m]" id="skinChangeButton" accesskey="m"> Monobook </a></li></ul> '); } addOnloadHook(CreateSkinChangeButtons);

/* kill image popups */ window.wgEnableImageLightboxExt = false; function changeimagelinks { $('#WikiaArticle, .LatestPhotosModule, #article-comments').unbind('click.lightbox');

var a = document.getElementsByTagName('a'); for(var t = 0; t < a.length; ++t) { var a2 = a[t]; var img = a2.getElementsByTagName('img'); if(img[0] != null) { if (a2.href.indexOf('images.wikia.com') != -1) { var link = wgServer + '/wiki/File:' + a2.href.substring(a2.href.lastIndexOf('/') + 1); a2.setAttribute('href',link); }		}	} } addOnloadHook(changeimagelinks);