User:Wwepro126/diffcur.js

From BetaArchive Wiki
< User:Wwepro126
Revision as of 17:18, 2 May 2019 by Wwepro126 (talk | contribs) (Created page with "/* If you want to use this script, simply add the following line to your Special:Mypage/monobook.js: importScript('User:Anomie/diffcur.js'); // Linkback: [[User:Wwepro126...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* If you want to use this script, simply add the following line to your [[Special:Mypage/monobook.js]]:

importScript('User:Anomie/diffcur.js'); // Linkback: [[User:Wwepro126/diffcur.js]]

* (Please keep the comment so I can see how many people use this).
*/

$( function () {
    var nl=$('#differences-nextlink');
    if ( !nl || !nl.length ) return;
    mw.loader.using( 'mediawiki.Uri', function () {
        var h = new mw.Uri( nl[0].href );
        if ( h.query.diff === 'next' ) {
            h.query.oldid = new mw.Uri( $( '#mw-diff-otitle1 a' )[0].href ).query.oldid;
        }
        h.query.diff = 'cur';
        $( '<a>Cur →</a>' ).attr( 'href', h.toString() ).insertAfter( nl );
        nl.after( ' ' );
    } );
} );