Difference between revisions of "User:Smashman/vector.js"
(Update that thingy I had that went all old and stuff and stopped working) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | mediaWiki.loader.using('mediawiki.util', function() { | |
− | + | "use strict"; | |
− | + | jQuery(function($) { | |
− | + | // Double run protection. | |
− | + | if ($('#displayTimer, #showdate, #DisplayClockJS').length) return; | |
− | + | ||
− | function | + | 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; | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | setInterval( | ||
− | |||
− | |||
− | |||
− | $ | ||
− | |||
− | |||
}); | }); | ||
− | |||
− | |||
− | |||
− | |||
}); | }); |
Latest revision as of 17:10, 21 June 2014
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; }); });