User:PhilipBembridge/monobook.js
From Wikipedia, the free encyclopedia
If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
//////////////////////////////// ///////// Purge button ///////// //////////////////////////////// // addPurge addOnloadHook(function () { var hist; var url; if (!(hist = document.getElementById('ca-history') )) return; if (!(url = hist.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return; addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'), 'purge', 'ca-purge', 'Purge server cache for this page', '0'); }); // ///////////////////////////// ///////// Logs link ///////// ///////////////////////////// // adds a 'logs for this page' link to the toolbox bar // if the page is a user's page, talk page or subpage, the link will go to logs for the user instead // if the page is a special page, then no link is displayed addOnloadHook(function () { // if this is a user, show the logs for the user rather than the page if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) { url = wgServer + "/w/index.php?title=Special:Log&user=" + wgTitle.split("/")[0]; } else if ( wgCanonicalNamespace == "Special" ) { // don't display link for special pages return; } else { url = wgServer + "/w/index.php?title=Special:Log&page=" + wgPageName; } addPortletLink("p-tb", url, "Logs", "pt-logs"); }); // //////////////////////////////////////////////////////////////// ///////// Last F.M. (Buggy when at school, so removed) ///////// //////////////////////////////////////////////////////////////// //document.write('<script type="text/javascript" src="' //+ 'http://en.wikipedia.org/w/index.php?title=User:Csörföly D/lastfm.js' //+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); ////////////////////////// ///////// Popups ///////// ////////////////////////// // [[User:Lupin/popups.js]] importScript('User:Lupin/popups.js'); //////////////////////////// ///////// Friendly ///////// //////////////////////////// importScript('User:Ioeth/friendly.js'); /////////////////////////// ///////// Twinkle ///////// /////////////////////////// importScript('User:AzaToth/twinkle.js'); ////////////////////////////////// ///////// User watchlist ///////// ////////////////////////////////// importScript('User:Tra/userwatchlist.js'); //[[User:Tra/userwatchlist.js]] ///////////////////////////////////////////////////// ///////////////////////////////////////////////////// ///////// Changes since last load watchlist ///////// ///////////////////////////////////////////////////// ///////////////////////////////////////////////////// addOnloadHook(function () { if (!wgCanonicalSpecialPageName || wgCanonicalSpecialPageName != "Watchlist") return; if (!document.forms[0] || !document.forms[0].namespace) return; var link = document.createElement('a'); link.id = 'listSince'; link.href = '#listSince'; // must have a href to show as link! var then = +(new Date()); var fixLinkHref = function () { var url = window.location.href.split('#')[0]; var days = ( +(new Date()) - then )/(1000 * 3600 * 24); if (url.match(/[?&]days=/)) this.href = url.replace(/([?&]days=)[^&]*/, '$1'+days); else this.href = url + (url.indexOf('?') < 0 ? '?':'&') + 'days=' + days; return true; }; link.onclick = fixLinkHref; link.onmousedown = fixLinkHref; // react to middle clicks too var frag = document.createDocumentFragment(); frag.appendChild(document.createTextNode(' | ')); frag.appendChild(link); link.appendChild(document.createTextNode('Changes')); frag.appendChild(document.createTextNode(' since last load.')); // just one little ID attribute would be _so_ nice... var nsSelectForm = document.getElementsByTagName('form')[0]; nsSelectForm.parentNode.insertBefore(frag, nsSelectForm); }); // /////////////////////////////////////////////// ///////// Article for creation helper ///////// /////////////////////////////////////////////// importScript ('User:Henrik/js/afc-helper.js');

