User:Ckatz/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.
function addLink(where, url, name, id, title, key, after) { // addLink() accepts either an id or a DOM node, addPortletLink() only takes a node if (after && !after.cloneNode) after = document.getElementById(after); return addPortletLink(where, url, name, id, title, key, after); } // [[User:Henrik/sandbox/google-search]] (please include this line) function install_search() { document.getElementById('searchBody').innerHTML='<div>'+ '<FORM method=get action="http://www.google.ca/search">'+ '<input type=hidden name="ie" value="UTF-8" /><input type=hidden name="oe" value="UTF-8" />'+ '<INPUT id="searchInput" name="q" type="text" accesskey="f" value="" />'+ '<input type="hidden" name="domains" value="en.wikipedia.org" />'+ '<input type=radio name=sitesearch value="">Web'+ '<input type=radio name=sitesearch value="en.wikipedia.org" checked />WP'+ '<INPUT type="submit" name="btnG" VALUE="Google Search" /></FORM></div>'; } addOnloadHook(install_search); // [[User:TheDJ/apipopups.js]] importScript('User:TheDJ/apipopups.js'); popupAdminLinks=true; // 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"></script>'); //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>'); } //Add "unwatch" functionality to the watchlist ([[user:js/watchlist]], replaces [[User:Ilmari Karonen/unwatch.js]] and [[Wikipedia:WikiProject_User_scripts/Scripts/Unwatch]] importScript('user:js/watchlist.js') // Script from [[User:Lupin/editcount.js]] importScript('User:Lupin/editcount.js'); //[[User:Lupin/editcount.js]] popupEditCounterTool='custom'; popupEditCounterUrl='http://en.wikipedia.org/wiki/User:$1?ectarget=$1'; //Adding Twinkle (Wikipedia:WikiProject User scripts/Scripts/Twinkle) importScript('User:AzaToth/twinkle.js'); TwinkleConfig = { revertMaxRevisions : 50, userTalkPageMode : 'tab', showSharedIPNotice : false, openTalkPage : [ 'agf', 'norm', 'vand' ], openTalkPageOnAutoRevert : false, openAOLAnonTalkPage : false, summaryAd : "", deletionSummaryAd : "", protectionSummaryAd : "", watchSpeedyPages : [ 'g3', 'g5', 'g10', 'g11', 'g12' ], watchProdPages : true, openUserTalkPageOnSpeedyDelete : [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ], watchRevertedPages : [ 'agf', 'norm', 'vand', 'torev' ], markRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ], deleteTalkPageOnDelete : false, watchWarnings : true, markAIVReportAsMinor : true, markSpeedyPagesAsMinor : true, markProdPagesAsMinor : true, confirmUsernameToAIV : true, toolboxButtons : [ ] }; // [[User:Jsimlo/shortcuts.js]] document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Jsimlo/shortcuts.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); function shortcutsInit () { shortcutsAddLink ('UWatchlist', 'User:Tra/User_watchlist'); shortcutsAddLink ('Navigation shortcuts', 'Wikipedia:Tools/Navigation shortcuts'); shortcutsAddLink ('Useful tools', 'User:Ckatz/Tools'); shortcutsAddLink ('ADMIN: AIV', 'Wikipedia:Administrator intervention against vandalism'); shortcutsAddLink ('ADMIN: Block list', 'Special:IPBlockList'); shortcutsAddLink ('SEARCH: Ext. links', 'Special:Linksearch'); shortcutsAddLink ('DIR: user pages', 'Special:PrefixIndex/User:Ckatz/'); shortcutsAddLink ('DIR: talk pages', 'Special:PrefixIndex/User talk:Ckatz/'); } importScript('User:Tra/userwatchlist.js'); //[[User:Tra/userwatchlist.js]] //importScript('User:AndyZ/peerreviewer.js'); //[[User:AndyZ/peerreviewer.js]] /* <pre><nowiki> */ //Please adjust the following variables according to when you want to end your break: var year = 2007; //YYYY var month = 09; //MM var day = 28; //DD var hour = 18; //HH var minute = 00; //MM var second = 00; //SS function EnforceWikiBreak() { var currentdate = new Date(); var enforced_break_end = new Date(year,changemonth(),day,hour,minute,second); if (currentdate > enforced_break_end) { // alert ("Welcome back from your enforced wikibreak!"); } else { alert ("Enforced wikibreak until " + enforced_break_end.toLocaleString() + " (currently " + currentdate.toLocaleString() + "). Bye!"); window.location.href = ("http://"+document.location.host+"/w/index.php?title=Special:Userlogout&returnto=Main_Page"); } } function changemonth() { //thing to subtract 1 from the month. you can't use month-1 because it removes the '0' from the front if(month==01) return 00; if(month==02) return 01; if(month==03) return 02; if(month==04) return 03; if(month==05) return 04; if(month==06) return 05; if(month==07) return 06; if(month==08) return 07; if(month==09) return 08; if(month==10) return 09; if(month==11) return 10; if(month==12) return 11; return 00; } addOnloadHook(function() { EnforceWikiBreak(); }); /* </nowiki></pre> */ if( !document.all ) { /* Watchlist notifier ([[User:Ais523/watchlistnotifier.js]]); displays a message every time a watched page changes. */ //<pre><nowiki> var wmwpajax; // From [[WP:US]] mainpage (wpajax renamed to wmwpajax) wmwpajax={ download:function(bundle) { // mandatory: bundle.url // optional: bundle.onSuccess (xmlhttprequest, bundle) // optional: bundle.onFailure (xmlhttprequest, bundle) // optional: bundle.otherStuff OK too, passed to onSuccess and onFailure var x = window.XMLHttpRequest ? new XMLHttpRequest() : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false; if (x) { x.onreadystatechange=function() { x.readyState==4 && wmwpajax.downloadComplete(x,bundle); }; x.open("GET",bundle.url,true); x.send(null); } return x; }, downloadComplete:function(x,bundle) { x.status==200 && ( bundle.onSuccess && bundle.onSuccess(x,bundle) || true ) || ( bundle.onFailure && bundle.onFailure(x,bundle) || alert(x.statusText+': '+bundle.url)); } }; // Example: // function dlComplete(xmlreq, data) { // alert(data.message + xmlreq.responseText); // } // wmwpajax.download({url:'http://en.wikipedia.org/w/index.php?title=Thresher&action=raw', // onSuccess: dlComplete, message: "Here's what we got:\n\n" }); // End of [[WP:US]] quote function wmWatchEditFound(xmlreq, data) { var watchrev, watchsum, watchrevold, watchpage, junk; watchrev=xmlreq.responseText.split('timestamp="')[1].split('"')[0]; if(wgPageName == "Special:Watchlist") document.cookie="ais523wmwatchrev="+watchrev+".; path=/"; else { watchsum=xmlreq.responseText.split('comment="')[1].split('"')[0]; watchpage=xmlreq.responseText.split('title="')[1].split('"')[0]; try { watchrevold=document.cookie.split('ais523wmwatchrev=')[1].split('.')[0]; } catch(junk) {watchrevold=0;} watchsum=watchsum.split('<').join('<').split('>').join('>'); watchpage=watchpage.split('<').join('<').split('>').join('>'); if(watchrev!=watchrevold) document.getElementById('contentSub').innerHTML+= "<div class='watchlistnotify'>\""+watchpage+'" changed: "'+watchsum+'".</div>'; } } addOnloadHook(function() { /* Find the top item in the watchlist, and its edit summary. We only need one item, so set the limit to 1 to ease the load on the server. */ //if(location.href.indexOf("/wiki/")!=-1) wmwpajax.download({url:'http://en.wikipedia.org/w/api.php?action=query&list=watchlist&wllimit=1&'+ 'wldir=older&format=xml&wlprop=comment|timestamp|title', onSuccess: wmWatchEditFound}); }); // </nowiki></pre> // [[Category:Wikipedia scripts]] } importScript('User:Ioeth/friendly.js'); //Variables for wikEd var wikEdRegExTypoFix = true; //Gracenotes - script to add custom summaries for rollbacks importScript('User:Gracenotes/rollback.js'); //Cameltrader - add "Advisor" script importScript('User:Cameltrader/Advisor.js'); //AWeenieMan - Fair Use Rationale scripts (Firefox only) importScript('User:AWeenieMan/furme.js'); importScript('User:AWeenieMan/furmescroller.js'); //[[User:js/diff.js]] - improved "diff" rendering importScript('user:js/diffs.js'); //[[User:Alex Smotrov/histcomb.js]] - improved history page rendering importScript('User:Alex Smotrov/histcomb.js');