MediaWiki:Gadget-workinprogress.js

来自工场百科
Yuanxing14留言 | 贡献2015年2月6日 (五) 15:50的版本 (创建页面,内容为“/** * 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...”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

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

  • 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 );
} );