MediaWiki:Gadget-workinprogress.js

来自工场百科

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
/**
 * Gadget to change the wiki page appearance
 * to appear as if it is opposite to what is considered by some the aspired convention.
 * For example, make titles appear title case instead of sentence case.
 */
mw.loader.using( 'mediawiki.Title', function () {
  var title = new mw.Title( mw.config.get( 'wgPageName' ) );
  var wipTitle = title.toText().replace(/(\b[^\b])/g, function ( str ) {
    return str.toUpperCase();
  } );
  $( '.firstHeading' ).text( wipTitle );
} );