Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* This object holds utility functions for messing with MediaWiki's rollback links */

var RollbackBits = {
    Type: '',   // Defined by an onload function, below
                // @private: Technically, one should always use RollbackBits.GetType()
    CheckType: function() {
        if(document.getElementById('pagehistory')) { return 'hist'; }
        if(document.getElementById('mw-diff-ntitle2')) { return 'diff'; }
        if(wgCanonicalSpecialPageName && wgCanonicalSpecialPageName == 'Contributions') { return 'trib'; }
        else { return false; }
    },
    GetType: function() {
        if(this.Type == '') { this.Type = this.CheckType(); return this.Type; }
        else return this.Type;
    },
    PromptForSummary: function() {  // Designed to be called by the onclick of a rollback link 
        var summary = prompt('Enter a summary for your rollback. To cancel, click Cancel or the X.','');
        if(summary) {
            this.href += '&summary=' + escape(summary).replace(/\+/,'%2B');
            return true;
        } else {
            return false;
        }
    }
};