User:Fangoriously/monobook.js
From Homestar Runner Wiki
(Difference between revisions)
Fangoriously (Talk | contribs)
(Created page with ' function addPurgeButton() { var href = document.location.href; { var historyHref = document.getElementById( "ca-history" ).firstChild.href; var …')
Newer edit →
(Created page with ' function addPurgeButton() { var href = document.location.href; { var historyHref = document.getElementById( "ca-history" ).firstChild.href; var …')
Newer edit →
Revision as of 18:46, 27 July 2011
function addPurgeButton()
{
var href = document.location.href;
{
var historyHref = document.getElementById( "ca-history" ).firstChild.href;
var div = document.getElementById( "p-cactions" );
var ul = div.getElementsByTagName( "ul" )[0];
var newLi = document.createElement( "li" );
var newA = document.createElement( "a" );
newA.setAttribute( "href" , historyHref.replace( "=history" , "=purge" ) );
var text = document.createTextNode( "purge" );
newA.appendChild( text );
newLi.appendChild( newA );
ul.appendChild( newLi );
}
}
if ( window.addEventListener ) window.addEventListener( "load" , addPurgeButton , false );
else if ( window.attachEvent ) window.attachEvent( "onload", addPurgeButton );
function getTime() {
var time = new Date();
var hours = time.getUTCHours();
if (hours < 10) { hours = "0" + hours; }
var minutes = time.getUTCMinutes();
if (minutes < 10) { minutes = "0" + minutes; }
var currentTime = hours + ":" + minutes
document.getElementById('pt-time').childNodes[0].childNodes[0].replaceData(0, 5, currentTime);
doTime = window.setTimeout("getTime()", 1000);
}
function makeTime() {
var div = document.createElement( 'div' );
div.id = 'pt-time';
var mySpan = document.createElement( 'span' );
mySpan.appendChild( document.createTextNode( '00:00 UTC' ) );
div.appendChild( mySpan );
document.getElementById( 'globalWrapper' ).parentNode.appendChild( div );
doTime = window.setTimeout("getTime()", 1000);
}
if (window.addEventListener) window.addEventListener ('load', makeTime, false);
else if (window.attachEvent) window.attachEvent ('onload', makeTime)
mwCustomEditButtons[mwCustomEditButtons.length] =
{
"imageFile": 'http://upload.wikimedia.org/wikipedia/commons/8/83/Button_encrypted.png',
"speedTip": 'please login',
"tagOpen": "{" + "{subst:pleaselogin|version=[",
"tagClose": "]}} ~~" + "~~",
"sampleText": "link to latest version of page before reversion"
}
mwCustomEditButtons[mwCustomEditButtons.length] =
{
"imageFile": 'http://upload.wikimedia.org/wikipedia/commons/2/2b/Button_plume_1.png',
"speedTip": 'signing for newbs',
"tagOpen": "{" + "{subst:signing}} ~~" + "~~",
"tagClose": "",
"sampleText": ""
}
mwCustomEditButtons[mwCustomEditButtons.length] =
{
"imageFile": 'http://upload.wikimedia.org/wikipedia/commons/2/2a/Button_examine.png',
"speedTip": 'show preview',
"tagOpen": "{" + "{subst:showpreview}} ~~" + "~~",
"tagClose": "",
"sampleText": ""
}
mwCustomEditButtons[mwCustomEditButtons.length] =
{
"imageFile": 'http://upload.wikimedia.org/wikipedia/commons/7/74/Button_comment.png',
"speedTip": 'use summary',
"tagOpen": "{" + "{subst:usesummary}} ~~" + "~~",
"tagClose": "",
"sampleText": ""
}
mwCustomEditButtons[mwCustomEditButtons.length] =
{
"imageFile": 'http://upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso_borrado.png',
"speedTip": 'test notice',
"tagOpen": "{" + "{subst:test|diff=[",
"tagClose": "]}} ~~" + "~~\n",
"sampleText": "link to diff"
}
mwCustomEditButtons[mwCustomEditButtons.length] =
{
"imageFile": 'http://upload.wikimedia.org/wikipedia/commons/9/9d/Button_halt.png',
"speedTip": 'block warning',
"tagOpen": "{" + "{subst:blockwarning|subst=subst:",
"tagClose": "}} ~~" + "~~",
"sampleText": "|test=true"
}
