更改

// Edit via Wikiplus
第5行: 第5行:  
  * in UTC+8, and also provides a link to purge the current page.
 
  * in UTC+8, and also provides a link to purge the current page.
 
  *
 
  *
  * Based on Gadget-UTCLiveClock.js (revision November 2017)
+
  * Based on Gadget-UTCLiveClock.js (revision November 2017) with tweaks to get UTC+8 time
 
  * Revision: June 2020
 
  * Revision: June 2020
 
  * Original Source: https://www.mediawiki.org/wiki/MediaWiki:Gadget-UTCLiveClock.js
 
  * Original Source: https://www.mediawiki.org/wiki/MediaWiki:Gadget-UTCLiveClock.js
第25行: 第25行:  
// Set the time.
 
// Set the time.
 
var hh = (now.getUTCHours() + 8);
 
var hh = (now.getUTCHours() + 8);
while(hh > 24) {hh -= 24;}
+
while(hh >= 24) {hh -= 24;}
 
var mm = now.getUTCMinutes();
 
var mm = now.getUTCMinutes();
 
var ss = now.getUTCSeconds();
 
var ss = now.getUTCSeconds();
var time = padWithZeroes( hh ) + ':' + padWithZeroes( mm ) + ':' + padWithZeroes( ss );
+
var time = padWithZeroes( hh ) + ':' + padWithZeroes( mm ) + ':' + padWithZeroes( ss ) + ' UTC+8';
$target.text( `${time} UTC+8` );
+
$target.text( time );
    
// Schedule the next time change.
 
// Schedule the next time change.
第48行: 第48行:  
// Set CSS styles. We do this here instead of on the CSS page because some
 
// Set CSS styles. We do this here instead of on the CSS page because some
 
// wikis load this page directly, without loading the accompanying CSS.
 
// wikis load this page directly, without loading the accompanying CSS.
mw.util.addCSS( '#utcdate a { font-weight:bolder; font-size:120%; }' );
+
mw.util.addCSS( '#utcdate a { font-weight:bolder; }' );
    
// Reset whitespace that was set in the peer CSS gadget; this prevents the
 
// Reset whitespace that was set in the peer CSS gadget; this prevents the
第73行: 第73行:  
location.reload();
 
location.reload();
 
}, function () {
 
}, function () {
mw.notify( 'Purge failed', { type: 'error' } );
+
mw.notify( ' 刷新失败', { type: 'error' } );
 
} );
 
} );
 
e.preventDefault();
 
e.preventDefault();
161

个编辑