Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if(document.URL=='http://en.wikipedia.org/wiki/User:Waggers/aaiv'){addOnloadHook(func_aaiv);}functionfunc_aaiv(){varop="<p>The tool is active; the current vandal alerts should appear below. If the page has finished loading and there are no reports listed, then there are currently no reports at AIV!</p>";//get html code of AIV pagea=sajax_init_object();a.open("GET",wgServer+"/wiki/Wikipedia:Administrator_intervention_against_vandalism",true);a.onreadystatechange=function(){if(a.readyState!=4)return;// alert("[" + a.status + ":" + a.statusText + "]\n" + a.responseText);aivcode=a.responseText;varbotpointer=aivcode.indexOf('<span class="mw-headline">Bot-reported</span>');varuserpointer=aivcode.indexOf('<span class="mw-headline">User-reported</span>');//bot reportedvarlistpointer=aivcode.indexOf('<ul>',botpointer);if(userpointer>listpointer){//start tableop=op+"<h2>Bot reported</h2>";op=op+"<table border=2>";op=op+"<tr>";op=op+"<td>Alleged vandal</td>";op=op+"<td>Reported by</td>";op=op+"<td>Last edit</td>";op=op+"<td>Last talk page edit</td>";op=op+"<td>Time reported</td>";op=op+"</tr>";while(listpointer<userpointer&&listpointer>0){listpointer=aivcode.indexOf('<span class=',listpointer+4);varvandal=aaivgetvandal(aivcode,listpointer);op=op+"<tr><td>"+vandal+"</td></tr>";}// end of while loop//end of tableop=op+"</table>";}else{op=op+"<p>There are currently no bot-reported vandals.</p>";}// end if//user reportedlistpointer=aivcode.indexOf('<ul>',userpointer);botpointer=aivcode.indexOf('<div class="printfooter">',userpointer);if(listpointer<botpointer){//start tableop=op+"<h2>User reported</h2>";op=op+"<table border=2>";op=op+"<tr>";op=op+"<td>Alleged vandal</td>";op=op+"<td>Reported by</td>";op=op+"<td>Last edit</td>";op=op+"<td>Last talk page edit</td>";op=op+"<td>Time reported</td>";op=op+"</tr>";while(listpointer<botpointer&&listpointer>0){listpointer=aivcode.indexOf('<span class=',listpointer+4);varvandal=aaivgetvandal(aivcode,listpointer);op=op+"<tr><td>"+vandal+"</td></tr>";}// end of while loop//end of tableop=op+"</table>";}else{op=op+"<p>There are currently no user-reported vandals.</p>";}// end if//test output//op = op + a.responseText;//op = op + aivcode;document.getElementById('bodyContent').innerHTML=document.getElementById('bodyContent').innerHTML+op;};a.send(null);}functionaaivgetvandal(aivcode,listpointer){varp=aivcode.indexOf("title=User:",listpointer);vars=aivcode.substr(p);varq=s.indexOf("&action");varv=s.substr(11,q-11);returnv;}