User:Trevor MacInnis/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.
// install [[User:TheFearow]]'s ticker script importScript("User:Trevor MacInnis/public/ticker.js"); importScript("User:Trevor MacInnis/public/pagecss.js"); // [[User:Outriggr/metadatatest.js]] importScript('User:Outriggr/metadatatest.js'); document.write('<scr'+'ipt type="text/javascript"' + 'src="http://nl.wikipedia.org/w/index.php?title=Gebruiker:JePe/recentrevisionsbox.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'+'ipt>'); // Script from [[User:AndyZ/peerreviewer.js]] document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:AndyZ/peerreviewer.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></s'+'cript>'); // ============== // NavBar testing document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Gimmetrow/dynabars.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>'); } // Filter changes live // [[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/popups.js]] - please include this line 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"></script>'); simplePopups=true; popupAdminLinks=true; // <pre><nowiki> function BlockIpHelp() { var form = document.getElementById( 'blockip' ); if ( ! form || form.tagName != 'FORM' || ! form.wpBlockAddress ) return; var span = document.createElement( 'SPAN' ); form.span = span; // avoid globals // to the right of the IP or username field // form.wpBlockAddress.parentNode.insertBefore( span, form.wpBlockAddress.nextSibling ); function ipMessage( message, selectedIndex, color ) { var span = document.createElement( 'SPAN' ); span.appendChild( document.createTextNode( ' ' + ( message || '' ) ) ); span.style.color = color || '#000000'; span.style.fontWeight = 'bold'; span.selectedIndex = selectedIndex || 0; return span; } var expiry = { 'other' : 0, '15 minutes' : 1, '1 hour' : 2, '3 hours' : 3, '24 hours' : 4, '48 hours' : 5, '1 week' : 6, '1 month' : 7, 'indefinite' : 8 }; span.ipNone = ipMessage(); span.ipNot = ipMessage( 'Not an IP.' , expiry[ '24 hours' ], '#009900' ); // green span.ipUnknown = ipMessage( 'Unknown IP.' , expiry[ '1 hour' ], '#999900' ); // yellow span.ipAOL = ipMessage( 'AOL IP address.', expiry[ '15 minutes' ], '#990000' ); // red span.appendChild( span.ipNot ); // place holder span.showMessage = function( span ) { this.replaceChild( span, this.firstChild ); } form.wpBlockAddress.onchange = function() { var ip = IpDottedToLong( this.value ); if ( ip === null ) this.form.span.showMessage( this.form.span.ipNone ); else if ( isNaN( ip ) ) this.form.span.showMessage( this.form.span.ipNot ); else if ( IsAOL( ip ) ) this.form.span.showMessage( this.form.span.ipAOL ); // what else, EarthLink? else this.form.span.showMessage( this.form.span.ipUnknown ); this.form.wpBlockExpiry.selectedIndex = this.form.span.selectedIndex; } form.wpBlockAddress.onchange(); } if ( window.addEventListener ) window.addEventListener( 'load', BlockIpHelp, false ); else if ( window.attachEvent ) window.attachEvent( 'onload', BlockIpHelp ); function IpDottedToLong( ip ) //-> number, Number.NaN for username, or null { if ( ! ip ) return null; if ( ( ip.constructor != String ) || ( (ip = ip.split( '.' )).length != 4 ) ) return Number.NaN; // for ( var i = 0; i < 4; i++ ) if ( isNaN( ip[ i ] = Number( ip[ i ] ) ) || ip[ i ] < 0 || ip[ i ] > 255 ) return Number.NaN; // I "think" JavaScript numbers can handle this.... // return ip[ 0 ] * 256 * 256 * 256 + // JS lacks an exponent op, I refuse to use Math.pow() ip[ 1 ] * 256 * 256 + ip[ 2 ] * 256 + ip[ 3 ]; } function IsAOL( ip ) { if ( ip < 1074528256 ) return false; // 64. 12. 0. 0 .. else if ( ip <= 1074593791 ) return true; // .255.255 else if ( ip < 2511208448 ) return false; // 149.174. 0. 0 .. else if ( ip <= 2511273983 ) return true; // .255.255 else if ( ip < 2560819200 ) return false; // 152.163. 0. 0 .. else if ( ip <= 2560884735 ) return true; // .255.255 else if ( ip < 2894069760 ) return false; // 172.128. 0. 0 .. else if ( ip <= 2899574783 ) return true; // .211.255.255 else if ( ip < 3277651968 ) return false; // 195. 93. 0. 0 .. else if ( ip <= 3277684735 ) return true; // .127.255 else if ( ip < 3327197184 ) return false; // 198. 81. 0. 0 .. else if ( ip <= 3327205375 ) return true; // . 31.255 else if ( ip < 3393404928 ) return false; // 202. 67. 64. 0 .. else if ( ip <= 3393421311 ) return true; // .127.255 else if ( ip < 3451650048 ) return false; // 205.188. 0. 0 .. else if ( ip <= 3451715583 ) return true; // .255.255 else if ( ip < 3486007296 ) return false; // 207.200. 64. 0 .. else if ( ip <= 3486023679 ) return true; // .127.255 else return false; } // </nowiki></pre> /**** handy watch ****/ document.write('<script type="text/javascript"' + 'src="http://en.wikipedia.org/w/index.php?title=User:R3m0t/' + 'handywatch.js&action=raw&ctype=text/javascript&dontcountme=s"></script>'); /* This is to keep track of who is using this extension: [[User:R3m0t/handywatch.js]] */

