위키백과:WikiProject User scripts/Scripts/Revert toolsWikiProject 사용자 스크립트/스크립트/반환 도구

Wikipedia:

/*

*/ //Diff 페이지에서 이 스크립트는 편집 내용을 되돌리고 편집한 사용자에게 경고하기 위한 다른 도구로 ""(리비전 간 차이)""를 대체한다. //설명서는 대화 페이지를 참조하십시오. // Revert tools by Lorian 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 $)"; (i = 0, j = 0; i < elsLen; i++) { 만약 (pattern.test(els[i]))className) { classElements[j] = els[i]; j++; } 반환 classElements; } // http://www.nogray.com/new_site/ var 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 = 새 어레이() for (_get_arr_i=0; _get_temp_get_arr.lengt; _i+){{ _temp_get_ar_ar_r_1 = _temp_get_ar_ar_ar_i].분할(""="), _GET[디코드]URI(_temp_get_arr_1[0])] = 디코딩URI(_temp_get_arr_1[1]).};_temp_get_arr을 삭제하고, _temp_get_arr_1을 삭제하고 기능getMessage(어디, user1, user2){을 만든다고 메시지)신속한('What 메시지 당신을 떠나라고 했나요?'고 싶어 할 것");window.location)'http://en.wikipedia.org/w/index.php?title='+_GET['title의]+'&, action=edit&, oldid=의+_GET['oldid']+'&, '+where+'=2 _uri을 삭제합니다.&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.inner]HTML; 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+'\');">메시지 (Warn: <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=1">Test<, /a>./<>;href=ᆪhttp://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=3">Nonsense</a>./<>;href=".http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=4">블랭킹</a]; }개 다른 경우(location.href.match(/revert=1/) { document.GetElementById('wpSummary').값 = 'reverted edits by [[Special:기여/'+_GET['user2']+'+'+_'+_GET['user2']+']에서 버전 '+'까지 [[특수:기여/'+_GET['user1']+'+'+_'+_GET['user1']+']'; document.GetElementById('편집 양식');submit(); (location.href.match(/revert=2/) { document.GetElementById('wpSummary').value = 'reverted edits by [[Special:기여/'+_GET['user2']+'+'+_'+_GET['user2']+']에서 버전 '+'까지 [[특수:기여/'+_GET['user1']+'+'+_'+_GET['user1']+']('+_GET['메시지'+'); 문서.getElementById('editform').제출(): } 이외의 경우(location.href.match(/vandalism=1/) { document.GetElementById('wpSummary').value = [[Special:]에 의한 반역 반달리즘기여/'+_GET['user2']+'+'+_'+_GET['user2']+']에서 버전 '+'까지 [[특수:기여/'+_GET['user1']+'+'+_'+_GET['user1']+']'; document.GetElementById('편집 양식');제출(): } 이외의 경우(location.href.match(/vandalism=2/) { document.GetElementById('wpSummary').value = [[Special:]에 의한 반역 반달리즘기여/'+_GET['user2']+'+'+_'+_GET['user2']+']에서 버전 '+'까지 [[특수:기여/'+_GET['user1']+'+'+_'+_GET['user1']+']('+_GET['메시지'+'); 문서.getElementById('editform').submit();   } else if (location.href.match(/warn=1/)) {     document.getElementById('wpSummary').value = 'Vandalism warning';     document.getElementById('wpTextbox1').value = '{{sub'+'st:test}} ~~'+'~~';     document.getElementById('editform').submit();   } else if (location.href.match(/warn=2/)) {     document.getElementById('wpSummary').value = 'Vandalism warning';     document.getElementById('wpTextbox1').value = '{{sub'+'st:blatantvandal}} ~~'+'~~';     document.getElementById('editform').submit();   } else if (location.href.match(/warn=3/)) {     document.getElementById('wpSummary').value = 'Vandalism warning';     document.getElementById('wpTextbox1').value = '{{sub'+'st:test2}} ~~'+'~~';     document.getElementById('editform').submit();   } else if (location.href.match(/warn=4/)) {     document.getElementById('wpSummary').value = 'Vandalism warning';     document.getElementById('wpTextbox1').value = '{{sub'+'st:test2a}} ~~'+'~~';     document.getElementById('editform').제출(; } }); /*

*/