MediaWiki:Common.js: diferència entre les revisions

m Applying changes that should make this JS file partially HTTPS-ready. If you have any questions or noticed issues related to this edit, please reach out to us using the Special:Contact page.
removing displayTimer code due to security concerns: If you still need this functionality, please import w:c:dev:displayTimer
 
Línia 511: Línia 511:
   
   
importScript( 'MediaWiki:Functions.js' );
importScript( 'MediaWiki:Functions.js' );
//<pre>
// ============================================================
// Rellotge de la barra Wikia
// ============================================================
var refreshDate;
function addDate() {
    var UTCDate = (new Date()).toLocaleDateString() + ' ' + (new Date()).toLocaleTimeString();
    $('#showdate').empty().append('<span style="font-weight: bold; text-transform: none;"><a title="Purge the server cache and update the contents of this page." href="' + wgArticlePath.replace('$1', wgPageName.replace(/ /g, '_')) + '?action=purge">' + UTCDate + '</a></span>');
    window.clearTimeout(refreshDate);
    refreshDate = window.setTimeout(addDate, 1000);
}
$(document).ready(function() {
    if (skin == 'oasis')
        $('<li id="displayTimer"><span id="showdate"></span></li>').appendTo('#GlobalNavigation');
    else
        $('#p-personal ul').prepend('<li><span id="showdate"></span></li>');
    addDate();
    refreshDate = window.setTimeout(addDate, 5000);
    $('#displayTimer').css({'font-size': "12px"});
});
//</pre>