/*<pre>*///Этот скрипт замещает на страницах сравнений версий надпись в левом верхнем углу ''(Различия между версиями)'' на//кнопки быстрого отката и предупреждения участника//За инструкциями обращайтесь на страницу обсуждения.// Инструмент отката создан LorianfunctiongetElementsByClass(searchClass,node,tag){// Функции с сайта http://www.dustindiaz.com/getelementsbyclass/varclassElements=newArray();if(node==null)node=document;if(tag==null)tag='*';varels=node.getElementsByTagName(tag);varelsLen=els.length;varpattern=newRegExp("(^|\\s)"+searchClass+"(\\s|$)");for(i=0,j=0;i<elsLen;i++){if(pattern.test(els[i].className)){classElements[j]=els[i];j++;}}returnclassElements;}// _GET code из NoGray JS Library http://www.nogray.com/new_site/var_GET=newArray();var_uri=location.href;var_temp_get_arr=_uri.substring(_uri.indexOf('?')+1,_uri.length).split("&");var_temp_get_arr_1=newArray();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;functiongetMessage(where,user1,user2){varmessage=prompt('Описание правки','');window.location='http://ru.wikipedia.org/w/index.php?title='+_GET['title']+'&action=edit&oldid='+_GET['oldid']+'&'+where+'=2&user1='+user1+'&user2='+user2+'&message='+message;}$(function(){if(location.href.match(/diff=/)){// Get username of submittervaruser1=getElementsByClass('diff-otitle',null,'td');user1=user1[0].getElementsByTagName('a')[2].innerHTML;varuser2=getElementsByClass('diff-ntitle',null,'td');user2=user2[0].getElementsByTagName('a')[3].innerHTML;document.getElementById('contentSub').innerHTML='(<a href="http://ru.wikipedia.org/w/index.php?title='+_GET['title']+'&action=edit&oldid='+_GET['oldid']+'&revert=1&user1='+user1+'&user2='+user2+'">Откатить</a> | Комментарий: <a href="http://ru.wikipedia.org/w/index.php?title='+_GET['title']+'&action=edit&oldid='+_GET['oldid']+'&revert=2&user1='+user1+'&user2='+user2+'">Тест</a> | <a href="http://ru.wikipedia.org/w/index.php?title='+_GET['title']+'&action=edit&oldid='+_GET['oldid']+'&revert=3&user1='+user1+'&user2='+user2+'">Вандализм</a> | <a href="http://ru.wikipedia.org/w/index.php?title='+_GET['title']+'&action=edit&oldid='+_GET['oldid']+'&revert=4&user1='+user1+'&user2='+user2+'">Спам</a> | <a href="javascript:var message = getMessage(\'revert=5\', \''+user1+'\', \''+user2+'\');">Другая причина</a>)(Предупреждения: <a href="http://ru.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit§ion=new&warn=1">Тест</a> | <a href="http://ru.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit§ion=new&warn=2">Вандализм</a> | <a href="http://ru.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit§ion=new&warn=3">Спам</a>)';}elseif(location.href.match(/revert=1/)){document.getElementById('wpSummary').value='Правка [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] (№'+_GET['oldid']+') откачена к версии участника [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']]';document.getElementById('editform').submit();}elseif(location.href.match(/revert=2/)){document.getElementById('wpSummary').value='Правка [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] (№'+_GET['oldid']+') откачена к версии участника [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] (тестовая правка)';document.getElementById('editform').submit();}elseif(location.href.match(/revert=3/)){document.getElementById('wpSummary').value='Правка [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] (№'+_GET['oldid']+') откачена к версии участника [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] (вандализм)';document.getElementById('editform').submit();}elseif(location.href.match(/revert=4/)){document.getElementById('wpSummary').value='Правка [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] (№'+_GET['oldid']+') откачена к версии участника [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] (спам)';document.getElementById('editform').submit();}elseif(location.href.match(/revert=5/)){document.getElementById('wpSummary').value='Правка [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] (№'+_GET['oldid']+') откачена к версии участника [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] ('+_GET['message']+')';document.getElementById('editform').submit();}elseif(location.href.match(/warn=1/)){document.getElementById('wpTextbox1').value='{{sub'+'st:тест}}—~~'+'~~';document.getElementById('editform').submit();}elseif(location.href.match(/warn=2/)){document.getElementById('wpSummary').value='Предупреждение';document.getElementById('wpTextbox1').value='{{sub'+'st:вандализм}}—~~'+'~~';document.getElementById('editform').submit();}elseif(location.href.match(/warn=3/)){document.getElementById('wpTextbox1').value='{{sub'+'st:спам}}—~~'+'~~';document.getElementById('editform').submit();}});/*</pre>*/