User:Chlod/Scripts/AjaxRollbackSummary.js

// Global User Toolbox // Author: Chlod // Version: 1.0.0-REL

// jQuery(document).ready(function ($) {   $('span.mw-rollback-link a').on("click", function(e) { e.preventDefault; var $rblink = $(this); var href = this.getAttribute("href"); this.innerHTML = '';       var summary = prompt("Enter rollback summary"); if (summary == null) { $rblink.text(function (i, val) {return val + '[rollback cancelled]';}); return; }       $.ajax({            url: href.replace("?", "?summary=" + encodeURIComponent(summary) + "&"),            success: function {                $rblink.text(function (i, val) {return val + '[reverted]';});            },            error: function {                $rblink.text(function (i, val) {return val + '[rollback failed]';});            }        }); return false; }); }); //