User:Jäzzi/global.js

importScriptURI('http://c.wikia.com/index.php?title=User:J%C3%A4zzi/sidebar.js&action=raw&ctype=text/javascript') 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/ClearAutoDelete.js&action=raw&ctype=text/javascript'); importScriptPage('AdvancedOasisUI/code.js', 'dev'); importScriptPage('AjaxRC/code.js', 'dev'); importScriptPage('User:Joeyaa/wham.js','vstf'); importScriptPage('MediaWiki:WhamAPI.js','monchbox');

// ============================================================ // 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);

/* get all personal code files in chat */ $(setTimeout('ChatCheck', 200)); function ChatCheck { if($('.chat-join button').length != 0) { $('.chat-join button').replaceWith('<a class="wikia-button" onclick="OpenChatWindow"><img src="http://images.wikia.com/common/__cb36140/extensions/wikia/Chat/images/chat_icon.png" style="margin-right:3px;">Join the Chat</a>'); } else { setTimeout('ChatCheck', 200); } } function OpenChatWindow { window.chatwindow = window.open('/wiki/Special:Chat'); window.chatwindow.onload = function {window.chatwindow.$('body').prepend('<script src="' + wgServer + '/index.php?title=User:' + wgUserName + '/wikia.js&action=raw&ctype=text/javascript"> <style type="text/css">/*<![CDATA[*/@import "http://community.wikia.com/index.php?title=User:' + wgUserName + '/global.css";/*]]>*/ <style type="text/css">/*<![CDATA[*/@import "' + wgServer + '/index.php?title=User:' + wgUserName + '/wikia.css";/*]]>*/ ');} } importScriptPage('User:Monchoman45/ChatHacks.js', 'community');