// ==UserScript== // @name Bulk Player Retirement // @namespace glb.warriorgeneral.com // @description Lets you retire players in bulk. // @include http://glb.warriorgeneral.com/game/home.pl // @copyright 2010, garrettFoster // @version 2014.04.22 // @downloadURL none // ==/UserScript== // pabst repaired it 1/12/14 window.setTimeout(main,1000); //needed to start greasemonkey function main(){ var option = document.getElementsByTagName('option'); if (option[14].selected){ //add button var div = document.createElement('div'); div.setAttribute('id','retireDiv'); var button = document.createElement('input'); button.setAttribute('type','button'); button.setAttribute('value','Retire Selected Players'); button.setAttribute('style','float: right;'); button.addEventListener('click',getPass,false); div.appendChild(button); var location = document.getElementById('players'); location.parentNode.insertBefore(div,location); div = document.createElement('div'); div.setAttribute('id','hidden-div'); div.setAttribute('style','visibility:hidden; display:none;'); location = document.getElementById('retireDiv'); location.parentNode.insertBefore(div,location.nextSibling); div = document.createElement('div'); div.setAttribute('style','clear: both;'); location = document.getElementById('hidden-div'); location.parentNode.insertBefore(div,location.nextSibling); //add headings var tr = document.getElementById('playerTable').getElementsByTagName('tr'); var th = document.createElement('th'); var a = document.createElement('a'); a.innerHTML = 'Retire Player?'; a.setAttribute('style','cursor:pointer;cursor:hand;'); a.addEventListener('click',function(){toggle('retirePlayer');},false); th.appendChild(a); tr[0].appendChild(th); th = document.createElement('th'); a = document.createElement('a'); a.innerHTML = 'Delete Name?'; a.setAttribute('style','cursor:pointer;cursor:hand;'); a.addEventListener('click',function(){toggle('retireName');},false); th.appendChild(a); tr[0].appendChild(th); //add checkboxes for(var i=1;i