Wikipedia:WikiProject User scripts/Scripts/Revert tools: Difference between revisions
Content deleted Content added
Edited script |
m Protected Wikipedia:WikiProject User scripts/Scripts/Revert tools: protect against abuse - arbitrary code injection [edit=sysop:move=sysop] [cascading] |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1:
/*<pre>*/▼
On diff pages this script replaces ''(Difference between revisions)'' with different tools for reverting the edit and warning the user that made the edit.▼
//On diff pages this script replaces ''(Difference between revisions)''with
▲
//For instructions see talk page.
▲<pre>
// Revert tools by Lorian
function getElementsByClass(searchClass,node,tag) {
Line 76 ⟶ 47:
// Get username of submitter
var user1 = getElementsByClass('diff-otitle',null,'td'); user1 = user1[0].getElementsByTagName('a')[2].innerHTML;
var user2 = getElementsByClass('diff-ntitle',null,'td'); user2 = user2[0].getElementsByTagName('a')[
document.getElementById('contentSub').innerHTML = '(<a href="http://en.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&revert=1&user1='+user1+'&user2='+user2+'">Revert</a> / <a href="javascript:var message = getMessage(\'revert\', \''+user1+'\', \''+user2+'\');">Message</a>) (<a href="http://en.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&vandalism=1&user1='+user1+'&user2='+user2+'">Vandalism</a> / <a href="javascript:var message = getMessage(\'vandalism\', \''+user1+'\', \''+user2+'\');">Message</a>) (Warn: <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit§ion=new&warn=1">Test</a> / <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit§ion=new&warn=2">Blatant</a> / <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit§ion=new&warn=3">Nonsense</a> / <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit§ion=new&warn=4">Blanking</a>)';
} else if (___location.href.match(/revert=1/)) {
Line 108 ⟶ 79:
}
});
/*</pre>*/
|