User:Bhairava7/rollbackSum.js: Difference between revisions
From Test Wiki
Content deleted Content added
+ |
m Bhairava7 moved page User:Kiteretsu/rollbackSum.js to User:Bhairava7/rollbackSum.js |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
/* Credits to [[User: |
/* Credits to [[User:Kiteretsu]] for original code |
||
*/ |
*/ |
||
$(function(){ |
$(function(){ |
||
var promptSummary = 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"); |
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 == 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; |
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) + "&"); |
this.href = this.href.replace("?", "?summary=" + encodeURIComponent(summary) + "&"); |
||
}; |
}; |
||
| Line 12: | Line 12: | ||
$('.mw-rollback-link a').click( promptSummary ); |
$('.mw-rollback-link a').click( promptSummary ); |
||
}) |
}); |
||