User:Josephyr/global.js

importScriptURI('http://josephhawk.wikia.com/index.php?title=User:Josephyr/scripts.js&action=raw&ctype=text/javascript');

if (wgAction == "edit" || wgAction == "publish") { /***** Custom edit buttons *****/ if (mwCustomEditButtons) {

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#redirect",           "tagClose": "", "sampleText": "PAGE" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20100502153339/callofduty/images/1/17/Button_Ssig.jpg", "speedTip": "Signature", "tagOpen": "", "tagClose": "", "sampleText": "" };

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/central/images/b/b4/Button_category03.png", "speedTip": "Category", "tagOpen": "[[Category:",           "tagClose": "]]", "sampleText": "Category name" };   } }

/* Monobook changes. */ function UserLinks {

document.getElementById('pt-mytalk').getElementsByTagName('a')[0].innerHTML = 'Talk'; document.getElementById('pt-preferences').getElementsByTagName('a')[0].innerHTML = 'Preferences'; document.getElementById('pt-mycontris').getElementsByTagName('a')[0].innerHTML = 'Contribs'; $('#pt-mytalk').after($('#pt-mycontris').detach); $('#pt-watchlist').remove; $('#pt-preferences').after('global.jsglobal.css');

if (document.getElementById('ca-move')) { document.getElementById('ca-move').getElementsByTagName('a')[0].innerHTML = 'Move'; }

if (document.getElementById('wpSave')) { document.getElementById('wpSave').value = 'Save page'; } } if (skin != 'oasis') { addOnloadHook(UserLinks); }

/* Skin switch buttons and JS tab. */ function ExtraTabs { $('#p-cactions .pBody ul li:nth-last-child(1)').after('Oasis'); } if (skin != 'oasis') { addOnloadHook(ExtraTabs); }

/* Sub-menus. */ function MonobookSubmenus { var ports = $('.generated-sidebar'); $('#p-search').before(' Wiki navigation  '); var ul = document.getElementById('p-generated').getElementsByTagName('ul')[0]; for (var i = 0; i < ports.length; i++) { var links = ''; for (var j = 0; j < ports[i].getElementsByTagName('li').length; j++) { links += ports[i].getElementsByTagName('li')[j].outerHTML; }       ul.innerHTML += ' ' + ports[i].getElementsByTagName('h5')[0].innerHTML + ' &raquo;  ' + links + '</ul></li>'; }   ports.remove; document.getElementById('p-generated').className = 'generated-sidebar portlet'; //set here to avoid class list loop } if (skin != 'oasis') { addOnloadHook(MonobookSubmenus); }

function ShowMBMenu { clearTimeout(window.sidebartime); var uls = $('.sidebar-subnav'); for (var i = 0; i < uls.length; i++) { uls[i].style.display = 'none'; uls[i].parentNode.onmouseover = function(event) { window.sidebarpar = this; ShowMBMenu; }   }    window.sidebarpar.getElementsByTagName('ul')[0].style.display = 'block'; window.sidebarpar.onmouseover = function(event) { window.sidebarpar = undefined; clearTimeout(window.sidebartime); }   window.sidebarpar.onmouseout = function(event) { window.sidebarpar = this; window.sidebartime = setTimeout('HideMBMenu', 400); } }

function HideMBMenu { window.sidebarpar.getElementsByTagName('ul')[0].style.display = 'none'; window.sidebarpar.onmouseover = function(event) { window.sidebarpar = this; window.sidebartime = setTimeout('ShowMBMenu', 300); }   window.sidebarpar.onmouseout = function(event) { window.sibebarpar = undefined; clearTimeout(window.sidebartime); } }

function ExtraPortlets { $('#p-search').before(' Tools  <a href="/wiki/Special:RecentChanges">Recent changes</a> &raquo; <ul class="sidebar-subnav" style="position:absolute; left:138px; margin-top:-22px; z-index:99999; background-color:#fff; border:1px solid #000; padding:3px 7px 3px 17px; display:none;"><a href="/wiki/Special:Log">Log</a></li><a href="/wiki/Special:NewPages">New pages</a></li><a href="/wiki/Special:NewFiles">New files</a></li></ul></li> <a href="/wiki/Special:CreatePage">Create page</a> &raquo;  <ul class="sidebar-subnav" style="position:absolute; left:138px; margin-top:-22px; z-index:99999; background-color:#fff; border:1px solid #000; padding:3px 7px 3px 17px; display:none;"><a href="/wiki/Special:Upload">Upload</a></li><a href="/wiki/Special:MultipleUpload">Multiple upload</a></li><a href="/wiki/Special:CreateBlogPage">Blog</a></li></ul></li> <a href="/wiki/Special:ListUsers">List</a> &raquo;  <ul class="sidebar-subnav" style="position:absolute; left:138px; margin-top:-22px; z-index:99999; background-color:#fff; border:1px solid #000; padding:3px 7px 3px 17px; display:none;"><a href="/wiki/Special:ListUsers/sysop">Admins</a></li><a href="/wiki/Special:ListUsers/bureaucrat">Bureaucrats</a></li><a href="/wiki/Special:ListUsers/chatmoderator">Chat mods</a></li></ul></li><a href="/wiki/Special:SpecialPages">Special pages</a></li><a href="javascript:OpenChatWindow;">Chat</a></li></ul>  '); $('#p-logo').after($('#p-search').detach); } if (skin != 'oasis') { addOnloadHook(ExtraPortlets) }