User:Path slopu/scripts/RBK-assist.js: Difference between revisions

Content deleted Content added
Created page with '$( function($) { $( '.mw-rollback-link a' ).click( function(e) { e.preventDefault(); var $el = $(this); $.ajax({ url: $el.attr('href'), success: fun...'
 
No edit summary
Line 1:
$( function($) {
$( '.mw-rollback-link a' ).click( function(e) {
e.preventDefault();
var $el = $(this);
$.ajax({
url: $el.attr('href'),
success: function() {
// [[phab:T29606]]
var user = mw.util.getParamValue( 'from', $el.attr('href') ).replace(/\+/g, '_');
___location.href = mw.util.getUrl( 'User talk:' + user );
},
error: function(){
$el.text(function( i, val ) {
return val + ' [failed]';
} );
}
});
} );
});
 
$(function(){
var promptSummary = function () {
var summary = prompt("Enter summarySummary 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;