Jump to content

User:Voice of All/Bureaucrat/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Aaron Schulz (talk | contribs) at 07:49, 1 June 2006 (if). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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.
//<pre><nowiki>
//Helper tools
if (!addTab)
{
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
//END

//Analyze any user's contribs
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/History/monobook.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

//END

addOnloadHook(crathide)
function crathide()
{
if (document.title.indexOf('Wikipedia:Requests for adminship') != -1 && document.title.indexOf('Editing ') == -1) 
{
var hidea = '<div class="NavFrame" style="border-style: none; text-align: left; border: darkblue solid 1px; background: #ffffff; padding: 5px;"><div class="NavHead"  style="border-style: none; background: lightgrey; text-align: center; padding: 2px; font-size: 120%;">';
var hideb = '</div>' + '\r' + '<div class="NavContent" style="background: none; display: none;">';
var hidec = '</div></div></div>';
var doc = document.getElementById('bodyContent').innerHTML;
var array = doc.split('<h3><a href="/wiki/User:');
var bodyend = '<div class="editsection" style="float:right;margin-left:5px;">[<a href="/w/index.php?title=Wikipedia:Requests_for_adminship&amp;action=edit&amp;section=2" title="Edit section: About RfB">edit</a>]</div>' + array[array.length-1].split('<div class="editsection" style="float:right;margin-left:5px;">[<a href="/w/index.php?title=Wikipedia:Requests_for_adminship&amp;action=edit&amp;section=2" title="Edit section: About RfB">edit</a>]</div>')[1];
var newdoc = '';
for (var i=0; i<array.length; i++)
  {
var newsub = '<h3><a href="/wiki/User:' + array[i];
var addsub = newsub;
  if (i==0){addsub = array[i].split('<hr />')[1];}
  if (newsub.indexOf('>Discuss here') != -1 && newsub.indexOf('(UTC)</b></p>') != -1 && newsub.indexOf(') ending ') !=-1)
    {
   var subtitle = newsub.split('(UTC)</b></p>')[0] + '(UTC)</b></p>';
   var subbody = '<br><br>' + array[i].split(' (UTC)</b></p>')[1];
   if (i==array.length-1) 
  {subbody = '<br><br>' + array[i].split(' (UTC)</b></p>')[1].split('<div class="editsection" style="float:right;margin-left:5px;">[<a href="/w/index.php?title=Wikipedia:Requests_for_adminship&amp;action=edit&amp;section=2" title="Edit section: About RfB">edit</a>]</div>')[0];}
   addsub = '<br>' + hidea + subtitle + hideb + subbody + hidec + '<br>';
    }
    newdoc += addsub;
  }
newdoc += bodyend;
document.getElementById('bodyContent').innerHTML = newdoc;
}
}

addOnloadHook(crattools)
function crattools()
{
  if (document.title.indexOf('Editing Wikipedia:Requests for adminship/') != -1)
    {
     addTab("javascript:cratClose(1)", "(Success)", "ca-cratS", "Close as success", "");
     addTab("javascript:cratClose(0)", "(Failure)", "ca-cratF", "Close as failure", "");
    } 
}
//END

function jssubmitclose()
{
var form = document.getElementById('editform');
form.submit();
setTimeout('window.close()',12000);
}
//END

function cratClose(type)
{
if (!type){return;}
  if (type == 1)
  {
  document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('}} Discuss here]','}} Final]').replace(') ending ',') ended ');
  document.editform.wpTextbox1.value = "{{subst:rfap}}" + "\n" + document.editform.wpTextbox1.value + "{{subst:rfab}}";
  document.editform.wpSummary.value += "Closed nomination - Consensus to promote has been reached.";
  //jssubmitclose();
  }
  else if (type == 0)
  {
  document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('Disscuss here','Final').replace('ending','ended');
  document.editform.wpTextbox1.value = "{{subst:rfaf}}" + "\n" + document.editform.wpTextbox1.value + "{{subst:rfab}}";
  document.editform.wpSummary.value += "Closed nomination - No consensus to promote has been reached.";
  //jssubmitclose();
  }
}

//</nowiki></pre>