User:Tra/monobook.js
From Wikipedia, the free encyclopedia
< User:Tra
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.
// Script from [[User:Tra/userwatchlist.js]] document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Tra/userwatchlist.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></scr' + 'ipt>'); // [[User:Lupin/popups.js]] document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></scr' + 'ipt>'); popupFixDabs=true; popupWatchDisambiggedPages=true; popupOnlyArticleLinks=false; popupOnEditSelection=false; popupDragHandle='popupTopLinks'; popupRevertSummaryPrompt=true; popupEditCounterTool='custom'; popupEditCounterUrl='http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=$1&site=en.wikipedia.org'; popupAdminLinks=true; /* // Script from [[User:Lupin/editcount.js]] document.write('<scr'+'ipt type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/editcount.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'+'ipt>'); popupEditCounterTool='custom'; popupEditCounterUrl='http://en.wikipedia.org/wiki/User:$1?ectarget=$1'; */ // Script from [[User:Lupin/recent2.js]] 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"></scr' + 'ipt>'); // Script from [[User:Tra/sidebartranslate.js]] document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Tra/sidebartranslate.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></s'+'cript>'); // Script from [[User:Tra/whatlinksherewatchlist.js]] document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Tra/whatlinksherewatchlist.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></s'+'cript>'); //Watch page when making non-talk page if ((document.URL.lastIndexOf("&action=edit") != -1) && wgArticleId == 0 && (wgNamespaceNumber == 0 || wgNamespaceNumber == 2 || wgNamespaceNumber == 4 || wgNamespaceNumber == 6 || wgNamespaceNumber == 8 || wgNamespaceNumber == 10 || wgNamespaceNumber == 12 || wgNamespaceNumber == 14 || wgNamespaceNumber == 100)) { addOnloadHook(wlTickBox); } function wlTickBox() {document.editform.wpWatchthis.checked = "1";} // function replace() { var s = prompt("Search regexp?", ''); if(s) { var r = prompt("Replace regexp?", ''); if(!r && r != '') return; var txt = document.editform.wpTextbox1; txt.value = txt.value.replace(new RegExp(s, "g"), r); } } addOnloadHook(function () { if(document.forms.editform) { uwaddToolboxLink('javascript:replace()', 'Replace', 'ca-replace'); } }); addOnloadHook(function () { if (unescape(window.location.href).indexOf("Special:Watchlist") < 0) return; // just one little ID attribute would be _so_ nice... var nsSelectForm = document.getElementById('namespace'); while (nsSelectForm && !(nsSelectForm.tagName && nsSelectForm.tagName.toLowerCase() == 'form')) nsSelectForm = nsSelectForm.parentNode; if (!nsSelectForm) 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.')); nsSelectForm.parentNode.insertBefore(frag, nsSelectForm); }); // parse querystring function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } //alert('Query Variable ' + variable + ' not found'); } function Traautochange() { //allow auto-change if (getQueryVariable("doreplace") == "yes") { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(new RegExp(getQueryVariable("fromtxt"), "g"), getQueryVariable("totxt")); } //allow second auto-change if (getQueryVariable("doreplace2") == "yes") { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(new RegExp(getQueryVariable("fromtxt2"), "g"), getQueryVariable("totxt2")); } if (wgNamespaceNumber == 14) { var myhead=document.getElementsByTagName('h1')[0] var mycatfooter=document.createElement('div'); myhead.parentNode.appendChild(mycatfooter); mycatfooter.innerHTML = '<br /><form method="GET" action="http://www.1site1moment.com/toby/fixcatsort.asp"><input type="TEXT" name="prefix" size="20"><input type="hidden" name="category" value="Category:' + wgTitle + '"><input type=submit value="Fix prefix"><font size="-1">Enter a prefix that multiple pages have been sorted by, to remove that prefix</font></form>'; } } addOnloadHook (Traautochange) // addOnloadHook (function () {if(document.forms.editform) {document.getElementById('bodyContent').getElementsByTagName('p')[0].innerHTML=''; }}) // not working importScript('User:AzaToth/twinkle.js'); addOnloadHook(function () { addPortletLink("p-personal", "/w/index.php?title=Special:Userlogin&wpName=Tra&wpRemember&returnto=" + wgPageName, "Log in (1)", "pt-login1", "Log in as Tra"); addPortletLink("p-personal", "/w/index.php?title=Special:Userlogin&wpName=Tra non-admin&wpRemember&returnto=" + wgPageName, "(2)", "pt-login2", "Log in as Tra non-admin"); if(wgCanonicalSpecialPageName == false){addPortletLink("p-tb", "/wiki/Special:Prefixindex/" + wgPageName + "/", "Subpages", "t-subpages", "Show subpages of this page"); } }) // addPurge addOnloadHook(function () { if(wgCanonicalNamespace == "Image" ) { addPortletLink('p-cactions', "/w/index.php?action=purge&title=" + wgPageName, 'Purge', 'ca-purge', 'Purge image', '0'); } }); //