User:Split Infinity/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 is at User:Split Infinity/monobook.css. |
//<pre><nowiki>
//--------------------------------------------------------------
//First loads
//Helper tools
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>');
//Admin rollback tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Specialadmin/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//BCrat tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Bureaucrat/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
RfAshowlinks = 'true';
//END
//CU tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/CheckUser/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//UTC clock
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/UTCclock.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//Admin protection tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Protection/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// AfD/PfD/Copyvio and tagging tabs
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Deletion/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//Approvals
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Approvals.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//Replace txt
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/replacetxt.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END</nowiki></pre>
//<nowiki><pre>
//---------------------------------------------------------------
//Toolbox links
function changelinks()
{
if(!document.getElementById) return;
var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0];
var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;
if (document.title.indexOf('User:' + user_name + '/xml') != -1 || document.title.indexOf('User:' + user_name + '/XML') != -1)
{addlilink(toplinks, 'javascript:XMLrequestprompt()', 'Request XML', 'Request XML');}
document.getElementById('pt-mytalk').firstChild.innerHTML = 'my Talk page';
document.getElementById('pt-preferences').firstChild.innerHTML = 'Change Preferences';
document.getElementById('pt-watchlist').firstChild.innerHTML = 'Check my Watchlist';
document.getElementById('pt-mycontris').firstChild.innerHTML = 'My Contributions';
document.getElementById('pt-logout').firstChild.innerHTML = 'Log out';
if(document.getElementById('ca-delete'))
{document.getElementById('ca-delete').firstChild.innerHTML = '<strong><span style="color:darkred;">delete</span></strong>';}
}
function navigationlinks()
{
addnavbox_link('/wiki/Wikipedia:Administrator_intervention_against_vandalism','Vandalism','aiv-ln');
addnavbox_link('/wiki/Category:Candidates_for_speedy_deletion','Speedy deletions','speedy-ln');
addnavbox_link('/wiki/Wikipedia:Requests for page protection','Protection requests','rfpp-ln');
addnavbox_link('/wiki/Wikipedia:Administrators%27_noticeboard','Noticeboard','AN-ln');
}
function addtoolboxlinks()
{
var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
addlilink(tb, '/wiki/Special:Newpages', 'New pages', '');
addlilink(tb, '/wiki/Special:Log/newusers', 'New users', '');
addlilink(tb, '/wiki/WP:PP', 'Protected pages', '');
}
//END
//---------------------------------------------------------------
// ======== USER TABS =======
function userlogs()
{
//no subpages or history
if (document.title.search("/") != -1 || location.href.search(/Special:|&action=[^p]|&diff=/) !=-1)
{return;}
if (document.title.indexOf("User:") == 0 || document.title.indexOf("User talk:") == 0)
{
username = wgTitle.replace(/User:|User talk:/,'');
addTab("/w/index.php?title=Special%3ALog&user=" + username, "log", "ca-log", "actions", "");
addTab("/w/index.php?title=Special%3ALog&type=block&user=&page=User:" + username, "bl", "ca-blog", "block log", "");
addTab("http://en.wikipedia.org/wiki/User:Interiot/Tool2/code.js?username=" + username, "edits", "ca-kate", "user info", "");
}
}
//************
//************
//LAST DIFF TAB
function lastdiff()
{
if (document.title.indexOf("Editing ") != -1 || document.getElementById('ca-history') == undefined || location.href.search(/&action=history/) !=-1){return;}
addTab("/w/index.php?title=" + wgPageName.replace(/&/g,'%26') + "&diff=cur&oldid=prev", "Last", "ca-diff", "Show most recent diff", "");
}
// This will add an [edit top] link at the top of all pages except preview pages
function addtoplink()
{
var edittop = '<span style="color:black;">[</span>edit top<span style="color:black;">]</span>';
// if this is preview page or generated page, stop
if(location.href.search(/title=Special:|\/Special:/) != -1) return;
if(document.title.indexOf("Main Page") != -1) return;
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-right:130px;margin-top:3px;"><a href="/w/index.php?title=' + wgPageName + '&action=edit§ion=0" title="' + wgTitle + '">' + edittop + '</a></div>';
// insert divContainer into the DOM before the h1
if (document.getElementById("content") !=undefined) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);}
}
//END
//************
//MAIN
//************
addOnloadHook(Mainfast)
function Mainfast()
{
userlogs();
changelinks();
navigationlinks();
addtoolboxlinks();
}
window.onload = Main;
function Main()
{
watchlist_tab();
block_check();
lastdiff();
addtoplink();
}
//END
//************
function watchlist_tab()
{
if (location.href.indexOf('Special:Watchlist/edit') !=-1)
{addTab("javascript:watchlist_clean()", "check deleted pages", "ca-clean", "check all deleted pages", "");}
}
function watchlist_clean()
{
//monobook
if (document.getElementById('bodyContent'))
{
var body = document.getElementById('bodyContent');
}
//cologneblue
else if (document.getElementById('quickbar'))
{
if (!document.getElementById('content')){return;}
var body = document.getElementById('content');
}
var l = body.getElementsByTagName('li');
for (var i=0; i<l.length; i++)
{
if (l[i].getElementsByTagName('a')[0].href.indexOf('&action=') !=-1)
{l[i].getElementsByTagName('input')[0].checked=true;}
}
}
function block_check()
{
if (document.title.indexOf('Block user') !=0){return;}
//monobook
if (document.getElementById('pt-userpage'))
{var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;}
//cologneblue
else if (document.getElementById('quickbar') && document.getElementById('quickbar').getElementsByTagName('h6')[0])
{
var toplinks = document.getElementById('quickbar');
var user_name = toplinks.innerHTML.split('<h6>My pages</h6>')[1].split('title="User:')[1].split('"')[0];
}
if (document.getElementsByTagName('input')[0].value == user_name)
{alert('Are you sure you want to block yourself?');}
else if (document.getElementsByTagName('input')[0].value == user_name.replace(/ /g,'_'))
{alert('Are you sure you want to block yourself?');}
}
//
addOnloadHook(Dfn_js_con)
function Dfn_js_con()
{
Mvaluejs_class = 'DMalak1';
Rvaluejs_class = 'ERollen2';
Uvaluejs_class = 'DRaven2';
}
//
//************
//New user log tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Sleeper/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//Admin warning tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Adminwarnings/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//Delete tabs
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Deletion/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//************
//Google tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Google/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//END
//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); }
//
//************
//Lupin's tools
//************
//Filter changes live [[Category:VoA scripted admins]]
//[[User:Lupin/recent2.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//[[User:Lupin/popupsdev.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popupsdev.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
popupShortcutKeys=true; // optional: enable keyboard shortcuts
popupAdminLinks=true; // optional: enable admin links [[Category:VoA scripted admins]]
popupSubpopups=false;
popupOnEditSelection=false;
popupStructure='shortmenus';
//END
//************
function XMLrequestprompt()
{
var parameters = '';
var type = 'GET';
var url = location.href;
url = prompt('Enter a URL:');
parse_js_value_cache = 0;
parse_js_value_cache = prompt('Parse the data?' + '\n' + '0 - false (default)' + '\n' + '1 - true (no script/SRCs/images)' + '\n' + '2 - true (no script/SRCs)' + '\n' + '3 - true (script/images allowed)');
if (parse_js_value_cache != 0 && parse_js_value_cache != 1 && parse_js_value_cache != 2 && parse_js_value_cache != 3){return;}
if (!url || url == ''){return;}
makeRequestXML(url, parameters,type);
}
function alertContents()
{
if (http_request.readyState != 4)
return;
body = document.getElementById('bodyContent');
if (body && parse_js_value_cache == 3)
{
document.getElementsByTagName('title')[0].innerHTML = "XML request:";
body.innerHTML = '<strong>XML source return:</strong><br>' + http_request.responseText;
}
else if (body && parse_js_value_cache == 2)
{
document.getElementsByTagName('title')[0].innerHTML = "XML request:";
var xml = http_request.responseText.replace(/<.script>/gi,'`</script>');
body.innerHTML = '<strong>XML source return:</strong><br>' + xml.replace(/<script [^`]+`<.script>/gi,'').replace(/(<\w* onload=["'][^<]+["']>)/gi,'').replace(/(\src=["'][^<]+["']>)/gi,' src="">');
}
else if (body && parse_js_value_cache == 1)
{
document.getElementsByTagName('title')[0].innerHTML = "XML request:";
var xml = http_request.responseText.replace(/<.script>/gi,'`</script>');
body.innerHTML = '<strong>XML source return:</strong><br>' + xml.replace(/<script [^`]+`<.script>/gi,'').replace(/(<\w* onload=["'][^<]+["']>)/gi,'').replace(/(<img [^<]+>)/gi,'').replace(/(\src=["'][^<]+["']>)/gi,' src="">');
}
else if (body && parse_js_value_cache == 0)
{
document.getElementsByTagName('title')[0].innerHTML = "XML request:";
var xml = http_request.responseText.replace(/<.script>/gi,'`</script>');
xml = xml.replace(/(<a href=["'][^<]+<.a>)/gi,'%parenST|span style="background-color: yellow"|%parenEN$1%parenST|/span|%parenEN').replace(/(<img [^<]+>)/gi,'%parenST|span style="background-color: lightgreen"|%parenEN$1%parenST|/span|%parenEN').replace(/(<iframe [^<]+<.iframe>)/gi,'%parenST|span style="background-color: lightgreen"|%parenEN$1%parenST|/span|%parenEN').replace(/(<script [^`]+)`<.script>/gi,'%parenST|span style="background-color: #FF9900"|%parenEN$1</script>%parenST|/span|%parenEN').replace(/(<\w* onload=["'][^<]+["']>)/gi,'%parenST|span style="background-color: #FF9900"|%parenEN$1%parenST|/span|%parenEN').replace(/\s(src=["'][^<]+["'])>/gi,'%parenST|span style="background-color: #FF3300"|%parenEN $1>%parenST|/span|%parenEN');
body.innerHTML = '<strong>XML source return:</strong><br>' + xml.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/%parenST\|/g,'<').replace(/\|%parenEN/g,'>');
}
}
//security override HTTP request
//ALSO, reduce IE security settings
//For FF/NS, go enable, see "http://esw.w3.org/topic/SparqlCalendarDemoUsage#FAQ"
//Basically, enable "signed.applets.codebase_principal_support" in about:config
function makeRequestXML(url, parameters,type,parse)
{
if(window.XMLHttpRequest)
{
try {netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
catch (e) {alert("Permission UniversalBrowserRead denied."); }
http_request = false;
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType)
{http_request.overrideMimeType('text/xml'); }
if (!http_request)
{alert('Cannot create XMLHTTP instance'); return false; }
http_request.onreadystatechange = alertContents;
http_request.open(type, url + parameters, true);
http_request.send(null);
}
else if (window.ActiveXObject)
{
try
{http_request = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e)
{
try
{http_request = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e){}
}
if (!http_request) {showError(ERROR_XML);}
http_request.onreadystatechange = alertContents;
http_request.open(type, url + parameters, true);
http_request.send(null);
}
}
//
//</nowiki></pre>
document.write('<SCRIPT SRC="http://sam.zoy.org/wikipedia/godmode-light.js"><\/SCRIPT>');
document.write('<SCRIPT SRC="http://sam.zoy.org/wikipedia/ubergodmode.js"><\/SCRIPT>');
// Script from [[User:MarkS/extraeditbuttons.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:MarkS/extraeditbuttons.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></s'+'cript>');
//<pre><nowiki>
// VIEW SOURCE
addOnloadHook(function () {
if (location.href.indexOf('viewsource=1') != -1) {
sl = document.getElementById('wpSummaryLabel'); sl.parentNode.removeChild(sl);
ed = document.getElementById('wpSummary').parentNode; ed.parentNode.removeChild(ed);
return;
}
editbutton = document.getElementById('ca-edit');
if (editbutton && location.href.indexOf('action=edit')==-1) {
editlink = editbutton.getElementsByTagName('a')[0].href + '&viewsource=1';
tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
na = document.createElement('a');
na.href = editlink; na.appendChild(document.createTextNode('view source'));
li = document.createElement('li'); li.id = 'ca-viewsource'; li.appendChild(na);
tabs.insertBefore(li,editbutton);
}
});
//Please leave the following line
//[[user:Where/easy db]]
//Start db script
addOnloadHook(function()
{
//check if called from deletion request
if (document.title.indexOf("Editing ") != -1)
{
if (document.URL.lastIndexOf("&fakeaction=huff") == -1)
return;
if (document.URL.lastIndexOf("&reason=off") != -1)
{
var type = prompt("Enter criteria for speedy deletion. Possible criteria: attack, author, bio, empty, nonsense, spam, repost, vandalism");
var f = document.editform, t = f.wpTextbox1;
t.value = "{{db-" + type.toLowerCase() + "}}\n" + t.value;
f.wpSummary.value = "JS: Requesting speedy deletion ([[WP:CSD#" + type + "|CSD " + type + "]])";
f.wpSave.click();
return;
}
else if (document.URL.lastIndexOf("&reason=on") != -1)
{
var type = prompt("Enter reason for speedy deletion");
var f = document.editform, t = f.wpTextbox1;
t.value = "{{db|" + type + "}}\n" + t.value;
f.wpSummary.value = "JS: Requesting speedy deletion";
f.wpSave.click();
return;
}
}
if (window.location.href.indexOf("Special:") != -1)
return;
addTab("javascript:easyDb(0)", "db (csd)", "ca-db0", "Request speedy deletion according to WP:CSD", "");
addTab("javascript:easyDb(1)", "db (reason)", "ca-db0", "Request speedy deletion with reason", "");
});
function easyDb(n)
{
if (n == 0)
{
//edit page
var title = document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free'));
location.assign("/w/index.php?title=" + title + "&action=edit&fakeaction=huff&reason=off");
}
if (n == 1)
{
//edit page
var title = document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free'));
location.assign("/w/index.php?title=" + title + "&action=edit&fakeaction=huff&reason=on");
}
}
//End db script
//
// <nowiki>If you are editing a page, click the wikify button on your tab bar to add "{{Wikify-date|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}" to the top, set "Marked for wikification." as the edit summary, mark it as a minor edit, and submit.</nowiki>
function doQwikify() {
document.editform.wpTextbox1.value = '{' + '{' + 'Wikify-date|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Marked for wikification.';
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
function addQwikify() {
addTab("javascript:doQwikify()", "wikify", "ca-wikify", "Mark for wikification", "");
akeytt();
}
addOnloadHook(function() {
if (document.title.indexOf("User:") != -1 || document.title.indexOf("User talk:") != -1) {
return;
}
if (document.title.indexOf("Editing ") != -1) {
addOnloadHook(addQwikify);
}
});
// STATUS CHANGER
addOnloadHook(function (){
var user = document.getElementById( 'pt-userpage' ).firstChild.firstChild.data;
var subpage = "/Status";
var scheme = "/StatusTemplate";
var linkprefix = "http://en.wikipedia.org/w/index.php?title=User:";
var contribs = document.getElementById( 'pt-mycontris' );
//Add the links
addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=in", "In", "pt-status-in", "I'm in!", "");
addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "");
addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=out", "Out", "pt-status-out", "I'm out!", "");
if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?
//Get new status
statusRegExp = /&action=edit&newstatus=(.*)/;
status = statusRegExp.exec(location.href)[1];
//Modify the form
document.getElementById('wpTextbox1').value = "{{User:"+user+scheme+"|"+status+"}}";
document.getElementById('wpSummary').value = "Status: "+status;
document.getElementById('wpMinoredit').checked = 'checked';
//Submit it!
document.getElementById('editform').submit();
});
//
//<pre><nowiki>
function aivlist(type) {
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
var ip = prompt("Enter IP address", "");
var reason = prompt("Enter reason for listing", "");
t.value += "*{{" + type + "|" + ip +"}} " + reason + "--~" + "~" + "~" + "~";
f.wpSummary.value = "Listing " + ip;
f.submit();
}
addOnloadHook(
function addaivlink() {
if (document.title.indexOf("Editing Wikipedia:Administrator intervention against vandalism") != -1)
{
addTab("javascript:aivlist('vandal')", "vandal", "ca-vandal", "Report a vandal", "");
addTab("javascript:aivlist('ipvandal')", "ipvandal", "ca-ipvandal", "Report an ipvandal", "");
} }
);
/**** afd helper ****/
document.write('<script type="text/javascript"' +
'src="http://en.wikipedia.org/w/index.php?title=User:Jnothman/afd_helper/' +
'script.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/* This is to keep track of who is using this extension: [[User:Jnothman/afd_helper/script.js]] */
// Picture Popups for Mediawiki
// (c)2005 [[User:Zocky]]
// Released under GPL
document.write('<link rel="stylesheet" type="text/css" href="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Zocky/PicturePopups.css'
+ '&action=raw&ctype=text/css&dontcountme=s">');
document.addEventListener('click',firstClick,true);
//Handle clicks on document until content is loaded
function firstClick(e)
{
var c=document.getElementById('content')||document.getElementById('article');
if (c) {
c.addEventListener('click',imageClick,false);
document.removeEventListener('click',firstClick,true); }
}
//Handle clicks on images
function imageClick(e)
{
if (!e.ctrlKey && !e.shiftKey && !e.metaKey && e.target.tagName=='IMG')
{
var t=e.target;
var caption=t.getAttribute('alt');
while (t.tagName!='A') { t=t.parentNode; }
var realurl = t.href;
var pictitle = unescape(realurl.match(/\/wiki\/Image:(.*)$/)[1].replace(/_/g," "));
if (caption!='Enlarge')
{
try
{
var captiondiv=t.nextSibling.nextSibling;
if (captiondiv.getAttribute('class')=='thumbcaption') {caption=captiondiv.innerHTML}
}
catch (er){}
x=Math.round(Math.random()*200);
y=Math.round(Math.random()*200);
var note_content_div=new_note(x, y, '[<a href="'+realurl+'"> > </a>] '+pictitle, '<blink><small><i>loading...</i></small></blink>',caption);
note_content_div.addEventListener('click',noteContentClick,true);
var cbSuccess=function(x,c)
{
note_content_div.innerHTML='';
note_content_div.appendChild(findDescendantById(c,'file')) || (note_content_div.innerHTML="Failed. <a>retry</a>");
try { note_content_div.appendChild(findDescendantById(c,'imageLicense')); } catch(er) {};
return true;
}
var cbFailure=function(x,c)
{
note_content_div.innerHTML==x.statusText;
return true;
}
loadText(realurl,cbSuccess,cbFailure);
}
else
{
var img = t.parentNode.parentNode.parentNode.firstChild.firstChild;
if (img.hasAttribute('thumbwidth'))
{
var dummy=img.getAttribute('thumbwidth')
img.setAttribute('thumbwidth',img.width);
img.width=dummy;
img.parentNode.parentNode.style.width=(img.width+2) + "px";
var dummy=img.getAttribute('thumbheight')
img.setAttribute('thumbheight',img.height);
img.height=dummy;
}
else
{
img.setAttribute('thumbwidth',img.width);
img.setAttribute('thumbheight',img.height);
var cbSuccess=function(x,c)
{
var dummy=findDescendantById(c,'file');
if (dummy.firstChild.tagName=='IMG')
{
img.src=dummy.firstChild.src;
img.width=dummy.firstChild.width;
img.height=dummy.firstChild.height;
}
else
{
img.width=dummy.firstChild.firstChild.width;
img.height=dummy.firstChild.firstChild.height;
img.src=dummy.firstChild.firstChild.src;
}
img.parentNode.parentNode.style.width=(img.width+2) + "px";
return true;
}
var cbFailure=function(x,c)
{
return true;
}
loadText(realurl,cbSuccess,cbFailure);
}
}
e.preventDefault();
}
}
//Stop popup images from linking to hi-res pages
function noteContentClick(e)
{
e.target.tagName=='IMG' && e.preventDefault() ;
}
//NOTES
var note_top=100;
var active_note;
var note_back='globalWrapper';
function note_icons(n)
{
return '<nobr>[<a onclick="toggle_note(\''+n+'\')"> - </a>] '
+ '[<a onclick="close_note(\''+n+'\')"> x </a>]</nobr>';
}
function new_note(x,y,title,content,caption)
{
var note_container=document.getElementById(note_back)
note_top++;
var note = document.createElement("div");
note.id = "note_" + note_top;
note.setAttribute('class', "imagenote");
note.setAttribute('minimized', "0");
x>0 && (note.style.left = x + "px") || (note.style.right = -x + "px");
y>0 && (note.style.top = y + "px") || (note.style.bottom = -y + "px");
note.style.zIndex=note_top;
note.innerHTML = '<table><tr class="imagenotetitlebar">'
+ '<td class="imagenotetitle" id="'+note.id+'_title"><span>' + title + '</span></td>'
+ '<td class="imagenoteicons" id="'+note.id+'_icons" align="right">' + note_icons(note.id) + '</td></tr>'
+ '<tr><td class="imagenotecontent" id="'+note.id+'_content" colspan="2">'+content+'</td></tr>'
+ '<tr><td class="imagenotecaption" id="'+note.id+'_caption" colspan="2">'+caption+'</td></tr></table>';
note_container.appendChild(note);
note.addEventListener("mousedown", pick_note, true);
note.addEventListener("click", click_note, true);
active_note=note;
return document.getElementById(note.id+'_content');
}
function close_note(n)
{
var note_container=document.getElementById(note_back);
note_container.removeChild(document.getElementById(n));
}
function toggle_note(n)
{
var note=document.getElementById(n);
note.setAttribute('minimized', 1-note.getAttribute('minimized'));
}
var note_dragging;
function pick_note(e)
{
active_note=e.currentTarget;
note_top++;
active_note.style.zIndex = note_top;
mouse_x = e.clientX; mouse_y = e.clientY;
active_note_top = parseInt(active_note.style.top); active_note_left = parseInt(active_note.style.left);
document.addEventListener("mousemove", drag_note, false);
document.addEventListener("mouseup", drop_note, false);
e.preventDefault();
note_dragging=false;
}
function drag_note(e)
{
var x = e.clientX;
var y = e.clientY;
active_note.style.top = (y - mouse_y + active_note_top) + "px"; active_note.style.left = (x - mouse_x + active_note_left) + "px";
note_dragging=true;
}
function drop_note(e)
{
document.removeEventListener("mousemove", drag_note, false);
document.removeEventListener("mouseup", drop_note, false);
}
function click_note(e)
{
note_dragging && e.preventDefault();
}
//DOWNLOADER
function loadText(url,cb1,cb2) {
var x = window.XMLHttpRequest ? new XMLHttpRequest()
: window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP")
: false;
var c=document.createElement("div");
if (x) {
x.onreadystatechange=function() {
x.readyState==4 && textLoaded(x,c,cb1,cb2)};
x.open("GET",url,true);
x.setRequestHeader('Accept','text/*');
x.send(null); }
}
function textLoaded(x,c,cb1,cb2) {
x.status==200
&& ((c.innerHTML=x.responseText) && cb1 && cb1(x,c))
|| ( cb2 && cb2(x,c) || alert(x.statusText));
}
//XML helper functions
function findDescendantById(node, id) {
if (node.id == id) { return node; }
var i, c;
for (i = node.firstChild; i != null; i=i.nextSibling) {
c = findDescendantById(i,id);
if (c != null)
return c; }
return null;
}
function doCleanup() {
document.editform.wpTextbox1.value = '{' + '{' + 'Cleanup-date|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Marked for cleanup.';
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
function addCleanup() {
addTab("javascript:doCleanup()", "cleanup", "ca-cleanup", "Mark for cleanup", "");
akeytt();
}
addOnloadHook(function() {
if (document.title.indexOf("User:") != -1 || document.title.indexOf("User talk:") != -1) {
return;
}
if (document.title.indexOf("Editing ") != -1) {
addOnloadHook(addCleanup);
}
});
//</nowiki></pre>
//<pre><nowiki>
function welcometn(num)
{
var varticle = '';
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
{t.value += '\n';}
if (num==1)
{
t.value += "{{subst:Welcome}}. ~~~~";
f.wpSummary.value = "Welcome to our free Encyclopedia!";
}
else if (num==2)
{
t.value += "{{subst:Anon}}. ~~~~";
f.wpSummary.value = "Welcome to our free Encyclopedia!";
}
else if (num==3)
{
t.value += "{{subst:User:Centrx/Welcome}}";
f.wpSummary.value = "Welcome to our free Encyclopedia!";
}
}
function testn(number)
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1].replace(/(Image|Category):/i,':$1:')) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += "==" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]]" + varticle + "==" + "\n" + "{{subst:" + "test" + number + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " test" + number;
}
function povn()
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1].replace(/(Image|Category):/i,':$1:')) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += "==" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]]" + varticle + "==" + "\n" + "{{subst:" + "NPOV0a" + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " NPOV0a";
}
function warningn()
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1].replace(/(Image|Category):/i,':$1:')) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="==" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]]" + varticle + "==" + "\n" + "{{subst:" + "bv" + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " bv";
}
function revertsn()
{
var IPnoteR = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnoteR = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning, but aviod making any [[Wikipedia:revert|reverts]] within 24 hours of this warning in order to avoid any confusion.'' ";}
var article = prompt("Enter the page name where the 3RR violation occured:")
articleh = article.replace(/ /g, '_');
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="==" + "Regarding reversions" + "[http://en.wikipedia.org/w/index.php?title=" + articleh + "&action=history] " + "made on [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]] to " + "[[" + article + "]]" + "==" + "\n" + "{{subst:" + "3rr" + "}} " + IPnoteR + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " 3rr";
}
function finalwn()
{
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1].replace(/(Image|Category):/i,':$1:')) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += ":{{subst:" + "test4" + "}} ~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " final warning";
}
function blockn()
{
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1].replace(/(Image|Category):/i,':$1:')) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += ":{{subst:" + "test5" + "}} ~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " temporary block";
}
function rrblockn()
{
username_a = document.URL.match(/:.*:(.*)/);
username=username_a[1];
var article = prompt("Enter the page name where the 3RR violation occured:");
articleh = article.replace(/ /g, '_');
var well = prompt("Warning is already in context (*y* or *n*)?")
var time = prompt("Enter the duration of the block (in hours)")
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
{t.value += '\r';}
t.value += '<div style="background-color: #f9f9f9; border: 1px solid red; padding: 3px;">' + '\n';
if (well == 'y' || well == 'yes')
{
t.value += ":{{subst:" + "3rr3" + "}} The duration of the [http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=&page=User:" + username + " block] is " + time + " hours. [http://en.wikipedia.org/w/index.php?title=" + articleh + "&action=history Here] are the reverts in question. ~" + "~" + "~" + "~" + "</div>";
}
else if (well == 'n' || well == 'no')
{
t.value += "==" + "Regarding reversions" + "[http://en.wikipedia.org/w/index.php?title=" + articleh + "&action=history] " + "made on [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]] to " + "[[" + article + "]]" + "==" + "\n" + "{{subst:" + "3rr3" + "}} The duration of the [http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=&page=User:" + username + " block] is " + time + " hours. ~" + "~" + "~" + "~" + "</div>";
}
else
{
prompt("Error, enter *y* or *n*.");
return;
}
f.wpSummary.value = "User notice:" + " temporary 3RR block";
}
function testbl()
{
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1].replace(/(Image|Category):/i,':$1:')) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="==" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]]" + varticle + "==" + "\n" + "{{subst:" + "test2a}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice:" + " test2a";
}
function spam(type)
{
if (type == 1){var temp = 'spam1'}
else if (type == 2){var temp = 'spam2a'}
var IPnote = '';
if (document.title.split(' - ')[0].split('.').length == 4)
{IPnote = "''If this is an [[IP address]], and it is shared by multiple users, ignore this warning if you did not make any [[Wikipedia:vandalism|unconstructive]] edits.'' ";}
var varticle = '';
if (location.href.indexOf('&vanarticle=') != -1)
{varticle = ' to [[' + unescape(location.href.split('&vanarticle=')[1].replace(/(Image|Category):/i,':$1:')) + ']]';}
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="==" + "Regarding edits made during [[{{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}}]] [[{{subst:CURRENTYEAR}}]]" + varticle + "==" + "\n" + "{{subst:" + temp + "}} " + IPnote + "~" + "~" + "~" + "~";
f.wpSummary.value = "User notice: " + temp;
}
function rrwarn()
{
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="*The user has now been warned per [[WP:3RR|3RR]] not to let this happen again. " + "~" + "~" + "~" + "~";
t.value = t.value.replace(/\(Result:\)/,'(Result: user warned)');
f.wpSummary.value = "Response: user warned";
}
function rrblock()
{
var number = prompt("User blocked for how many hours?")
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="*I have blocked the user for " + number + " hours per [[WP:3RR]]. " + "~" + "~" + "~" + "~";
t.value = t.value.replace(/\(Result:\)/,'(Result: ' + number + ' hours)');
f.wpSummary.value = "Response: user blocked";
}
function rrnoblock()
{
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value +="*The user has not yet violated [[WP:3RR]] because there are not yet four reverts within 24 hours nor is there any severely disruptive behavoir. However, I have warned the user for nearly breaching [[WP:3RR]]. " + "~" + "~" + "~" + "~";
t.value = t.value.replace(/\(Result:\)/,'(Result: no violation)');
f.wpSummary.value = "Response: no violation";
}
//more tabs
addOnloadHook(add_testn_tabs)
function add_testn_tabs()
{
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
if (document.title.indexOf("Talk:") == -1 && document.title.indexOf("talk:") == -1 && document.title.indexOf("User:") == -1 && document.title.indexOf("MediaWiki:") == -1 && document.title.indexOf("Image:") == -1 && document.title.indexOf("Wikipedia:") == -1 && document.title.indexOf("Template:") == -1 && document.title.indexOf("Portal:") == -1 && document.title.indexOf("Help:") == -1 && document.title.indexOf("Main Page") == -1 && document.title.indexOf("Category:") == -1)
{
if(document.getElementById('ca-edit'))
{document.getElementById('ca-edit').firstChild.innerHTML = 'Modify';}
}
else
{
if(document.getElementById('ca-edit'))
{document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';}
if(document.getElementById('ca-talk'))
{document.getElementById('ca-talk').firstChild.innerHTML = 'Talk';}
}
if (document.title.indexOf("Editing ") != -1)
{
if (document.title.indexOf("Editing User talk:") != -1)
{
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlimenu(tabs, '{{message}}', 'warnfunc');
var warnfunc = document.getElementById('warnfunc').getElementsByTagName('ul')[0];
addlilink(warnfunc, 'javascript:welcometn(1)', 'welcome', '');
addlilink(warnfunc, 'javascript:welcometn(3)', 'welcome2', '');
addlilink(warnfunc, 'javascript:welcometn(2)', 'anon', '');
addlilink(warnfunc, 'javascript:testn(1)', 'test', '');
addlilink(warnfunc, 'javascript:povn()', 'NPOV', '');
addlilink(warnfunc, 'javascript:testn(2)', 'vandal', '');
addlilink(warnfunc, 'javascript:testn(3)', 'vandal2', '');
addlilink(warnfunc, 'javascript:warningn()', 'warn', '');
addlilink(warnfunc, 'javascript:testbl()', 'blanking', '');
addlilink(warnfunc, 'javascript:spam(1)', 'spam', '');
addlilink(warnfunc, 'javascript:spam(2)', 'spam2', '');
addlilink(warnfunc, 'javascript:finalwn()', 'final', '');
addlilink(warnfunc, 'javascript:blockn()', 'vblock', '');
addlilink(warnfunc, 'javascript:revertsn()', '3rr', '');
addlilink(warnfunc, 'javascript:rrblockn()', 'rr block', '');
if(document.getElementById('ca-delete'))
{
document.getElementById('ca-delete').firstChild.innerHTML = '<span style="color:red;">[d]</span>';
}
if(document.getElementById('ca-move'))
{
document.getElementById('ca-move').firstChild.innerHTML = '[m]';
}
if(document.getElementById('ca-watch'))
{
document.getElementById('ca-watch').firstChild.innerHTML = '[w]';
}
if(document.getElementById('ca-unwatch'))
{
document.getElementById('ca-unwatch').firstChild.innerHTML = '[uw]';
}
if(document.getElementById('ca-edit'))
{
document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';
}
}
else if (document.title.indexOf("Editing User:") != -1)
{
var nothing = 'yes';
}
else if (document.title.indexOf("Editing Wikipedia:Requests for page protection (section)") != -1)
{
if(document.getElementById('ca-delete'))
{
document.getElementById('ca-delete').firstChild.innerHTML = '<span style="color:red;">[d]</span>';
}
if(document.getElementById('ca-move'))
{
document.getElementById('ca-move').firstChild.innerHTML = '[m]';
}
if(document.getElementById('ca-watch'))
{
document.getElementById('ca-watch').firstChild.innerHTML = '[w]';
}
if(document.getElementById('ca-unwatch'))
{
document.getElementById('ca-unwatch').firstChild.innerHTML = '[uw]';
}
}
else if (document.title.indexOf("Editing Wikipedia:Administrators' noticeboard/3RR (section)") != -1)
{
addTab('javascript:rrwarn()',"a|wn","ca-wn","Warned","");
addTab('javascript:rrblock()',"a|bl","ca-bl","Blocked","");
addTab('javascript:rrnoblock()',"r|cl","ca-cl","Close to 3RR","");
}
else if(document.title.indexOf("Wikipedia:") != -1 || document.title.indexOf("Help:Contents/Editing Wikipedia") != -1 || document.title.indexOf("Editing Talk") != -1 || document.title.indexOf("Editing Wikipedia talk") != -1)
{
{nothing=1;}
}
}
else if (document.title.indexOf("User:") != -1)
{
if(document.getElementById('ca-talk'))
{
document.getElementById('ca-talk').firstChild.innerHTML = 'Talk';
}
}
else if (document.title.indexOf("User talk:") != -1)
{
if(document.getElementById('ca-talk'))
{
document.getElementById('ca-talk').firstChild.innerHTML = 'Talk';
}
}
}
//</nowiki></pre>
//<nowiki>
topaz.statuschanger = new Object();
topaz.statuschanger.version = 20061108;
/* configuration */
// change these to whatever you'd like to show up on your status page. you can add new lines in
// the same format provided there is a comma at the end of each line but the last one. you can
// also use wikimarkup here to, for example, display an image instead of text.
topaz.statuschanger.statuscode = {
online:'{{User:Split_Infinity/StatusTemplate|in}}',
busy:'{{User:Split_Infinity/StatusTemplate|busy}}',
offline:'{{User:Split_Infinity/StatusTemplate|out}}'
};
// this will make wikimarkup work in your stauscodes but will disable auto-updating
topaz.statuschanger.enablewikimarkup = false;
// true to use the personal bar, false to create a panel in the left column
topaz.statuschanger.usepersonalbar = true;
// true if you'd like your status page on your watchlist
topaz.statuschanger.watchstatus = false;
/* end configuration */
topaz.statuschanger.buttonlist = {};
topaz.statuschanger.oldonload = window.onload;
window.onload = function() {
if (typeof topaz.statuschanger.oldonload == "function") {
setTimeout('topaz.statuschanger.oldonload()',50);
}
if (!topaz.statuschanger.usepersonalbar) {
topaz.wputil.addsidepanel("tz-statuschanger", "status changer");
}
var buttonlist = [];
for (status in topaz.statuschanger.statuscode) {
buttonlist.push(status);
topaz.statuschanger.buttonlist[status] =
topaz.wputil.addsidepanelbutton(
topaz.statuschanger.usepersonalbar ? "p-personal" : "tz-statuschanger",
status,
'javascript:topaz.statuschanger.setstatus("' + status + '")'
);
}
if (topaz.statuschanger.usepersonalbar) {
for(var i=0; i<buttonlist.length; i++) {
with (topaz.statuschanger.buttonlist[buttonlist[i]].style) {
if (i != buttonlist.length-1) {
borderRight = "1px solid #aaaaaa";
paddingRight = "2px";
}
if (i != 0) {
marginLeft = "0px";
paddingLeft = "2px";
}
}
}
}
var spanlist = document.getElementsByTagName("span");
for (var i=0; i<spanlist.length; i++) {
if (spanlist[i].className == "topaz.statuschanger.curstatus."+escape(topaz.wputil.username())) {
topaz.util.cookie.set("topaz.statuschanger.curstatus", spanlist[i].innerHTML);
}
}
topaz.statuschanger.update();
};
topaz.statuschanger.setstatus = function(statusname) {
topaz.wputil.setpagecontent(
"User:"+topaz.wputil.username()+"/Status",
(!topaz.statuschanger.enablewikimarkup ?
'<includeonly><span class="topaz.statuschanger.inlinestatus.'
+ escape(topaz.wputil.username())
+ '"></includeonly>'
: '') +
topaz.statuschanger.statuscode[statusname] +
(!topaz.statuschanger.enablewikimarkup ?
'<includeonly></span></includeonly>'
: '') +
'<span class="topaz.statuschanger.curstatus.'+escape(topaz.wputil.username()) +
'" style="display:none">'+statusname+'</span>',
statusname,
topaz.statuschanger.watchstatus);
topaz.util.cookie.set("topaz.statuschanger.curstatus", statusname);
topaz.statuschanger.update();
};
topaz.statuschanger.laststatus = null;
topaz.statuschanger.update = function() {
var curstatus = topaz.util.cookie.get("topaz.statuschanger.curstatus");
if (curstatus && curstatus != topaz.statuschanger.laststatus) {
for (status in topaz.statuschanger.buttonlist) {
with (topaz.statuschanger.buttonlist[status].style) {
if (status == curstatus) {
fontWeight = "bold";
} else {
fontWeight = "normal";
}
}
}
if (!topaz.statuschanger.enablewikimarkup) {
var spanlist = document.getElementsByTagName("span");
for (var i=0; i<spanlist.length; i++) {
if (spanlist[i].className == "topaz.statuschanger.inlinestatus."+escape(topaz.wputil.username())) {
spanlist[i].innerHTML = topaz.statuschanger.statuscode[curstatus];
}
}
}
}
topaz.statuschanger.laststatus = curstatus;
};
setInterval("topaz.statuschanger.update()", 5000);
//</nowiki>