User:Phillycj/global.js

importScriptPage('User:Monchoman45/ChatHacks.js', 'c');

/* change wiki activity to recent changes */ function WikiActivity2RecentChanges { $('.wikia-button[data-id$="wikiactivity"]').replaceWith('Recent Changes'); } addOnloadHook(WikiActivity2RecentChanges);

// ============================================================ // displayTimer // ============================================================ //Add a clock to the WikiHeader //Modified from work by Patrick Westerhoff [poke]: //http://bulbapedia.bulbagarden.net/wiki/MediaWiki:Monobook.js hookEvent( 'load', displayTimer ); function displayTimer {   if ( typeof( timerDisplay ) !== 'undefined' && timerDisplay === false ) return; var date; if (skin == 'oasis') {   var timerParent = document.getElementById( 'WikiHeader' ).getElementsByTagName( 'div' )[0]; }   if (skin == 'monobook') {   var timerParent = document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' )[0]; }   var timerLink   = document.createElement( 'a' ); var timerObj   = document.createElement( 'li' ); timerLink.href              = '/wiki/' + wgPageName + '?action=purge'; timerLink.title             = 'Purge the server cache and update the contents of this page.' timerObj.id                 = 'displayTimer'; timerObj.style.textTransform = 'none'; timerObj.style.fontWeight   = 'bold'; timerObj.style.fontSize     = '100%'; timerObj.appendChild( timerLink ); timerParent.insertBefore( timerObj, timerParent.firstChild ); if (skin == 'oasis') {       $('#displayTimer').css({'position': "inherit", 'right': "0px", 'top': "-28px"}); }   var month = new Array(12); month[0] = "Jan"; month[1] = "Feb"; month[2] = "Mar"; month[3] = "Apr"; month[4] = "May"; month[5] = "Jun"; month[6] = "Jul"; month[7] = "Aug"; month[8] = "Sep"; month[9] = "Oct"; month[10] = "Nov"; month[11] = "Dec"; function actualizeUTC {       timerDate           = new Date; timerLink.innerHTML = ( timerDate.getUTCDate    < 10 ? '0' : '' ) + timerDate.getUTCDate     + ' ' + ( timerDate.getUTCMonth   < 10 ?  :   ) + month[timerDate.getUTCMonth] + ' ' + ( timerDate.getUTCFullYear < 10 ? '0' : '' ) + timerDate.getUTCFullYear + ' ' + ( timerDate.getUTCHours   < 10 ? '0' : '' ) + timerDate.getUTCHours    + ':' + ( timerDate.getUTCMinutes < 10 ? '0' : '' ) + timerDate.getUTCMinutes  + ':' + ( timerDate.getUTCSeconds < 10 ? '0' : '' ) + timerDate.getUTCSeconds  + ' (UTC)'; }   function actualizeCustom {       timerDate           = new Date; timerDate.setMinutes ( timerDate.getMinutes + timerDate.getTimezoneOffset + timerTimezone * 60 ); timerLink.innerHTML = ( timerDate.getDate    < 10 ? '0' : '' ) + timerDate.getDate     + ' ' + ( timerDate.getMonth   < 10 ?  :   ) + month[timerDate.getMonth] + ' ' + ( timerDate.getFullYear < 10 ? '0' : '' ) + timerDate.getFullYear + ' ' + ( timerDate.getHours   < 10 ? '0' : '' ) + timerDate.getHours    + ':' + ( timerDate.getMinutes < 10 ? '0' : '' ) + timerDate.getMinutes  + ':' + ( timerDate.getSeconds < 10 ? '0' : '' ) + timerDate.getSeconds + ' (UTC' + ( timerTimezone < 0 ? '' : '+' ) + timerTimezone + ')'; }   // start if ( typeof( timerTimezone ) !== 'number' ) {       actualizeUTC; setInterval( actualizeUTC, 1000 ); }   else {       actualizeCustom; setInterval( actualizeCustom, 1000 ); } }

//Custom shiny edit buttons if (mwCustomEditButtons) { 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://images1.wikia.nocookie.net/__cb20100304205745/callofduty/images/0/03/Al-Asad.jpg", "speedTip": "Speedy delete: spam", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/__cb20100304205745/callofduty/images/0/03/Al-Asad.jpg", "speedTip": "Speedy delete: unnecessary", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/__cb20100304205745/callofduty/images/0/03/Al-Asad.jpg", "speedTip": "Speedy delete: other reason", "tagOpen": "{{Sdelete|", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/callofduty/images/4/47/T_button.jpg", "speedTip": "Trolling", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/callofduty/images/b/b3/V_button.jpg", "speedTip": "Vandalism", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://i.imgur.com/p0q2A.png", "speedTip": "Needs Images", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://i.imgur.com/E1B5s.png", "speedTip": "Better Images", "tagOpen": "", "tagClose": "", "sampleText": ""};

} //End custom shiny edit buttons