User:Smashman/vector.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.
mediaWiki.loader.using('mediawiki.util', function() {
"use strict";
jQuery(function($) {
// Double run protection.
if ($('#displayTimer, #showdate, #DisplayClockJS').length) return;
var $parent = $('<span id="showdate" />'),
$node = $('<a title="Purge the server cache and update the contents of this page." href="' + mediaWiki.util.wikiGetlink() + '?action=purge" />')
.appendTo($('<span style="font-weight: bold; text-transform: none;" />')
.appendTo($parent)
);
function updateDate() {
$node.text(new Date().toUTCString().replace("GMT", "(UTC)").substr(5));
}
if (mediaWiki.config.get('skin') === 'oasis') {
$('<li id="displayTimer" />').css('fontSize', "12px").append($parent).appendTo('#GlobalNavigation');
} else {
$('#p-personal ul').prepend($('<li id="displayTimer" />').append($parent));
}
updateDate();
window.setInterval(updateDate, 1000);
$parent = null;
});
});