Jump to content

User:Trevor MacInnis/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:Misza13/watchlistSorter.js');

importScript('User:Mr.Z-man/closeAFD.js');

importScript('User:AzaToth/twinkle.js');
TwinkleConfig = {
        revertMaxRevisions              :       50,
        userTalkPageMode                :       'window',
        showSharedIPNotice              :       true,
        openTalkPage                    :       [ 'agf', 'norm', 'vand' ],
        openTalkPageOnAutoRevert        :       false,
        summaryAd                       :       " using [[WP:TWINKLE|TW]]",
        deletionSummaryAd               :       " using [[WP:TWINKLE|TW]]",
        protectionSummaryAd             :       " using [[WP:TWINKLE|TW]]",
        watchSpeedyPages                :       [ 'g3', 'g5', 'g10', 'g11', 'g12' ],
        watchProdPages                  :       true,
        openUserTalkPageOnSpeedyDelete  :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],
        watchRevertedPages              :       [ ],
        markRevertedPagesAsMinor        :       [ 'agf', 'norm', 'vand', 'torev' ],
        deleteTalkPageOnDelete          :       false,
        watchWarnings                   :       true,
        markAIVReportAsMinor            :       true,
        markSpeedyPagesAsMinor          :       true,
        offerReasonOnNormalRevert       :       true,
        orphanBacklinksOnSpeedyDelete   :       {orphan:true, exclude:['g6']}
};

// Script from [[User:Lightmouse/monobook.js/script.js]] to automatically unlink dates
importScript('User:Lightmouse/monobook.js/script.js');

// Cite button in editting
importScript('User:Mr.Z-man/refToolbar.js');

// google search
importScript('User:Mr.Z-man/gsearch.js');

// DOI checker
importScript("User:Smith609/toolbox.js");


importScript('User:Plastikspork/date.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]]
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:AndyZ/peerreviewer.js' 
             + '&action=raw&ctype=text/javascript');



// ==============
// NavBar testing
  mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Gimmetrow/dynabars.js' 
    + '&action=raw&ctype=text/javascript');
// ==============
//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
  mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }


// Filter changes live
// [[User:Lupin/recent2.js]] - please include this line

 mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');

// [[User:Lupin/popups.js]] - please include this line 

 mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript');
 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]] */