User:Kiteretsu/rollbackSum.js: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
Content deleted Content added
Amos (talk | contribs)
mNo edit summary
Amos (talk | contribs)
m Tsukushi moved page User:Infinityboy7/rollbackSum.js to User:Kiteretsu/rollbackSum.js without leaving a redirect: Uncontroversial move: User renamed.
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
/* Credits to [[User:Infinityboy7]] for original code
/* Credits to [[User:Kiteretsu]] for original code
*/
*/
$(function(){
$(function(){
Line 12: Line 12:
$('.mw-rollback-link a').click( promptSummary );
$('.mw-rollback-link a').click( promptSummary );
})
});

Latest revision as of 02:22, 30 August 2024

/* Credits to [[User:Kiteretsu]] for original code
 */
$(function(){
 
   var promptSummary = function () {
        var summary = prompt("Enter summary for rollback (or leave as current to use default summary):", "[[wikipedia: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 == "[[wikipedia: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 );
 
});