User:Voice of All/Bureaucrat/monobook.js
Appearance
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. |
![]() | The accompanying .css page for this skin can be added at User:Voice of All/Bureaucrat/monobook.css. |
//<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&action=edit&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&action=edit&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&action=edit&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>