MediaWiki:Gadget-targetlog.js

From RationalWiki
Jump to navigation Jump to search

Note: After saving, 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)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
//<source lang=javascript>
/** This Gadget adds a link to the toolbar to quickly let you view all the logs that the user has been the subject of (rather than the ones they took action on themselves. This is often more interesting than their own log, as it shows the history of vandal bins, blocks and rights changes. **/
jQuery( document ).ready( function( $ ) {
	if (mw.config.get('wgNamespaceNumber') != 2 && mw.config.get('wgNamespaceNumber') != 3)  // User or User talk
        return;
    var user = mw.config.get('wgTitle').split("/")[0];
    var url = mw.config.get('wgScript') + "?title=Special:Log&page=User%3A" + encodeURIComponent(user);
    mw.util.addPortletLink("p-tb", url, "Target Logs", "t-targetlog", "View actions take on " + user, null, "#t-blockip");
} );

//</source>