User:Nicolas NALLET/common.js
Appearance
From mediawiki.org
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* Simple user script examples to demonstrate the use of ResourceLoader core modules: https://www.mediawiki.org/wiki/ResourceLoader/Core_modules */ //mw.loader.load("//www.mediawiki.org/w/index.php?title=User:SSethi_(WMF)/Sandbox/MyEditCount.js&action=raw&ctype=text/javascript"); // Example 1: Use of jQuery function to make article font size bigger //$('body').css('font-size', '1em'); // Example 2: Use of `mw.config` & `mw.notify` module to send in a notification // for groups a user is a part of //mw.notify(mw.config.get('wgUserGroups')); // Example 3: Use of `mw.now` module and jQuery function to fetch the date and // display it beneath the article title //$('#bodyContent').prepend(new Date(mw.now())); // Example 4: User script to calculate and display estimated reading time of an // article varwords=$('#bodyContent').text().split(' ').length, avgSpeed=Math.round(words/250); $('#firstHeading').append("<small> ("+avgSpeed+" min"+" read) </small>");