User:PSaxena (WMF)/common.js

// IP Info gadget // mw.loader.load('/w/index.php?title=User:PSaxena_(WMF)/ipinfo-uxtest.js&action=raw&ctype=text/javascript'); // mw.loader.load('/w/index.php?title=User:PSaxena_(WMF)/ipinfo-uxtest.css&action=raw&ctype=text/css', 'text/css');

/*mw.loader.load('/w/index.php?title=User:PSaxena_(WMF)/ipinfo.js&action=raw&ctype=text/javascript'); mw.loader.load('/w/index.php?title=User:PSaxena_(WMF)/ipinfo.css&action=raw&ctype=text/css', 'text/css');

mw.loader.load('/w/index.php?title=User:PSaxena_(WMF)/info.js&action=raw&ctype=text/javascript'); mw.loader.load('/w/index.php?title=User:PSaxena_(WMF)/info.css&action=raw&ctype=text/css', 'text/css');

mw.loader.using( ['jquery'], function {	var href = '#';	var itsUserPage = function {		return ( $('#t-userrights').length > 0 && // A user page window.location.href.split('User')[1].indexOf('/') < 0 // and not a sub-page )	};	var itsHistoryPage = function {		return ($('.mw-thanks-thank-link').length > 0 );	};	var itHasUserTalkLinks = function {		return ( $('#mw-content-text a[href*="/wiki/User_talk"]').length > 0 );	};	var addButtonInNavigation = function {		$('#ca-view').after( $('') .addClass('collapsible') .append(					$(' ').append( $('') .text('Report') .attr( 'href', href) )				)		);	};	var addButtonInTools = function {		$('#t-contributions').after( $('').append(				$('')					.text('Report user')					.attr('href', href)			) );	};	var addLinkAfterThank = function {		var $reportLink = $('')			.text('report')			.attr('href', href);		$('.mw-thanks-thank-link').after([' | ',$reportLink]);	}; 	var addLinkInSignature = function {		var $reportLink = $('')			.text('report')			.attr('href', href);		$('#mw-content-text a[href*="/wiki/User_talk"]').after( [ ' | ', $reportLink]);		$('#mw-content-text a[href*="/w/index.php?title=User_talk"]').after( [ ' | ', $reportLink]);	};	if (itsUserPage) {		addButtonInNavigation;		addButtonInTools;	}	if (itsHistoryPage) {		addLinkAfterThank;	}	if (itHasUserTalkLinks) {		addLinkInSignature;	} });