mic_none

User:Nageh/rollbackSum.js Source: en.wikipedia.org/wiki/User:Nageh/rollbackSum.js

/* Credits to [[User:Ilmari Karonen]] for original code
 *        ... [[User:Porchcrop]] for minor improvements (documentation at [[User:Porchcrop/Rollback Summary]])
 *        ... [[User:Alex_Smotrov]] for essentially this version (see [[Wikipedia:Village_pump_(technical)/Archive_96#Script_User:Porchcorpter.2FrollbackSum.js_working.2C_not_working.2C_working.2C_not_working...]])
 */
$(function(){
 
   var promptSummary = function () {
        var summary = prompt("Enter summary for rollback (or leave as current to use default summary):", "[[Help:Reverting|Reverted]] edits by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]]) to last version by $1");
        if (summary == null || summary == "") return false;
        if (summary == "[[Help:Reverting|Reverted]] edits by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]]) to last version by $1") return true;
        this.href = this.href.replace("?", "?summary=" + encodeURIComponent(summary) + "&"); 
    };
 
   $('.mw-rollback-link a').click( promptSummary );
 
})