User:CruelCow/valve.js
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/*<nowiki>*/ /** additional monobook scripts **/ hookEvent( 'load', displayTimer ); /**** function displayTimer.js * originally by Patrick Westerhoff */ function displayTimer () { if ( typeof( timerDisplay ) !== 'undefined' && timerDisplay === false ) return; var date; 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 = 'pt-timer'; timerObj.style.textTransform = 'none'; timerObj.appendChild( timerLink ); timerParent.insertBefore( timerObj, timerParent.firstChild ); function actualize () { var tempDate = new Date(); timerDate = new Date(tempDate.getTime()+(tempDate.getTimezoneOffset() * 60000)); //UTC instead of local time timerLink.innerHTML = timerDate.toLocaleTimeString(); } actualize(); //setInterval( actualize, 1000 ); //Uncomment to show current time instead of time of page load. } /*</nowiki>*/ // Quicklinks by Wind function addMenu() { var stuff = [ ['Tasks', '/wiki/Team_Fortress_Wiki:Tasks'], ['Wall of Shame', '/wiki/Team Fortress Wiki:Trivia Wall of Shame'], ['Discussion', '/wiki/Team Fortress Wiki:Discussion'], ['Maintenance templates', '/wiki/Category:Maintenance_templates'], ['Category:ERROR', '/wiki/Category:ERROR'], ['Delete log', '/wiki/Special:Log/delete'], ['New Pages log', '/wiki/Special:NewPages'], ['Block log', 'http://wiki.teamfortress.com/w/index.php?title=Special:Log&type=block&:Log'], ['Edit Notice all', '/wiki/MediaWiki:Editnotice-0'], ['Edit Notice specific', '/wiki/Team_Fortress_Wiki:Editnotice/Haunted_Halloween_Gift'], ['Edit Counter', '/w/api.php?action=query&list=users&usprop=editcount&ususers='], ['Warning Blue (|32px)', '/wiki/File:Warning_blue.png'], ['Warning Yellow(|32px)', '/wiki/File:Warning_yellow.png'], ['Warning Red(|32px)', '/wiki/File:Warning_red.png'], ['New Blog/Patch', '/wiki/Template:Updates'] ]; var menudiv = $('<div id="quicklinks" style="background: white; border: 1px solid black; padding: 2px; display: none; position: absolute; z-index: 1000"/>'); var menu = $('<ul/>'); menudiv.append(menu); for(var i = 0; i < stuff.length; i++) { menu.append( $('<li/>').append( $('<a/>').attr('href', stuff[i][1]).text(stuff[i][0]) ) ); } var hovered = false; var onHover = function(){ hovered = true; $('#quicklinks').slideDown('fast'); }; var onOut = function(){ hovered = false; setTimeout(function(){ if(!hovered) { $('#quicklinks').slideUp('fast'); } }, 250); }; $('body').append(menudiv); menudiv.css({ 'left': $('#pt-timer').offset().left.toString() + 'px', 'top': ($('#pt-timer').offset().top + $('#pt-timer').height()).toString() + 'px' }).hover(onHover, onOut); $('#pt-timer').hover(onHover, onOut); } function waitForTimer() { if(!$('#pt-timer').length) { setTimeout(waitForTimer, 100); } else { addMenu(); } } addOnloadHook(waitForTimer);