User:FreddyderHamster/VDAde.js

/***Bitte Lesen: Dieser Code ist erfunden worden um im Kampf gegen Vandalismus zu helfen.Es arbeitet wie Twinkle von Wikipedia.Wenn du diesen code benutzen willst,schreibe den folgenden code in deine eigene js file: importScriptPage('User:Ajraddatz/VDA.js', 'community'); importScriptPage('User:VegaDark/VDA.js', 'community');

Wenn du diesen code missbrauchst oder irgendenwelche Schaden mit diesem Code verursachts könnestes du geblockt werden.Für mehr Informationen, kannst du http://vda.wikia.com/wiki/VDA_Revert besuchen. Bitte melde dich bei Ajraddatz or VegaDark ,wenn du einen Fehler siehst. Übersetzte versionen von diesem Code kannst du hier finden: http://vda.wikia.com/wiki/VDA_Translated_Versions Danke und viel Spaß.***/ // Reverting tools V6.5 Gold (Original coding by User:VegaDark, modified by User:Ajraddatz) function getElementsByClass(searchClass,node,tag) { // Function from http://www.dustindiaz.com/getelementsbyclass/ var classElements = new Array; if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; } }  return classElements; } // _GET code from NoGray JS Library http://www.nogray.com/new_site/ var _GET = new Array; var _uri = location.href; var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&"); var _temp_get_arr_1 = new Array; for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){ _temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("="); _GET[decodeURI(_temp_get_arr_1[0])] = decodeURI(_temp_get_arr_1[1]); } delete _uri; delete _temp_get_arr; delete _temp_get_arr_1; function getMessage (where, user1, user2) { var message = prompt ('Schreibe deinen Kommentar unter diesen Satz:', ''); window.location = 'http://'+ location.hostname + '/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&user2='+user2+'&message='+message; } function AGFMessage (where, user1, user2) { var message = prompt ('Schreibe deinen Kommentar unter diesen Satz:', ''); window.location = 'http://'+ location.hostname + '/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=3&user1='+user1+'&user2='+user2+'&message='+message; } addOnloadHook(function { if (location.href.match(/diff=/)) {    // 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')[3].innerHTML;    document.getElementById('contentSub').innerHTML = ' [ Rückgängig machen(Vandalismus) ]   [Rückgängig machen]   [ Rückgängig machen (AGF) ]   [ Rückgängig (Spam) ] ' + ''; } else if (location.href.match(/revert=1/)) {    document.getElementById('wpSummary').value = 'Reverted edits identified as vandalism by '+_GET['user2']+' using VDA';    document.getElementById('editform').submit;  } else if (location.href.match(/revert=2/)) {    document.getElementById('wpSummary').value = 'Reverted edits by ' + _GET['user2'] + ' using VDA (' +_GET['message']+ ')';    document.getElementById('editform').submit;  } else if (location.href.match(/revert=3/)) {    document.getElementById('wpSummary').value = 'Reverted good faith edits by ' + _GET['user2'] + ' to the last version by ' + _GET['user1'] + ' (' +_GET['message']+ ') ) (VDA';    document.getElementById('editform').submit; } else if (location.href.match(/revert=4/)) { document.getElementById('wpSummary').value = 'Reverted spam edits by '+_GET['user2']+' to the last version by '+_GET['user1']+' (VDA';   document.getElementById('editform').submit;  } });